GenerateMembersUtil#copyAnnotations: exclude annotations already copied to type (IDEA-236474)

Also: check that annotations resolve to the same type in target place.

GitOrigin-RevId: 0093c5966f37281b4f852e78a8cd5cd6667527f4
This commit is contained in:
Tagir Valeev
2020-04-07 10:04:02 +00:00
committed by intellij-monorepo-bot
parent 713cd98e68
commit 4db59b2205
6 changed files with 82 additions and 1 deletions
@@ -0,0 +1,20 @@
import java.lang.annotation.*;
import java.util.Map;
@Target({ElementType.METHOD, ElementType.TYPE_USE})
@interface Foo {}
interface X {
@Foo Map.@Foo Entry getString();
}
static class Y implements X {
X x;
@Override
@Foo
public Map.@Foo Entry getString() {
return x.getString();
}
}
@@ -0,0 +1,12 @@
import pkg.Foo;
import java.io.Writer;
class Impl extends Abstract {
Abstract orig;
@Override
public @Foo Writer getWriter() {
return orig.getWriter();
}
}
@@ -0,0 +1,16 @@
import java.lang.annotation.*;
import java.util.Map;
@Target({ElementType.METHOD, ElementType.TYPE_USE})
@interface Foo {}
interface X {
@Foo Map.@Foo Entry getString();
}
static class Y implements X {
X x;
<caret>
}
@@ -0,0 +1,6 @@
class Impl extends Abstract {
Abstract orig;
<caret>
}