@@ -0,0 +1,20 @@ | |||
interface Generic<T> { | |||
void non_generic(String i); | |||
void generic(T t); | |||
} | |||
public class pr102357 implements Generic<String> { | |||
public static void main(String[] args) { | |||
new pr102357().non_generic("works"); | |||
new pr102357().generic("works"); | |||
Generic<String> generic = new pr102357(); | |||
generic.non_generic("works"); | |||
generic.generic("AbstractMethodError"); | |||
} | |||
} | |||
aspect Injector { | |||
public void pr102357.non_generic(String s) {} | |||
public void pr102357.generic(String s) {} | |||
} |
@@ -0,0 +1,16 @@ | |||
abstract class A {} | |||
class B extends A {} | |||
aspect X { | |||
abstract String A.getName(); | |||
public String B.getName() { return "B"; } | |||
public String A.toString() { return getName(); } | |||
} | |||
public class Trouble { | |||
public static void main(String[] args) { | |||
System.out.println(new B()); | |||
} | |||
} |
@@ -0,0 +1,22 @@ | |||
class A { | |||
int x = 1; | |||
class B { | |||
} | |||
B b = new B(); | |||
} | |||
aspect Aspect { | |||
int A.B.foo() { | |||
class C { | |||
int bar() { return A.this.x;} | |||
} | |||
return new C().bar(); | |||
} | |||
} | |||
public class MissingAccessor { | |||
public static void main(String[] args) { | |||
A a = new A(); | |||
System.out.println(a.b.foo()); | |||
} | |||
} |
@@ -0,0 +1,21 @@ | |||
aspect Aspect { | |||
int A.B.foo() { | |||
class C { | |||
int bar() { return A.this.x;} | |||
} | |||
return new C().bar(); | |||
} | |||
} | |||
class A { | |||
int x = 1; | |||
class B { } | |||
B b = new B(); | |||
} | |||
public class MissingAccessor2 { | |||
public static void main(String[] args) { | |||
A a = new A(); | |||
System.out.println(a.b.foo()); | |||
} | |||
} |
@@ -0,0 +1,33 @@ | |||
class MyClass { | |||
protected Object method() { | |||
return null; | |||
} | |||
} | |||
abstract aspect A { | |||
interface C2 { } | |||
public void C2.hello() { | |||
new MyClass() { | |||
protected Object methodX() { | |||
return | |||
//super. | |||
method(); | |||
} | |||
}; | |||
} | |||
// ok | |||
class C { } | |||
public void C.hello() { | |||
new MyClass() { | |||
protected Object methodX() { | |||
return super.method(); | |||
} | |||
}; | |||
} | |||
} | |||
@@ -0,0 +1,15 @@ | |||
class Base { | |||
public int x; | |||
} | |||
aspect ExtendBase { | |||
public ExtendBase() {} | |||
// private int ExtendBase.x; | |||
declare parents: Y extends ExtendBase; | |||
} | |||
class Y extends Base { | |||
public void foo() { | |||
System.out.println(x); | |||
} | |||
} |