-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
static imports don't work with annotations #861
Comments
Static imports are for static functions and JavaPoet does nothing with them when handling type references. Nested types in Java use regular imports, but JavaPoet will always prefer to import the top-level type and use a semi-qualified reference instead. There is no way to force it that I can remember. |
generated file contains the static import as below but the type reference in annotations don't reflect the static import, as you said.
|
Right but static imports are not for types, they're for methods. So that is working as expected. |
In MethodSpec.Builder, I have...
builder.addAnnotation(Value.Lazy.class);
In JavaFile.Builder, I have..
static import is added, however the annotation contains the fully qualified static name....
The text was updated successfully, but these errors were encountered: