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 134000 - go to type not finding classes
Summary: go to type not finding classes
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker with 2 votes (vote)
Assignee: Tomas Zezula
URL:
Keywords:
: 134433 (view as bug list)
Depends on:
Blocks: 133996
  Show dependency tree
 
Reported: 2008-04-25 22:34 UTC by gshyde
Modified: 2008-06-06 22:19 UTC (History)
1 user (show)

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 gshyde 2008-04-25 22:34:34 UTC
With the upgrade from 6.0 to 6.1 RC2 I can not find many classes with the Go to type window, even when typing out the
full class name with proper case. If I manually find the class and open it after that the go to type will find it but
not before. This doesn't happen with all classes but many from my project.
Comment 1 Jiri Prox 2008-04-28 08:21:44 UTC
What type of project do you use? How is the project configured?

Comment 2 gshyde 2008-04-28 13:15:14 UTC
the projects is a standard java project created from existing source. I didn't do anything special in the 
configuration other than add jars to the project, just the same as in 6.0
Comment 3 gshyde 2008-04-28 18:18:05 UTC
As an extension to this it's not just limited to Find Type. It looks like these classes aren't loaded into netbeans at
all until I open the file. I tried doing a Hierarchy and it only showed one of the two classes that implemented an
interface. Once I opened the other class manually (it was in the same package as the other class and the interface) it
was found from that point on. There doesn't appear to be any rime or reason to the classes that aren't found. this may
be related to issue 133996 as the errors that I don't see may be coming from classes the IDE doesn't see.
Comment 4 gshyde 2008-04-30 23:18:14 UTC
I've now found that it's not just with the Go To Type but all internal class checking. If I do a find usage classes not
found in go to aren't displayed there either. I will be more than happy to send whatever I can to help get this fixed as
this makes 6.1 pretty much unusable until it is fixed. One interesting thing is that if I issue a build it will find
errors in classes that netbeans can't find and if I click on them then netbeans will know about them from that point on.
Another location that doesn't find classes is the CTRL+SPACE for autocomplete. Switching back to the 6.0 version works fine.
Comment 5 bwl 2008-05-02 02:15:50 UTC
I also experience this.  Our projects are freeform ant projects.  At first I thought that it had only picked up classes
under the "src" directory in the project, and not the "test".  Next time I ran it though it seemed to have the tests but
not everything in src.  This defect makes go to type, find usages, code completion all broken.  As such I'd have thought
it was a P1, not P3.

I looked in the messages.log to see if there were any errors.  There is one. Don't know if its related.
INFO: Cannot get end position for com.sun.tools.javac.tree.JCTree$JCMethodInvocation super(x0)
file:Z:/lms/trunk/conftool/docobj/src/com/adc/docobj/core/DocObjectCache.java

java.lang.RuntimeException: Cannot get end position for com.sun.tools.javac.tree.JCTree$JCMethodInvocation super(x0)
file:Z:/lms/trunk/conftool/docobj/src/com/adc/docobj/core/DocObjectCache.java

	at org.netbeans.modules.refactoring.java.WhereUsedElement.create(WhereUsedElement.java:179)

	at org.netbeans.modules.refactoring.java.plugins.JavaWhereUsedQueryPlugin$FindTask.run(JavaWhereUsedQueryPlugin.java:296)

	at org.netbeans.modules.refactoring.java.plugins.JavaWhereUsedQueryPlugin$FindTask.run(JavaWhereUsedQueryPlugin.java:244)

	at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:963)

	at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:244)

	at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:231)

	at org.netbeans.modules.refactoring.java.plugins.JavaWhereUsedQueryPlugin.prepare(JavaWhereUsedQueryPlugin.java:187)

	at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:380)

	at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:202)

	at org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:765)

	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)

	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)

INFO: Cannot get end position for com.sun.tools.javac.tree.JCTree$JCMethodInvocation super(x0)
file:Z:/lms/trunk/conftool/docobj/src/com/adc/docobj/core/util/CompileProcessor.java

