Skip to content
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

The spotless gradle plugin fails on some common Java 16 syntax #2931

Closed
kwvanderlinde opened this issue Sep 1, 2021 · 1 comment
Closed
Assignees
Labels
bug tested This issue has been QA tested by someone other than the developer.

Comments

@kwvanderlinde
Copy link
Collaborator

Describe the bug
Even though MapTool targets Java 16, the spotless plugin 5.2.0 does not support some common Java 16 syntax. This causes the plugin to error out as though invalid syntax was encountered, even though it is valid Java. E.g. instanceof patterns like this:

if (object instanceof String string) {
   ...
}

This prevents the use of some Java 16 features in MapTool.

To Reproduce
Steps to reproduce the behavior:

  1. Add an instanceof patterns to the codebase.
  2. Run spotlessCheck from gradle.
  3. Observe an error message with the cause error: ')' expected

Expected behavior
instanceof patterns and other Java 16 syntax is accepted so it can be used in MapTool.

MapTool Info

  • Version: develop
  • Install:

Desktop (please complete the following information):

  • OS: Linux Mint
  • Version 20

Additional context
We're using spotless plugin version 5.2.0, but there is already version 5.14.3 available which seems to support Java 16 syntax.

@Phergus Phergus added this to To do in MapTool 1.10.0 via automation Sep 1, 2021
@Phergus Phergus moved this from To do to In progress in MapTool 1.10.0 Sep 1, 2021
@Phergus Phergus moved this from In progress to Review in progress in MapTool 1.10.0 Oct 3, 2021
@Phergus Phergus added the tested This issue has been QA tested by someone other than the developer. label Oct 3, 2021
@Phergus
Copy link
Contributor

Phergus commented Oct 3, 2021

Tested described instanceof pattern issue. Now passes spotless. No other issues seen.

@Phergus Phergus closed this as completed Oct 3, 2021
@Phergus Phergus moved this from Review in progress to Reviewer approved in MapTool 1.10.0 Oct 3, 2021
@Phergus Phergus moved this from Reviewer approved to Done in MapTool 1.10.0 Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tested This issue has been QA tested by someone other than the developer.
Projects
No open projects
Development

No branches or pull requests

2 participants