Bug #5557


Replace hardcoded path separator with File.pathSeparator

Added by dhogan dhogan over 12 years ago. Updated over 12 years ago.

build system
Target version:
Start date:
Due date:
% Done:


Estimated time:


The class uses ":" rather than File.pathSeparator. It will display incorrectly on Windows without the fix.


fix_classpath_char.diff (749 Bytes) fix_classpath_char.diff dhogan dhogan, 11/29/2011 11:58 AM
fix_classpath_char_v2.diff (3.56 KB) fix_classpath_char_v2.diff dhogan dhogan, 11/29/2011 12:44 PM
temp_fix_javadoc.diff (6.42 KB) temp_fix_javadoc.diff dhogan dhogan, 01/09/2012 03:02 PM
Actions #1

Updated by dhogan dhogan over 12 years ago

Added a few more fixes. The importance should be bumped to normal because it's no longer just a cosmetic fix. When I run 'ant javadoc' on Windows, it fails immediately due to the path separator problem.

The attached patch fixes it with a few other changes: point to Oracle/JRE 1.6.x and fix a few typos. I'm getting 522 warnings and 3 errors when running javadoc against r29009/trunk on Windows. Could someone test on the platform that normally generates the javadoc to see if that's the same?

Actions #2

Updated by Derik Barseghian over 12 years ago

Thanks for your contribution. Committed to trunk at r29119.
ant javadoc still needs testing on Windows, see comment#1, leaving open.

Actions #3

Updated by Derik Barseghian over 12 years ago

On linux w/ java 1.6 I get 8 errors, 626 warnings, and the process ends with an IOException:

[create-javadoc] 8 errors
[create-javadoc] 626 warnings
[create-javadoc] IOException: Subprocess "javadoc -d /home/barseghian/dev2/kepler.modules/javadoc -sourcepath /home/barseghian/dev2/kepler.modules/sensor-view/src:/home/barseghian/dev2/kepler.modules/runtimemonitor/src:/home/barseghian/dev2/kepler.modules/reporting/src:/home/barseghian/dev2/kepler.modules/workflow-run-manager/src:/home/barseghian/dev2/kepler.modules/provenance/src:/home/barseghian/dev2/kepler.modules/tagging/src:/home/barseghian/dev2/kepler.modules/workflow-scheduler-gui/src:/home/barseghian/dev2/kepler.modules/outreach/src:/home/barseghian/dev2/kepler.modules/r/src:/home/barseghian/dev2/kepler.modules/loader/src:/home/barseghian/dev2/kepler.modules/actors/src:/home/barseghian/dev2/kepler.modules/opendap/src:/home/barseghian/dev2/kepler.modules/dataturbine/src:/home/barseghian/dev2/kepler.modules/ecogrid/src:/home/barseghian/dev2/kepler.modules/authentication-gui/src:/home/barseghian/dev2/kepler.modules/gui/src:/home/barseghian/dev2/kepler.modules/module-manager-gui/src:/home/barseghian/dev2/kepler.modules/authentication/src:/home/barseghian/dev2/kepler.modules/repository/src:/home/barseghian/dev2/kepler.modules/job/src:/home/barseghian/dev2/kepler.modules/io/src:/home/barseghian/dev2/kepler.modules/ssh/src:/home/barseghian/dev2/kepler.modules/data-handling/src:/home/barseghian/dev2/kepler.modules/sms/src:/home/barseghian/dev2/kepler.modules/component-library/src:/home/barseghian/dev2/kepler.modules/util/src:/home/barseghian/dev2/kepler.modules/event-state/src:/home/barseghian/dev2/kepler.modules/core/src:/home/barseghian/dev2/kepler.modules/common/src:/home/barseghian/dev2/kepler.modules/module-manager/src:/home/barseghian/dev2/kepler.modules/configuration-manager/src:/home/barseghian/dev2/kepler.modules/ptolemy/src:/home/barseghian/dev2/kepler.modules/build-area/src -classpath ptolemy/lib/guava.jar:/home/barseghian/dev2/kepler.modules/util/lib/jar/commons-logging-1.1.jar:/home/barseghian/dev2/kepler.modules/build-area/lib/ant.jar -tagletpath /home/barseghian/dev2/kepler.modules/build-area/target/kepler-tasks.jar -exclude -subpackages org:com:util:ptolemy -link -linksource -author -breakiterator -use -quiet -tag Pt.AcceptedRating -tag Pt.ProposedRating -tag -tag UserLevelDocumentation -tag created -tag entity.description -tag status -taglet -J-Xmx768m" returned 1

