mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 02:38:59 +07:00
[java-inspections] CreateLocalFromUsageFix: tests for preview
GitOrigin-RevId: 18145df666bfb6601725d6cdd13a14bb341fe32a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
00e0603e53
commit
6266f14d9b
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'x'" "true"
|
||||
// "Create local variable 'x'" "true-preview"
|
||||
class other {
|
||||
public int method1() { return 1;}
|
||||
public String field1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'x'" "true"
|
||||
// "Create local variable 'x'" "true-preview"
|
||||
class other {
|
||||
public int method1() { return 1;}
|
||||
public String field1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'a'" "true"
|
||||
// "Create local variable 'a'" "true-preview"
|
||||
class C {
|
||||
void foo() {
|
||||
int a<caret> = 10;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'zeit'" "true"
|
||||
// "Create local variable 'zeit'" "true-preview"
|
||||
public class A {
|
||||
{
|
||||
Object zeit;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'lf'" "true"
|
||||
// "Create local variable 'lf'" "true-preview"
|
||||
import java.util.function.Function;
|
||||
|
||||
class Main2 {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'zeit'" "true"
|
||||
// "Create local variable 'zeit'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
final String zeit = "";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'a'" "true"
|
||||
// "Create local variable 'a'" "true-preview"
|
||||
class C {
|
||||
void foo() {
|
||||
(s) -> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'java'" "true"
|
||||
// "Create local variable 'java'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
String java = "";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// "Create local variable 'foo'" "true-preview"
|
||||
class Foo {
|
||||
{
|
||||
A foo = (s, s1) -> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 't'" "true"
|
||||
// "Create local variable 't'" "true-preview"
|
||||
class Test {
|
||||
private void f() {
|
||||
int t<caret>;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'x'" "true"
|
||||
// "Create local variable 'x'" "true-preview"
|
||||
class other {
|
||||
Runnable field = () -> {
|
||||
Object x;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'v'" "true"
|
||||
// "Create local variable 'v'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
L l = () -> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'zeit'" "true"
|
||||
// "Create local variable 'zeit'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
Object zeit<caret> = A::foo;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// "Create local variable 'foo'" "true-preview"
|
||||
import java.util.*;
|
||||
class Test {
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'x'" "true"
|
||||
// "Create local variable 'x'" "true-preview"
|
||||
class A {
|
||||
public void foo() {
|
||||
Object x;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'a'" "true"
|
||||
// "Create local variable 'a'" "true-preview"
|
||||
class C {
|
||||
void foo(Foo f) {
|
||||
Foo a = f;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'str'" "true"
|
||||
// "Create local variable 'str'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
String str;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'xyz'" "true"
|
||||
// "Create local variable 'xyz'" "true-preview"
|
||||
interface Other<T> {
|
||||
void add(int x, T y);
|
||||
void add(T y);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'zeit'" "true"
|
||||
// "Create local variable 'zeit'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
String[] split = null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'a'" "true"
|
||||
// "Create local variable 'a'" "true-preview"
|
||||
class C {
|
||||
C builder() {
|
||||
return this;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'local'" "true"
|
||||
// "Create local variable 'local'" "true-preview"
|
||||
class A {
|
||||
public void foo() {
|
||||
String local<caret>;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 't'" "true"
|
||||
// "Create local variable 't'" "true-preview"
|
||||
class Test {
|
||||
private void f(boolean f) {
|
||||
String t = f ? null : "";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// "Create local variable 'foo'" "true-preview"
|
||||
class Foo {
|
||||
String test(int i) {
|
||||
String foo;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// "Create local variable 'foo'" "true-preview"
|
||||
class Foo {
|
||||
String test(int i) {
|
||||
return switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// "Create local variable 'foo'" "true-preview"
|
||||
class Foo {
|
||||
String test(int i) {
|
||||
int foo;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// "Create local variable 'foo'" "true-preview"
|
||||
class Foo {
|
||||
int x = foo ? 0 : switch(1) {
|
||||
default -> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'field'" "true"
|
||||
// "Create local variable 'field'" "true-preview"
|
||||
import java.util.*;
|
||||
class A {
|
||||
void foo(Map<String, String> s){}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'x'" "true"
|
||||
// "Create local variable 'x'" "true-preview"
|
||||
class X {
|
||||
void m(String s) {}
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'a'" "true"
|
||||
// "Create local variable 'a'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
Class<?>[] a = get();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'zeit'" "true"
|
||||
// "Create local variable 'zeit'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
String[] split = null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'x'" "true"
|
||||
// "Create local variable 'x'" "true-preview"
|
||||
class other {
|
||||
public int method1() { return 1;}
|
||||
public String field1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'x'" "true"
|
||||
// "Create local variable 'x'" "true-preview"
|
||||
class other {
|
||||
public int method1() { return 1;}
|
||||
public String field1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'a'" "true"
|
||||
// "Create local variable 'a'" "true-preview"
|
||||
class C {
|
||||
void foo() {
|
||||
<caret>a = 10;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'zeit'" "true"
|
||||
// "Create local variable 'zeit'" "true-preview"
|
||||
public class A {
|
||||
{
|
||||
Runnable r = new Runnable(ze<caret>it) {};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'lf'" "true"
|
||||
// "Create local variable 'lf'" "true-preview"
|
||||
import java.util.function.Function;
|
||||
|
||||
class Main2 {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'zeit'" "true"
|
||||
// "Create local variable 'zeit'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
ze<caret>it = "";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'a'" "true"
|
||||
// "Create local variable 'a'" "true-preview"
|
||||
class C {
|
||||
void foo() {
|
||||
(s) -> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'java'" "true"
|
||||
// "Create local variable 'java'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
ja<caret>va = "";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// "Create local variable 'foo'" "true-preview"
|
||||
class Foo {
|
||||
{
|
||||
f<caret>oo = (s, s1) -> {};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 't'" "true"
|
||||
// "Create local variable 't'" "true-preview"
|
||||
class Test {
|
||||
private void f() {
|
||||
int i = <caret>t;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'x'" "true"
|
||||
// "Create local variable 'x'" "true-preview"
|
||||
class other {
|
||||
Runnable field = () -> {<caret>x};
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'v'" "true"
|
||||
// "Create local variable 'v'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
L l = () -> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'zeit'" "true"
|
||||
// "Create local variable 'zeit'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
ze<caret>it = A::foo;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// "Create local variable 'foo'" "true-preview"
|
||||
import java.util.*;
|
||||
class Test {
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'x'" "true"
|
||||
// "Create local variable 'x'" "true-preview"
|
||||
class A {
|
||||
public void foo() {
|
||||
x;<caret>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'a'" "true"
|
||||
// "Create local variable 'a'" "true-preview"
|
||||
class C {
|
||||
void foo(Foo f) {
|
||||
<caret>a = f;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'str'" "true"
|
||||
// "Create local variable 'str'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
String s = s<caret>tr;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'xyz'" "true"
|
||||
// "Create local variable 'xyz'" "true-preview"
|
||||
interface Other<T> {
|
||||
void add(int x, T y);
|
||||
void add(T y);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'zeit'" "true"
|
||||
// "Create local variable 'zeit'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
String[] split = null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'a'" "true"
|
||||
// "Create local variable 'a'" "true-preview"
|
||||
class C {
|
||||
C builder() {
|
||||
return this;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'local'" "true"
|
||||
// "Create local variable 'local'" "true-preview"
|
||||
class A {
|
||||
public void foo() {
|
||||
System.out.println(local);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 't'" "true"
|
||||
// "Create local variable 't'" "true-preview"
|
||||
class Test {
|
||||
private void f(boolean f) {
|
||||
<caret>t = f ? null : "";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// "Create local variable 'foo'" "true-preview"
|
||||
class Foo {
|
||||
String test(int i) {
|
||||
return switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// "Create local variable 'foo'" "true-preview"
|
||||
class Foo {
|
||||
String test(int i) {
|
||||
return switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// "Create local variable 'foo'" "true-preview"
|
||||
class Foo {
|
||||
String test(int i) {
|
||||
return switch (f<caret>oo) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'foo'" "true"
|
||||
// "Create local variable 'foo'" "true-preview"
|
||||
class Foo {
|
||||
int x = foo ? 0 : switch(1) {
|
||||
default -> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'field'" "true"
|
||||
// "Create local variable 'field'" "true-preview"
|
||||
import java.util.*;
|
||||
class A {
|
||||
void foo(Map<String, String> s){}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'x'" "true"
|
||||
// "Create local variable 'x'" "true-preview"
|
||||
class X {
|
||||
void m(String s) {}
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'a'" "true"
|
||||
// "Create local variable 'a'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
<caret>a = get();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create local variable 'zeit'" "true"
|
||||
// "Create local variable 'zeit'" "true-preview"
|
||||
public class A {
|
||||
void foo() {
|
||||
String[] split = null;
|
||||
|
||||
Reference in New Issue
Block a user