-
Notifications
You must be signed in to change notification settings - Fork 334
Update Gradle Wrapper from 8.14.3 to 9.4.1 & also run tests with JDK 25 #1550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -459,7 +459,10 @@ String covariantlyOverriddenCausingBridgeMethod() { | |
| JavaMethodCall callFromBridgeMethodToOverriddenOne = getOnlyElement( | ||
| new ClassFileImporter().importClasses(Parent.class, Child.class) | ||
| .get(Child.class) | ||
| .getMethodCallsFromSelf()); | ||
| .getMethodCallsFromSelf() | ||
| .stream() | ||
| .filter(call -> call.getOrigin().isMethod()) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this relies entirely on the fact the the new null check is added in the constructor which doesn't count as method. As a user of ArchUnit I would be very surprised to see the new synthetic method call to Objects.requireNonNull. |
||
| .collect(toSet())); | ||
| JavaCodeUnit bridgeMethod = callFromBridgeMethodToOverriddenOne.getOrigin(); | ||
|
|
||
| assertThat(bridgeMethod.getName()).isEqualTo("covariantlyOverriddenCausingBridgeMethod"); | ||
|
|
@@ -1146,10 +1149,11 @@ void call(Target target) { | |
| } | ||
| } | ||
|
|
||
| JavaMethodCall call = getOnlyElement(new ClassFileImporter() | ||
| .importClasses(Origin.class, Target.class) | ||
| .get(Origin.class) | ||
| .getMethodCallsFromSelf()); | ||
| JavaMethodCall call = getOnlyElement( | ||
| new ClassFileImporter().importClasses(Origin.class, Target.class) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. optional: keep line breaks as before |
||
| .get(Origin.class) | ||
| .getMethod("call", Target.class) | ||
| .getMethodCallsFromSelf()); | ||
|
|
||
| assertThat(call.getTarget().getParameterTypes()) | ||
| .isEqualTo(call.getTarget().getRawParameterTypes()); | ||
|
|
@@ -1193,10 +1197,13 @@ void call(Target target) { | |
| } | ||
| } | ||
|
|
||
| JavaClass origin = new ClassFileImporter().importClasses(Origin.class, Target.class).get(Origin.class); | ||
|
|
||
| assertThat(origin.getMethodCallsFromSelf()).hasSize(2); | ||
| for (JavaMethodCall call : origin.getMethodCallsFromSelf()) { | ||
| Set<JavaMethodCall> methodCallsFromSelf = | ||
| new ClassFileImporter().importClasses(Origin.class, Target.class) | ||
| .get(Origin.class) | ||
| .getMethod("call", Target.class) | ||
| .getMethodCallsFromSelf(); | ||
| assertThat(methodCallsFromSelf).hasSize(2); | ||
| for (JavaMethodCall call : methodCallsFromSelf) { | ||
| assertThatCall(call).isTo("callMe"); | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,6 +71,7 @@ | |
| import static com.tngtech.java.junit.dataprovider.DataProviders.$; | ||
| import static com.tngtech.java.junit.dataprovider.DataProviders.$$; | ||
| import static com.tngtech.java.junit.dataprovider.DataProviders.testForEach; | ||
| import static java.util.stream.Collectors.toSet; | ||
|
|
||
| @RunWith(DataProviderRunner.class) | ||
| public class ClassFileImporterAutomaticResolutionTest { | ||
|
|
@@ -349,9 +350,13 @@ void resolvesMethodCallTargetOwner() { | |
| } | ||
| } | ||
|
|
||
| JavaClass javaClass = ImporterWithAdjustedResolutionRuns.disableAllIterationsExcept(MAX_ITERATIONS_FOR_ACCESSES_TO_TYPES_PROPERTY_NAME) | ||
| .importClass(Origin.class); | ||
| JavaMethodCall call = getOnlyElement(javaClass.getMethodCallsFromSelf()); | ||
| JavaMethodCall call = getOnlyElement( | ||
| ImporterWithAdjustedResolutionRuns.disableAllIterationsExcept(MAX_ITERATIONS_FOR_ACCESSES_TO_TYPES_PROPERTY_NAME) | ||
| .importClass(Origin.class) | ||
| .getMethodCallsFromSelf() | ||
| .stream() | ||
| .filter(c -> c.getOrigin().isMethod()) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you are not extremly aware of the new null check, the logic behind this is quite surprising. or functionally equivalent: again use |
||
| .collect(toSet())); | ||
|
|
||
| assertThat(call.getTargetOwner()).isFullyImported(true); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,8 +67,11 @@ Runnable call() { | |
| } | ||
| } | ||
|
|
||
| JavaClasses classes = new ClassFileImporter().importClasses(Target.class, Caller.class); | ||
| JavaMethodCall call = getOnlyElement(classes.get(Caller.class).getMethodCallsFromSelf()); | ||
| JavaMethodCall call = getOnlyElement( | ||
| new ClassFileImporter().importClasses(Target.class, Caller.class) | ||
| .get(Caller.class) | ||
| .getMethod("call") | ||
| .getMethodCallsFromSelf()); | ||
|
|
||
| assertThatCall(call).isFrom("call").isTo(Target.class, "target"); | ||
| } | ||
|
|
@@ -171,8 +174,11 @@ Consumer<String> call() { | |
| } | ||
| } | ||
|
|
||
| JavaClasses classes = new ClassFileImporter().importClasses(Target.class, Caller.class); | ||
| JavaMethodCall call = getOnlyElement(classes.get(Caller.class).getMethodCallsFromSelf()); | ||
| JavaMethodCall call = getOnlyElement( | ||
| new ClassFileImporter().importClasses(Target.class, Caller.class) | ||
| .get(Caller.class) | ||
| .getMethod("call") | ||
| .getMethodCallsFromSelf()); | ||
|
|
||
| assertThatCall(call).isFrom("call").isTo(Target.class, "target", String.class); | ||
| } | ||
|
|
@@ -195,8 +201,11 @@ Supplier<String> call() { | |
| } | ||
| } | ||
|
|
||
| JavaClasses classes = new ClassFileImporter().importClasses(Target.class, Caller.class); | ||
| JavaMethodCall call = getOnlyElement(classes.get(Caller.class).getMethodCallsFromSelf()); | ||
| JavaMethodCall call = getOnlyElement( | ||
| new ClassFileImporter().importClasses(Target.class, Caller.class) | ||
| .get(Caller.class) | ||
| .getMethod("call") | ||
| .getMethodCallsFromSelf()); | ||
|
|
||
| assertThatCall(call).isFrom("call").isTo(Target.class, "target"); | ||
| } | ||
|
|
@@ -251,8 +260,10 @@ Runnable call() { | |
| } | ||
| } | ||
|
|
||
| JavaClasses classes = new ClassFileImporter().importClasses(Target.class, Caller.class); | ||
| Set<JavaMethodCall> calls = classes.get(Caller.class).getMethodCallsFromSelf(); | ||
| Set<JavaMethodCall> calls = new ClassFileImporter().importClasses(Target.class, Caller.class) | ||
| .get(Caller.class) | ||
| .getMethod("call") | ||
| .getMethodCallsFromSelf(); | ||
|
|
||
| assertThat(calls).hasSize(2); | ||
| calls.forEach(call -> assertThatCall(call).isFrom("call").isTo(Target.class, "target")); | ||
|
|
@@ -284,8 +295,12 @@ Function<String, Target> call2() { | |
| } | ||
| } | ||
|
|
||
| JavaClasses classes = new ClassFileImporter().importClasses(Target.class, Caller.class); | ||
| Set<JavaMethodCall> calls = classes.get(Caller.class).getMethodCallsFromSelf(); | ||
| Set<JavaMethodCall> calls = new ClassFileImporter().importClasses(Target.class, Caller.class) | ||
| .get(Caller.class) | ||
| .getMethodCallsFromSelf() | ||
| .stream() | ||
| .filter(call -> call.getOrigin().isMethod()) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| .collect(toSet()); | ||
| assertThat(calls).hasSize(5); | ||
|
|
||
| assertThat(filterOriginByName(calls, "call1")) | ||
|
|
@@ -361,10 +376,14 @@ Supplier<String> call() { | |
|
|
||
| JavaClasses classes = new ClassFileImporter().importClasses(Target.class, Caller1.class, Caller2.class); | ||
|
|
||
| JavaMethodCall call1 = getOnlyElement(classes.get(Caller1.class).getMethodCallsFromSelf()); | ||
| JavaMethodCall call1 = getOnlyElement(classes.get(Caller1.class) | ||
| .getMethod("call") | ||
| .getMethodCallsFromSelf()); | ||
| assertThatCall(call1).isFrom("call").isTo(Target.class, "target"); | ||
|
|
||
| JavaMethodCall call2 = getOnlyElement(classes.get(Caller2.class).getMethodCallsFromSelf()); | ||
| JavaMethodCall call2 = getOnlyElement(classes.get(Caller2.class) | ||
| .getMethod("call") | ||
| .getMethodCallsFromSelf()); | ||
| assertThatCall(call2).isFrom("call").isTo(Target.class, "target"); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did you drop the checksum intentionally? If we actually check it somewhere in the pipeline, I'd prefer to keep it, otherwise, deletion is fine |
||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip | ||
| networkTimeout=10000 | ||
| validateDistributionUrl=true | ||
| zipStoreBase=GRADLE_USER_HOME | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took me a really long time reproduce the second method call locally, as the build always falls back to java8 as the minimum supported version.
The easiest was in the end to set
testJavaVersion=25manually in thegradle.properties.Is it document somewhere how to choose the java version for local execution?