mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-17 06:49:59 +07:00
[analysis] IDEA-241656 Provide a fix for "static member qualifying type may not be annotated"
This patch fixes notes from the code review, it includes: 1. moving MoveAnnotationOnStaticMemberQualifyingTypeFix to top level 2. reusing MoveAnnotationOnStaticMemberQualifyingTypeFix#getFamilyName in MoveAnnotationOnStaticMemberQualifyingTypeFix#getName 3. using PsiTreeUtil#findSiblingBackwards to find the rightmost dot token instead of custom code 4. removing redundant test data Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com> GitOrigin-RevId: a539ed96c3883947b621525fc4bd017eefd7b458
This commit is contained in:
committed by
intellij-monorepo-bot
parent
73835fbb74
commit
d7ceab7d2d
-14
@@ -1,14 +0,0 @@
|
||||
// "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;
|
||||
}
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
// "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) { }
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
// "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;
|
||||
}
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
// "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;
|
||||
}
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
// "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) { }
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
// "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) { }
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
// "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;
|
||||
}
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
// "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) { }
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
// "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;
|
||||
}
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
// "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;
|
||||
}
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
// "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) { }
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
// "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) { }
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
// "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;
|
||||
}
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
// "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) { }
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
// "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;
|
||||
}
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
// "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;
|
||||
}
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
// "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) { }
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
// "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) { }
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
// "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;
|
||||
}
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
// "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) { }
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
// "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;
|
||||
}
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
// "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;
|
||||
}
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
// "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) { }
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
// "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) { }
|
||||
}
|
||||
Reference in New Issue
Block a user