United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6948251 need to quote args in langtools launcher script
6948251 : need to quote args in langtools launcher script

Details
Type:
Bug
Submit Date:
2010-04-29
Status:
Closed
Updated Date:
2011-05-18
Project Name:
JDK
Resolved Date:
2011-05-18
Component:
tools
OS:
generic
Sub-Component:
javac
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
7

Related Reports
Backport:

Sub Tasks

Description
This isn't so important, since you don't use this configuration for production, but I thought I'd let you know anyway...

When I run the langtools/dist/bin/javadoc file with this javadoc option:

javadoc -header "Sample Source" Class1.java

it generates a Class1.html file with just "Sample" in the header.  The quotes are stripped before javadoc is run, so it evaluates as if -header has only the argument "Sample".

Looking closer, this line:
eval "/home/doog/javadoc/jdk1.7.0/bin/java" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} -jar "${mydir}"/../lib/javadoc.jar ${toolOpts}

gets expanded to this:
+ eval /home/doog/javadoc/jdk1.7.0/bin/java $'-Xbootclasspath/p:../dist/lib/javadoc.jar:../dist/lib/javac.jar:../dist/lib/doclets.jar:\r' -ea:com.sun.tools... '
-Xmx40M' -jar ../dist/bin/../lib/javadoc.jar -d ../builddocs -source 1.7 -notimestamp -quiet -use -header Sample Source -linksource -linkoffline http://java.sun.com/j2se/1.6/docs/api ../../../../samplesrc/sample-src/doc-files -overview ../../../../samplesrc/sample-src/overview.html -sourcepath ../../../../samplesrc/sample-src ../../../../samplesrc/sample-src/com/package1/Class1.java ../../../../samplesrc/sample-src/com/package1/SubClass.java

I didn't see an obvious fix, so I just changed the text to "Sample_Source". 

Also, if I add some HTML to the header:

javadoc -header "<b>Sample</b>" Class1.java

I get this error:
../dist/bin/javadoc: line 69: b: No such file or directory

It thinks that <b> is a filename.

Also, the following has the error "nbsp: command not found":

javadoc -header "Sample&nbsp;Source" Class1.java

                                    

Comments
EVALUATION

Problem is how to prevent white-space splitting in ${toolOpts} in the final eval line.
                                     
2010-04-29
EVALUATION

1. Need to re-enable IFS=$nl for final command execution
2. Need to remove eval from final command execution
                                     
2010-04-29



Hardware and Software, Engineered to Work Together