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 70387 - Completion javadoc and go to source don't work
Summary: Completion javadoc and go to source don't work
Status: VERIFIED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords: REGRESSION, SIMPLEFIX
: 70449 (view as bug list)
Depends on:
Blocks: 69735 70376
  Show dependency tree
 
Reported: 2005-12-14 10:25 UTC by Jiri Skrivanek
Modified: 2005-12-19 11:49 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log with option -J-Dorg.netbeans.api.java.queries.JavadocForBinaryQuery=0 (54.34 KB, text/plain)
2005-12-14 10:33 UTC, Jiri Skrivanek
Details
Log file after my testcase (46.65 KB, text/plain)
2005-12-14 16:42 UTC, Tomas Danek
Details
My log file, for purposes of comparison (68.47 KB, text/plain)
2005-12-14 19:14 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2005-12-14 10:25:26 UTC
In recent builds stopped to work javadoc in code completion and go to source
functionality for NetBeans modules. To reproduce:

- run IDE with empty userdir
- open e.g. nb_all/ant project and wait until scanning finishes
- open e.g. org.apache.tools.ant.module.AntCustomizer.java
- move cursor to 39:26 position (somewhere in DialogDescriptor import)
- invoke code completion (Ctrl+Space) and "Javadoc not found." message is shown
in popup.
- try Alt+G or Alt+O at the same position but only message "Source file for
org.openide.DialogDescripto not found." is printed at status bar.

Build 200512132030, JDK1.5.0_06, WindowsXP.
Comment 1 Jiri Skrivanek 2005-12-14 10:33:23 UTC
Created attachment 27828 [details]
IDE log with option -J-Dorg.netbeans.api.java.queries.JavadocForBinaryQuery=0
Comment 2 Martin Krauskopf 2005-12-14 13:22:48 UTC
Works for me on linux with fresh build. Tomasi are you able to reproduce on
Windows? Thanks.
Comment 3 Tomas Danek 2005-12-14 14:02:08 UTC
true, it's reproducible for me in "5.1" 2005121319 on WinXP
Comment 4 Tomas Danek 2005-12-14 14:37:38 UTC
Reprodicible also for external modules.
In netbeans-5_0-daily-bin-200512061900-6_Dec_2005_1900.zip  works,
in netbeans-5_0-daily-bin-200512072015-7_Dec_2005_2015.zip  does not. Some
change between must have broken it. 
Comment 5 Martin Krauskopf 2005-12-14 14:48:11 UTC
Did you have associated sources and javadoc when trying it with external
modules? Trying it with fresh build would be helpful. There was a P1 fixed
today. Not sure if it can be a culprit.
Comment 6 Tomas Danek 2005-12-14 15:13:59 UTC
Aha, it matter *which* sources i associate with platform. I downloaded ~100MB
sources zip file, and it works. But if I associate the same sources, unzipped to
a dir, it does not works. Martine, any change in NBPM which could break this??
Comment 7 Tomas Danek 2005-12-14 15:17:35 UTC
Yes, my steps:
1) fresh userdir
2) associate sources in NBPM
3) create module, set dependency to e.g. Filesystems API
4) create new class, type some class and try ALT+O, ALT+G

As i said, it depends on type of sources which i do associate.
Comment 8 Martin Krauskopf 2005-12-14 15:25:51 UTC
When you check out whole NB cvs tree, open an e.g. mentioned NB_CVS/ant module,
you shouldn't need to associate any sources AFAIK.
We can try it together tomorrow Tomasi on your machine.

Jesse feel free to reassign if you don't have any fast ideas.... I'm working on
that leak (70032) - trying to play with GUI vs. assertGC unsuccessfully so far -
but off topic here, I suppose :)
Comment 9 Martin Krauskopf 2005-12-14 15:31:24 UTC
> Martine, any change in NBPM which could break this??

