United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6759775 RegularFileObject.inferBinaryName gives bad result on empty path
JDK-6759775 : RegularFileObject.inferBinaryName gives bad result on empty path

Details
Type:
Bug
Submit Date:
2008-10-15
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:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
Independent of whether or not empty path elements should be allowed on a path, if an empty path element is found, then RegularFileObject.inferBinaryName will give an incorrect result for a file found from a directory (e.g. a classes/ directory) found elsewhere on the path.

                                    

Comments
EVALUATION

If a class is found in a classes/directory, then JavaFileObject.inferBinaryName will be provided by RegularFileObject.inferBinaryName.  There is no reliable way to determine the binary name, and so the method works imperfectly by looking for the first directory on the path whose path is a prefix of the path for the class in question.   An empty path provides a trivial and incorrect match.

The solution is to treat empty path elements, if they occur, as user.dir.

A separate issue to be resolved is whether empty path elements should be allowed at all.
                                     
2008-10-15
EVALUATION

noreg-other since the fix is covered by running testgetallmemberes in particular modes, and because we will probably consider disallowing empty elements in paths, which would invalidate any explicit test for this bug fix.
                                     
2008-10-16



Hardware and Software, Engineered to Work Together