OK I think I figured it out. There is setSignature in org.apache.bcel.generic.Type which I need to call with my generic field signature (since direct representations of generic types are actually not built into BCEL yet).
Not a problem, what's unfortunate is just that setSignature is package-protected so I'd have to patch BCEL to call it. The field signature itself is protected so I could set it directly in a subclass of ObjectType. However, there is a note that say this practice will be made impossible in the future. So, in conclusion, I am proposing to change that note (in org/apache/bcel/generic/Type.java): /** * @deprecated (since 6.0) will be made private; do not access directly, use getter/setter */ @Deprecated protected String signature; // signature for the type TODO should be private and/or making the setSignature method in the same class public. Greetings, Stefan On Sat, 30 Apr 2022 at 17:42, Stefan Reich < [email protected]> wrote: > Hi, the title basically says it... I'm trying to create a field with a > parameterized type (e.g. List<String>), but I can't find a subclass of Type > representing a parameterized type that I could pass to the FieldGen > constructor. > > Thanks, > Stefan > > -- > == Gaz.AI == > -- == Gaz.AI ==
