United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4136558 : javadoc tool: error exit status from doclet is not reflected by javadoc

Details
Type:
Bug
Submit Date:
1998-05-08
Status:
Closed
Updated Date:
2002-06-27
Project Name:
JDK
Resolved Date:
2001-03-30
Component:
tools
OS:
solaris_2.5.1
Sub-Component:
javadoc(tool)
CPU:
sparc
Priority:
P5
Resolution:
Fixed
Affected Versions:
1.2.0
Fixed Versions:
1.4.0 (beta)

Related Reports

Sub Tasks

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



Hardware and Software, Engineered to Work Together