Skip to content

Commit 73e88c8

Browse files
committed
Fix forRemoval deprecations
This commit removes/replaces deprecations that were causing the build to fail (i.e. those that were marked for removal). Signed-off-by: Chris Bono <[email protected]>
1 parent 8bbeb08 commit 73e88c8

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

gradle/java-conventions.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ project.afterEvaluate {
1717
tasks.withType(JavaCompile).configureEach {
1818
options.encoding = "UTF-8"
1919
options.compilerArgs.add("-parameters")
20-
// TODO add this back in once we have removed deprecations
21-
//options.compilerArgs.addAll(["-Werror", "-Xlint:unchecked", "-Xlint:rawtypes", "-Xlint:varargs"]);
20+
options.compilerArgs.addAll(["-Werror", "-Xlint:unchecked", "-Xlint:rawtypes", "-Xlint:varargs"]);
2221
options.release.set(17)
2322
}
2423
}

spring-pulsar-reactive/src/main/java/org/springframework/pulsar/reactive/aot/ReactivePulsarRuntimeHints.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,15 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
6363
SecretsSerializer.class, NioSocketChannel.class, AbstractByteBufAllocator.class,
6464
NioDatagramChannel.class, PulsarAdminBuilderImpl.class, OffloadProcessStatusImpl.class,
6565
Commands.class, ReferenceCountUtil.class)
66-
.forEach(type -> reflectionHints.registerType(type,
67-
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
68-
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.INTROSPECT_PUBLIC_METHODS)));
66+
.forEach(type -> reflectionHints.registerType(type, builder -> builder
67+
.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_DECLARED_METHODS)));
6968

7069
// In addition to the above member category levels, these components need field
7170
// and declared class level access.
7271
Stream.of(ClientConfigurationData.class, ConsumerConfigurationData.class, ProducerConfigurationData.class)
7372
.forEach(type -> reflectionHints.registerType(type,
7473
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
75-
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.INTROSPECT_PUBLIC_METHODS,
76-
MemberCategory.DECLARED_CLASSES, MemberCategory.DECLARED_FIELDS)));
74+
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.ACCESS_DECLARED_FIELDS)));
7775

7876
// These are inaccessible interfaces/classes in a normal scenario, thus using the
7977
// String version, and we need field level access in them.
@@ -88,7 +86,7 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
8886
"org.apache.pulsar.shade.io.netty.util.internal.shaded.org.jctools.queues.unpadded.MpscUnpaddedArrayQueueProducerIndexField",
8987
"org.apache.pulsar.shade.io.netty.util.internal.shaded.org.jctools.queues.unpadded.MpscUnpaddedArrayQueueProducerLimitField")
9088
.forEach(typeName -> reflectionHints.registerTypeIfPresent(classLoader, typeName,
91-
MemberCategory.DECLARED_FIELDS));
89+
MemberCategory.ACCESS_DECLARED_FIELDS));
9290

9391
// @formatter:off
9492
Stream.of(
@@ -150,9 +148,7 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
150148
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
151149
MemberCategory.INVOKE_PUBLIC_METHODS,
152150
MemberCategory.INVOKE_DECLARED_METHODS,
153-
MemberCategory.INTROSPECT_PUBLIC_METHODS,
154-
MemberCategory.DECLARED_CLASSES,
155-
MemberCategory.DECLARED_FIELDS)));
151+
MemberCategory.ACCESS_DECLARED_FIELDS)));
156152
reflectionHints.registerField(ReflectionUtils.findField(Thread.class, "threadLocalRandomProbe"));
157153

158154
// @formatter:on

spring-pulsar/src/main/java/org/springframework/pulsar/aot/PulsarRuntimeHints.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
5858
.of(HashSet.class, LinkedHashMap.class, TreeMap.class, Authentication.class,
5959
AuthenticationDataProvider.class, SecretsSerializer.class, PulsarAdminBuilderImpl.class,
6060
OffloadProcessStatusImpl.class, Commands.class)
61-
.forEach(type -> reflectionHints.registerType(type,
62-
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
63-
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.INTROSPECT_PUBLIC_METHODS)));
61+
.forEach(type -> reflectionHints.registerType(type, builder -> builder
62+
.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_DECLARED_METHODS)));
6463

6564
// In addition to the above member category levels, these components need field
6665
// and declared class level access.
@@ -69,8 +68,7 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
6968
ListTopicsOptions.class)
7069
.forEach(type -> reflectionHints.registerType(type,
7170
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
72-
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.INTROSPECT_PUBLIC_METHODS,
73-
MemberCategory.DECLARED_CLASSES, MemberCategory.DECLARED_FIELDS)));
71+
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.ACCESS_DECLARED_FIELDS)));
7472

7573
// @formatter:off
7674
// These are shaded classes and other inaccessible interfaces/classes (thus using
@@ -201,8 +199,7 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
201199
.forEach(type -> reflectionHints.registerTypeIfPresent(classLoader, type,
202200
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
203201
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_DECLARED_METHODS,
204-
MemberCategory.INTROSPECT_PUBLIC_METHODS, MemberCategory.DECLARED_CLASSES,
205-
MemberCategory.DECLARED_FIELDS)));
202+
MemberCategory.ACCESS_DECLARED_FIELDS)));
206203
// @formatter:on
207204

208205
// Registering JDK dynamic proxies for these interfaces. Since the Connection

0 commit comments

Comments
 (0)