Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4258405
Votes 1
Synopsis stddoclet: When source & destination dir's are the same, doc-files are trashed
Category doclet:tbd
Reported Against 1.2.2
Release Fixed 1.4.2(mantis)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs
Submit Date 29-JUL-1999
Description
This bug has been fixed.  If the destination directory is in the sourcepath, the doc-files directories are not copied.
 xxxxx@xxxxx  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.
 xxxxx@xxxxx  2002-07-11

This bug has been fixed.
 xxxxx@xxxxx  2002-07-19




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) 
======================================================================
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 .
Evaluation
Yes, needs a fix.
 xxxxx@xxxxx  1999-07-30

Will investigate and fix for 1.4 beta.
 xxxxx@xxxxx  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

 xxxxx@xxxxx  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.

--  xxxxx@xxxxx  2002-10-23

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

 xxxxx@xxxxx  2002-11-04
Comments
  
  Include a link with my name & email   

Submitted On 09-JUL-2002
DavidBiesack
I am still seeing this bug in 1.4.0_01
After running c:\jdk1.4.0_01\bin\javadoc all
the images in the doc-files directories have 0 length.


Submitted On 09-JUL-2002
DavidBiesack
I also verified that this bug still exists in the 1.4.1 beta



PLEASE NOTE: JDK6 is formerly known as Project Mustang