mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-03 15:50:52 +07:00
Java: allow to introduce a constant as a field of an inner, local or anonymous class (IDEA-341923)
for Introduce Constant refactoring. Also fixes IDEABKL-3269 when introducing a compile-time constant from an expression. GitOrigin-RevId: 169e7ee8e14306a265948537b62746d9a26c0298
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cf79dfa709
commit
0dbc31a8b6
@@ -0,0 +1,7 @@
|
||||
class Foo {
|
||||
class Bar {
|
||||
void foo() {
|
||||
String str = <caret>"42";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Foo {
|
||||
class Bar {
|
||||
public static final String xxx = "42";
|
||||
|
||||
void foo() {
|
||||
String str = xxx;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
class Foo {
|
||||
class Bar {
|
||||
public static final String xxx = "42";
|
||||
@NonNls
|
||||
private static final String xxx = "42";
|
||||
|
||||
void foo() {
|
||||
String str = xxx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class X {
|
||||
|
||||
void x() {
|
||||
new Object() {
|
||||
void x() {
|
||||
System.out.println(<selection>new <caret>Object()</selection>);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class X {
|
||||
|
||||
void x() {
|
||||
new Object() {
|
||||
void x() {
|
||||
System.out.println(<selection>new <caret>Object()</selection>);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class X {
|
||||
|
||||
public static final Object xxx = new Object();
|
||||
|
||||
void x() {
|
||||
new Object() {
|
||||
void x() {
|
||||
System.out.println(xxx);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class X {
|
||||
|
||||
void x() {
|
||||
new Object() {
|
||||
public static final Object xxx = new Object();
|
||||
|
||||
void x() {
|
||||
System.out.println(xxx);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user