eclipse-vertx / eclipse-vertx/vertx-codegen

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

Open
#194 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
111
Forks
89
PR merge metrics
No merged PRs in 30d

Description

Hi!

My EB service looks like this:
```java
@Fluent
MyService getTickets1(JsonObject whatever, Handler>> e);

@Fluent
MyService getTickets2(JsonObject whatever, Handler>> e);
```
notice that handlers accept lists of `Ticket`s 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:
```java
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`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.