I'm not aware of any.
Comment 10 Jesse Glick 2005-12-14 15:51:59 UTC
Working fine for me in a dev build. Try running with

-J-Dorg.netbeans.api.java.queries.SourceForBinaryQuery=0

if you can still reproduce.

Do you have other stuff checked out, like nbbuild and openide and so on?
Comment 11 Jesse Glick 2005-12-14 16:03:55 UTC
Sorry, did not see preceding comments for some reason.

If there is still a bug reproducible in current dev builds, please include
complete steps to reproduce from scratch. And specify on which operating systems
you can reproduce, and include a fresh diagnostic log. The preceding comments
leave it ambiguous what exactly you are talking about and who can reproduce what.
Comment 12 Tomas Danek 2005-12-14 16:20:41 UTC
1) using build 5.0 200512132030, on Windows XP, with installation
2) downloaded zip file sources to this build
3) unpacking zip to some folder.
4) clear userdir
5) starting ide, setting sources association in NBPM
6) creating new standalone module, setting it's dependency to e.g. Filesytems api
7) creating new class in that module, typing e.g. "FileObject x;"
8) invoking ALT+G and ALT+O -> does not work

note that if i associate not folder with sources, but zip, it works.
Comment 13 Martin Krauskopf 2005-12-14 16:28:23 UTC
> musilt2 Wed Dec 14 16:20:41

This is rather another issue (not P2 I think). Original reporter complained
about modules in NB cvs tree regression. Should be filed separatelly (assigned
to me), since I'm not sure if anybody checked this before at all.
Comment 14 Tomas Danek 2005-12-14 16:40:39 UTC
>This is rather another issue (not P2 I think). Original reporter complained
>about modules in NB cvs tree regression. Should be filed separatelly (assigned
>to me), since I'm not sure if anybody checked this before at all.

nope. this is only another testcase, which reproduces *the same bug*. I am able
to reproduce also the original testcase.


I'll attach log produced after my "steps to reproduce"
Comment 15 Tomas Danek 2005-12-14 16:42:11 UTC
Created attachment 27853 [details]
Log file after my testcase
Comment 16 Jesse Glick 2005-12-14 19:13:18 UTC
Working fine for me using last instructions from musilt2, on Linux with JDK
5.0u6. Downloaded

netbeans-5_0-daily-bin-200512132030-13_Dec_2005_2030.zip
netbeans-5_0-daily-src-200512132030-ide_sources-13_Dec_2005_2030.zip

Unpacked them so that we have e.g.

-rw-r--r--  1 jglick jglick 422650 Dec 13 22:46
/tmp/70387/netbeans-200512132030/platform6/core/org-openide-filesystems.jar
-rw-r--r--  1 jglick jglick    615 Dec 13 16:17
/tmp/70387/netbeans-src-200512132030/openide/fs/build.xml

Started IDE:

cd /tmp/70387
./netbeans-200512132030/bin/netbeans --userdir testud
-J-Dorg.netbeans.api.java.queries.SourceForBinaryQuery=0
-J-Dorg.netbeans.modules.apisupport.project=0

In NB Plat Mgr, set Sources for Default Platform to
/tmp/70387/netbeans-src-200512132030.

Made new module /tmp/70387/module1, added FS API as a dep, created

import org.openide.filesystems.FileObject;
public class X {
    public X() {
        FileObject x;
    }
}

and code completion and Go To Source both work fine on FileObject.

Perhaps you accidentally configured the source association with the directory
containing netbeans-src, rather than the directory netbeans-src itself? Just a
guess.
Comment 17 Jesse Glick 2005-12-14 19:14:44 UTC
Created attachment 27856 [details]
My log file, for purposes of comparison
Comment 18 Jesse Glick 2005-12-14 20:15:23 UTC
I just added some diagnostics (-J-Dorg.netbeans.modules.apisupport.project=0)
which would be helpful if this can be reproduced in a future dev build:

