JDK-6440528 : javac deposits package-info.class in bogus directory
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-06-19
  • Updated: 2010-04-06
  • Resolved: 2006-07-01
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.
JDK 6
6 b91Fixed
Related Reports
Relates :  
Relates :  
Description
To reproduce:

* Compile package-info.java. javac creates extattrib2\package-info.class:

    $ java -version
    java version "1.6.0-rc"
    Java(TM) SE Runtime Environment (build 1.6.0-rc-b88)
    Java HotSpot(TM) Client VM (build 1.6.0-rc-b88, mixed mode)

    $ javac -version
    javac 1.6.0-rc

    $ dir
     Volume in drive C has no label.
     Volume Serial Number is B8DF-A984

     Directory of C:\JAXB2.0\jaxb-sqe\sandbox\Mustang\NewCR

    06/19/2006  03:05 PM    <DIR>          .
    06/19/2006  03:05 PM    <DIR>          ..
    06/19/2006  01:35 PM               469 package-info.java
                   1 File(s)            469 bytes
                   2 Dir(s)  15,382,396,928 bytes free

    $ javac package-info.java

    $ dir /S
     Volume in drive C has no label.
     Volume Serial Number is B8DF-A984

     Directory of C:\JAXB2.0\jaxb-sqe\sandbox\Mustang\NewCR

    06/19/2006  03:06 PM    <DIR>          .
    06/19/2006  03:06 PM    <DIR>          ..
    06/19/2006  03:06 PM    <DIR>          extattrib2
    06/19/2006  01:35 PM               469 package-info.java
                   1 File(s)            469 bytes

     Directory of C:\JAXB2.0\jaxb-sqe\sandbox\Mustang\NewCR\extattrib2

    06/19/2006  03:06 PM    <DIR>          .
    06/19/2006  03:06 PM    <DIR>          ..
    06/19/2006  03:06 PM               255 package-info.class
                   1 File(s)            255 bytes

         Total Files Listed:
                   2 File(s)            724 bytes
                   5 Dir(s)  15,382,396,928 bytes free

    $
My apologies. Please see attachment.

Comments
SUGGESTED FIX Index: j2se/src/share/classes/com/sun/tools/javac/util/DefaultFileManager.java --- /tmp/geta3485 2006-06-20 12:44:07.000000000 -0700 +++ DefaultFileManager.java 2006-06-20 12:43:43.000000000 -0700 @@ -909,7 +909,7 @@ throw new IllegalArgumentException("relativeName is invalid"); String name = packageName.length() == 0 ? relativeName - : externalizeFileName(packageName) + "/" + relativeName; + : new File(externalizeFileName(packageName), relativeName).getPath(); return getFileForOutput(location, name, sibling); }
20-06-2006

EVALUATION This was most likely caused by 6411073 and that getFileForInput use "/", not File.separatorChar.
20-06-2006