[java] More tests for preview; minor fixes

GitOrigin-RevId: 7f72c5f68ab821e728eb0d5152f0910f48035046
This commit is contained in:
Tagir Valeev
2022-07-20 15:22:33 +02:00
committed by intellij-monorepo-bot
parent 7a1f179f41
commit 9c6aeba5b4
726 changed files with 874 additions and 767 deletions

View File

@@ -1,4 +1,4 @@
// "Bring 'int i' into scope" "true"
// "Bring 'int i' into scope" "true-preview"
class a {
void foo () {
int i = 0;

View File

@@ -1,4 +1,4 @@
// "Bring 'int i' into scope" "true"
// "Bring 'int i' into scope" "true-preview"
class a {
void foo (int y) {
int i;

View File

@@ -1,4 +1,4 @@
// "Bring 'int i' into scope" "true"
// "Bring 'int i' into scope" "true-preview"
class a {
void foo (int y) {
int i = 0;

View File

@@ -1,4 +1,4 @@
// "Bring 'int i' into scope" "true"
// "Bring 'int i' into scope" "true-preview"
class a {
public void foo() {
int i;

View File

@@ -1,4 +1,4 @@
// "Bring 'int i' into scope" "true"
// "Bring 'int i' into scope" "true-preview"
class a {
public void foo() {
int i;

View File

@@ -1,11 +1,11 @@
// "Bring 'String con' into scope" "true"
// "Bring 'String con' into scope" "true-preview"
class a {
private void ffff(String c) {
String con = null;
try {
con = null;
} finally {
ffff(con); // This method doesn't mind con == null.
ffff(con);// This method doesn't mind con == null.
}
}
}

View File

@@ -1,4 +1,4 @@
// "Bring 'int j' into scope" "true"
// "Bring 'int j' into scope" "true-preview"
class a {
void foo() {
int j;
@@ -6,6 +6,6 @@ class a {
int i;
j = 10;
}
System.out.println(<caret>j); // invoke "bring 'int j' into scope" quickfix here
System.out.println(<caret>j);// invoke "bring 'int j' into scope" quickfix here
}
}

View File

@@ -1,4 +1,4 @@
// "Bring 'String msg' into scope" "true"
// "Bring 'String msg' into scope" "true-preview"
public class BringVarIntoScope {
public void moveVariableDeclarationOutOfBlock(boolean b) {
String msg;

View File

@@ -1,4 +1,4 @@
// "Bring 'int i' into scope" "true"
// "Bring 'int i' into scope" "true-preview"
class a {
void foo () {
try {

View File

@@ -1,4 +1,4 @@
// "Bring 'int i' into scope" "true"
// "Bring 'int i' into scope" "true-preview"
class a {
void foo (int y) {
while (y != 0) {

View File

@@ -1,4 +1,4 @@
// "Bring 'int i' into scope" "true"
// "Bring 'int i' into scope" "true-preview"
class a {
void foo (int y) {
while (y != 0) {

View File

@@ -1,4 +1,4 @@
// "Bring 'int i' into scope" "true"
// "Bring 'int i' into scope" "true-preview"
class a {
public void foo() {
if (true) {

View File

@@ -1,4 +1,4 @@
// "Bring 'int i' into scope" "true"
// "Bring 'int i' into scope" "true-preview"
class a {
public void foo() {
for (int i = 0; i < 10; i++) { }

View File

@@ -1,9 +1,9 @@
// "Bring 'String con' into scope" "true"
// "Bring 'String con' into scope" "true-preview"
class a {
private void ffff(String c){
try { String con = null; }
finally {
ffff(<caret>con); // This method doesn't mind con == null.
ffff(<caret>con);// This method doesn't mind con == null.
}
}
}

View File

@@ -1,9 +1,9 @@
// "Bring 'int j' into scope" "true"
// "Bring 'int j' into scope" "true-preview"
class a {
void foo() {
{
int i, j = 10;
}
System.out.println(<caret>j); // invoke "bring 'int j' into scope" quickfix here
System.out.println(<caret>j);// invoke "bring 'int j' into scope" quickfix here
}
}

View File

@@ -1,4 +1,4 @@
// "Bring 'String msg' into scope" "true"
// "Bring 'String msg' into scope" "true-preview"
public class BringVarIntoScope {
public void moveVariableDeclarationOutOfBlock(boolean b) {
if (b) {