moving tests

This commit is contained in:
Dmitry Jemerov
2009-09-10 19:49:38 +04:00
parent e389680982
commit b43c03ca2f
305 changed files with 32 additions and 4 deletions

View File

@@ -0,0 +1,11 @@
class A {
public void test() {
Inner[] b = new Inner[] { new Inner() };
}
private class <caret>Inner {
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,10 @@
class A {
public void test() {
Object[] b = new Object[] {new Object() {
public String toString() {
return "A";
}
}};
}
}

View File

@@ -0,0 +1,12 @@
class A {
public void test() {
Inner[] b = new Inner[1];
b [0] = new Inner();
}
private class <caret>Inner {
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,11 @@
class A {
public void test() {
Object[] b = new Object[1];
b [0] = new Object() {
public String toString() {
return "A";
}
};
}
}

View File

@@ -0,0 +1,14 @@
import java.util.*;
class A {
public void test() {
Inner<String>[] b = new Inner<String>[1];
b [0] = new Inner<String>();
}
private class <caret>Inner<T> implements Comparator<T> {
public int compare(T t1, T t2) {
return 0;
}
}
}

View File

@@ -0,0 +1,13 @@
import java.util.*;
class A {
public void test() {
Comparator<String>[] b = new Comparator[1];
b [0] = new Comparator<String>() {
public int compare(String t1, String t2) {
return 0;
}
};
}
}

View File

@@ -0,0 +1,17 @@
class A {
private Object b = new MyException("w");
private class <caret>MyException extends Exception {
public MyException(String msg) {
this(new Throwable(), msg);
}
public MyException(Throwable t, String msg) {
super(msg, t);
}
public String getMessage() {
return "q";
}
}
}

View File

@@ -0,0 +1,8 @@
class A {
private Object b = new Exception("w", new Throwable()) {
public String getMessage() {
return "q";
}
};
}

View File

@@ -0,0 +1,9 @@
class A {
private Inner b = new Inner();
private class <caret>Inner {
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,8 @@
class A {
private Object b = new Object() {
public String toString() {
return "A";
}
};
}

View File

@@ -0,0 +1,13 @@
class A {
private Object b = new Inner();
private class <caret>Inner {
{
// class initializer
}
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,12 @@
class A {
private Object b = new Object() {
{
// class initializer
}
public String toString() {
return "A";
}
};
}

View File

@@ -0,0 +1,17 @@
public class QualifyInnerTest {
public class C2User {
public void test() {
C2.C2Inner inner = new C2.C2Inner();
}
}
}
class C2 {
private static int a;
public static class <caret>C2Inner {
public void doStuff() {
System.out.println(a);
}
}
}

View File

@@ -0,0 +1,13 @@
class A {
private Object b = new MyException();
private class <caret>MyException extends Exception {
public MyException() {
super("w");
}
public String getMessage() {
return "q";
}
}
}

View File

@@ -0,0 +1,8 @@
class A {
private Object b = new Exception("w") {
public String getMessage() {
return "q";
}
};
}

View File

@@ -0,0 +1,15 @@
public class A {
public class <caret>Inner {
private int a = 0;
public Inner(int arg) {
int j = 5;
while (j < 10) j++;
a = arg * j;
}
}
public void test() {
Inner i = new Inner(1);
}
}

View File

@@ -0,0 +1,14 @@
public class A {
public void test() {
Object i = new Object() {
private int a = 0;
{
int j = 5;
while (j < 10) j++;
a = 1 * j;
}
};
}
}

View File

@@ -0,0 +1,19 @@
public class A {
public class <caret>Inner implements Runnable {
private final int c;
public Inner(int arg) {
c = arg;
}
public void run() {
System.out.println(c);
}
}
public void test() {
int c = 0;
Inner i = new Inner(1);
new Thread(i).start();
}
}

View File

@@ -0,0 +1,14 @@
public class A {
public void test() {
int c = 0;
Runnable i = new Runnable() {
private final int c = 1;
public void run() {
System.out.println(c);
}
};
new Thread(i).start();
}
}

View File

@@ -0,0 +1,15 @@
class A {
private Object b = new Inner();
private class <caret>Inner {
public Inner() {
// this does some stuff
doStuff();
/* isn't this interesting? */
}
public String doStuff() {
return "A";
}
}
}

View File

@@ -0,0 +1,14 @@
class A {
private Object b = new Object() {
{
// this does some stuff
doStuff();
/* isn't this interesting? */
}
public String doStuff() {
return "A";
}
};
}

View File

@@ -0,0 +1,13 @@
class A {
private Object b = new MyException("w");
private class <caret>MyException extends Exception {
public MyException(String msg) {
super(msg);
}
public String getMessage() {
return "q";
}
}
}

View File

@@ -0,0 +1,8 @@
class A {
private Object b = new Exception("w") {
public String getMessage() {
return "q";
}
};
}

View File

@@ -0,0 +1,13 @@
class A {
private Object b = new MyException("w");
private class <caret>MyException extends Exception {
public MyException(String msg) {
super(msg.substring(0, 1));
}
public String getMessage() {
return "q";
}
}
}

View File

@@ -0,0 +1,8 @@
class A {
private Object b = new Exception("w".substring(0, 1)) {
public String getMessage() {
return "q";
}
};
}

View File

@@ -0,0 +1,12 @@
class A {
private Object b = new Inner();
private class <caret>Inner {
private int i=0;
public String toString() {
i++;
return "A";
}
}
}

View File

@@ -0,0 +1,11 @@
class A {
private Object b = new Object() {
private int i=0;
public String toString() {
i++;
return "A";
}
};
}

View File

@@ -0,0 +1,18 @@
class ParentCtor {
public ParentCtor(String s) {
}
}
class <caret>ChildCtor extends ParentCtor {
private static final String CONST = "";
public ChildCtor() {
super(CONST);
}
}
class Usage {
public void test() {
ChildCtor c = new ChildCtor();
}
}

View File

@@ -0,0 +1,12 @@
class ParentCtor {
public ParentCtor(String s) {
}
}
class Usage {
public void test() {
ParentCtor c = new ParentCtor("") {
private static final String CONST = "";
};
}
}

View File

@@ -0,0 +1,18 @@
class A {
public void doTest() {
Object b = new Inner(new Throwable("t"));
}
private class <caret>Inner {
private String myMessage;
public Inner(Throwable t) {
String msg = t.getMessage();
myMessage = msg;
}
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,18 @@
class A {
public void doTest() {
final Throwable t = new Throwable("t");
Object b = new Object() {
private String myMessage;
{
String msg = t.getMessage();
myMessage = msg;
}
public String toString() {
return "A";
}
};
}
}

View File

@@ -0,0 +1,19 @@
class A {
public void doTest() {
Throwable t = new Throwable("q");
Object b = new Inner(new Throwable("t"));
}
private class <caret>Inner {
private String myMessage;
public Inner(Throwable t) {
String msg = t.getMessage();
myMessage = msg;
}
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,19 @@
class A {
public void doTest() {
Throwable t = new Throwable("q");
final Throwable t1 = new Throwable("t");
Object b = new Object() {
private String myMessage;
{
String msg = t1.getMessage();
myMessage = msg;
}
public String toString() {
return "A";
}
};
}
}

View File

@@ -0,0 +1,20 @@
class A {
public void doTest() {
Object b = new Inner(new Throwable("t"));
}
private class <caret>Inner {
private Throwable t;
private String myMessage;
public Inner(Throwable t) {
this.t = t;
String msg = this.t.getMessage();
myMessage = msg;
}
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,19 @@
class A {
public void doTest() {
final Throwable t1 = new Throwable("t");
Object b = new Object() {
private Throwable t = t1;
private String myMessage;
{
String msg = this.t.getMessage();
myMessage = msg;
}
public String toString() {
return "A";
}
};
}
}

View File

@@ -0,0 +1,11 @@
import java.util.*;
class A {
private Inner b = new Inner();
private class <caret>Inner implements Comparator<String> {
public int compare(String s1, String s2) {
return 0;
}
}
}

View File

@@ -0,0 +1,10 @@
import java.util.*;
class A {
private Comparator<String> b = new Comparator<String>() {
public int compare(String s1, String s2) {
return 0;
}
};
}

View File

@@ -0,0 +1,13 @@
public class <caret>AGeneric<T> {
private T myT;
public T getT() {
return myT;
}
public void setT(T t) {
myT = t;
}
}
class Client {
private AGeneric<String> myGen = new AGeneric<String>();
}

View File

@@ -0,0 +1,13 @@
class Client {
private Object myGen = new Object() {
private String myT;
public String getT() {
return myT;
}
public void setT(String t) {
myT = t;
}
};
}

View File

@@ -0,0 +1,17 @@
import java.util.*;
class A {
private AGeneric<Collection> b = new AGeneric<Collection>();
private class <caret>AGeneric<T> {
private T myV;
public <X extends T> void parMethA(X p) {
myV = p;
}
private class Inner<Y extends T> {
private Y myY;
}
}
}

View File

@@ -0,0 +1,16 @@
import java.util.*;
class A {
private Object b = new Object() {
private Collection myV;
public <X extends Collection> void parMethA(X p) {
myV = p;
}
private class Inner<Y extends Collection> {
private Y myY;
}
};
}

View File

@@ -0,0 +1,11 @@
import java.util.*;
class A {
private Inner b = new Inner();
private class <caret>Inner<T> implements Comparator<T> {
public int compare(T s1, T s2) {
return 0;
}
}
}

View File

@@ -0,0 +1,10 @@
import java.util.*;
class A {
private Comparator b = new Comparator() {
public int compare(Object s1, Object s2) {
return 0;
}
};
}

View File

@@ -0,0 +1,11 @@
import java.util.*;
class A {
private Inner<String> b = new Inner<String>();
private class <caret>Inner<T> implements Comparator<T> {
public int compare(T s1, T s2) {
return 0;
}
}
}

View File

@@ -0,0 +1,10 @@
import java.util.*;
class A {
private Comparator<String> b = new Comparator<String>() {
public int compare(String s1, String s2) {
return 0;
}
};
}

View File

@@ -0,0 +1,10 @@
import java.awt.event.*;
class A {
private ActionListener b = new Inner();
private class <caret>Inner implements ActionListener {
public void actionPerformed(ActionEvent e) {
}
}
}

View File

@@ -0,0 +1,9 @@
import java.awt.event.*;
class A {
private ActionListener b = new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
};
}

View File

@@ -0,0 +1,10 @@
class A {
private Inner b = new <caret>Inner();
private Inner b2 = new Inner();
private class Inner {
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,14 @@
class A {
private Inner b = new Object() {
public String toString() {
return "A";
}
};
private Inner b2 = new Inner();
private class Inner {
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,19 @@
import java.io;
class A {
public void test() {
Inlined i = new Inlined();
}
}
class <caret>Inlined {
public class A {
}
private A myA = new A();
public String toString() {
A a = new A();
return a.toString();
}
}

View File

@@ -0,0 +1,18 @@
import java.io;
class A {
public void test() {
Object i = new Object() {
public class A {
}
private A myA = new A();
public String toString() {
A a = new A();
return a.toString();
}
};
}
}

View File

@@ -0,0 +1,11 @@
class A {
public void test() {
class <caret>Inner {
public String toString() {
return "A";
}
}
Object b = new Inner();
}
}

View File

@@ -0,0 +1,10 @@
class A {
public void test() {
Object b = new Object() {
public String toString() {
return "A";
}
};
}
}

View File

@@ -0,0 +1,10 @@
public class A {
private class <caret>Inner {
void doTest() {
}
}
public void test() {
new Inner().doTest();
}
}

View File

@@ -0,0 +1,9 @@
public class A {
public void test() {
new Object() {
void doTest() {
}
}.doTest();
}
}

View File

@@ -0,0 +1,10 @@
public class A {
private class <caret>Inner {
void doTest() {
}
}
public void test() {
(new Inner()).doTest();
}
}

View File

@@ -0,0 +1,9 @@
public class A {
public void test() {
(new Object() {
void doTest() {
}
}).doTest();
}
}

View File

@@ -0,0 +1,13 @@
class A {
private Object b = new Inner();
private class <caret>Inner {
public String toString() {
return getMyStringRepresentation();
}
public String getMyStringRepresentation() {
return "q";
}
}
}

View File

@@ -0,0 +1,12 @@
class A {
private Object b = new Object() {
public String toString() {
return getMyStringRepresentation();
}
public String getMyStringRepresentation() {
return "q";
}
};
}

View File

@@ -0,0 +1,17 @@
class A {
private Object b = new MyException(new Throwable(), "w");
private class <caret>MyException extends Exception {
public MyException(String msg) {
super(msg);
}
public MyException(Throwable t, String msg) {
super(msg, t);
}
public String getMessage() {
return "q";
}
}
}

View File

@@ -0,0 +1,8 @@
class A {
private Object b = new Exception("w", new Throwable()) {
public String getMessage() {
return "q";
}
};
}

View File

@@ -0,0 +1,20 @@
class PrivateInitUser {
public void method() {
new WithPrivateInit(new CustomType("a"));
new WithPrivateInit(new CustomType("b"));
}
public static class CustomType {
public CustomType(String s) {
}
}
}
class <caret>WithPrivateInit {
public WithPrivateInit(PrivateInitUser.CustomType customType) {
privateMethod(customType);
}
private void privateMethod(PrivateInitUser.CustomType customType) {
}
}

View File

@@ -0,0 +1,28 @@
class PrivateInitUser {
public void method() {
final CustomType customType = new CustomType("a");
new Object() {
{
privateMethod(customType);
}
private void privateMethod(CustomType customType) {
}
};
final CustomType customType1 = new CustomType("b");
new Object() {
{
privateMethod(customType1);
}
private void privateMethod(CustomType customType) {
}
};
}
public static class CustomType {
public CustomType(String s) {
}
}
}

View File

@@ -0,0 +1,21 @@
class A {
class <caret>Inner {
private void a() {
}
private void b() {
}
class InnerA {
}
class InnerB {
}
}
}
class B {
public void test() {
A.Inner inner = new A.Inner();
}
}

View File

@@ -0,0 +1,20 @@
class A {
}
class B {
public void test() {
Object inner = new Object() {
private void a() {
}
private void b() {
}
class InnerA {
}
class InnerB {
}
};
}
}

View File

@@ -0,0 +1,13 @@
class A {
private Object b = new Inner();
private Object c = new Object() {
public void doStuff(Inner i) {
}
};
private class <caret>Inner {
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,12 @@
class A {
private Object b = new Object() {
public String toString() {
return "A";
}
};
private Object c = new Object() {
public void doStuff(Object i) {
}
};
}

View File

@@ -0,0 +1,9 @@
class A {
private Object b = new Inner();
public abstract class <caret>Inner {
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,9 @@
class A {
@Inner
public void test() {
}
}
@interface <caret>Inner {
}

View File

@@ -0,0 +1,18 @@
class A {
public void test() {
try {
test2();
}
catch(Inner ex) {
}
}
private void test2() {
}
private class <caret>Inner extends RuntimeException {
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,13 @@
class A {
private Object b = new Inner();
public void test() {
System.out.println(Inner.class.getName());
}
private class <caret>Inner {
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,8 @@
class A {
public void test(Inner b) {
}
}
enum <caret>Inner {
A, B
}

View File

@@ -0,0 +1,13 @@
class A {
public void f() {
Inner i = new Inner();
i.q = 2;
}
private class <caret>Inner implements Runnable {
public int q = 1;
public void run() {
}
}
}

View File

@@ -0,0 +1,8 @@
class A {
public void test(Inner b) {
}
public interface <caret>Inner {
void doStuff();
}
}

View File

@@ -0,0 +1,3 @@
class A {
private <caret>String s = new String();
}

View File

@@ -0,0 +1,11 @@
class A {
public void f() {
Inner i = new Inner();
i.doStuff();
}
private class <caret>Inner {
public void doStuff() {
}
}
}

View File

@@ -0,0 +1,13 @@
import java.awt.event.*;
class A {
private Object b = new Inner();
public class <caret>Inner implements Runnable, ActionListener {
public void run() {
}
public void actionPerformed(ActionEvent e) {
}
}
}

View File

@@ -0,0 +1,10 @@
class <caret>WithInner {
public class Inner {
}
}
class A {
public void test() {
WithInner.Inner i = new WithInner().new Inner();
}
}

View File

@@ -0,0 +1,7 @@
class A {
private class <caret>Inner {
public Inner newInstance() {
return new Inner();
}
}
}

View File

@@ -0,0 +1,15 @@
class A {
private Object b = new MyException();
private class <caret>MyException extends Exception {
public MyException() {
super("w");
if (toString().length() == 0) return;
System.out.println(toString());
}
public String getMessage() {
return "q";
}
}
}

View File

@@ -0,0 +1,11 @@
import java.io;
class A {
public void test() {
Inlined i = new Inlined();
}
}
class <caret>Inlined {
public static final Stream s = System.out;
}

View File

@@ -0,0 +1,17 @@
class A {
private Object b = new Inner();
private class <caret>Inner {
{
// class initializer
}
public String toString() {
return "A";
}
static {
// static initializer
}
}
}

View File

@@ -0,0 +1,12 @@
import java.io;
class A {
public void test() {
Inlined i = new Inlined();
}
}
class <caret>Inlined {
public static class A {
}
}

View File

@@ -0,0 +1,12 @@
import java.io;
class A {
public void test() {
Inlined i = new Inlined();
}
}
class <caret>Inlined {
public static void main() {
}
}

View File

@@ -0,0 +1,11 @@
import java.io;
class A {
public void test() {
Inlined i = new Inlined();
}
}
class <caret>Inlined {
public static String s = "s";
}

View File

@@ -0,0 +1,10 @@
import java.awt.event.*;
class A {
private Object b = new Inner();
public class <caret>Inner extends Throwable implements Runnable {
public void run() {
}
}
}

View File

@@ -0,0 +1,15 @@
class <caret>A {
private int b;
private class B {
private int b;
void doTest() {
b = A.this.b;
}
}
}
class User {
A a = new A();
}

View File

@@ -0,0 +1,19 @@
class A {
public void test() {
try {
test2();
}
catch(Exception ex) {
}
}
private void test2() throws Inner {
throw new Inner();
}
private class <caret>Inner extends Exception {
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,9 @@
class A {
private Object b = new Inner("q");
private class <caret>Inner {
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,12 @@
class A {
private Object b = new Inner();
private class <caret>Inner {
public Inner(int i) {
}
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,9 @@
class A {
private Object b = new Inner("q");
private class <caret>Inner implements Someshit {
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,9 @@
class A {
private Object b = new Inner("q");
private class <caret>Inner extends Someshit {
public String toString() {
return "A";
}
}
}

View File

@@ -0,0 +1,18 @@
class A {
private Object b = new Inner();
private class <caret>Inner {
private String s;
public Inner() {
s=null;
}
public String toString() {
if (s == null) {
s = "q";
}
return "A";
}
}
}

View File

@@ -0,0 +1,13 @@
class A {
private Object b = new Object() {
private String s = null;
public String toString() {
if (s == null) {
s = "q";
}
return "A";
}
};
}

View File

@@ -0,0 +1,14 @@
class Outer {
int i;
class Inner {
public void f() {
int j = i;
}
}
void foo() {
final int i = 0;
new <caret>Inner();
}
}

View File

@@ -0,0 +1,12 @@
class Outer {
int i;
void foo() {
final int i = 0;
new Object() {
public void f() {
int j = Outer.this.i;
}
};
}
}

View File

@@ -0,0 +1,18 @@
class A {
private Object b = new Inner(100);
private class <caret>Inner {
private int myInt = 0;
public Inner() {
}
public Inner(int anInt) {
myInt = anInt;
}
public int getInt() {
return myInt;
}
}
}

View File

@@ -0,0 +1,10 @@
class A {
private Object b = new Object() {
private int myInt = 100;
public int getInt() {
return myInt;
}
};
}

View File

@@ -0,0 +1,19 @@
class A {
class <caret>Inner {
private int myNonStaticField = 0;
class InnerNonStatic {
private int myInsField = 0;
public void insMethod() {
myNonStaticField += myInsField;
}
}
}
}
class B {
public void test() {
A.Inner inner = new A.Inner();
}
}

View File

@@ -0,0 +1,18 @@
class A {
}
class B {
public void test() {
Object inner = new Object() {
private int myNonStaticField = 0;
class InnerNonStatic {
private int myInsField = 0;
public void insMethod() {
myNonStaticField += myInsField;
}
}
};
}
}

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