committed     Up-To-Date  1.28       
apisupport/project/src/org/netbeans/modules/apisupport/project/universe/NbPlatform.java
Comment 19 Jaromir Uhrik 2005-12-14 20:38:17 UTC
As both guys Tomas and Jirka mentioned this problem appears on Win XP. OS of
this issue is set as Win XP. Jesse and Martine why don't you try to reproduce
this issue on reported platform instead of resolving as worksforme? It is
obviously problem of just Windows, not Linux. I am reopening this issue because
it is easily reproducible on Win XP. I hope my comment helps to clarify.
Comment 20 Jesse Glick 2005-12-15 00:39:41 UTC
Due to misuse of file separators in patch to SourceForBinaryImpl for issue #69735.
Comment 21 Jesse Glick 2005-12-15 01:21:07 UTC
Patch checked that the target JAR file actually had the same suffix including
cluster as the expected one, e.g.

platform6/modules/org-netbeans-modules-whatever.jar

It used PropertyUtils.relativizeFile which always produced a '/'-separated path.
This works on Unix but not Windows.

Have not tested fix. Would have to waste several more hours getting a usable
development environment on my Windows partition. Hopefully someone else would be
able to test quickly. Ought to be able to change

clusterPath = PropertyUtils.relativizeFile(cluster.getParentFile(),
project.getModuleJarLocation());

to

clusterPath = PropertyUtils.relativizeFile(cluster.getParentFile(),
project.getModuleJarLocation()).replace('/', File.separatorChar);
Comment 22 Martin Krauskopf 2005-12-15 02:16:11 UTC
Than it would be strange if all of our SourceForBinaryImplTest pass. Maybe that
just nobody runs them on Windows since that fix. Probably
testFindSourceRootForModuleJar() and testExternalModules() should fail. I'm also
unable to test it right now. To be sure, I'll check it in cca 6 hours with Radek
or Tomas, depending on who will be in the office :)
Thanks to all for investigation.
Comment 23 Jiri Skrivanek 2005-12-15 07:28:32 UTC
I tested patch by Jesse in build 200512142030 (release50) and it works
perfectly. I suggest to merge it into release50 branch because it is a big
usability issue and fix is really simple.
Comment 24 Martin Krauskopf 2005-12-15 09:17:09 UTC
Ok, thanks for your help Jirko. I'll integrate it soon (also into release50 branch)
Comment 25 Martin Krauskopf 2005-12-15 09:30:32 UTC
Patch applied.

Checking in queries/SourceForBinaryImpl.java; 1.4 -> 1.5;
Comment 26 Martin Krauskopf 2005-12-15 09:32:51 UTC
*** Issue 70449 has been marked as a duplicate of this issue. ***
Comment 27 Martin Krauskopf 2005-12-15 10:56:14 UTC
Jesse could you review your patch for release50? :)

http://apisupport.netbeans.org/servlets/ReadMsg?list=cvs&msgNo=2990
Comment 28 Martin Krauskopf 2005-12-15 10:56:54 UTC
Forgot to CC reviewer...
Comment 29 Jesse Glick 2005-12-15 16:19:07 UTC
Sure, consider it reviewed. :-)

Do you know anything about the unit test status? I tried to look at what
SFBITest was doing but I didn't see anything that would test this specifically.
Comment 30 Martin Krauskopf 2005-12-15 17:06:51 UTC
You can simulate Windows behaviour on linux with s/File.separator/\\/ in your
patch, I believe (OS negation).
Also we tried it here with Tomas on Windows and those two test failed before the
patch was applied. After fix it works.
There should be somebody who runs tests on Windows from time to time I think ;)
I'll commit into release50 tomorrow.
Comment 31 Martin Krauskopf 2005-12-16 10:36:24 UTC
Backported into release50 (the same diff)
Comment 32 Tomas Danek 2005-12-19 11:49:32 UTC
verified in 5.0 && trunk