Idea: Facilitate having two classes with same name and different packages

30 views
Skip to first unread message

lyassa

unread,
May 13, 2024, 8:17:55 PMMay 13
to Project Lombok
As you know you cannot import two classes having the same name from two differnt packages. We can import one class, but need to fully qualify the other all the time. 

Is it possible to have an annotation as follows:

@alias class1
import pkg1.someClass;

@alias class2
import pkg2.someClass;
...
...
@class1 myObject1 = new @class1(arg1, arg2, ...);
@class2 myObject2 = new @class2(arg1, arg2, ...);

List<@class1> list = new ArrayList<>();
...
Thank you,
Louis.
Reply all
Reply to author
Forward
0 new messages