java.lang.RuntimeException: Cannot get end position for com.sun.tools.javac.tree.JCTree$JCMethodInvocation super(x0)
file:Z:/lms/trunk/conftool/docobj/src/com/adc/docobj/core/util/CompileProcessor.java

	at org.netbeans.modules.refactoring.java.WhereUsedElement.create(WhereUsedElement.java:179)

	at org.netbeans.modules.refactoring.java.plugins.JavaWhereUsedQueryPlugin$FindTask.run(JavaWhereUsedQueryPlugin.java:296)

	at org.netbeans.modules.refactoring.java.plugins.JavaWhereUsedQueryPlugin$FindTask.run(JavaWhereUsedQueryPlugin.java:244)

	at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:963)

	at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:244)

	at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:231)

	at org.netbeans.modules.refactoring.java.plugins.JavaWhereUsedQueryPlugin.prepare(JavaWhereUsedQueryPlugin.java:187)

	at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:380)

	at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:202)

	at org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:765)

	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)

	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
Comment 6 gshyde 2008-05-02 15:41:35 UTC
One additional thing I can remember about it is when I open/create a project for the first time sometimes if I use the
goto class after it comes back without my result it will show at the bottom a warning symbol saying that the scan hadn't
completed yet. I only get it once ever but maybe it has something to do with it. From what I'm seeing it does look like
a complete scan of the classes in the project isn't finished, especially since once I open the class it adds it to
whatever cache of classes netbeans uses internaly and I can find it at that point. 
Comment 7 Jiri Prox 2008-05-05 13:15:28 UTC
*** Issue 134433 has been marked as a duplicate of this issue. ***
Comment 8 Jiri Prox 2008-05-05 13:19:40 UTC
Please try deleting ${userdir}/var/cache/index folder and restart IDE, does the problem persists?
If yes, can someone provide the sample project? Thanks
Comment 9 Jiri Prox 2008-05-05 13:20:22 UTC
P2 duplicate -> increasing priority
Comment 10 gshyde 2008-05-05 17:27:57 UTC
I've tried removing that index directory to no avail. For the original project I had open every search just came back
with a message saying that the incomplete results do to an unfinished scan (I still have the Task scanning slidebar
showing at the bottom of the screen). Eventually I had to close that project and open another one and this one just
doesn't return any results from my project. The task scan is still going on (over an hour at this point, there are
almost 7k classes in the project). One thing with my projects, they're all essentially the same, just different versions
of the same project. This task scan eats almost all of my memory, configured at 768 at the moment. I've had to shut down
netbeans several times at this point to be able to continue to work and eventually it always creeps back up. If the task
scan is used to populate these other functions could we have some kind of tiered system where there's a fast scan to
just get the class names and then work progressively deeper within the class and it's connections so simple things like
find a class can work relatively quickly after opening a new project without having to wait for a full task scan to
complete?
Comment 11 Jiri Prox 2008-05-21 14:58:12 UTC
Can you, please, apply patch from issue 128326, and check if it helps?
Comment 12 gshyde 2008-05-21 19:23:45 UTC
This seems to fix the issue. However, it takes FOREVERRRRRRRRRRRRRRRR for that scan to complete for me (7600+ classes).
However, with testing from that point on, after a restart and after opening a project it's significantly faster.
Comment 13 jn 2008-05-22 20:23:02 UTC
I reported issue 134433 which was marked as a duplicate of this issue.  The suggested patch (for issue 128326) appears
to have fixed the problem for me.  Whereas before, find usages would produce zero usages (except for usages which
existed in currently or recently opened files), it is now producing numerous usages, in files I haven't recently touched.  

This bug is a showstopper for me.  Because I am doing heavy refactoring, I was forced to revert to NB 6.0.1.  It looks
like I'll be able to continue with 6.1 with this patch.  Thanks for working on this issue.
Comment 14 Jan Becicka 2008-06-06 11:43:53 UTC
So it looks like bug is fixed after fix of 128326, right?
Comment 15 gshyde 2008-06-06 22:19:34 UTC
Yes, the issue has been fixed