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.
It would be useful to have a very fast parser for Java files, which would not parse the whole file, but only enough to determine the class name, its superclass and superinterfaces. This partial data about classes could also be stored in the MDR. Such a parser could then be used in the FileObject recognition process. So a module could register a dataloader that accepts Java classes which extend class java.applet.Applet, or classes that implement interface javax.servlet.Servlet, and provide functionality specific to these files.
That can be IMHO done for top-level classes, but there may be inner classes as well. They are quite peculiar, because for top-level classes, only imports and the package statement determine scope for identifier resolution. Inner classes may use types inherited from the outer class' superclasses. So - quick & dirty: might be, but *only* for top-level classes and really fast only if only first class in the file is scanned.
I think it is sufficient to only do this for the first top level class and no inner classes, especially for the purpose of recognition by DataLoaders. The only problem could be if there are multiple top-level classes, and the first one is not the public one, but I would say this is a corner case which does not need to be considered.
A question: will it be possible to implement this feature for NB 4.0? This release will cache the inheritance information in a persistent storage, so information from this storage could potentially be used by the dataloader which would like to recognize all servlets, correct? Thanks.
Yes, that's correct.
Fixed by new JMI based java model
Reorganization of java component