Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated file has errors when there are two classes with same name in different packages #194

Open
EnilPajic opened this issue Jun 21, 2018 · 5 comments

Comments

@EnilPajic
Copy link

Hi!

My EB service looks like this:

@Fluent
MyService getTickets1(JsonObject whatever, Handler<AsyncResult<List<Ticket>>> e);

@Fluent
MyService getTickets2(JsonObject whatever, Handler<AsyncResult<List<package2.Ticket>>> e);

notice that handlers accept lists of Tickets from two different packages (package1 which is imported (import package1.Ticket;) and package2).

When I try to build my project, generated file (MyServiceVertxEBProxy) have two ambiguous imports:

import package1.Ticket;
import package2.Ticket;

And of course Java cannot distinguish which Ticket to use and throws compile time error on the second import "a type with the same simple name is already defined by the single-type-import of package1.Ticket"

Of course, this is simplified example. I'm using vertx-codegen version 3.5.0.

@EnilPajic
Copy link
Author

Hello, anything on this? (Ping comment)

@vietj
Copy link
Member

vietj commented Aug 15, 2018

nobody has been looking at this issue, actually nobody has examined yet how this should be handled best

@EnilPajic
Copy link
Author

Aha, thank you. I'm sorry to hear that, this is a such useful library.
I assume the simplest solution would be to use full qualified names (e.g. with package) on every place, but I'm not fully competent.

Feel free to close the issue then.

@vietj
Copy link
Member

vietj commented Aug 16, 2018

yes that's a solution, but it means that the generators shall be rewritten and it's not the codegen lib that is faulty.

@vietj
Copy link
Member

vietj commented Aug 16, 2018

in your case the service-proxy generator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants