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 95864 - Go To Class intermittent with NB source
Summary: Go To Class intermittent with NB source
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-17 05:49 UTC by err
Modified: 2007-08-14 14:47 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 err 2007-02-17 05:49:57 UTC
Starting with an empty userdir, I created module1, then NewClass.java. During
module1 creation I added platform source, netbeans-5_5-ide_sources.zip from
http://translatedfiles.netbeans.org/docs/HOWTOs/How-to-build-localized-IDE.html.
I added dependencies "Editor Library" and "Text API".

Here's the entire class file. Using GoToClasss (or GoToSource) EditorCookie is
found, StatusBar is not. Is there some kind of workaround?

package org.yourorghere.module1;

import org.netbeans.editor.StatusBar;
import org.openide.cookies.EditorCookie;

and the source is in the zip file

/netbeans-5.5/ $ jar -tf netbeans-5_5-ide_sources.zip |grep StatusBar
netbeans-src/editor/libsrc/org/netbeans/editor/StatusBar.java
Comment 1 Jan Lahoda 2007-02-20 17:49:22 UTC
I tested both NB5.5 and a recent trunk build. In NB5.5, the go to class
sometimes worked for EditorCookie, sometimes not. It never worked for StatusBar
for me in NB5.5, and never worked for any of these classes in NB6.0. 

I have enabled logging in org.netbeans.api.java.queries.SourceForBinaryQuery and
it seems that when the go to class did not work, the
org.netbeans.modules.apisupport.project.queries.GlobalSourceForBinaryImpl
returned an empty result for binary roots corresponding to StatusBar and
EditorCookie. The sources then cannot be found and the editor cannot jump to the
source.

Reassigning to apisupport/project for evaluation.
Comment 2 Martin Krauskopf 2007-02-21 08:46:09 UTC
There are XXX/TODOs notes about hardcoded src. Presumably the problem here. We
should read editor/lib/nbproject/project.properties#src.dir (in this case)
instead. I hope there will be sometime to look at it until 6.0. Might be simple fix.
Comment 3 err 2007-02-21 19:16:21 UTC
One of the most useful, and common, tools when working with a new and/or complex
system is "tags", they've been around forever; NetBeans is certainly complex,
and I'd guess even experienced users find themselves venuturing into new areas.
Its disapointing to think there might not be time to get to this before NB6. I
believe this problem affects not only Go To Class, but also Go To Source and Go
To Definition.

P3 seems to low according to the guidelines; in some ways it seems to qualify as
P1 "doesn't work no workarround exists", but that seems too high.
Comment 4 Martin Krauskopf 2007-02-21 20:02:00 UTC
Then make it higher priority during filing an issue. I have a lot high priority
tasks to do. If reporter files an issue as P3 I'll concentrate at another higher
priority tasks since reporter says it is not that big issue for him/her.
I agree this may be quite annoying/time_wasting in some cases -> P2. So I'll
look at it soon.
Comment 5 Jesse Glick 2007-02-21 20:26:38 UTC
The workaround is simple - open the class some other way, e.g. Ctrl-O.
Comment 6 err 2007-02-21 21:31:06 UTC
I don't know what Ctrl-O is; but if you mean Alt-O, that doesn't work either.

Sorry about the Priority thing, still feeling my way around NetBeans community
workflow. Makes sense for reporter to make a stab at accurately setting priority.
Comment 7 Jesse Glick 2007-02-21 21:40:45 UTC
Ctrl-O is like File > Open File.
Comment 8 Martin Krauskopf 2007-02-21 21:51:19 UTC
Yup, reasonably higher priority never hurts :) The fact is that currently there
are not too much developers working actively on API support (maybe 0.5). So
there will be some delay in fixing.
Anyway your report is detailed and clear - so thanks for filling issues like this.
Comment 9 err 2007-02-21 21:56:53 UTC
Open file, that can be an adventure. Do "find nb-src -name StatusBar.java"
first. Guess I'll run ctags and grep that.
Comment 10 Martin Krauskopf 2007-02-21 22:05:26 UTC
Or put the following into your .bashrc (or similar):

function nblocate() {
  checkparams 1 "$#" "Usage: nblocate fileToLocateInNB_CVS" || return 1
  locate -r \/path\/to\/netbeans-src\/.*$1 | grep -v CVS\/RevisionCache
}

then just "nblocate \/StatusBar.java".
Comment 11 Martin Krauskopf 2007-08-14 14:47:32 UTC
It's fixed. However there are some failing tests and I'm not sure whether they are related to my changes. I'm going to
evaluate failures soon (this week?) and also will commit test for this issue.

src/org/netbeans/modules/apisupport/project/universe/AbstractEntryWithSources.java;
new revision: 1.12; previous revision: 1.11
src/org/netbeans/modules/apisupport/project/universe/ExternalEntry.java;
new revision: 1.8; previous revision: 1.7
src/org/netbeans/modules/apisupport/project/universe/ModuleList.java;
new revision: 1.33; previous revision: 1.32
src/org/netbeans/modules/apisupport/project/universe/NetBeansOrgEntry.java;
new revision: 1.10; previous revision: 1.9