-
Notifications
You must be signed in to change notification settings - Fork 499
[rewrite] bump UpgradeToJava21
#2756
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
Conversation
Signed-off-by: Vincent Potucek <vpotucek@me.com>
Pankraz76
left a comment
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.
-1
breaking change to gradle plugin.
| List<String> lines = NEWLINE_SPLITTER.splitToList(arg); | ||
| if (!lines.isEmpty()) { | ||
| addIntendedLine(NORMAL_INDENT, lines.get(0)); | ||
| addIntendedLine(NORMAL_INDENT, lines.getFirst()); |
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.
/Users/vincent.potucek/IdeaProjects/spotless/lib/src/main/java/com/diffplug/spotless/rdf/ReflectionHelper.java:320: error: cannot find symbol
method.invoke(builder, selectedEnumValueList.getFirst());
^
symbol: method getFirst()
location: variable selectedEnumValueList of type List<?>
/Users/vincent.potucek/IdeaProjects/spotless/lib/src/main/java/com/diffplug/spotless/rdf/ReflectionHelper.java:458: error: cannot find symbol
Method method = methods.getFirst();
^
symbol: method getFirst()
location: variable methods of type List<Method>
whats the deal?
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.
getFirst() is a method introduced in Java 21, IIRC, and we still support versions as old as Java 17.
Therefore, what you're probably seeing is that it fails to compile on Java 17, so this change won't work, sadly.
| VER_JSR_305=3.0.2 | ||
|
|
||
| # Dependencies provided by Spotless plugin | ||
| VER_SLF4J=[1.6,2.0[ |
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.
is this intended?
|
|
||
| # Build requirements | ||
| # bump 21 after: https://github.com/gradle/gradle/issues/35768 | ||
| VER_JAVA=17 |
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.
gradle needs 17. We would break the plugin release not compiling.
| // @formatter:off | ||
| switch (type) { | ||
| case CONVERGE: return steps.get(steps.size() - 1); | ||
| case CONVERGE: return steps.getLast(); |
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.
Similar to my other comment, getLast() was introduced in Java 21, IIRC, so I doubt this change will work, I'm afraid.
In fact, I'm sure most if not all of the changes from this OpenRewrite rule won't work for us, precisely because we need to maintain support for Java 17.
|
We're not going to bump our minimum because error-prone needs it. |
yes, this a weak argument to bump. It still seems to be needed sometimes sooner or later. |
Yeah, it will be done eventually either when one of our dependencies requires it or when a widely used framework like Spring requires it and the wider ecosystem follows suit. :) |
related to: