Skip to content

Commit 42e0fa4

Browse files
Verifier error importing Lombok introspections (#11711)
* reproducer verifier error * Fix boxing * update to non-vulnerable netty versions --------- Co-authored-by: Denis Stepanov <[email protected]>
1 parent 1ae5825 commit 42e0fa4

File tree

4 files changed

+47
-4
lines changed

4 files changed

+47
-4
lines changed

core-processor/src/main/java/io/micronaut/inject/writer/WriterUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public static void invokeBeanConstructor(GeneratorAdapter writer,
116116
pushNewArrayIndexed(writer, Object.class, constructorArguments, (i, parameter) -> {
117117
pushValue(writer, argumentsPusher, parameter, i);
118118
if (parameter.isPrimitive()) {
119-
writer.unbox(getTypeReference(parameter));
119+
writer.box(getTypeReference(parameter));
120120
}
121121
});
122122
writer.invokeStatic(

gradle/libs.versions.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ managed-jackson-databind = "2.17.2"
7474
managed-kotlin = "1.9.25"
7575
managed-kotlin-coroutines = "1.8.1"
7676
managed-methvin-directory-watcher = "0.18.0"
77-
managed-netty = "4.1.118.Final"
78-
managed-netty-iouring = "0.0.25.Final"
79-
managed-netty-http3 = "0.0.28.Final"
77+
managed-netty = "4.1.119.Final"
78+
managed-netty-iouring = "0.0.26.Final"
79+
managed-netty-http3 = "0.0.29.Final"
8080
managed-netty-tcnative = "2.0.70.Final"
8181
managed-reactive-streams = "1.0.4"
8282
# This should be kept aligned with https://github.com/micronaut-projects/micronaut-reactor/blob/master/gradle.properties from the BOM

test-suite/src/test/java/io/micronaut/test/lombok/LombokIntrospectedBuilderTest.java

+12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package io.micronaut.test.lombok;
22

3+
import io.micronaut.core.annotation.Introspected;
34
import io.micronaut.core.beans.BeanConstructor;
45
import io.micronaut.core.beans.BeanIntrospection;
56
import io.micronaut.core.beans.BeanProperty;
7+
import io.micronaut.test.lombok.importtest.VersionManifest;
68
import org.junit.jupiter.api.Assertions;
79
import org.junit.jupiter.api.Test;
810

@@ -13,8 +15,18 @@
1315
import static org.junit.jupiter.api.Assertions.assertNotNull;
1416
import static org.junit.jupiter.api.Assertions.assertTrue;
1517

18+
@Introspected(classes = VersionManifest.VersionManifestEntry.class)
1619
public class LombokIntrospectedBuilderTest {
1720

21+
@Test
22+
void testImportedIntrospection() {
23+
BeanIntrospection<VersionManifest.VersionManifestEntry> introspection = BeanIntrospection.getIntrospection(VersionManifest.VersionManifestEntry.class);
24+
VersionManifest.VersionManifestEntry entry = introspection.instantiate("test", 1, 2);
25+
assertNotNull(entry);
26+
assertEquals("test", entry.getName());
27+
assertEquals(1, entry.getMajorVersion());
28+
}
29+
1830
@Test
1931
void testLombokInheritance() {
2032
Foo foo = Foo.builder().name("Name").build();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package io.micronaut.test.lombok.importtest;
2+
3+
import lombok.Builder;
4+
import lombok.NonNull;
5+
import lombok.Value;
6+
import lombok.extern.jackson.Jacksonized;
7+
8+
import java.util.List;
9+
10+
@Value
11+
@Builder
12+
@Jacksonized
13+
public class VersionManifest {
14+
@NonNull
15+
List<VersionManifestEntry> workflows;
16+
17+
@Value
18+
@Builder
19+
@Jacksonized
20+
public static class VersionManifestEntry {
21+
@NonNull
22+
String name;
23+
24+
@NonNull
25+
int majorVersion;
26+
27+
@NonNull
28+
int minorVersion;
29+
30+
}
31+
}

0 commit comments

Comments
 (0)