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 187773 - Only project classes are marked for Categorization with subtypes definition
Summary: Only project classes are marked for Categorization with subtypes definition
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Ide (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: issues@profiler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-18 09:42 UTC by Denis Anisimov
Modified: 2010-11-17 07:08 UTC (History)
0 users

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 Denis Anisimov 2010-06-18 09:42:05 UTC
Class org.netbeans.modules.profiler.categories.MarkerProcessor which is used
for classes mark has method "addImplementorMethods" .
The latter method is used for marking classes an their methods which 
extends/implements some given class/interface.
This method uses ClassIndex.SearchScope.SOURCE only for classes search .
Such approach could work ( actually it doesn't work , see below ) 
when user choses Profile only Project classes settings.
F.e. in case of profiling ALL classes such approach will miss marks for 
classes in binary jars classpath.

There is f.e. marks for classes in the package "sun.java2d".
ALL classes in this package will be marked with Java 2D category ( when all 
classes are profiled ). This is inconsistent with approach for subtypes 
definition: algorithm apply marks only for classes in the project source root.

I suggest to use  both scopes ClassIndex.SearchScope.SOURCE and ClassIndex.SearchScope.DEPENDENCIES for search.
This will always work . In Project classes only profile case it will just takes 
more time .

Current approach has the following issue anyway :
"addImplementorMethods" method needs to "recursively" find all classes which 
are extends/implements given class/interface. But result of usage only scope 
ClassIndex.SearchScope.SOURCE leads to miss part of such implementors.
Consider f.e. JPanel. This class extends JComponent with UI/Painters category.
The current algorithm will not include JPanel as implementor of JComponent.
As result all custom hierarchy of JPanel ( any class in the project source code
which extends JPanel directly or indirectly ) will not be included in 
implementors list.
So the current approach should be changed . I believe the most 
appropriate way to do this : just uses both search scopes.
Comment 1 J Bachorik 2010-11-01 13:39:48 UTC
Suggestion implemented - http://hg.netbeans.org/profiler-main/rev/da0b53f3fd82
Comment 2 Quality Engineering 2010-11-17 07:08:06 UTC
Integrated into 'main-golden', will be available in build *201011170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/da0b53f3fd82
User: Jaroslav Bachorik <yardus@netbeans.org>
Log: #187773: Searching for implementors (for marking purposes) in binaries too