-
Notifications
You must be signed in to change notification settings - Fork 531
[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
Changes from all 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 |
|---|---|---|
|
|
@@ -21,11 +21,12 @@ artifactIdMaven=spotless-maven-plugin | |
| artifactIdGradle=spotless-plugin-gradle | ||
|
|
||
| # Build requirements | ||
| # bump 21 after: https://github.com/gradle/gradle/issues/35768 | ||
| VER_JAVA=17 | ||
| VER_JSR_305=3.0.2 | ||
|
|
||
| # Dependencies provided by Spotless plugin | ||
| VER_SLF4J=[1.6,2.0[ | ||
|
Author
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. is this intended? |
||
| VER_SLF4J=[1.6,2.0] | ||
|
|
||
| # Used in multiple places | ||
| VER_DURIAN=1.2.0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -201,7 +201,7 @@ private void addFile(String arg) { | |
| // ... (more lines that didn't fit) | ||
| List<String> lines = NEWLINE_SPLITTER.splitToList(arg); | ||
| if (!lines.isEmpty()) { | ||
| addIntendedLine(NORMAL_INDENT, lines.get(0)); | ||
| addIntendedLine(NORMAL_INDENT, lines.getFirst()); | ||
|
Author
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. whats the deal?
Member
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.
Therefore, what you're probably seeing is that it fails to compile on Java 17, so this change won't work, sadly. |
||
| } | ||
| for (int i = 1; i < Math.min(MIN_LINES_PER_FILE, lines.size()); i++) { | ||
| addIntendedLine(DIFF_INDENT, lines.get(i)); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,7 +152,7 @@ public boolean isResolvable() { | |
| public String canonical() { | ||
| // @formatter:off | ||
| switch (type) { | ||
| case CONVERGE: return steps.get(steps.size() - 1); | ||
| case CONVERGE: return steps.getLast(); | ||
|
Member
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. Similar to my other comment, 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. |
||
| case CYCLE: return Collections.min(steps, Comparator.comparingInt(String::length).thenComparing(Function.identity())); | ||
| case DIVERGE: throw new IllegalArgumentException("No canonical form for a diverging result"); | ||
| default: throw new IllegalArgumentException("Unknown type: " + type); | ||
|
|
||

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.