Bug 42443 - Error when inner class name has the same name than another class, but with not the same case sensitive
Summary: Error when inner class name has the same name than another class, but with no...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-03 09:16 EDT by Etienne Juliot CLA
Modified: 2003-10-08 07:31 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Etienne Juliot CLA 2003-09-03 09:16:08 EDT
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.
Comment 1 Philipe Mulet CLA 2003-09-03 09:51:33 EDT
This problem got resolved into 3.0 development stream. 

*** This bug has been marked as a duplicate of 39281 ***
Comment 2 Etienne Juliot CLA 2003-09-03 11:42:06 EDT
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.
Comment 3 Philipe Mulet CLA 2003-09-04 04:12:47 EDT
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.
Comment 4 Etienne Juliot CLA 2003-09-04 10:44:16 EDT
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 ...).
Comment 5 Kent Johnson CLA 2003-09-04 11:30:17 EDT
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.
Comment 6 David Audel CLA 2003-10-08 07:31:25 EDT
Verified.