JDK-8006973 : jtreg test fails: test/tools/javac/warnings/AuxiliaryClass/SelfClassWithAux.java
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P5
  • Status: Closed
  • Resolution: Fixed
  • OS: windows
  • CPU: generic
  • Submitted: 2013-01-26
  • Updated: 2014-09-29
  • Resolved: 2013-06-25
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 8
8 b98Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
This is windows only.  That file contains a 2ndary class named 'Aux'. That is not allowed on Windows.  The class should be renamed to Sux or something.

The testname is 
   tools/javac/warnings/AuxiliaryClass/SelfClassWithAux.java

and the failure mode is
D:\\tools\\tl8\\langtools\\test\\tools\\javac\\warnings\\AuxiliaryClass\\SelfClassWithAux.java:42: error: error while writing Aux: D:\\tools\\tl8\\langtools\\AA_regtest.windows-i586\\JTwork\\classes\\tools\\javac\\warnings\\AuxiliaryClass\\Aux.class (Access is denied)
class Aux {
^
1 error
result: Failed. Compilation failed: Compilation failed


test result: Failed. Compilation failed: Compilation failed
Comments
Here are the Windows NO-NO files: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx Relevant part: Do not use the following reserved names for the name of a file: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed immediately by an extension; for example, NUL.txt is not recommended. For more information, see Namespaces.
07-06-2013

Two parts, possibly two separate issues 1. Fix the test to not use Aux 2. Fix javac to detect and give friendly messages for bad names on Windows. There's already an issue for this, see Links
06-06-2013

The problem here is "what are we going to do with these files". We can't compile them, we can't compile the rest of the classes that depends on them. And even if this class is compiled (on other system, for example) - we can't compile the rest of the classes that rely on this class unless it's already in the jar file. So, imagine we have the request to compile such java source - right now we are failing with "File not found" error. All i can mind right now is to fail with some other more clever error message - not to fail is not an option, unfortunately.
06-06-2013

The fix is relatively simple,according to Alan. In JavacFileManager, after we open a java.io.File object, do an isFile() on it. As to whether it is worth it -- just because everyone else does a shoddy job is not a reason for us to do the same. Jon's "I Am Not A Sheep" Rule #3. Also, Picard management tip: ���That's the way it's always been��� is never an adequate reason to continue doing something. May 9, 2013 https://twitter.com/PicardTips/status/332532455137501185 But it is low priority.
06-06-2013

Do we really need to do anything here? What we do does not differ from all the rest of the tools on Windows do - you can not add file Aux.java (or Aux.txt) to the zip file, you can not copy it using DOS 'copy' command, the type command will not find it even if it is present on the disk. And we will have to add a lot of special-casing here - all the tools have to be changed, java, javac, jar, javadoc - you name it - they all aren't ready to handle special names on Windows. Does it really worth it?
06-06-2013

The fix for the test is to rename the class. Separately, we should sometime do something inside javac to check if the user is using any of the reserved names in windows. CON, COMn, AUX, LPT etc
26-04-2013

Downgrading to p5. javac can't compile a file named Aux.java in jdk 6,7, 8, eg: ~:36 cat Aux.java public class Aux { public static void main(String[] args) { System.out.println("hi"); } } c:/jdk6u32/bin/javac Aux.java javac: file not found: Aux.java Usage: javac <options> <source files> use -help for a list of possible options ~:38 c:/jdk6u32/bin/javac aux.java javac: file not found: aux.java Usage: javac <options> <source files> use -help for a list of possible options
29-01-2013

After a reboot, the test passes on my windows machine. However, something odd is going on - the Aux.class file is not present in the output directory. If I change the source code to Aux1 instead of Aux, then an Aux1.class file _is_ generated. It is as if before my reboot, javac got the Access denied error and reported it whereas after the reboot, javac got the Access denied error and just swallowed it.
26-01-2013

Good question. It passes in the nightlys on windows. I'll reboot and see if the test passed for me after that.
26-01-2013

This test is unmodified since it was created in a changeset Nov 1, 2012. Do we have any idea why the failure is only showing up now?
26-01-2013