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 251040 - "javadoc not found" for org.openide.util.*, OK for most other platform API
Summary: "javadoc not found" for org.openide.util.*, OK for most other platform API
Status: REOPENED
Alias: None
Product: java
Classification: Unclassified
Component: Platform (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-09 16:36 UTC by err
Modified: 2015-04-01 15:21 UTC (History)
2 users (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 err 2015-03-09 16:36:30 UTC
In a platform app java file there is the following:
    import org.openide.filesystems.FileObject;
    import org.openide.util.ImageUtilities;
- Place the caret at the end of the word "FileObject" and do
    <ctrl-shft-space>
Observe the javadoc for FileObject ("NetBeans API Documentation" *is* installed). 

- Put the caret at the end of ImageUtilities and do the same 
Observe the error "javadoc not found".

This is a particular problem since these things, like Lookup, are so commonly used.
Comment 1 err 2015-03-09 16:44:55 UTC
Attempted workaround failed.

On the "javadoc not found" dialog, there was an "attach javadoc" option. I selected that and added the API docs zip (from .../AppData/Roaming/NetBeans/8.0/docs/NetBeansAPIs.zip) and that did not fix the problem.
Comment 2 Svata Dedic 2015-03-25 14:32:28 UTC
Works for me in a simple NB app (trying in dev nad 8.0.2 version). Do you have correct dependencies set up ?
Comment 3 err 2015-03-25 19:15:47 UTC
The problem is cause by something in Menu>Tools>Libraries. I have a library
named nb-lookup which contains the jars for org-openide-util-lookup. I use
this frequently for plain old java projects.

In the library they referenced .../NetBeans 8.0/platform/lib/xxx.jar. I copied
these two jar files somewhere else, and changed the "Ant Library Manager"
entry to point there and now the javadoc works. I changed nothing else.

Funny that the search for javadoc got confused by this (something that's not
a library in the project). BTW, the library in question did reference the
same javadoc as well.

Changed it to P3.
Comment 4 Svata Dedic 2015-03-31 09:12:17 UTC
Your library did not specify the javadoc folder for the Lookup ? 

I was only able to reproduce the 'missing javadoc' if I removed NB development support, but retained API javadocs packed (from the NetBeans Platform API Documentation plugin).
Comment 5 err 2015-03-31 20:42:10 UTC
- The platform API plugin is installed
- set library nb-lookup to reference 
    org-openide-util-lookup.jar, org-openide-util.jar
  from <install-dir>NetBeans 8.0/platform/lib
  This is also the default platform.
  Make javadoc and source tabs empty.
- create new platform app, create module in app
- create class in module
- enter method with line "Lookup.getDefault();"
- hint: Search module dependency for lookup
- select "Lookup API" in Add Module Dependency dialog.
- put caret over "getDefault()" and enter <ctrl-shift-space>

Observe javadoc not found in the javadoc popup

- click on "Attach javadoc..." from the same javadoc popup
- click on "Add Zip/Folder..." in "Select Javadoc" dialog
- Navigate to <userdir>/docs, select NetBeansAPIs.zip
- click "Add Zip/Folder..."
- click OK in "Select javadoc" dialog
- put caret over "getDefault()" and enter <ctrl-shift-space>

Observe javadoc not found in the javadoc popup, but this time the message
about "attach javadoc" is not in the popup

Below I have copied the contents of 
    .../AppData/Roaming/NetBeans/8.0/config/org-netbeans-api-project-libraries
        /Libraries/nb-lookup.xml
There are two versions; they are labeled "initial condition"
and "after adding javadoc". Note that the 2nd one has what looks like a bogus
path for the javadoc.
    .../NetBeansAPIs.zip!/org-netbeans-api-progress/
I don't think the org-netbeans-api-progress should be there.

The problems are
1 - can't find javadoc when I first try it
2 - add javadoc modifies a library *not* referenced by my module project
3 - the add javadoc creates a bad entry


=== initial condition ===

<?xml version="1.0" encoding="UTF-8"?>
<library xmlns="http://www.netbeans.org/ns/library-declaration/3" version="3.0">
    <name>nb-lookup</name>
    <type>j2se</type>
    <display-name>nb-lookup</display-name>
    <volume>
        <type>classpath</type>
        <resource>jar:file:/C:/b/j/NetBeans%208.0/platform/lib/org-openide-util-lookup.jar!/</resource>
        <resource>jar:file:/C:/b/j/NetBeans%208.0/platform/lib/org-openide-util.jar!/</resource>
    </volume>
    <volume>
        <type>src</type>
    </volume>
    <volume>
        <type>javadoc</type>
    </volume>
    <volume>
        <type>maven-pom</type>
    </volume>
    <properties/>
</library>


=== after adding javadoc ===

<?xml version="1.0" encoding="UTF-8"?>
<library xmlns="http://www.netbeans.org/ns/library-declaration/3" version="3.0">
    <name>nb-lookup</name>
    <type>j2se</type>
    <display-name>nb-lookup</display-name>
    <volume>
        <type>classpath</type>
        <resource>jar:file:/C:/b/j/NetBeans%208.0/platform/lib/org-openide-util-lookup.jar!/</resource>
        <resource>jar:file:/C:/b/j/NetBeans%208.0/platform/lib/org-openide-util.jar!/</resource>
    </volume>
    <volume>
        <type>src</type>
    </volume>
    <volume>
        <type>javadoc</type>
        <resource>jar:file:/C:/Users/err/AppData/Roaming/NetBeans/8.0/docs/NetBeansAPIs.zip!/org-netbeans-api-progress/</resource>
    </volume>
    <volume>
        <type>maven-pom</type>
    </volume>
    <properties/>
</library>
Comment 6 err 2015-03-31 20:48:03 UTC
If I now go to Menu>Tools>Libraries>nb-lookup>javadoc I see
    C:/Users/err/AppData/Roaming/NetBeans/8.0/docs/NetBeansAPIs.zip
So it doesn't show the bogus part of the entry.


Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 1
Java: 1.8.0_40; Java HotSpot(TM) 64-Bit Server VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b26
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\err\AppData\Roaming\NetBeans\8.0
Cache directory: C:\Users\err\AppData\Local\NetBeans\Cache\8.0
Comment 7 Svata Dedic 2015-04-01 14:14:37 UTC
Moving to java platform/libs. The current code selects the first valid javadoc root from the added ZIP file, if the ZIP's root does not hold javadoc index files direclty.
Comment 8 err 2015-04-01 14:23:37 UTC
(In reply to Svata Dedic from comment #7)
> The current code selects the first valid
> javadoc root from the added ZIP file

This problem occurs because a library, nb-lookup in this case, is being referenced event though it has not been added to the project.

Does your comment (and reassignment) consider this. I'm kind of in the woods on this whole thing.
Comment 9 Svata Dedic 2015-04-01 14:45:00 UTC
(In reply to err from comment #8)
> 
> This problem occurs because a library, nb-lookup in this case, is being
> referenced event though it has not been added to the project.
> 
Sorry - I didn't understand; could you pls. elaborate ?
Comment 10 err 2015-04-01 15:21:33 UTC
I tried to describe this in comment #3; but not very well.

I find that javadoc completion works fine for Lookup if the library
named nb-lookup does not reference the jar files from the platform.
See the end of comment #5 for what the library nb-lookup is.

But the point I am trying to make with the comment
    This problem occurs because a library, nb-lookup in this case,
    is being referenced even though it has not been added to the project.
is that the library nb-lookup is *NOT* part of the project.
By "library" I mean something you see in Menu>Tools>Libraries.

I do not understand how some library, that is not included in the project, is
being referenced by the project. In fact, I do not believe you can include any
"library" in a module project.
You need to put them into a "Library Wrapper Module"