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 88146 - Trees.getElement() returns null in Phase.RESOLVED
Summary: Trees.getElement() returns null in Phase.RESOLVED
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords: RANDOM
: 88727 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-27 12:56 UTC by Jiri Prox
Modified: 2007-01-17 10:09 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
project (25.08 KB, application/x-compressed)
2006-10-27 12:57 UTC, Jiri Prox
Details
new test project (32.65 KB, application/x-compressed)
2006-10-31 15:28 UTC, Jiri Prox
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Prox 2006-10-27 12:56:39 UTC
NetBeans IDE Dev (Build 200610261800)
1.6.0-rc; Java HotSpot(TM) Client VM 1.6.0-rc-b100
Windows XP version 5.1 running on x86
en_US (nb); Cp1252

Sometimes the find usages for method retun empty result, although there are some
usages. I cannot find out when this happens so I'am attaching the project, where
it is reproducible (from fresh userdir). 

Steps to reproduce:
1) open attached project
2) open class handlerdemo.Spool
3) find usages of metohod "find"
-> no usages found but in class Handler there are two (in the method "get")
Comment 1 Jiri Prox 2006-10-27 12:57:34 UTC
Created attachment 35593 [details]
project
Comment 2 Jan Becicka 2006-10-30 06:44:55 UTC
I cannot reproduce, but I suppose, that there must be some exceptions in the
log, if find usages did not work. Please attach them.
Comment 3 Jiri Prox 2006-10-31 15:28:00 UTC
I've found another test case (reproducible on 2 computers).

1) Open attached project (note, use the new one)
2) open class testpack.Test
3) put caret on declaration of method run  (or  setup)
4) find usages
-> 0 occurrences found, but apperently used in method go() in the same class
-> if this class is copy pased to another project is works fine
Comment 4 Jiri Prox 2006-10-31 15:28:48 UTC
Created attachment 35674 [details]
new test project
Comment 5 Jan Becicka 2006-11-01 12:38:20 UTC
There is no such class testpack.Test in the project.
Comment 6 Jiri Prox 2006-11-01 12:56:17 UTC
Did you use the new version of the project (attached on Tue Oct31)?
Comment 7 Jan Becicka 2006-11-01 16:50:07 UTC
OK. My fault. Now I see testpack.Test. But again - it works for me.
I need to do clean/update/build and test it again.
Comment 8 Jan Becicka 2006-11-01 17:16:16 UTC
Now it does not work. Strange. Anyway from the debugger I can see, that I have
an identifier -JCIdent- "run" and I have corresponding TreePath, but if I do
workingCopy.getTrees().getElement(path), I get null. It worked few weeks ago, I
hope. And it works even now - sometimes.
Or is it correct to get null? How can I resolve this identifier?
Thanks.
Comment 9 Jan Becicka 2006-11-08 10:37:15 UTC
This bug is blocker for Find Usages and Refactoring.
Comment 10 Tomas Zezula 2006-11-08 13:25:00 UTC
Sorry, but I have less common with this method than you. :-)
Comment 11 Tomas Zezula 2006-11-08 16:01:33 UTC
I'will take a care of this.
Comment 12 Tomas Zezula 2006-11-08 18:41:12 UTC
Checking in
java/src/org/netbeans/modules/refactoring/java/plugins/JavaWhereUsedQueryPlugin.java;
/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/JavaWhereUsedQueryPlugin.java,v
 <--  JavaWhereUsedQueryPlugin.java
new revision: 1.3; previous revision: 1.2
done

Partial fix, the same problem is probably on more places in the refactoring/java
module.
Comment 13 Jan Becicka 2006-11-09 09:24:24 UTC
Hm. In case of refactoring this kind of fix produce several ModificationResults.
How can I merge those results? I'd like to do refactoring in one commit...
Thanks.
Comment 14 Tomas Zezula 2006-11-09 10:06:04 UTC
Checking in source/src/org/netbeans/api/java/source/TreePathHandle.java;
/cvs/java/source/src/org/netbeans/api/java/source/TreePathHandle.java,v  <-- 
TreePathHandle.java
new revision: 1.3; previous revision: 1.2
done
Comment 15 Tomas Zezula 2006-11-09 10:11:41 UTC
The problem of this issue was that the javac got a wrong classpath which does
not contained needed dependencies and had mixed (source+compile+bootpath) in
both -source and -classpath.
Comment 16 Tomas Zezula 2006-11-09 10:15:22 UTC
As far as I know, I am not a Jackpot expert :-), for Jackpot its' quite easy how
many of ModificationResults it has if they are mutual distinct which is exactly
this case.
Comment 17 Tomas Zezula 2006-11-09 10:43:46 UTC
*** Issue 88727 has been marked as a duplicate of this issue. ***
Comment 18 Jan Becicka 2006-11-09 14:27:32 UTC
Checking in RenameRefactoringPlugin.java;
/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/RenameRefactoringPlugin.java,v
 <--  RenameRefactoringPlugin.java
new revision: 1.5; previous revision: 1.4
done
Checking in JavaWhereUsedQueryPlugin.java;
/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/JavaWhereUsedQueryPlugin.java,v
 <--  JavaWhereUsedQueryPlugin.java
new revision: 1.4; previous revision: 1.3
done
Checking in JavaRefactoringPlugin.java;
/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/JavaRefactoringPlugin.java,v
 <--  JavaRefactoringPlugin.java
new revision: 1.3; previous revision: 1.2
done
Comment 19 Jiri Prox 2007-01-03 11:07:56 UTC
verified