Skip to content

Commit c4fa604

Browse files
authored
Merge pull request #57335 from jponge/vertx5/vertx-5.1.10
Bump to Vert.x 5.1.10 and Netty 4.2.19.Final
2 parents 8c89da1 + ecb574c commit c4fa604

5 files changed

Lines changed: 5 additions & 150 deletions

File tree

‎bom/application/pom.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<wildfly-elytron.version>2.9.4.Final</wildfly-elytron.version>
115115
<jboss-marshalling.version>2.3.0</jboss-marshalling.version>
116116
<jboss-threads.version>3.10.1</jboss-threads.version>
117-
<vertx.version>5.1.8</vertx.version>
117+
<vertx.version>5.1.10</vertx.version>
118118
<httpclient5.version>5.6.4</httpclient5.version>
119119
<httpcore5.version>5.4.3</httpcore5.version>
120120
<httpclient.version>4.5.14</httpclient.version>
@@ -136,7 +136,7 @@
136136
<infinispan.protostream.version>6.0.7</infinispan.protostream.version>
137137
<caffeine.version>3.2.4</caffeine.version>
138138
<netty-tcnative.version>2.0.84.Final</netty-tcnative.version>
139-
<netty.version>4.2.18.Final</netty.version>
139+
<netty.version>4.2.19.Final</netty.version>
140140
<brotli4j.version>1.23.0</brotli4j.version>
141141
<reactive-streams.version>1.0.4</reactive-streams.version>
142142
<jboss-logging.version>3.6.3.Final</jboss-logging.version>

‎docs/src/main/asciidoc/rest.adoc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include::_attributes.adoc[]
1515
:httpspec: https://tools.ietf.org/html/rfc7231
1616
:jsonpapi: https://javadoc.io/doc/jakarta.json/jakarta.json-api/2.1.2/jakarta.json
1717
:injectapi: https://javadoc.io/doc/jakarta.inject/jakarta.inject-api/2.0.1/jakarta.inject
18-
:vertxapi: https://javadoc.io/doc/io.vertx/vertx-core/5.1.8
18+
:vertxapi: https://javadoc.io/doc/io.vertx/vertx-core/5.1.10
1919
:resteasy-reactive-api: https://javadoc.io/doc/io.quarkus.resteasy.reactive/resteasy-reactive/{quarkus-version}
2020
:resteasy-reactive-common-api: https://javadoc.io/doc/io.quarkus.resteasy.reactive/resteasy-reactive-common/{quarkus-version}
2121

‎extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java‎

Lines changed: 0 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -754,151 +754,6 @@ public void visit(int version, int access, String name, String signature,
754754
.build());
755755
}
756756

