Skip to content

Commit f1b2f2c

Browse files
authored
Merge branch 'main' into lredor/bug/908-Predicates-instanceOf
2 parents 6cf0177 + 8f8a2f5 commit f1b2f2c

25 files changed

+741
-253
lines changed

.run/InlineMethodCallsRecipeGenerator.run.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.sdkmanrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Enable auto-env through the sdkman_auto_env config
22
# Add key=value pairs of SDKs to use below
3-
java=21.0.7-tem
3+
java=21.0.8-tem

gradle/wrapper/gradle-wrapper.jar

176 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=a17ddd85a26b6a7f5ddb71ff8b05fc5104c0202c6e64782429790c933686c806
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
3+
distributionSha256Sum=df67a32e86e3276d011735facb1535f64d0d88df84fa87521e90becc2d735444
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ fi
202202

203203

204204
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
205-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
205+
DEFAULT_JVM_OPTS=
206206

207207
# Collect all arguments for the java command:
208208
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,

gradlew.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ set APP_HOME=%DIRNAME%
3636
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
3737

3838
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
39-
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
39+
set DEFAULT_JVM_OPTS=
4040

4141
@rem Find java.exe
4242
if defined JAVA_HOME goto findJavaFromJavaHome

src/main/java/org/openrewrite/java/migrate/guava/NoGuavaPredicate.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
*/
1616
package org.openrewrite.java.migrate.guava;
1717

18-
import org.openrewrite.*;
18+
import org.openrewrite.ExecutionContext;
19+
import org.openrewrite.Preconditions;
20+
import org.openrewrite.Recipe;
21+
import org.openrewrite.TreeVisitor;
1922
import org.openrewrite.java.ChangeMethodName;
2023
import org.openrewrite.java.ChangeType;
2124
import org.openrewrite.java.JavaIsoVisitor;

src/main/java/org/openrewrite/java/migrate/lang/MigrateMainMethodToInstanceMain.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,16 @@ private boolean hasNoArgConstructor(J.ClassDeclaration classDecl) {
106106
.filter(J.MethodDeclaration::isConstructor)
107107
.collect(toList());
108108

109-
// If no constructors are declared, the class has an implicit no-arg constructor
109+
// If no constructors are declared, the class has an implicit public no-arg constructor
110110
if (constructors.isEmpty()) {
111111
return true;
112112
}
113113

114-
// Check if any explicit constructor is a no-arg constructor
114+
// Instance main requires a public no args constructor
115115
return constructors.stream()
116-
.anyMatch(ctor -> ctor.getParameters().isEmpty() ||
117-
(ctor.getParameters().size() == 1 && ctor.getParameters().get(0) instanceof J.Empty));
116+
.anyMatch(ctor -> (ctor.getParameters().isEmpty() ||
117+
(ctor.getParameters().size() == 1 && ctor.getParameters().get(0) instanceof J.Empty)) &&
118+
ctor.hasModifier(J.Modifier.Type.Public));
118119
}
119120

120121
private boolean isMainMethodReferenced(J.MethodDeclaration mainMethod) {

src/main/resources/META-INF/rewrite/add-common-annotations-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ recipeList:
3333
newGroupId: jakarta.annotation
3434
newArtifactId: jakarta.annotation-api
3535
newVersion: 1.3.x
36-
# set explicitly even if managed, as higher versions do not have the javax namespace
36+
# Set explicitly even if managed, as higher versions do not have the javax namespace
3737
overrideManagedVersion: true
3838
changeManagedDependency: false
3939
# Jakarta EE recommends `provided` scope

0 commit comments

Comments
 (0)