This commit is contained in:
Dmitry Jemerov
2009-09-11 16:21:24 +04:00
parent 813f3538dd
commit 8b0e19eb68
45 changed files with 6 additions and 0 deletions
@@ -0,0 +1,8 @@
package p;
class A {
public void test() {
B b = new B();
}
}
@@ -0,0 +1,7 @@
package p;
class B {
B() {
System.out.println("Constructor");
}
}
@@ -0,0 +1,13 @@
package p;
class A {
public void test() {
B b = new B();
}
private class B {
private B() {
System.out.println("Constructor");
}
}
}
@@ -0,0 +1,5 @@
package p;
class A {
int foo(){}
}
@@ -0,0 +1,10 @@
package p;
class B extends S{
private A a;
public B(A a) {
super(a.foo());
this.a = a;
}
}
@@ -0,0 +1,5 @@
package p;
class S {
public S(int i){}
}
@@ -0,0 +1,10 @@
package p;
class A {
int foo(){}
private class B extends S{
public B() {
super(A.this.foo());
}
}
}
@@ -0,0 +1,5 @@
package p;
class S {
public S(int i){}
}
@@ -0,0 +1,4 @@
package p;
public class A {
}
@@ -0,0 +1,4 @@
package p;
public enum E {
}
@@ -0,0 +1,7 @@
package p2;
import p.E;
public class U {
E myE;
}
@@ -0,0 +1,6 @@
package p;
public class A {
public enum E {
}
}
@@ -0,0 +1,7 @@
package p2;
import static p.A.E;
public class U {
E myE;
}
@@ -0,0 +1,4 @@
package pack1;
public class Inner {
}
@@ -0,0 +1,6 @@
package pack1;
public class Outer {
// pack1.Inner
}
@@ -0,0 +1 @@
pack1.Inner
@@ -0,0 +1,8 @@
package pack1;
public class Outer {
// pack1.Outer.Inner
public class Inner {
}
}
@@ -0,0 +1 @@
pack1.Outer.Inner
@@ -0,0 +1,12 @@
package pack1;
public class Client {
public static void main(String[] args) {
StaticInner staticInner = new StaticInner();
StaticInner.NonStaticInnerInner nonStaticInnerInner
= staticInner.new NonStaticInnerInner("Joe");
System.out.println(nonStaticInnerInner.toString());
}
}
@@ -0,0 +1,15 @@
package pack1;
public class StaticInner {
public class NonStaticInnerInner {
private String name;
public NonStaticInnerInner(String name) {
this.name = name;
}
public String toString() {
return name;
}
}
}
@@ -0,0 +1,4 @@
package pack1;
public class TopLevel {
}
@@ -0,0 +1,12 @@
package pack1;
public class Client {
public static void main(String[] args) {
TopLevel.StaticInner staticInner = new TopLevel.StaticInner();
TopLevel.StaticInner.NonStaticInnerInner nonStaticInnerInner
= staticInner.new NonStaticInnerInner("Joe");
System.out.println(nonStaticInnerInner.toString());
}
}
@@ -0,0 +1,17 @@
package pack1;
public class TopLevel {
public static class StaticInner {
public class NonStaticInnerInner {
private String name;
public NonStaticInnerInner(String name) {
this.name = name;
}
public String toString() {
return name;
}
}
}
}
@@ -0,0 +1,4 @@
package xxx;
public class Inner {
}
@@ -0,0 +1,8 @@
package xxx;
public class Outer {
{
Inner inner = new Inner();
}
}
@@ -0,0 +1,10 @@
package xxx;
public class Outer {
{
Inner inner = new Inner();
}
public class Inner {
}
}
@@ -0,0 +1,9 @@
package xxx;
class Inner {
private Outer outer;
public Inner(Outer outer) {
this.outer = outer;
}
}
@@ -0,0 +1,7 @@
package xxx;
class Outer {
{
Object o = new Inner;
}
}
@@ -0,0 +1,9 @@
package xxx;
class Outer {
class Inner {
}
{
Object o = new Inner;
}
}
@@ -0,0 +1,4 @@
package p;
public class A extends X {
}
@@ -0,0 +1,13 @@
package p;
public class B extends X {
{
method();
}
private A outer;
public B(A outer) {
this.outer = outer;
}
}
@@ -0,0 +1,5 @@
package p;
public class X {
void method();
}
@@ -0,0 +1,9 @@
package p;
public class A extends X {
public class B extends X {
{
method();
}
}
}
@@ -0,0 +1,5 @@
package p;
public class X {
void method();
}
@@ -0,0 +1,8 @@
package package1;
import package2.InnerClass;
public class OuterClass {
private InnerClass instance = new InnerClass();
}
@@ -0,0 +1,3 @@
package package2;
public class InnerClass { }
@@ -0,0 +1,7 @@
package package1;
public class OuterClass {
private InnerClass instance = new InnerClass();
private static class InnerClass { }
}
@@ -0,0 +1,4 @@
package pack1;
public class Inner {
}
@@ -0,0 +1,4 @@
package pack1;
public class Outer {
}
@@ -0,0 +1 @@
<x>pack1.Inner</x>
@@ -0,0 +1,6 @@
package pack1;
public class Outer {
public static class Inner {
}
}
@@ -0,0 +1 @@
<x>pack1.Outer$Inner</x>