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 51331 - Find usages does not work for packages
Summary: Find usages does not work for packages
Status: CLOSED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 4.x
Hardware: All All
: P1 blocker (vote)
Assignee: Jan Becicka
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2004-11-09 16:14 UTC by Tomas Hurka
Modified: 2007-04-03 18:02 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NPE stacktrace (1.95 KB, text/plain)
2004-11-09 16:17 UTC, Tomas Hurka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Hurka 2004-11-09 16:14:54 UTC
How to reproduce:
1) Open file
2) Put cursor into package name (in import or package 
statement)
3) Invoke Find Usages

NPE is thrown.
Comment 1 Tomas Hurka 2004-11-09 16:17:43 UTC
Created attachment 18807 [details]
NPE stacktrace
Comment 2 Jan Becicka 2004-11-09 16:28:18 UTC
Checking in NbAbstractRefactoring.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/NbAbstractRefactoring.java,v
 <--  NbAbstractRefactoring.java
new revision: 1.12; previous revision: 1.11
done

Fixed in trunk.

Problem was, that refactoring classpath was created according
element's resource, but element is in this case JavaPackage. And
JavaPackage.getResource() returns null.

Diff for review:
http://refactoring.netbeans.org/source/browse/refactoring/src/org/netbeans/modules/refactoring/NbAbstractRefactoring.java.diff?r1=1.11&r2=1.12

Marku, please verify this fix in trunk. Thanks.
Comment 3 Marek Grummich 2004-11-10 08:27:49 UTC
Seems to be fixed in the build 200411091900 - Verified.

Comment 4 Tomas Hurka 2004-11-10 08:43:50 UTC
I have reviewed the proposed fix and agree with it.
Comment 5 Jan Becicka 2004-11-10 08:44:33 UTC
Fixed in release40
Checking in NbAbstractRefactoring.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/NbAbstractRefactoring.java,v
 <--  NbAbstractRefactoring.java
new revision: 1.11.4.1; previous revision: 1.11
done