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 49855 - "Find usages" don't find this() constructs
Summary: "Find usages" don't find this() constructs
Status: CLOSED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: Martin Matula
URL:
Keywords:
: 52988 (view as bug list)
Depends on: 53550
Blocks:
  Show dependency tree
 
Reported: 2004-10-03 14:27 UTC by Tim Lebedkov
Modified: 2007-04-03 18:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test project (7.46 KB, application/octet-stream)
2004-10-03 14:28 UTC, Tim Lebedkov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Lebedkov 2004-10-03 14:27:35 UTC
-open the attached project
-open Test.java
-Find Usages on "Test" from
 public Test(String t) {
- Test() will not be found
Comment 1 Tim Lebedkov 2004-10-03 14:28:20 UTC
Created attachment 17999 [details]
test project
Comment 2 Jan Becicka 2004-10-14 10:50:10 UTC
Test project is really simple:
public final class Test {
    public Test() {
        this("");
    }
    
    public Test(String t) {
    }
}

Well there are 2 problems, why this("") is not reported as a usage:
1. ElementNavigator does not let UsageFinder to enter body of the
first constructor, because there is not "Test" string there.
Suggested fix: ElementNavigator should have special handling for
Constructors and it's method containsIdentifierIn() should return
true, if an argument contains not only the specified identifier but
also "super" and "this"

2. I tried to bypass ElementNavigator, to fix this issue, but I was
not successful. ConstructorInvocation.getElement() / for this("")/
returned null. Probably parser does not correctly resolve this("").

Tomasi, please take a look at it. Thanks.
Comment 3 Tomas Hurka 2004-11-03 15:45:50 UTC
Problem #2 fixed in trunk.

Checking in org/netbeans/modules/javacore/parser/MDRParser.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/parser/MDRParser.java,v  <--  
MDRParser.java
new revision: 1.62; previous revision: 1.61
done
Comment 4 Jan Becicka 2005-01-05 14:07:52 UTC
*** Issue 52988 has been marked as a duplicate of this issue. ***
Comment 5 Jan Lahoda 2005-01-05 15:04:27 UTC
This problem may cause that refactoring makes the source uncompilable
(see issue #52988) -> raising to P2.
Comment 6 Tomas Hurka 2005-01-14 13:53:04 UTC
Problem #1 - ElementNavigator fixed in trunk. 

Checking in src/org/netbeans/modules/javacore/jmiimpl/javamodel/
ElementNavigator.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/
ElementNavigator.java,v  <--  ElementNavigator.java
new revision: 1.4; previous revision: 1.3
done
 

One more fix (ConstructorInvocation must extends Invocation) in javamodel is still needed 
to fix this issue.
Reassigning to Martin.
Comment 7 Martin Matula 2005-01-18 10:17:21 UTC
This issue will be fixed by integrating changes covered by issue 53550.
Comment 8 Martin Matula 2005-01-25 14:42:04 UTC
Fixed by resolving 53550.
Comment 9 Tim Lebedkov 2005-03-11 19:58:22 UTC
OK