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

Bug 558405

Summary: Naming a class with a non-ASCII character causes a compilation error
Product: [Eclipse Project] JDT Reporter: Mario Fusco <mario.fusco>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: stephan.herrmann
Version: 4.15   
Target Milestone: 4.15 M1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Mario Fusco CLA 2019-12-17 14:04:52 EST
Naming a class with a non-ASCII character like à as the following

package com.myspace.test; 
public class à { }

and putting it a file named à.java produces the following compilation error:

com/myspace/test/à.java (1:39) : The type à collides with a package
Comment 1 Mario Fusco CLA 2019-12-18 05:16:06 EST
I'm closing this issue because probably not valid. Just to recap my situation I'm a maintainer of Drools, the Red Hat rule engine, and we use ecj internally. I'm migrating our dependency from the old org.eclipse.jdt.core.compiler to the new org.eclipse.jdt group id and while doing so this test started failing: https://github.com/kiegroup/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/commons/jci/compilers/JavaCompilerI18NTest.java

Before at line 32 it did:

String fileStr = "com/myspace/test/" + URLEncoder.encode("あ", "UTF-8") + ".java";

Apparently this was necessary with old ecj, but now replacing that line with just 

String fileStr = "com/myspace/test/あ.java";

fixed the problem.
Comment 2 Stephan Herrmann CLA 2019-12-18 16:44:20 EST
(In reply to Mario Fusco from comment #1)

Thanks for the update and explanation.