JDK-4136558 : javadoc tool: error exit status from doclet is not reflected by javadoc
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.2.0
  • Priority: P5
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.5.1
  • CPU: sparc
  • Submitted: 1998-05-08
  • Updated: 2002-06-27
  • Resolved: 2001-03-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
Other
1.4.0 betaFixed
Description
Tested in JDK1.2Beta4-E.

Run javadoc command with custom doclets using option -doclet, error exit status from doclets is not reflected by javadoc:

$ javadoc -doclet Test Test.java
Loading source file Test.java...
Constructing Javadoc information...

$ echo $?
0

$ more Test.java
import com.sun.javadoc.*;

public class Test extends Doclet {
  
  public static boolean start(RootDoc root) {
    return false;
  }
}
$ 

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta FIXED IN: merlin-beta INTEGRATED IN: merlin-beta VERIFIED IN: merlin-beta3
2004-06-14

PUBLIC COMMENTS .
2004-06-10

EVALUATION Okay. atul.dambalkar@eng 1998-05-14 Check with Robert on how to properly implement this before actually doing it. doug.kramer@Eng 1998-05-18 In Main.main, the return value from the doclet is ignored. // pass off control to the doclet docletInvoker.start(root); I think what should happen is, if nerrors is 0, that is if the doclet did not call printError to generate their own error, one should be printed for them - "Doclet failed". Then, when Main.exit is called the exit status will be correct. robert.field@Eng 1999-06-24 No diagnostic is required - the doclet can print its own error messages. I have fixed javadoc to use the exit status of the doclet. neal.gafter@Eng 2001-02-26
1999-06-24

WORK AROUND Use printError() this will increment the error count and cause a non-zero exit status. robert.field@Eng 1998-05-08
1998-05-08