Skip to content

Incorrect comment? #1291

Answered by eamonnmcmanus
AriaAdibi asked this question in Q&A
Discussion options

You must be logged in to vote

As you say, validating a package consists only of validating the annotations on it. The point about package-info.java is that that is the mechanism for annotating a package:

// com/example/foo/package-info.java

@SomeAnnotation
@SomeOtherAnnotation
package com.example.foo;

Suppose package com.example.foo was one of the elements returned by RoundEnvironment.getElementsAnnotatedWith, and suppose the class SomeOtherAnnotation doesn't exist (because an annotation processor will create it later). Then we will defer an ElementName representing package com.example.foo to a later processing round.

I don't think the comment is wrong per se, but it could possibly be worded better. Feel free to sen…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by eamonnmcmanus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants