Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Get vanilla tests passing in Java 9 #210

Merged
merged 3 commits into from
Nov 21, 2016
Merged

Get vanilla tests passing in Java 9 #210

merged 3 commits into from
Nov 21, 2016

Conversation

alicederyn
Copy link
Collaborator

@alicederyn alicederyn commented Nov 15, 2016

We have two choices regarding the @Generated annotation: omit it entirely henceforth, or conditionally exclude it in Java 9+. As James points out, since @Generated is a compile-time annotation, we won't accidentally be generating non–Java 9–compliant libraries from older compilers, so conditionally omitting it should be sufficient.

Included in this PR:

@j-baker
Copy link
Collaborator

j-baker commented Nov 15, 2016

@Generated is a source-only annotation, so you'll be generating Java 9 compliant code anyway, right? Like, @FreeBuilder doesn't need to be on the classpath in order to run FreeBuilder generated classes properly

@alicederyn
Copy link
Collaborator Author

You make an excellent point.

j-baker
j-baker approved these changes Nov 20, 2016
private static final class GeneratedAnnotationExcerpt extends Excerpt {
private final Class<?> generator;

GeneratedAnnotationExcerpt(Class<?> generator) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you should probably have a test that the Generated annotation doesn't show up in JDK9. Or, is that way more work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Impossible, really—we don't run unit tests in JDK 9.

@alicederyn alicederyn merged commit e952aba into master Nov 21, 2016
@alicederyn alicederyn deleted the java.9 branch November 21, 2016 00:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants