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 204001 - find usages in scope "Other Projects" not working
Summary: find usages in scope "Other Projects" not working
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.0.1
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks: 204025
  Show dependency tree
 
Reported: 2011-10-20 10:03 UTC by cfd
Modified: 2011-10-20 18:32 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 cfd 2011-10-20 10:03:08 UTC
I have 2 projects A and B.

A> foo.java{
	public static void m(){}
}

B> bar.java{
	public static void m2(){
		A.m();
	}
}

a "find usages" of A>foo.java>m (after selecting the method and selecting "Open Projects" as Scope) doesn't list the B>bar.java>m2 method.

Note: projects A and B are not linked as Libraries. I just open both projects in NetBeans.

Product Version = NetBeans IDE 7.0.1 (Build 201107282000)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.6.0_20
Runtime = Java HotSpot(TM) Client VM 16.3-b01
Comment 1 cfd 2011-10-20 11:19:50 UTC
read "foo.m()" instead of "A.m()"
Comment 2 cfd 2011-10-20 11:31:29 UTC
(In reply to comment #0)
> I have 2 projects A and B.
> A> foo.java{
>     public static void m(){}
> }
> B> bar.java{
>     public static void m2(){
>         A.m();
>     }
> }
> a "find usages" of A>foo.java>m (after selecting the method and selecting "Open
> Projects" as Scope) doesn't list the B>bar.java>m2 method.
> Note: projects A and B are not linked as Libraries. I just open both projects
> in NetBeans.
> Product Version = NetBeans IDE 7.0.1 (Build 201107282000)
> Operating System = Windows XP version 5.1 running on x86
> Java; VM; Vendor = 1.6.0_20
> Runtime = Java HotSpot(TM) Client VM 16.3-b01

It's working if the projects are (1) linked as Libraries and (2) open.

The UI label doesn't reflect that behavior: we have to read "Scope: Open Linked Projects" but it's should be better to have "Scope: Linked Projects".
The search should be done into the open linked projects but into the closed linked projects too.
Comment 3 Ralph Ruijs 2011-10-20 14:41:46 UTC
If project A is not a dependency of project B, the method m() and the method invocation on m() are not the same. There is a separate issue about Find Usages in libraries. #55291

Marking as wontfix. If you think option "Open Projects" should be named differently, please file a new issue.

Thanks.
Comment 4 cfd 2011-10-20 14:54:25 UTC
Refactoring and Usages maybe use the same internal tools but, for users, have different goals.
And #55291 is open since v4 in 2005...

I'll open a new ticket to rename the label, if it's possible.

Thanks.
Comment 5 Jan Lahoda 2011-10-20 18:32:00 UTC
If I may ask, do you see an error in bar.java (that it cannot find "foo")? If not, what is on the bar.java's compile classpath? Thanks.