Move Java-specific part of MoveStatementUpDownTest to java-tests module

GitOrigin-RevId: fd3331c90f28706c98d60134126defb1355e595b
This commit is contained in:
Dmitry Jemerov
2022-05-13 18:58:38 +00:00
committed by intellij-monorepo-bot
parent 2119368ea9
commit 285a5acd66
189 changed files with 2901 additions and 0 deletions
@@ -0,0 +1,16 @@
public class Foo {
public static int main(String[] args) {
new Runnable() {
public void run() {
// TODO1: not implemented
}
};
<caret>int r = 0;
new Runnable() {
public void run() {
// TODO2: not implemented
}
};
return r;
}
}
@@ -0,0 +1,16 @@
public class Foo {
public static int main(String[] args) {
Object o1 = new Runnable() {
public void run() {
// TODO1: not implemented
}
};
<caret>int r = 0;
Object o2 = new Runnable() {
public void run() {
// TODO2: not implemented
}
};
return r;
}
}
@@ -0,0 +1,16 @@
public class Foo {
public static int main(String[] args) {
Object o1 = new Runnable() {
public void run() {
// TODO1: not implemented
}
};
Object o2 = new Runnable() {
public void run() {
// TODO2: not implemented
}
};
<caret>int r = 0;
return r;
}
}
@@ -0,0 +1,16 @@
public class Foo {
public static int main(String[] args) {
<caret>int r = 0;
Object o1 = new Runnable() {
public void run() {
// TODO1: not implemented
}
};
Object o2 = new Runnable() {
public void run() {
// TODO2: not implemented
}
};
return r;
}
}
@@ -0,0 +1,16 @@
public class Foo {
public static int main(String[] args) {
new Runnable() {
public void run() {
// TODO1: not implemented
}
};
new Runnable() {
public void run() {
// TODO2: not implemented
}
};
<caret>int r = 0;
return r;
}
}
@@ -0,0 +1,16 @@
public class Foo {
public static int main(String[] args) {
<caret>int r = 0;
new Runnable() {
public void run() {
// TODO1: not implemented
}
};
new Runnable() {
public void run() {
// TODO2: not implemented
}
};
return r;
}
}
@@ -0,0 +1,25 @@
public class FF {
@Nullable
public Object bar () { //<--- MOVE THIS UP
int
c;
@Nullable
int
g;
Runnable runnable = new <caret>Runnable() {
public void run() {
//To change body of implemented methods use File | Settings | File Templates.
}
};
return null;
}
@Nullable
public
Object
foo () { //xxxx<--- MOVE THIS UP
return null;
}
}
@@ -0,0 +1,25 @@
public class FF {
@Nullable
public Object bar () { //<--- MOVE THIS UP
int
c;
@Nullable
int
g;
return null;
Runnable runnable = new Runnable() {
public void run() {
//To change body of implemented methods use File | Settings | File Templates.
}
};
}
@Nullable
public
Object
foo () { //xxxx<--- MOVE THIS UP
return null;
}
}
@@ -0,0 +1,25 @@
public class FF {
@Nullable
public Object bar () { //<--- MOVE THIS UP
int
c;
Runnable runnable = new Runnable() {
public void run() {
//To change body of implemented methods use File | Settings | File Templates.
}
};
@Nullable
int
g;
return null;
}
@Nullable
public
Object
foo () { //xxxx<--- MOVE THIS UP
return null;
}
}
@@ -0,0 +1,17 @@
class C {
Object o;
void m() {
o = new Object() {
public String toString() {
return "";
}
}
<caret>System.out.println();
o = new Object() {
public String toString() {
return "";
}
}
}
}
@@ -0,0 +1,17 @@
class C {
Object o;
void m() {
o = new Object() {
public String toString() {
return "";
}
}
o = new Object() {
public String toString() {
return "";
}
}
System.out.println();
}
}
@@ -0,0 +1,17 @@
class C {
Object o;
void m() {
System.out.println();
o = new Object() {
public String toString() {
return "";
}
}
o = new Object() {
public String toString() {
return "";
}
}
}
}
@@ -0,0 +1,11 @@
class C {
void m() {
if (true) {
new Runnable() {};
}
int a = 1;<caret>
if (true) {
new Runnable() {};
}
}
}
@@ -0,0 +1,11 @@
class C {
void m() {
if (true) {
new Runnable() {};
}
if (true) {
int a = 1;
new Runnable() {};
}
}
}
@@ -0,0 +1,11 @@
class C {
void m() {
if (true) {
new Runnable() {};
int a = 1;
}
if (true) {
new Runnable() {};
}
}
}
@@ -0,0 +1,15 @@
class C {
void m() {
new Object() {
public String toString() {
return null;
}
}.toString();
<caret>System.out.println();
new Object() {
public String toString() {
return null;
}
}.toString();
}
}
@@ -0,0 +1,15 @@
class C {
void m() {
new Object() {
public String toString() {
return null;
}
}.toString();
new Object() {
public String toString() {
return null;
}
}.toString();
System.out.println();
}
}
@@ -0,0 +1,15 @@
class C {
void m() {
System.out.println();
new Object() {
public String toString() {
return null;
}
}.toString();
new Object() {
public String toString() {
return null;
}
}.toString();
}
}
@@ -0,0 +1,9 @@
class BlockStatement {
void x() {
foo();
{
<caret>goo();
}
}
}
@@ -0,0 +1,9 @@
class BlockStatement {
void x() {
foo();
{
}
goo();
}
}
@@ -0,0 +1,9 @@
class BlockStatement {
void x() {
foo();
goo();
{
}
}
}
@@ -0,0 +1,12 @@
public class Braces {
public void meth(int j) {
String s;
if (j > 10)
s = "too high";
else
{
<caret>String laugh = "haha";
s = "too low";
}
}
}
@@ -0,0 +1,12 @@
public class Braces {
public void meth(int j) {
String s;
if (j > 10)
s = "too high";
else
{
s = "too low";
<caret>String laugh = "haha";
}
}
}
@@ -0,0 +1,13 @@
public class Braces {
public void meth(int j) {
String s;
if (j > 10) {
s = "too high";
<caret>String laugh = "haha";
}
else
{
s = "too low";
}
}
}
@@ -0,0 +1,15 @@
class Test {
void m(int v) {
switch (v) {
case 1:
System.out.println(1);
break;
<caret>case 2:
System.out.println(2);
break;
case 3:
System.out.println(3);
break;
}
}
}
@@ -0,0 +1,15 @@
class Test {
void m(int v) {
switch (v) {
case 1:
System.out.println(1);
break;
<caret> case 2:
System.out.println(2);
break;
case 3:
System.out.println(3);
break;
}
}
}
@@ -0,0 +1,15 @@
class Test {
void m(int v) {
switch (v) {
case 1:
System.out.println(1);
break;
case 3:
System.out.println(3);
break;
<caret> case 2:
System.out.println(2);
break;
}
}
}
@@ -0,0 +1,15 @@
class Test {
void m(int v) {
switch (v) {
<caret> case 2:
System.out.println(2);
break;
case 1:
System.out.println(1);
break;
case 3:
System.out.println(3);
break;
}
}
}
@@ -0,0 +1,18 @@
class Test {
void m(int v) {
switch (v) {
case 1:
System.out.println(1);
break;
<selection><caret> case 2:
System.out.println(2);
break;
case </selection>3:
System.out.println(3);
break;
case 4:
System.out.println(4);
break;
}
}
}
@@ -0,0 +1,18 @@
class Test {
void m(int v) {
switch (v) {
case 1:
System.out.println(1);
break;
case 4:
System.out.println(4);
break;
<selection><caret> case 2:
System.out.println(2);
break;
case </selection>3:
System.out.println(3);
break;
}
}
}
@@ -0,0 +1,18 @@
class Test {
void m(int v) {
switch (v) {
<selection><caret> case 2:
System.out.println(2);
break;
case </selection>3:
System.out.println(3);
break;
case 1:
System.out.println(1);
break;
case 4:
System.out.println(4);
break;
}
}
}
@@ -0,0 +1,15 @@
class Test {
void m(int v) {
switch (v) {
case 1:
System.out.println(1);
break;
case 3:
System.out.println(3);
break;
<caret>case 2:
System.out.println(2);
break;
}
}
}
@@ -0,0 +1,15 @@
class Test {
void m(int v) {
switch (v) {
<caret>case 2:
System.out.println(2);
break;
case 1:
System.out.println(1);
break;
case 3:
System.out.println(3);
break;
}
}
}
@@ -0,0 +1,23 @@
import java.io.File;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;
public class Plain {
@Nullable
public File oper1() {
return new File("filo");
}
public void oper2(int p) {
try {
File f = oper1();
f.createNewFile();
} catch (IOException ioe) {
ioe.printStackTrace();
<caret> } catch (NullPointerException npe) {
npe.printStackTrace();
} catch (Error err) {
err.printStackTrace();
}
}
}
@@ -0,0 +1,26 @@
import java.io.File;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;
public class Plain {
@Nullable
public File oper1() {
return new File("filo");
}
public void oper2(int p) {
try {
File f = oper1();
f.createNewFile();
}
catch (IOException ioe) {
ioe.printStackTrace();
}
<caret> catch (NullPointerException npe) {
npe.printStackTrace();
}
catch (Error err) {
err.printStackTrace();
}
}
}
@@ -0,0 +1,26 @@
import java.io.File;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;
public class Plain {
@Nullable
public File oper1() {
return new File("filo");
}
public void oper2(int p) {
try {
File f = oper1();
f.createNewFile();
}
catch (IOException ioe) {
ioe.printStackTrace();
}
catch (Error err) {
err.printStackTrace();
}
<caret> catch (NullPointerException npe) {
npe.printStackTrace();
}
}
}
@@ -0,0 +1,26 @@
import java.io.File;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;
public class Plain {
@Nullable
public File oper1() {
return new File("filo");
}
public void oper2(int p) {
try {
File f = oper1();
f.createNewFile();
}
<caret> catch (NullPointerException npe) {
npe.printStackTrace();
}
catch (IOException ioe) {
ioe.printStackTrace();
}
catch (Error err) {
err.printStackTrace();
}
}
}
@@ -0,0 +1,23 @@
import java.io.File;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;
public class Plain {
@Nullable
public File oper1() {
return new File("filo");
}
public void oper2(int p) {
try {
File f = oper1();
f.createNewFile();
} catch (IOException ioe) {
ioe.printStackTrace();
} <selection><caret>catch (NullPointerException npe) {
npe.printStackTrace();
}</selection> catch (Error err) {
err.printStackTrace();
}
}
}
@@ -0,0 +1,25 @@
import java.io.File;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;
public class Plain {
@Nullable
public File oper1() {
return new File("filo");
}
public void oper2(int p) {
try {
File f = oper1();
f.createNewFile();
} catch (IOException ioe) {
ioe.printStackTrace();
} cat<selection><caret>ch (NullPointerException npe) {
npe.printStackTrace();
} cat</selection>ch (Error err) {
err.printStackTrace();
} catch (Throwable t) {
t.printStackTrace();
}
}
}
@@ -0,0 +1,25 @@
import java.io.File;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;
public class Plain {
@Nullable
public File oper1() {
return new File("filo");
}
public void oper2(int p) {
try {
File f = oper1();
f.createNewFile();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (Throwable t) {
t.printStackTrace();
} cat<selection><caret>ch (NullPointerException npe) {
npe.printStackTrace();
} cat</selection>ch (Error err) {
err.printStackTrace();
}
}
}
@@ -0,0 +1,25 @@
import java.io.File;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;
public class Plain {
@Nullable
public File oper1() {
return new File("filo");
}
public void oper2(int p) {
try {
File f = oper1();
f.createNewFile();
} cat<selection><caret>ch (NullPointerException npe) {
npe.printStackTrace();
} cat</selection>ch (Error err) {
err.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (Throwable t) {
t.printStackTrace();
}
}
}
@@ -0,0 +1,23 @@
import java.io.File;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;
public class Plain {
@Nullable
public File oper1() {
return new File("filo");
}
public void oper2(int p) {
try {
File f = oper1();
f.createNewFile();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (Error err) {
err.printStackTrace();
} <selection><caret>catch (NullPointerException npe) {
npe.printStackTrace();
</selection> }
}
}
@@ -0,0 +1,23 @@
import java.io.File;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;
public class Plain {
@Nullable
public File oper1() {
return new File("filo");
}
public void oper2(int p) {
try {
File f = oper1();
f.createNewFile();
} <selection><caret>catch (NullPointerException npe) {
npe.printStackTrace();
</selection> } catch (IOException ioe) {
ioe.printStackTrace();
} catch (Error err) {
err.printStackTrace();
}
}
}
@@ -0,0 +1,23 @@
import java.io.File;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;
public class Plain {
@Nullable
public File oper1() {
return new File("filo");
}
public void oper2(int p) {
try {
File f = oper1();
f.createNewFile();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (Error err) {
err.printStackTrace();
<caret> } catch (NullPointerException npe) {
npe.printStackTrace();
}
}
}
@@ -0,0 +1,23 @@
import java.io.File;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;
public class Plain {
@Nullable
public File oper1() {
return new File("filo");
}
public void oper2(int p) {
try {
File f = oper1();
f.createNewFile();
<caret> } catch (NullPointerException npe) {
npe.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (Error err) {
err.printStackTrace();
}
}
}
@@ -0,0 +1,9 @@
class MoveStatementUp {
class Inner // note the line break here
implements java.io.Serializable {
<caret>int moveMeUp;
}
}
@@ -0,0 +1,9 @@
class MoveStatementUp {
class Inner // note the line break here
implements java.io.Serializable {
}
<caret>int moveMeUp;
}
@@ -0,0 +1,9 @@
class MoveStatementUp {
<caret>int moveMeUp;
class Inner // note the line break here
implements java.io.Serializable {
}
}
@@ -0,0 +1,10 @@
public class Base {
public int foo(boolean b) {
if (b) {
int i = 0;
return 1
- 0;
<caret> }
return 3
+3;
}
@@ -0,0 +1,10 @@
public class Base {
public int foo(boolean b) {
if (b) {
int i = 0;
return 1
- 0;
return 3
+3;
<caret> }
}
@@ -0,0 +1,10 @@
public class Base {
public int foo(boolean b) {
if (b) {
int i = 0;
<caret> }
return 1
- 0;
return 3
+3;
}
@@ -0,0 +1,20 @@
class CL {
void g() {
int k;
int ff;
/**
* Javadoc trap
*/
if (<caret>1==1) {
//fff
}
/**
* down trap
*/
j1 = 0;
}
}
@@ -0,0 +1,8 @@
public class Test {
void f() {
readTable("im_amortizacao", connection);
// readTable("po_proc_valor", connection);
<caret>readTable("kutilizadores", connection);
// readTable("po_proc_valor", connection);
}
}
@@ -0,0 +1,8 @@
public class Test {
void f() {
readTable("im_amortizacao", connection);
// readTable("po_proc_valor", connection);
// readTable("po_proc_valor", connection);
<caret>readTable("kutilizadores", connection);
}
}
@@ -0,0 +1,8 @@
public class Test {
void f() {
readTable("im_amortizacao", connection);
<caret>readTable("kutilizadores", connection);
// readTable("po_proc_valor", connection);
// readTable("po_proc_valor", connection);
}
}
@@ -0,0 +1,20 @@
class CL {
void g() {
int k;
int ff;
/**
* Javadoc trap
*/
/**
* down trap
*/
if (<caret>1==1) {
//fff
}
j1 = 0;
}
}
@@ -0,0 +1,20 @@
class CL {
void g() {
int k;
int ff;
if (<caret>1==1) {
//fff
}
/**
* Javadoc trap
*/
/**
* down trap
*/
j1 = 0;
}
}
@@ -0,0 +1,17 @@
class CL {
void g() {
int k;
while (
1==1
&& true
)
{
int j = <caret>0;
// comment
}
j1 = 0;
}
}
@@ -0,0 +1,17 @@
class CL {
void g() {
int k;
while (
1==1
&& true
)
{
// comment
int j = <caret>0;
}
j1 = 0;
}
}
@@ -0,0 +1,17 @@
class CL {
void g() {
int k;
int j = <caret>0;
while (
1==1
&& true
)
{
// comment
}
j1 = 0;
}
}
@@ -0,0 +1,20 @@
class Test {
private static final String moveMe = "";
/**
* Class
*/
class c {
}
int <selection>i;
in</selection><caret>t d;
/**
* F
*/
void f() {
//f
}
public static void main(String[] args) {
int ff;
// d
}
}
@@ -0,0 +1,20 @@
class Test {
private static final String moveMe = "";
/**
* Class
*/
class c {
}
/**
* F
*/
void f() {
//f
}
int <selection>i;
in</selection><caret>t d;
public static void main(String[] args) {
int ff;
// d
}
}
@@ -0,0 +1,20 @@
class Test {
private static final String moveMe = "";
/**
* Class
*/
class c {
int <selection>i;
in</selection><caret>t d;
}
/**
* F
*/
void f() {
//f
}
public static void main(String[] args) {
int ff;
// d
}
}
@@ -0,0 +1,22 @@
class CL {
private int i;
private int j;
<caret>private int k;
private int l;
private int p;
}
@@ -0,0 +1,14 @@
class CL {
private int j;
<caret>private int k;
private int l;
}
@@ -0,0 +1,14 @@
class CL {
private int j;
private int k;
<caret>private int l;
}
@@ -0,0 +1,14 @@
class CL {
private int j;
<caret>private int l;
private int k;
}
@@ -0,0 +1,14 @@
class CL {
private int j;
private int l;
<caret>private int k;
}
@@ -0,0 +1,14 @@
class CL {
<caret>private int k;
private int j;
private int l;
}
@@ -0,0 +1,22 @@
class CL {
private int i;
private int j;
private int l;
<caret>private int k;
private int p;
}
@@ -0,0 +1,22 @@
class CL {
private int i;
<caret>private int k;
private int j;
private int l;
private int p;
}
@@ -0,0 +1,6 @@
public enum E {
<caret>A,
B;
void f() {}
}
@@ -0,0 +1,7 @@
enum TestEnum {
ENTRY1,<caret>
ENTRY2,
ENTRY3;
}
@@ -0,0 +1,6 @@
enum Test1Enum {
ENTRY1,
ENTRY2,
ENTRY3<caret>
}
@@ -0,0 +1,6 @@
enum Test1Enum {
ENTRY1,
ENTRY2,
ENTRY3<caret>
}
@@ -0,0 +1,6 @@
enum Test1Enum {
ENTRY1,
ENTRY3<caret>,
ENTRY2
}
@@ -0,0 +1,7 @@
enum TestEnum {
ENTRY1,
ENTRY2,
ENTRY3;
}
@@ -0,0 +1,19 @@
enum NewEnum {
FOO(1),
BOO(2)
,
<caret>BAR(3){
public int getMyArg(){
return myarg;
}
};
int myarg;
NewEnum(int myarg) {
this.myarg = myarg;
}
public int getMyArg(){
return myarg;
}
}
@@ -0,0 +1,19 @@
enum NewEnum {
FOO(1),
BOO(2),
BAR<caret>(3){
public int getMyArg(){
return myarg;
}
};
int myarg;
NewEnum(int myarg) {
this.myarg = myarg;
}
public int getMyArg(){
return myarg;
}
}
@@ -0,0 +1,19 @@
enum NewEnum {
FOO(1),
BOO(2),
BAR<caret>(3){
public int getMyArg(){
return myarg;
}
};
int myarg;
NewEnum(int myarg) {
this.myarg = myarg;
}
public int getMyArg(){
return myarg;
}
}
@@ -0,0 +1,19 @@
enum NewEnum {
FOO(1),
BAR<caret>(3){
public int getMyArg(){
return myarg;
}
},
BOO(2);
int myarg;
NewEnum(int myarg) {
this.myarg = myarg;
}
public int getMyArg(){
return myarg;
}
}
@@ -0,0 +1,19 @@
enum NewEnum {
FOO(1),
BOO(2)
,
<caret>BAR(3){
public int getMyArg(){
return myarg;
}
};
int myarg;
NewEnum(int myarg) {
this.myarg = myarg;
}
public int getMyArg(){
return myarg;
}
}
@@ -0,0 +1,19 @@
enum NewEnum {
FOO(1),
<caret>BAR(3){
public int getMyArg(){
return myarg;
}
}
,
BOO(2);
int myarg;
NewEnum(int myarg) {
this.myarg = myarg;
}
public int getMyArg(){
return myarg;
}
}
@@ -0,0 +1,6 @@
public enum Test {
<caret>/** javadoc */
FOO,
BAR,
BAZ
}
@@ -0,0 +1,6 @@
public enum Test {
BAR,
/** javadoc */
<caret>FOO,
BAZ
}
@@ -0,0 +1,6 @@
public enum Test {
BAR,
BAZ,
/** javadoc */
FOO
}
@@ -0,0 +1,6 @@
public enum Test {
/** javadoc */
FOO,
BAR,
BAZ
}
@@ -0,0 +1,6 @@
public enum Test {
BAR,
<caret>/** javadoc */
FOO,
BAZ
}
@@ -0,0 +1,6 @@
public enum E {
B,
A;
void f() {}
}
@@ -0,0 +1,8 @@
public class Foo {
private int foo = 42;
private int bar<caret> = 42;
public Foo() {
}
}
@@ -0,0 +1,10 @@
public class Foo {
// comm
private int foo<caret> = 42;
private int bar = 42;
public Foo() {
}
}
@@ -0,0 +1,10 @@
public class Foo {
// comm
private int bar = 42;
private int foo<caret> = 42;
public Foo() {
}
}
@@ -0,0 +1,10 @@
public class Foo {
// comm
private int foo<caret> = 42;
private int bar = 42;
public Foo() {
}
}
@@ -0,0 +1,8 @@
public class Foo {
private int foo = 42;
public Foo() {
}
private int bar<caret> = 42;
}
@@ -0,0 +1,8 @@
public class Foo {
private int bar<caret> = 42;
private int foo = 42;
public Foo() {
}
}
@@ -0,0 +1,15 @@
public class Test {
/**
*
*/
void f(){
Collection<String> c = new ArrayList<String>(); //
}
/** <caret>dfgdfgdfgdfgdfgdfg*/
int ggg;
/** sdfsd */
void fg() {
}
}
@@ -0,0 +1,15 @@
public class Test {
/**
*
*/
void f(){
Collection<String> c = new ArrayList<String>(); //
}
/** sdfsd */
void fg() {
}
/** <caret>dfgdfgdfgdfgdfgdfg*/
int ggg;
}
@@ -0,0 +1,15 @@
public class Test {
/** <caret>dfgdfgdfgdfgdfgdfg*/
int ggg;
/**
*
*/
void f(){
Collection<String> c = new ArrayList<String>(); //
}
/** sdfsd */
void fg() {
}
}
@@ -0,0 +1,17 @@
class CL {
void g() {
int k;
if (1==1)
{
int j = <caret>0;
}
else
{
int i;
}
j1 = 0;
}
}
@@ -0,0 +1,17 @@
class CL {
void g() {
int k;
if (1==1)
{
int j = 0;
}
else
{
int i;<caret>
}
j1 = 0;
}
}

Some files were not shown because too many files have changed in this diff Show More