[rewrite] bump UpgradeToJava21#2756
Conversation
Signed-off-by: Vincent Potucek <vpotucek@me.com>
Pankraz76
left a comment
There was a problem hiding this comment.
-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.
/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.
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[ |
|
|
||
| # Build requirements | ||
| # bump 21 after: https://github.com/gradle/gradle/issues/35768 | ||
| VER_JAVA=17 |
There was a problem hiding this comment.
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.
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: