| Summary: | Annotation processor generates unnecessary imports when using inner classes | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Konstantin Komissarchik <konstantin> |
| Component: | Sapphire | Assignee: | Konstantin Komissarchik <konstantin> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ling.hao |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Fixed. I am backporting fix for Bug 353620 to 0.3.1 release, so this issue becomes relevant there. However, Bug 356539 documents a regression caused by the current fix, so a new approach in both branches is necessary. I am opting for the simpler solution of applying @IgnoreWarnings( "all" ) to generated classes. Done. Verify @SuppressWarnings( "all" ) is present in the generated class and thus no warnings. |
When an inner class is used in a model element definition (perhaps to define the type of the value property), the annotation processor generates an unnecessary import statement. For instance, given the following element definition: public interface ResourceRef extends IModelElement { ModelElementType TYPE = new ModelElementType( ResourceRef.class ); // *** AuthenticationMethod *** enum AuthenticationMethod { APPLICATION, CONTAINER } @Type( base = AuthenticationMethod.class ) ValueProperty PROP_AUTHENTICATION_METHOD = new ValueProperty( TYPE, "AuthenticationMethod" ); Value<AuthenticationMethod> getAuthenticationMethod(); void setAuthenticationMethod( String value ); void setAuthenticationMethod( AuthenticationMethod value ); } The annotation processor will include the following import statement when generating the implementation class: import org.eclipse.sapphire.samples.jee.environment.ResourceRef.AuthenticationMethod; This import is unnecessary and generates import is never used warning.