On Windows XP w/ java 1.7, after 146 minutes I finish with 556676 errors, and the IOException error. Something's clearly very wrong here -- most of these errors seem to be to do w/ illegal characters. I disabled my system bell just to get through this, most/all of these errors cause a beep.

Actions #4

Updated by Christopher Brooks over 12 years ago

I took a look at the javadoc problem under Linux and there were a number of problems.

- The -taglet parameter named, but that class does not exist. I set -taglet to doc.doclets.RatingTaglet. I'm not about this.

- I was seeing errors like
java.lang.ClassCastException: cannot be cast to com.sun.javadoc.AnnotationTypeDoc

The net said that this would occur if a class had annotations but the jar file
that contained the annotations was not included in the classpath to javadoc.
So, I added ptolemy/src/lib/junit-4.8.2.jar and ptolemy/src/lib/JUnitParams-0.3.0.jar to CreateJavadoc. I don't understand why I need to add these jar
files individually. When javadoc is run, the classpath should include
all the jar files for all the modules.

I'm still getting 2 errors and a message about the subprocess returning 1
under Linux.

Under Windows, I was getting lots of warnings and beeps as well. I believe the
problem is that the jar files are getting processed as source? Probably the
fix is to exclude the .jar files somehow.

I've found that javadoc does not work very well with large argument strings.
Ant has a way to use files instead of large argument strings.
I recently updated the javadoc command in ptII/build.xml. That file is created
by running (cd $PTII;./configure).

Actions #5

Updated by dhogan dhogan over 12 years ago

This is a bit of a hack since it requires you to compile doc.doclets.RatingTaglet first. It does generate all of the javadoc though.

There were two main problems with the javadoc:

  • Missing jars which caused packages warnings
    - Fixed by using the compile classpath for every module involved
  • Taglet class not found and the wrong name
    - Build doc.doclets.RatingTaglet in ptolemy now
    - Point to Ptolemy's classes directory rather than kepler-tasks.jar

This patch isn't ideal because it's pointing to ptolemy classes that have to be built first. It's down to 0 errors and 397 warnings (all related to invalid javadoc tag usage or Oracle proprietary APIs).

I generated the javadocs by running "ant force-ptolemy compile ; ant javadoc".

Actions #6

Updated by Christopher Brooks over 12 years ago

I folded in d. hogan's path (Thanks!)
One change that I made was that we now look for tools.jar by getting the java.home JDK property.

Unfortunately, I still can't run 'ant javadoc' under Windows, I get messages like:
Loading source files for package

C:\Users\Administrator\src\kepler\r\target\classes\org\ecoinformatics\seek\R\RExpression2.class:62: error: unmappable character for encoding Cp1252

The above message can be reproduced by creating a file called "doit" that contains:

CLASSPATH="C:/Users/Administrator/src/kepler/r/target/classes" javadoc sourcepath "C:/Users/Administrators/src/kepler/r/src/" -subpackages org

and then starting up Cygwin and running
sh doit

This is with Windows Java 1.7.0:
$ java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)

If I use the javadoc from Java 1.6.0_26, the problem goes away.

I submitted a bug to Oracle, we will see if anything comes of it.

Actions #7

Updated by Redmine Admin about 11 years ago

Original Bugzilla ID was 5557


Also available in: Atom PDF