Closed wbrusch closed 8 years ago
Thanks for the report - I will take care of it, but at the moment I can't find the time. Please have a little patience :smile:
@phax actually we also saw this with AndroidAnnotations (the repeated imports), but because of no harm for the compiled code, i forgot to report it. It was before you reworked the imports of classes after my other issues, so it is not a regression because of that.
Double imports are fixed now. Was because of the narrowed classes
I can't find a solution because than the emitting of a type would depend on the context in which it is emitted. I can suggest the following work around:
final AbstractJClass aspect = generator.directClass (ValueHolderInstanceImpl.class.getSimpleName ());
Not nice but produces the correct result.
I have a code generation need where I have an abstract outer class instance with generics that needs to add an instance of the inner class within the anonymous class definition
in codemodel i defined what I was doing with:
The output is:
so there are two general issues here:
AbstractFieldInstanceImpl.ValueHolderInstanceImpl
ieAbstractFieldInstanceImpl<String>.ValueHolderInstanceImpl
are getting dropped in the definition above. While I this probably has no code impact, it looks really bad and I would rather not add a@SuppressWarnings({ "rawtypes" })
annotation to remove the warning on the field and another@SuppressWarnings({ "unchecked", "rawtypes" })
on the initialization method. Ideally it should generate too:AbstractFieldInstanceImpl
I assume that if I generated another generic subtype it would add another import per subtype.While all of these are inconsequential and I could fix it all with a second pass generator really quickly it seems that you are actively working on this project and may wish to fix this.
Thanks