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 71391 - Alt+F1 does not work
Summary: Alt+F1 does not work
Status: CLOSED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: Adam Sotona
URL:
Keywords:
: 71394 71482 72028 80966 (view as bug list)
Depends on: 72045
Blocks:
  Show dependency tree
 
Reported: 2006-01-14 04:05 UTC by jozart
Modified: 2008-09-10 15:56 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 jozart 2006-01-14 04:05:25 UTC
The javadoc directory chosen by the j2seplatform implementation is either wrong
or unusable.

Given a JDK installed at "jdk1.5", the j2seplatform impl selects "jdk1.5/docs"
as the javadoc directory, if this directory exists.  (See method below.)

Given the structure of the JDK doc tree(*), the correct directory should be
"jdk1.5/docs/api".

(*) See http://java.sun.com/j2se/1.5.0/download.jsp

To reproduce:

1. Change dir to javahome and unzip the doc tree, creating "docs" directory.
2. Install netbeans.
3. Right click on a java platform classname; netbeans fails:

"Javadoc not found. Use Library Manager to specify Javadoc for classpath items
and the Java Platform Manager to..."

(The error message is so long that only half is displayed..)

To workaround:

Open Java Platform Manager, remove the existing Javadoc entry "javahome/docs"
and add a functional entry: "javahome/docs/api".

Note: I tried to use the doc.zip file directly by adding it as a Zip file, but
that didn't work either.

Possible enhancements:

1. Make Javadoc entries editable. Browse should take you to the specified
directory and let you modify the existing entry.

2. Allow JDK doc.zip to be assigned as a javadoc Zip file.

3. Support javadoc URLs.  (Could even default to Sun's javadoc online.)

org.netbeans.modules.java.j2seplatform.platformdefinition.DefaultPlatformImpl

    static List getJavadoc (File javaHome) {
        if (javaHome != null ) {
            File f = new File (javaHome,"docs"); //NOI18N
            if (f.isDirectory() && f.canRead()) {
                try {
                    return Collections.singletonList(f.toURI().toURL());
                } catch (MalformedURLException mue) {
                    ErrorManager.getDefault().notify (mue);
                }
            }                        
        }
        return null;
    }
Comment 1 Tomas Zezula 2006-01-16 09:38:57 UTC
The docs folder is OK, since it is a documentation folder of the JDK,
the api folder is found under the docs folder.
Works fine on Linux need to verify on Windows, but seems as WORKSFORME.
Comment 2 Tomas Zezula 2006-01-16 14:13:19 UTC
Works either on Windows. I've tried it using both the Javadoc index search and
code completion.

Comments to the enhancement below:
1) The entries are not editable, but you can remove an old one and add the new one.
2) You can assign JDK docs as zip file.

3)There is already an enhancement for it, the problem is that the javadoc module
is based on FileObject not URLs and the current implementation of HTTPFileSystem
is not very reliable.

Comment 3 jozart 2006-01-16 19:45:42 UTC
I am reporting that Show Javadoc fails (Alt-F1), while you are testing
that Javadoc Index Search (Shift-F1) works.
Comment 4 jozart 2006-01-16 19:51:30 UTC
To reproduce:

Assume NetBeans installs the javadoc link for my platform as "c:\jdk1.5\docs"

I go into my source code and right click on a reference to a java.*
class (an Object or a String, for example).  Then I select Show Javadoc.  

If I leave the javadoc link as "c:\jdk1.5\docs" it fails.  If I change
the javadoc link to "c:\jdk1.5\docs\api" it works.

NOTE: If I use Javadoc Index Search (Shift-F1) instead, then the installed
docs link DOES work -- so my report that the directory is wrong is wrong.

Must be a problem in the way Show Javadoc is implemented..

Fails in same way with either system browser or Swing browser.
Comment 5 Tomas Zezula 2006-01-17 08:58:21 UTC
OK, you are reporting the issue to wrong component.
I tried it on the Javadoc Index Search since I know the code behind it.
If it works any other feature should work also if it is not broken, it uses the
smae JDFBQImpl.

