Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 469317

Summary: Eclipse Mars compiler chokes on (case sensitive) package and class names
Product: [Eclipse Project] JDT Reporter: Henning Schmiedehausen <henning>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact: Manoj N Palat <manoj.palat>
Severity: normal    
Priority: P3 CC: henning, jarthana, manoj.palat, stephan.herrmann
Version: 4.5   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: stalebug
Attachments:
Description Flags
step-by-step instructions for testing none

Description Henning Schmiedehausen CLA 2015-06-03 13:57:31 EDT
Until Eclipse Luna 4.4.2 (JDT 3.10.2.v20150120-1634) it was perfectly legal to have e.g. a class com.foo.Stuff and a package with classes of the same name and different casing, e.g. com.foo.stuff.MoreStuff

The current Eclipse Mars (4.5rc3, 3.11.0.v20150526-1109) regresses on this and fails building.

How to reproduce:

check out git@github.com:hgschmie/eclipse-compiler-test.git

build with JDK 1.8 and a recent maven:   mvn clean install

Now install the current Eclipse Mars compiler locally so that Maven can use it:

* Download https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/S-4.5RC3-201505280700/org.eclipse.jdt-4.5RC3.zip
* Unzip and install the jar locally: 

  mvn -DgroupId=org.eclipse.tycho -DartifactId=org.eclipse.jdt.core -Dversion=3.11.0.v20150526-1109 -Dpackaging=jar -Dfile=plugins/org.eclipse.jdt.core_3.11.0.v20150526-1109.jar install:install-file

* Build with the mars compiler:  mvn -Peclipse-mars clean install

INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /private/tmp/eclipse-compiler-test/src/main/java/ect/broken/test7/Dummy.java:[1] The package ect.broken.test7 collides with a type
[INFO] 1 error
[INFO] -------------------------------------------------------------

This is a regression from the behavior with previous compiler versions (which did not flag this as an error).
Comment 1 Henning Schmiedehausen CLA 2015-06-03 14:13:45 EDT
Contrary to my previous comment, I was able to reproduce this with the Luna compiler, too. So it seems to have been present before.

It is still a deviation from the behavior of the Oracle compiler.
Comment 2 Henning Schmiedehausen CLA 2015-06-03 19:47:44 EDT
Another update here. I only see this behavior on MacOS. On Linux, the Luna and Mars compiler do not show this error.

Is there a switch to change case sensitivity of the eclipse compiler from the command line?
Comment 3 Jay Arthanareeswaran CLA 2015-06-04 01:28:50 EDT
Henning, can you provide us a standalone example that we can use to reproduce the bug? I seem to run into issue while cloning the given repo.
Comment 4 Henning Schmiedehausen CLA 2015-06-04 13:51:05 EDT
Created attachment 254120 [details]
step-by-step instructions for testing
Comment 5 Henning Schmiedehausen CLA 2015-06-04 13:52:20 EDT
I am afraid that this is as much standalone as I can come up with. I attached a log with Step-by-step instructions to reproduce the problem with maven on the command line.

You need to test this on a Mac. The same test works fine on Linux; it seems to be an issue with the compiler on MacOS (which may be related to the case-insensitive filesystem).
Comment 6 Stephan Herrmann CLA 2015-06-05 13:48:27 EDT
(In reply to Henning Schmiedehausen from comment #5)
> You need to test this on a Mac. The same test works fine on Linux; it seems
> to be an issue with the compiler on MacOS (which may be related to the
> case-insensitive filesystem).

And even on Mac not everybody will be affected, since AFAICS you can choose to use a case(in)sensitive filesystem (disclaimer: I don't have a Mac).
Comment 7 Eclipse Genie CLA 2020-04-11 14:48:33 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.