JDK-4258405 : stddoclet: When source & destination dir's are the same, doc-files are trashed
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.2.2
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 1999-07-29
  • Updated: 2014-05-05
  • Resolved: 2002-11-08
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 Availability Release.

To download the current JDK release, click here.
Other
1.4.2 mantisFixed
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
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis FIXED IN: mantis INTEGRATED IN: mantis mantis-b05
14-06-2004

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 .
11-06-2004

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
23-10-2002

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
11-07-2002