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

Disable route validation on Java 8 incremental (#5236) #5248

Merged
merged 1 commit into from
Apr 14, 2021
Merged

Disable route validation on Java 8 incremental (#5236) #5248

merged 1 commit into from
Apr 14, 2021

Conversation

martijndwars
Copy link
Contributor

As discussed in #5236. When the Java 8 compiler loads a compiled class, the method parameters are named arg0, arg1, ... (even though the real names are available in the class file), and the route validation processor incorrectly produces an error. With this PR route validation is skipped when running on Java 8 or lower and incremental compilation is enabled.

Feedback welcome!

@CLAassistant
Copy link

CLAassistant commented Apr 14, 2021

CLA assistant check
All committers have signed the CLA.

version = version.substring(0, dot);
}
}
return Integer.parseInt(version);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could lead to a NPE if one of the conditions fail. They shouldn't fail, but you never know. Best to wrap in an a try/catch and return -1 if an exception occurs.

@graemerocher
Copy link
Contributor

Thanks, one small change and it can be merged

@martijndwars
Copy link
Contributor Author

Thanks! I considered adding a test case to avoid regressions, but I wasn't sure where to start. Are there any tests that exercise incremental compilation that I can use as inspiration?

@graemerocher
Copy link
Contributor

yeah not really, the incremental part is really hard to test :/

Maybe a test could be written here https://github.com/micronaut-projects/micronaut-gradle-plugin/blob/master/src/test/groovy/io/micronaut/gradle/MicronautLibraryPluginSpec.groovy

But it would require us to first release a version of micronaut with this fix

@graemerocher graemerocher merged commit 1773682 into micronaut-projects:2.4.x Apr 14, 2021
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.

None yet

3 participants