757-
/**
758-
* Rewrites {@code PlatformDependent#estimateMaxDirectMemory()} to replace the
759-
* reflection-based VM argument lookup with direct calls. The original code uses
760-
* {@code Class.forName} + {@code MethodHandles.publicLookup().findStatic/findVirtual}
761-
* to call {@code ManagementFactory.getRuntimeMXBean().getInputArguments()} because
762-
* "Android doesn't have these classes". Since we target JDK 17+, these are always available.
763-
* <p>
764-
* Using ASM's tree API, we surgically replace the instruction sequence that performs
765-
* the reflection with a direct invocation, preserving all surrounding code (the loop,
766-
* the regex matching, the switch, the logging).
767-
*/
768-
@BuildStep
769-
void transformPlatformDependentEstimateMaxDirectMemory(BuildProducer<BytecodeTransformerBuildItem> producer) {
770-
String className = PlatformDependent.class.getName();
771-
772-
producer.produce(new BytecodeTransformerBuildItem.Builder()
773-
.setClassToTransform(className)
774-
.setCacheable(true)
775-
.setClassReaderOptions(ClassReader.EXPAND_FRAMES)
776-
.setVisitorFunction(new BiFunction<>() {
777-
@Override
778-
public ClassVisitor apply(String s, ClassVisitor classVisitor) {
779-
return new ClassVisitor(Gizmo.ASM_API_VERSION, classVisitor) {
780-
@Override
781-
public MethodVisitor visitMethod(int access, String name, String descriptor,
782-
String signature, String[] exceptions) {
783-
MethodVisitor mv = super.visitMethod(access, name, descriptor,
784-
signature, exceptions);
785-
if ("estimateMaxDirectMemory".equals(name) && "()J".equals(descriptor)) {
786-
MethodVisitor target = mv;
787-
return new MethodNode(Gizmo.ASM_API_VERSION, access, name, descriptor,
788-
signature, exceptions) {
789-
@Override
790-
public void visitEnd() {
791-
super.visitEnd();
792-
patchEstimateMaxDirectMemory(this.instructions);
793-
this.accept(target);
794-
}
795-
};
796-
}
797-
return mv;
798-
}
799-
};
800-
}
801-
})
802-
.build());
803-
}
804-
805-
/**
806-
* Replaces the reflection-based sequence in {@code estimateMaxDirectMemory} with direct calls.
807-
* <p>
808-
* Finds and replaces:
809-
*
810-
* <pre>
811-
* invokestatic getSystemClassLoader -> astore X
812-
* ldc "java.lang.management.ManagementFactory"
813-
* ... Class.forName ...
814-
* ... Class.forName ...
815-
* ... MethodHandles.publicLookup ...
816-
* ... lookup.findStatic ...
817-
* ... lookup.findVirtual ...
818-
* ... getInputArguments.invoke(getRuntime.invoke()) ...
819-
* checkcast List -> astore Y (vmArgs)
820-
* </pre>
821-
*
822-
* with:
823-
*
824-
* <pre>
825-
* invokestatic ManagementFactory.getRuntimeMXBean()
826-
* invokeinterface RuntimeMXBean.getInputArguments()
827-
* astore Y (vmArgs)
828-
* </pre>
829-
*
830-
* The approach: find the {@code invokestatic getSystemClassLoader} that starts the block
831-
* and the {@code checkcast java/util/List} that ends it, remove everything in between,
832-
* and insert the direct calls before the checkcast (which becomes a no-op but is harmless).
833-
*/
834-
private static void patchEstimateMaxDirectMemory(org.objectweb.asm.tree.InsnList instructions) {
835-
// Find the invokestatic getSystemClassLoader call that starts the reflection block
836-
AbstractInsnNode startNode = null;
837-
for (AbstractInsnNode node = instructions.getFirst(); node != null; node = node.getNext()) {
838-
if (node instanceof MethodInsnNode methodInsn
839-
&& methodInsn.getOpcode() == Opcodes.INVOKESTATIC
840-
&& "getSystemClassLoader".equals(methodInsn.name)) {
841-
startNode = node;
842-
break;
843-
}
844-
}
845-
if (startNode == null) {
846-
throw new IllegalStateException(
847-
"Could not find getSystemClassLoader call in PlatformDependent.estimateMaxDirectMemory. "
848-
+ "The bytecode pattern may have changed in a Netty update.");
849-
}
850-
851-
// Find the last MethodHandle.invoke call that ends the reflection block.
852-
// The sequence ends with: invokevirtual MethodHandle.invoke -> astore (vmArgs).
853-
// We keep the astore and replace everything before it.
854-
AbstractInsnNode lastInvoke = null;
855-
for (AbstractInsnNode node = startNode.getNext(); node != null; node = node.getNext()) {
856-
if (node instanceof MethodInsnNode methodInsn
857-
&& "invoke".equals(methodInsn.name)
858-
&& "java/lang/invoke/MethodHandle".equals(methodInsn.owner)) {
859-
lastInvoke = node;
860-
}
861-
// Stop scanning once we pass the reflection block (next invokestatic is
862-
// getMaxDirectMemorySizeArgPattern)
863-
if (node instanceof MethodInsnNode methodInsn
864-
&& "getMaxDirectMemorySizeArgPattern".equals(methodInsn.name)) {
865-
break;
866-
}
867-
}
868-
if (lastInvoke == null) {
869-
throw new IllegalStateException(
870-
"Could not find MethodHandle.invoke in PlatformDependent.estimateMaxDirectMemory. "
871-
+ "The bytecode pattern may have changed in a Netty update.");
872-
}
873-
874-
// The astore after the last invoke stores vmArgs - we keep it
875-
AbstractInsnNode astoreNode = nextRealInsn(lastInvoke);
876-
877-
// Remove everything from startNode through lastInvoke (inclusive)
878-
AbstractInsnNode current = startNode;
879-
while (current != astoreNode) {
880-
AbstractInsnNode next = current.getNext();
881-
instructions.remove(current);
882-
current = next;
883-
}
884-
885-
// Insert direct calls before the astore:
886-
// invokestatic ManagementFactory.getRuntimeMXBean() -> RuntimeMXBean
887-
// invokeinterface RuntimeMXBean.getInputArguments() -> List
888-
instructions.insertBefore(astoreNode, new MethodInsnNode(
889-
Opcodes.INVOKESTATIC,
890-
"java/lang/management/ManagementFactory",
891-
"getRuntimeMXBean",
892-
"()Ljava/lang/management/RuntimeMXBean;",
893-
false));
894-
instructions.insertBefore(astoreNode, new MethodInsnNode(
895-
Opcodes.INVOKEINTERFACE,
896-
"java/lang/management/RuntimeMXBean",
897-
"getInputArguments",
898-
"()Ljava/util/List;",
899-
true));
900-
}
901-
902757
/**
903758
* Rewrites {@code DefaultChannelId#processHandlePid(ClassLoader)} to avoid reflection as we target Java 21+.
904759
* <p>

‎independent-projects/resteasy-reactive/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<mutiny.version>3.3.0</mutiny.version>
5959
<smallrye-mutiny-vertx-core.version>4.0.2</smallrye-mutiny-vertx-core.version>
6060
<smallrye-common.version>2.20.0</smallrye-common.version>
61-
<vertx.version>5.1.8</vertx.version>
61+
<vertx.version>5.1.10</vertx.version>
6262
<rest-assured.version>6.0.1</rest-assured.version>
6363
<commons-logging-jboss-logging.version>2.0.0.Final</commons-logging-jboss-logging.version>
6464
<jackson-bom.version>3.1.7</jackson-bom.version>

‎independent-projects/vertx-utils/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<properties>
2020
<jboss-logging.version>3.6.3.Final</jboss-logging.version>
21-
<vertx.version>5.1.8</vertx.version>
21+
<vertx.version>5.1.10</vertx.version>
2222
</properties>
2323

2424
<dependencies>

0 commit comments

Comments
 (0)