This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The API based on reflection is not performing well. AddDeclaredTokenIDs iterates through all static final fields to register tokens. If we do not want to change this API we can at least override known subclasses in NetBeans.
It's intentional to do this reflection. It's done exactly once for each class during its lifetime so I do not consider this to be a performance issue. What do you mean by "The API based on reflection is not performing well" - do you mean that it's slow or anything else?
Yes, performance is the reason why I do not like this approach. This is one of many things that we perform during the start - all token context subclasses are analyzed using reflection.
Milo, is this still valid? Dik.
TokenContext classes are obsolete (replaced by lexer's languages) so fixing this is not worth the effort.