This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for Preview: jcf-io.c and Win32 case-insensitive filename handling


Hi Tom,

Thanks for your feedback.

>My recollection, from my brief and long since past Windows experience,
>is that it isn't always easy to control the case of the files you
>create on a Windows box.  That is, sometimes a tool will not do
>exactly what you might like.

On the contrary. Without getting into a religious war, I am a case
fanatic and on Windows, am satisfied with the degree to which the OS
accomodates me. Granted, it's case insensitive, but it is case
preserving and that's the most important for me.

>If that's the case...

(no pun intended, I hope :) )

>(and the more Windows knowledgeable should
>definitely speak to this) then it seems this approach will make things
>harder for gcj users.  So that's one (potential) reason to be careful
>before committing to this.

I disagree. See the explanation in the next section.

>Another question which we have to ask is what the JDK does. Can you
>find out?  I mean in a clean-room way.  For instance, does the JDK
>require strict case conformance on Windows?

It does, and this is trivial to demonstrate. I've been bitten by this
many times during my Win32 Java development, which is why I feel
comfortable with my approach.

To verify this on Windows, save the following file:

--------------------------------- 8< -------------------------------
public class ExactCase
{
public static void main(String[] args)
{
    System.out.println("You're getting on my case.");
}
}
--------------------------------- 8< -------------------------------

to "exactcase.java" (as opposed to ExactCase.java). javac will
scream:

--------------------------------- 8< -------------------------------
exactcase.java:1: class ExactCase is public, should be declared in a file named
ExactCase.java
public class ExactCase
       ^
1 error
--------------------------------- 8< -------------------------------

>Could you explain the mechanism of the bug a bit more?  I don't
>understand it, and I'd like to.  gcj must make one or more incorrect
>decisions that lead it astray.  Where are these points?  (I've seen a
>lot of information about the symptoms of the bug, which is helpful,
>but I want to know the cause.)

The "bug" is that gcj was victimized by case sensitivity not being
enforced when trying to compensate for the fact that the Java
Language is not context-free. See:

http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#106941

>There are a lot of changes that would need to be made to this code
>(for GNU standards conformance) before it can go in.  That can come
>later.

The crucial question here is whether you all believe this belongs
in the compiler or somewhere else, as Ranjit intimated in a post
to java-patches. I stand firmly behind my reasoning for putting this
in the compiler, for reasons I mentioned in java-patches. I also
believe I've put a mechanism in place which would allow others
(Cygwin and Darwin) to benefit. Like you said, once this decision
has been made, I'll gladly clean up the code and would welcome the
opportunity to do things GNU way. (You're dealing with a die-hard
MFC programmer who loves Microsoft's Hungarian notation, so you
won't believe how much I've have to morph my code already! Okay,
so now I'm unmasked. Flames to /dev/null.)

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]