United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4370719 : Better diagnosis of bad class file name/package name.

Details
Type:
Bug
Submit Date:
2000-09-13
Status:
Closed
Updated Date:
2002-06-27
Project Name:
JDK
Resolved Date:
2002-03-08
Component:
tools
OS:
solaris_2.6,generic
Sub-Component:
javadoc(tool)
CPU:
sparc,generic
Priority:
P5
Resolution:
Fixed
Affected Versions:
1.2.0,1.4.0
Fixed Versions:
1.4.1 (hopper)

Related Reports
Duplicate:

Sub Tasks

Description
When you write a shell script in Solaris to run javadoc 
(let's name it "run-javadoc"), such as the following:

/usr/local/java/jdk1.3/solaris/bin/javadoc -d docs \ 
java.applet 

and if you mistakenly put a space after a continuation character (\),
such as at the end of the second line, you get this misleading
error message:

% run-javadoc
javadoc: No package, class, or source file found named  .
1 error
run-minimal: java.applet: not found

The error message always says that the statement following the extra space
is not found.  It took me about 20 minutes to figure out the extra space 
was causing this problem.  What we need is a message that is not misleading,
and can better pinpoint the problem.

                                    

Comments
EVALUATION

I'm not sure this is even possible, but if so, it would be quite helpful.
(Submitted by me)
doug.kramer@Eng 2000-12-08

Well, we could certainly put quotes areound the file name in the error message. Cheap and easy.

neal.gafter@Eng 2000-12-13

Doug Kramer wrote:
> I'm not clear on your proposal to put quotes around the file name.
> How would that help?
> The problem is that the error message does not mention that
> there is an extra space following the continuation character.
> (I'm not sure if javadoc can be aware of this extra space.)

javadoc doesn't know there was a continuation character. That's a
function of your shell.

That is a perfectly valid syntax for specifying a file whose name is a
space. If our error message produced quotes around the filename, you
would see that we're trying to process a file named " ".

Changed the synopsis from
	javadoc: Better error msg when space follows continuation char in shell script
to
	javadoc: Error message when failing to open file should quote filename

neal.gafter@Eng 2000-12-14
                                     
2000-12-14
SUGGESTED FIX

Reject any file name that is not (1) a valid Java source file name, or (2) a valid Java package name.

At the very least, quote the file name when reporting being unable to open it.

neal.gafter@Eng 2000-12-20
                                     
2000-12-20
PUBLIC COMMENTS

...
                                     
2004-06-10
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
hopper

FIXED IN:
hopper

INTEGRATED IN:
hopper

VERIFIED IN:
hopper-beta


                                     
2004-06-14



Hardware and Software, Engineered to Work Together