-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
As, stated in release notes, I expected the parameter annotation for equal method to be copied to implementation. As, perilously discussed in 579,
I tried following approaches, one discussed in previous issue and other by defining the annotation in class.
Trying org.checkerframework.checker.nullness.qual.Nullable
@AutoValue
public abstract class Play {
abstract public String game();
abstract public long gameId();
public static Play createPlayWith(String game, long gameId){
return new AutoValue_Play(game, gameId);
}
@Override abstract public boolean equals(@Nullable Object o);
}Trying with defined @interface Nullable {}
@AutoValue
@AutoValue.CopyAnnotations
public abstract class Foo {
abstract public String bar();
public static Foo createFooWith(String bar){
return new AutoValue_Foo(bar);
}
@Target(ElementType.TYPE_USE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Nullable {}
@Override abstract public boolean equals(@Nullable Object x);
}Both of these abstract classes, with parameter annotation had no affect on implementation of equal(Object o):
@Override
public boolean equals(Object o) {
...
}Metadata
Metadata
Assignees
Labels
No labels