JodaOrg / joda-convert

Java library to enable conversion to and from standard string formats.

Home Page:http://www.joda.org/joda-convert/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails with 'Two methods are annotated' when the `@ToString` method is a specific implementation of a generic interface

hackmann opened this issue · comments

Generic interface

public interface HasCode<C> {
    C getCode();
}

And a String implementation

public final class AirportCode implements HasCode<String> {
    private final String code;

    @Override
    @ToString
    public String getCode() {
        return code;
    }

It fails with 'Two methods are annotated with @tostring: net.worldticket.commons.flight.AirportCode.'

It finds the getCode() method twice one with a String return type and the other with an Object as return type.

Looks like the compiler changed although I can't reproduce it.