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.

Bug 50371 - TokenContext uses reflection to find defined tokens
Summary: TokenContext uses reflection to find defined tokens
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: PC All
: P4 blocker (vote)
Assignee: Miloslav Metelka
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 49990
  Show dependency tree
 
Reported: 2004-10-13 17:04 UTC by _ rkubacki
Modified: 2009-02-19 20:45 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ rkubacki 2004-10-13 17:04:31 UTC
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.
Comment 1 Miloslav Metelka 2004-10-15 14:59:04 UTC
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?
Comment 2 _ rkubacki 2004-10-15 15:54:40 UTC
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.
Comment 3 Max Sauer 2008-11-27 14:57:19 UTC
Milo, is this still valid? Dik.
Comment 4 Miloslav Metelka 2008-11-28 11:12:37 UTC
TokenContext classes are obsolete (replaced by lexer's languages) so fixing this is not worth the effort.