United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4258405 : stddoclet: When source & destination dir's are the same, doc-files are trashed

Details
Type:
Bug
Submit Date:
1999-07-29
Status:
Resolved
Updated Date:
2002-12-05
Project Name:
JDK
Resolved Date:
2002-11-08
Component:
docs
OS:
generic
Sub-Component:
doclet
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.2.2
Fixed Versions:
1.4.2 (mantis)

Related Reports

Sub Tasks

Description

Name: rlT66838			Date: 07/29/99


If I run javadoc to build documentation "in place" (that is, in the same directories as the source), the source and destination directories for the doc-files copy is the same. This has the effect of trashing all the files in the doc-files directory. More specifically, the files remain, but are zero length after running javadoc.

The fix seems simple. Just check to see if the source and desination of the doc-files copy are the same, and don't do the copy if they are.
(Review ID: 93200) 
======================================================================

                                    

Comments
PUBLIC COMMENTS

This bug has been fixed.  If the destination directory is in the sourcepath, the doc-files directories are not copied.
jamie.ho@Eng 2001-05-15

I must reopen this bug because the doclet does not handle the case where the sourcepath is not specified at all.  If the destination directory is also not specified, they are both equal to the current working directory.  In that case, the doc-files should not be copied.  This bug only requires 1 line of code to fix.  It will be fixed for the 1.4.2 release.
###@###.### 2002-07-11

This bug has been fixed.
###@###.### 2002-07-19
                                     
2002-07-11
EVALUATION

Yes, needs a fix.
atul.dambalkar@eng 1999-07-30

Will investigate and fix for 1.4 beta.
jamie.ho@Eng 2001-05-14

I remembered to handle the case where the source path has multiple components.  I also handle the cases where relative or absolute paths are used.  The doclet simply creates File objects out of the source path components and compares them with the File object created by the destination directory path.  If any of them are equal, the doc-files directories are not copied.

However, there is a known bug.  If the source path is foo1:foo2 and the dest dir is foo1, the doc-files from foo2 will fail to be copied.  To work around this, I suggest that the user create a seperate output directory.

Location of Fix:

HtmlStandardWriter.java

jamie.ho@Eng 2001-05-15

I have fixed the bug but the webrev is pending review.

-----

PIT reports that this bug has not been fixed on windows 2000.

-- iag@sfbay 2002-10-23

I deleted the shell script based regression test and rewrote the test in Java.  The test now runs properly on Windows.

###@###.### 2002-11-04
                                     
2002-10-23
WORK AROUND

Explicitly specify the source path using -sourcepath and the destination directory with -d.  You should get the correct result if you do that with Javadoc 1.4 or higher.  If you want to use the current working
directory as the source path and destination directory, use:

   -d . -sourcepath .
                                     
2004-06-11
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mantis

FIXED IN:
mantis

INTEGRATED IN:
mantis
mantis-b05


                                     
2004-06-14



Hardware and Software, Engineered to Work Together