[analysis] IDEA-241656 Provide a fix for "static member qualifying type may not be annotated"

This patch adds a quickfix for errors of the "static member qualifying type may not be annotated" type

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>

GitOrigin-RevId: 9046c0c45d6a9d04058aae458f04b3f9fc0a5ad1
This commit is contained in:
Nikita Eshkeev
2020-06-08 09:05:53 +00:00
committed by intellij-monorepo-bot
parent 1ad538f097
commit 397638666d
53 changed files with 851 additions and 14 deletions
@@ -0,0 +1,12 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Main {
public static class Data { }
static final /*1 */ /*2*/ /*5 *//*6 */ transient Main.@/* 3 */ /* 4*/ Meta Data var = null;
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Main {
public static class Data { }
static {
final /*1 */ /*2*/ /*5 *//*6 */ synchronized transient Main.@/* 3 */ /* 4*/ Meta Data var = null;
}
}
@@ -0,0 +1,12 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Main {
public static class Data { }
void func(final /*1 */ /*2*/ /*5 *//*6 */ synchronized transient Main.@/* 3 */ /* 4*/ Meta Data var) { }
}
@@ -0,0 +1,12 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*/ /*5 *//*6 */ Main.@/* 3 */ /* 4*/ Meta Data> {
public static class Data { }
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data { }
static final /*1 */ /*2*//*one*/ @/*two*/Second /*5 *//*6 */ transient Main.@/* 3 */ /* 4*/ First Data var = null;
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data { }
static final /*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ /*5 *//*6 */ transient Main.@/*two*/Second Data var = null;
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data { }
static {
final /*1 */ /*2*//*one*/ @/*two*/Second /*5 *//*6 */ synchronized transient Main.@/* 3 */ /* 4*/ First Data var = null;
}
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data { }
static {
final /*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ /*5 *//*6 */ synchronized transient Main.@/*two*/Second Data var = null;
}
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data { }
void func(final /*1 */ /*2*//*one*/ @/*two*/Second /*5 *//*6 */ synchronized transient Main.@/* 3 */ /* 4*/ First Data var) { }
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data { }
void func(final /*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ /*5 *//*6 */ synchronized transient Main.@/*two*/Second Data var) { }
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*//*one*/ @/*two*/Second /*5 *//*6 */ Main.@/* 3 */ /* 4*/ First Data> {
public static class Data { }
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ /*5 *//*6 */ Main.@/*two*/Second Data> {
public static class Data { }
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Main {
public static class Data {
public static class Nested { }
}
static final /*1 */ /*2*/ /*5 *//*6 */ transient Main.Data.@/* 3 */ /* 4*/ Meta Nested var = null;
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Main {
public static class Data {
public static class Nested { }
}
static {
final /*1 */ /*2*/ /*5 *//*6 */ synchronized transient Main.Data.@/* 3 */ /* 4*/ Meta Nested var = null;
}
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Main {
public static class Data {
public static class Nested { }
}
void func(final /*1 */ /*2*/ /*5 *//*6 */ synchronized transient Main.Data.@/* 3 */ /* 4*/ Meta Nested var) { }
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*/ /*5 *//*6 */ Main.Data.@/* 3 */ /* 4*/ Meta Nested> {
public static class Data {
public static class Nested { }
}
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data {
public static class Nested { }
}
static final /*1 */ /*2*//*one*/ @/*two*/Second /*5 *//*6 */ transient Main.Data.@/* 3 */ /* 4*/ First Nested var = null;
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data {
public static class Nested { }
}
static final /*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ /*5 *//*6 */ transient Main.Data.@/*two*/Second Nested var = null;
}
@@ -0,0 +1,18 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data {
public static class Nested { }
}
static {
final /*1 */ /*2*//*one*/ @/*two*/Second /*5 *//*6 */ synchronized transient Main.Data.@/* 3 */ /* 4*/ First Nested var = null;
}
}
@@ -0,0 +1,18 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data {
public static class Nested { }
}
static {
final /*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ /*5 *//*6 */ synchronized transient Main.Data.@/*two*/Second Nested var = null;
}
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data {
public static class Nested { }
}
void func(final /*1 */ /*2*//*one*/ @/*two*/Second /*5 *//*6 */ synchronized transient Main.Data.@/* 3 */ /* 4*/ First Nested var) { }
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data {
public static class Nested { }
}
void func(final /*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ /*5 *//*6 */ synchronized transient Main.Data.@/*two*/Second Nested var) { }
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*//*one*/ @/*two*/Second /*5 *//*6 */ Main.Data.@/* 3 */ /* 4*/ First Nested> {
public static class Data {
public static class Nested { }
}
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ /*5 *//*6 */ Main.Data.@/*two*/Second Nested> {
public static class Data {
public static class Nested { }
}
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*/ /*5 *//*6 */ Main.Data.Nested.@/* 3 */ /* 4*/ Meta Inner> {
public static class Data {
public static class Nested {
public static class Inner { }
}
}
}
@@ -0,0 +1,12 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Main {
public static class Data { }
static final /*1 */ /*2*/@<caret>/* 3 */ /* 4*/ Meta /*5 *//*6 */ transient Main.Data var = null;
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Main {
public static class Data { }
static {
final /*1 */ /*2*/@<caret>/* 3 */ /* 4*/ Meta /*5 *//*6 */ synchronized transient Main.Data var = null;
}
}
@@ -0,0 +1,12 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Main {
public static class Data { }
void func(final /*1 */ /*2*/@<caret>/* 3 */ /* 4*/ Meta /*5 *//*6 */ synchronized transient Main.Data var) { }
}
@@ -0,0 +1,12 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*/@<caret>/* 3 */ /* 4*/ Meta /*5 *//*6 */ Main.Data> {
public static class Data { }
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data { }
static final /*1 */ /*2*/@<caret>/* 3 */ /* 4*/ First/*one*/ @/*two*/Second /*5 *//*6 */ transient Main.Data var = null;
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data { }
static final /*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ @/*two*/<caret>Second /*5 *//*6 */ transient Main.Data var = null;
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data { }
static {
final /*1 */ /*2*/@<caret>/* 3 */ /* 4*/ First/*one*/ @/*two*/Second /*5 *//*6 */ synchronized transient Main.Data var = null;
}
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data { }
static {
final /*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ @/*two*/<caret>Second /*5 *//*6 */ synchronized transient Main.Data var = null;
}
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data { }
void func(final /*1 */ /*2*/@<caret>/* 3 */ /* 4*/ First/*one*/ @/*two*/Second /*5 *//*6 */ synchronized transient Main.Data var) { }
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data { }
void func(final /*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ @/*two*/<caret>Second /*5 *//*6 */ synchronized transient Main.Data var) { }
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*/@<caret>/* 3 */ /* 4*/ First/*one*/ @/*two*/Second /*5 *//*6 */ Main.Data> {
public static class Data { }
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ @/*two*/<caret>Second /*5 *//*6 */ Main.Data> {
public static class Data { }
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Main {
public static class Data {
public static class Nested { }
}
static final /*1 */ /*2*/@<caret>/* 3 */ /* 4*/ Meta /*5 *//*6 */ transient Main.Data.Nested var = null;
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Main {
public static class Data {
public static class Nested { }
}
static {
final /*1 */ /*2*/@<caret>/* 3 */ /* 4*/ Meta /*5 *//*6 */ synchronized transient Main.Data.Nested var = null;
}
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Main {
public static class Data {
public static class Nested { }
}
void func(final /*1 */ /*2*/@<caret>/* 3 */ /* 4*/ Meta /*5 *//*6 */ synchronized transient Main.Data.Nested var) { }
}
@@ -0,0 +1,14 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*/@<caret>/* 3 */ /* 4*/ Meta /*5 *//*6 */ Main.Data.Nested> {
public static class Data {
public static class Nested { }
}
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data {
public static class Nested { }
}
static final /*1 */ /*2*/@<caret>/* 3 */ /* 4*/ First/*one*/ @/*two*/Second /*5 *//*6 */ transient Main.Data.Nested var = null;
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data {
public static class Nested { }
}
static final /*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ @/*two*/<caret>Second /*5 *//*6 */ transient Main.Data.Nested var = null;
}
@@ -0,0 +1,18 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data {
public static class Nested { }
}
static {
final /*1 */ /*2*/@<caret>/* 3 */ /* 4*/ First/*one*/ @/*two*/Second /*5 *//*6 */ synchronized transient Main.Data.Nested var = null;
}
}
@@ -0,0 +1,18 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data {
public static class Nested { }
}
static {
final /*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ @/*two*/<caret>Second /*5 *//*6 */ synchronized transient Main.Data.Nested var = null;
}
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data {
public static class Nested { }
}
void func(final /*1 */ /*2*/@<caret>/* 3 */ /* 4*/ First/*one*/ @/*two*/Second /*5 *//*6 */ synchronized transient Main.Data.Nested var) { }
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Main {
public static class Data {
public static class Nested { }
}
void func(final /*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ @/*two*/<caret>Second /*5 *//*6 */ synchronized transient Main.Data.Nested var) { }
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*/@<caret>/* 3 */ /* 4*/ First/*one*/ @/*two*/Second /*5 *//*6 */ Main.Data.Nested> {
public static class Data {
public static class Nested { }
}
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface First { }
@Target(ElementType.TYPE_USE)
@interface Second { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*/@/* 3 */ /* 4*/ First/*one*/ @/*two*/<caret>Second /*5 *//*6 */ Main.Data.Nested> {
public static class Data {
public static class Nested { }
}
}
@@ -0,0 +1,16 @@
// "Move type annotation" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@interface Meta { }
class Generic<T> {}
class Main extends Generic</*1 */ /*2*/@<caret>/* 3 */ /* 4*/ Meta /*5 *//*6 */ Main.Data.Nested.Inner> {
public static class Data {
public static class Nested {
public static class Inner { }
}
}
}