-
Bug
-
Resolution: Fixed
-
P2
-
5.0, 6u3
-
b05
-
generic, x86
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2157222 | 7 | Jonathan Gibbons | P2 | Closed | Fixed | b48 |
JDK-2158389 | 6u10 | Jonathan Gibbons | P3 | Resolved | Fixed | b12 |
JDK-2165664 | OpenJDK6 | Joe Darcy | P3 | Resolved | Fixed | b12 |
Javadoc's invocation and extension (Doclet) mechanisms are rather inelegant. You invoke it programmatically by passing a list of command-line args, exactly like a main(). You use this to pass it -doclet, -classpath and -docletpath. Javadoc creates a classloader from the paths you pass it, and uses that to load the named doclet class. It sets this classloader as the context classloader when invoking methods on the doclet, such as languageVersion(). (Annoyingly, it also fails to restore the context classloader, which has caused another
bug already).
The upshot of this seems to be that if tools.jar is not in the system classpath, javadoc and the doclet will load classes (such as LanguageVersion) from it using different
classloaders. When javadoc goes to do its dynamic invocation on the doclet methods, it complains when its instanceof tests fail. So, the LanguageVersion that it is complaining about really is a LanguageVersion, but it's just one from a different classloader.
The attached test case is a simple test case which demonstrates the problem using a dummy
Doclet. It also shows that you *can* get things to work if you can just pass -classpath to the java command that is invoked. This is exactly what the WLS ant script does, and is why thing work in the 'devenv' environment but not with out-of-the-box ant.
###@###.### 10/11/04 16:31 GMT
bug already).
The upshot of this seems to be that if tools.jar is not in the system classpath, javadoc and the doclet will load classes (such as LanguageVersion) from it using different
classloaders. When javadoc goes to do its dynamic invocation on the doclet methods, it complains when its instanceof tests fail. So, the LanguageVersion that it is complaining about really is a LanguageVersion, but it's just one from a different classloader.
The attached test case is a simple test case which demonstrates the problem using a dummy
Doclet. It also shows that you *can* get things to work if you can just pass -classpath to the java command that is invoked. This is exactly what the WLS ant script does, and is why thing work in the 'devenv' environment but not with out-of-the-box ant.
###@###.### 10/11/04 16:31 GMT
- backported by
-
JDK-2158389 current Javadoc's invocation and extension (Doclet) mechanisms are problematic
-
- Resolved
-
-
JDK-2165664 current Javadoc's invocation and extension (Doclet) mechanisms are problematic
-
- Resolved
-
-
JDK-2157222 current Javadoc's invocation and extension (Doclet) mechanisms are problematic
-
- Closed
-
- duplicates
-
JDK-6640954 current Javadoc's invocation and extension (Doclet) mechanisms are problematic, JDK6 fix for 6176978
-
- Closed
-