JDK-4196252 : switch for case-insensitive handling of java source files
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1998-12-09
  • Updated: 2001-03-29
  • Resolved: 2001-03-29
Related Reports
Duplicate :  
Description

Name: wm38563			Date: 12/09/98


I am developing a small Java image-processing
application. I would prefer to keep the source
files on our Sun NFS server. However it seems that
when my Windows NT machine copies files to
the NFS server, it converts the filenames to 
lower case (eg. ImageViewer.java becomes 
imageviewer.java). The javac compiler then 
refuses to compile the application.

It would be very useful to have a switch i can 
give javac to allow it to 'turn a blind eye' to 
the incorrect filenames and make it handle
filenames (although obviously not class names)
case insensitively.

Thanks.
(Review ID: 47556)
======================================================================

Comments
PUBLIC COMMENTS .
10-06-2004

EVALUATION Java identifers are case-sensitive, thus we cannot simply ignore case when searching for the files corresponding to Java classes. If the underlying filesystem is incapable of preserving case, then some kind of escape convention must be adopted in order to allow the case information to be represented and reconstructed. The JLS recommends a particular escape convention in section 7.2.1. Unfortunately, there is no general (i.e., platform-independent) way to determine on the Java platform exactly which characters are legal in a filename, leaving a draconian least common denominator approach as the only choice that works in all cases without user intervention. At present, the compiler simply assumes that any character allowable in a Java identifier on a given platform can also be used in a filename in the same environment. This quickly breaks down when Unicode escapes are used in the Java source file, but holds up well in practice otherwise, case issues on Windows being a notable exception. Note that using NTFS on Windows NT, you should be able to preserve case when moving files to and from the Unix environment using either Samba or NFS. We do our Win32 development on NT in such a mixed environment here at Sun. See bug 1266364 for discussion of this issue with respect to international character sets. william.maddox@eng 2000-01-20
20-01-2000