Skip to content

Commit e50a049

Browse files
committed
Merge remote-tracking branch 'origin/3.1' into 'origin/4.0'
Signed-off-by: Maxim Nesen <[email protected]>
2 parents 466c482 + 6c8f770 commit e50a049

File tree

88 files changed

+2444
-296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+2444
-296
lines changed

NOTICE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Notice for Jersey
1+
# Notice for Jersey
22
This content is produced and maintained by the Eclipse Jersey project.
33

44
* Project home: https://projects.eclipse.org/projects/ee4j.jersey
@@ -57,25 +57,25 @@ Bootstrap v3.3.7
5757
* Project: http://getbootstrap.com
5858
* Copyright: 2011-2016 Twitter, Inc
5959

60-
Google Guava Version 18.0
60+
Google Guava Version 33.3.0-jre
6161
* License: Apache License, 2.0
62-
* Copyright (C) 2009 The Guava Authors
62+
* Copyright (C) 2009, 2024 The Guava Authors
6363

64-
jakarta.inject Version: 1
64+
jakarta.inject Version: 2.0.1
6565
* License: Apache License, 2.0
66-
* Copyright (C) 2009 The JSR-330 Expert Group
66+
* Copyright (C) 2009, 2021 The JSR-330 Expert Group
6767

6868
Javassist Version 3.30.2-GA
6969
* License: Apache License, 2.0
7070
* Project: http://www.javassist.org/
7171
* Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
7272

73-
Jackson JAX-RS Providers Version 2.17.1
73+
Jackson JAX-RS Providers Version 2.18.0
7474
* License: Apache License, 2.0
7575
* Project: https://github.com/FasterXML/jackson-jaxrs-providers
7676
* Copyright: (c) 2009-2024 FasterXML, LLC. All rights reserved unless otherwise indicated.
7777

78-
jQuery v1.12.4
78+
jQuery v3.7.1
7979
* License: jquery.org/license
8080
* Project: jquery.org
8181
* Copyright: (c) jQuery Foundation
@@ -95,7 +95,7 @@ KineticJS, v4.7.1
9595
* Project: http://www.kineticjs.com, https://github.com/ericdrowell/KineticJS
9696
* Copyright: Eric Rowell
9797

98-
org.objectweb.asm Version 9.7
98+
org.objectweb.asm Version 9.7.1
9999
* License: Modified BSD (https://asm.ow2.io/license.html)
100100
* Copyright (c) 2000-2011 INRIA, France Telecom. All rights reserved.
101101

connectors/netty-connector/pom.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,24 @@
101101
</plugins>
102102
</build>
103103
</profile>
104+
<profile>
105+
<id>InaccessibleObjectException</id>
106+
<activation><jdk>[12,)</jdk></activation>
107+
<build>
108+
<plugins>
109+
<plugin>
110+
<groupId>org.apache.maven.plugins</groupId>
111+
<artifactId>maven-surefire-plugin</artifactId>
112+
<configuration>
113+
<argLine>
114+
--add-opens java.base/java.lang=ALL-UNNAMED
115+
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
116+
</argLine>
117+
</configuration>
118+
</plugin>
119+
</plugins>
120+
</build>
121+
</profile>
104122
</profiles>
105123

106124
</project>

connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/NettyConnector.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public void operationComplete(io.netty.util.concurrent.Future<? super Void> futu
436436
};
437437
ch.closeFuture().addListener(closeListener);
438438

439-
final NettyEntityWriter entityWriter = NettyEntityWriter.getInstance(jerseyRequest, ch);
439+
final NettyEntityWriter entityWriter = nettyEntityWriter(jerseyRequest, ch);
440440
switch (entityWriter.getType()) {
441441
case CHUNKED:
442442
HttpUtil.setTransferEncodingChunked(nettyRequest, true);
@@ -524,6 +524,10 @@ public void run() {
524524
}
525525
}
526526

527+
/* package */ NettyEntityWriter nettyEntityWriter(ClientRequest clientRequest, Channel channel) {
528+
return NettyEntityWriter.getInstance(clientRequest, channel);
529+
}
530+
527531
private SSLContext getSslContext(Client client, ClientRequest request) {
528532
Supplier<SSLContext> supplier = request.resolveProperty(ClientProperties.SSL_CONTEXT_SUPPLIER, Supplier.class);
529533
return supplier == null ? client.getSslContext() : supplier.get();

connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/JerseyChunkedInput.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -101,7 +101,15 @@ public ByteBuf readChunk(ChannelHandlerContext ctx) throws Exception {
101101

102102
@Override
103103
public ByteBuf readChunk(ByteBufAllocator allocator) throws Exception {
104+
try {
105+
return readChunk0(allocator);
106+
} catch (Exception e) {
107+
closeOnThrowable();
108+
throw e;
109+
}
110+
}
104111

112+
private ByteBuf readChunk0(ByteBufAllocator allocator) throws Exception {
105113
if (!open) {
106114
return null;
107115
}
@@ -143,6 +151,14 @@ public long progress() {
143151
return offset;
144152
}
145153

154+
private void closeOnThrowable() {
155+
try {
156+
close();
157+
} catch (Throwable t) {
158+
// do not throw other throwable
159+
}
160+
}
161+
146162
@Override
147163
public void close() throws IOException {
148164

@@ -208,10 +224,12 @@ private void write(Provider<ByteBuffer> bufferSupplier) throws IOException {
208224
try {
209225
boolean queued = queue.offer(bufferSupplier.get(), WRITE_TIMEOUT, TimeUnit.MILLISECONDS);
210226
if (!queued) {
227+
closeOnThrowable();
211228
throw new IOException("Buffer overflow.");
212229
}
213230

214231
} catch (InterruptedException e) {
232+
closeOnThrowable();
215233
throw new IOException(e);
216234
}
217235
}

0 commit comments

Comments
 (0)