Community
Participate
Working Groups
The compare method between class name has a problem with case sensitive. 1) Create a class Titi.java : package com.try; public class Titi { public Titi() { } } 1) Create a second class Toto.java, in the same package, and an inner class with the same name than the first class, but not the same case : package com.try; public class Toto { public Toto() { } } class titi { titi () { } } 3) try to compile under Eclipse. Eclipse mark an error on the top of Toto.java : "A class file was not written. The project may be inconsistent, if so try refreshing this project and rebuilding it." This message is very strange, isn't it ? 4) Try to compile with Sun's javac (v1.3.1) : all is OK. If the inner class is changed with exactly the same name, Eclipse and javac have the same error (class already defined). The problem is only when two class have the same name, but with not the same case.
This problem got resolved into 3.0 development stream. *** This bug has been marked as a duplicate of 39281 ***
Sorry, but I don't think it's the same bug than #39281 Because : - 39281 deals about refactoring (which is not the case here) - 39281 can be corrected just by recompile the project (not for this bug : source code must be changed) - the solution speak in 39281 (test the class output with test case sensitive) wil not resolve this bug, because Titi class and titi class must be together present at the same time. So, I don't think it's a duplicated bug.
Refactoring was not the problem in 39281, it was simply causing a source change which triggered the Java incremental compiler. But you're right it is the same flavor, but a slightly different problem. Reopening. Kent - can you please investigate ? As a teaser, I checked our batch compiler behavior, and it works fine as well (as Javac). So this must be something either in the builder or in the Eclipse resource management story.
I have test only with javac 1.3, so, perhaps it's normal to say it's an error with v1.4 of the java spec. (but, I think than Java must always be case sensitive, even if it's so bad to write 2 classes with same name, but with different case). But : - with 1.3 compatibility, eclipse seems to not have the same behavior than javac (who is wrong ? perhaps javac and not eclipse, I don't know) - the error message is really not clear. Thank Philippe for re-opening this bug (and hope to see you again ...).
This example should produce three .class files. When I tried it with javac 1.3, it only produced 2 because Titi.class was overwritten by titi.class. I have improved our error message but Eclipse was correct in detecting this collision.
Verified.