diff --git a/java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py b/java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py index e2ef50afe467..769e248b3de5 100644 --- a/java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py +++ b/java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py @@ -347,7 +347,6 @@ def extra_image_build_argument(self, benchmark, args): '-H:+AllowFoldMethods', '-H:-UseServiceLoaderFeature', '-H:+AllowDeprecatedBuilderClassesOnImageClasspath', # needs to be removed once GR-41746 is fixed - '-H:+DisableSubstitutionReturnTypeCheck', # remove once Quarkus fixed their substitutions (GR-48152) ]) + super(BaseQuarkusBenchmarkSuite, self).extra_image_build_argument(benchmark, args) diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageOptions.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageOptions.java index 56cd319598a5..10f0ee1798a3 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageOptions.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageOptions.java @@ -150,9 +150,6 @@ protected void onValueUpdate(EconomicMap, Object> values, Boolean o @Option(help = "Deprecated", type = User)// static final HostedOptionKey AllowIncompleteClasspath = new HostedOptionKey<>(false); - @Option(help = "Disable substitution return type checking", type = Debug, deprecated = true, stability = OptionStability.EXPERIMENTAL, deprecationMessage = "This option will be removed soon and the return type check will be mandatory.")// - public static final HostedOptionKey DisableSubstitutionReturnTypeCheck = new HostedOptionKey<>(false); - @SuppressWarnings("all") private static boolean areAssertionsEnabled() { boolean assertsEnabled = false; diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/substitute/AnnotationSubstitutionProcessor.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/substitute/AnnotationSubstitutionProcessor.java index 8970ee6efc23..5d5e98b49f2d 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/substitute/AnnotationSubstitutionProcessor.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/substitute/AnnotationSubstitutionProcessor.java @@ -861,8 +861,7 @@ private ResolvedJavaMethod findOriginalMethod(Executable annotatedMethod, Class< Method originalMethod = originalClass.getDeclaredMethod(originalName, originalParams); guarantee(Modifier.isStatic(annotatedMethod.getModifiers()) == Modifier.isStatic(originalMethod.getModifiers()), "Static modifier mismatch: %s, %s", annotatedMethod, originalMethod); - - guarantee(NativeImageOptions.DisableSubstitutionReturnTypeCheck.getValue() || getTargetClass(((Method) annotatedMethod).getReturnType()).equals(originalMethod.getReturnType()), + guarantee(getTargetClass(((Method) annotatedMethod).getReturnType()).equals(originalMethod.getReturnType()), "Return type mismatch:%n %s%n %s", annotatedMethod, originalMethod); return metaAccess.lookupJavaMethod(originalMethod);