Comment 6 Miloslav Metelka 2006-01-17 10:17:38 UTC
We have tried to reproduce on WinXP for java.lang.String, java.lang.System and
java.math.BigDecimal but it works fine. Honestly I don't know what could become
wrong in your environment. Could you please double-check that the docs dir is
fine (the particular class html files exist etc.) and possibly use a fresh
userdir? Thanks.
Closing as worksforme for now please reopen if necessary.
Comment 7 jozart 2006-01-17 21:31:04 UTC
Perhaps the problem is due to a bad interaction with the Mobility Module?

Though, AFAIK, Show Javadoc has never worked for me without modifying the
Javadoc directory.

I'll keep trying (and continue to workaround, I expect), and will report back if
I discover any new clues.
Comment 8 Tomas Zezula 2006-01-18 09:39:13 UTC
It may be possible, that j2me integration brakes this feature. All of us tried
it in the pure NetBeans. I will install the j2me pack to verify. Thanks for the
feedback.
Comment 9 Tomas Zezula 2006-01-18 10:45:05 UTC
It is caused by j2me module, it's reproduceable even on the Linux while having
the j2me support installed. If you uninstall it javadoc works fine.
Under the debuger I've found that the
org.netbeans.modules.kjava.j2meplatform.JavadocForBinaryQueryPlatformImpl causes
the problems.

Possible solutions:
Fix the JavadocForBinaryQueryPlatformImpl not to respond to j2se platforms requests.
Correct the priority of the j2me JDFBQI to be called after j2se JDFBQI.
The j2se JDFBQI priority is 150. If the j2me JDFBQI will have 151 it should work
fine. 
Comment 10 Adam Sotona 2006-01-18 11:12:03 UTC
Yes, we have an older implementation of the JavadocForBinaryQuery that handle
Javadoc for all Java platforms (the same behavior as does J2SE implementation).
Our implementation does not search for correct Javadoc root within the jar/zip
files but expects the root is equal to jar/zip root. But our implementation is
registered with higher priority.

We have two simple options to fix it: by completely removing our implementation
(because J2se one works even for us) or simply change the priority to >150.
 
Comment 11 Lukas Hasik 2006-01-18 13:52:06 UTC
decreasing priority and changing TM to 5.1

this issue won't be fixed for 5.0 release.
Easy workaround exists - add full path to documentation or correct existing link
e.g. - the javadoc link as "c:\jdk1.5\docs" fails.  Change
the javadoc link to "c:\jdk1.5\docs\api" then it works.
Comment 12 Jan Pokorsky 2006-01-19 10:08:38 UTC
*** Issue 71482 has been marked as a duplicate of this issue. ***
Comment 13 Tomas Zezula 2006-01-23 18:14:41 UTC
*** Issue 71394 has been marked as a duplicate of this issue. ***
Comment 14 Lukas Hasik 2006-01-31 08:15:48 UTC
*** Issue 72028 has been marked as a duplicate of this issue. ***
Comment 15 Adam Sotona 2006-03-09 15:02:03 UTC
fixed in trunk by removing 
src/org/netbeans/modules/kjava/j2meplatform/JavadocForBinaryQueryPlatformImpl.java
Comment 16 Lukas Hasik 2006-03-14 09:15:48 UTC
it still shows "Javadoc not found. Use Library Manager to specify... "
tested with MP build 0313_2.
Comment 17 Lukas Hasik 2006-03-29 10:33:13 UTC
seems to be working with nb60-0327+mp0328

(maybe I didn't add javadoc for the j2se when i verified it last time?)
Comment 18 Adam Sotona 2006-04-03 12:02:21 UTC
fixed in 5.5
Comment 19 Jan Pokorsky 2006-07-24 14:33:01 UTC
*** Issue 80966 has been marked as a duplicate of this issue. ***
Comment 20 Lukas Hasik 2007-10-25 19:28:27 UTC
v
Comment 21 Ivan Sidorkin 2008-09-10 15:56:53 UTC
close old issues