Community
Participate
Working Groups
I defined aspect named MyAspect in package debug If I import a java class named a.b.c.MyAspect, then the compiler tells me that "The import a.b.cMyAspect conflicts with a type defined in the same file"
this definitely needs investigating for the 1.5.1 point release.
this is working as designed. See the JVM language spec 7.5.1: "If another top level type with the same simple name is otherwise declared in the current compilation unit except by a 'type-import-on-demand' declaration then a compile-time error occurs. So the sample program: import java.util.Vector; class Vector { Object[] vec; } causes a compile time error." so I have recreated this error using some aspects, then I recreated it using some standard classes and ajc then I recreated it with javac too: === package debug; import a.b.c.MyAspect; public class MyAspect { } === package a.b.c; public class MyAspect { } === C:\>ajc debug\MyAspect.java a\b\c\MyAspect.java debug\MyAspect.java:3 [error] The import a.b.c.MyAspect conflicts with a type defined in the same file import a.b.c.MyAspect; ^^^^^^^^^^^^^ 1 error C:\>javac debug\MyAspect.java a\b\c\MyAspect.java debug\MyAspect.java:3: debug.MyAspect is already defined in this compilation unit import a.b.c.MyAspect; ^ 1 error
nothing to fix.