Skip to content

Conversation

@Pankraz76
Copy link
Contributor

@Pankraz76 Pankraz76 commented Nov 21, 2025

Signed-off-by: Vincent Potucek <vpotucek@me.com>
Copy link
Contributor Author

@Pankraz76 Pankraz76 left a 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());
Copy link
Contributor Author

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?

Image

Copy link
Member

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[
Copy link
Contributor Author

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
Copy link
Contributor Author

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();
Copy link
Member

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.

@nedtwigg
Copy link
Member

We're not going to bump our minimum because error-prone needs it.

@nedtwigg nedtwigg closed this Nov 21, 2025
@Pankraz76
Copy link
Contributor Author

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.

@jbduncan
Copy link
Member

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants