don't duplicate type use annotations during copy of modifier lists (inspired by IDEA-166062)

This commit is contained in:
Anna.Kozlova
2017-02-16 17:15:56 +01:00
parent 57c4f399d2
commit 71b7d9cbf3
11 changed files with 127 additions and 17 deletions
@@ -0,0 +1,19 @@
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Documented
@Retention(RetentionPolicy.CLASS)
@Target({ElementType.PARAMETER, ElementType.TYPE_USE})
@interface Anno {
String value() default "";
}
class Test {
void foo(@Anno String s) {
<selection>if (s == null) {}</selection>
}
}
@@ -0,0 +1,23 @@
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Documented
@Retention(RetentionPolicy.CLASS)
@Target({ElementType.PARAMETER, ElementType.TYPE_USE})
@interface Anno {
String value() default "";
}
class Test {
void foo(@Anno String s) {
newMethod(s);
}
private void newMethod(@Anno String s) {
if (s == null) {}
}
}