Browse Source

new test programs for bug reports.

tags/preDefaultReweavable
aclement 18 years ago
parent
commit
d83a207c95

+ 20
- 0
tests/bugs150/pr102357.java View File

@@ -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) {}
}

+ 16
- 0
tests/bugs150/pr72834/Trouble.java View File

@@ -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());
}
}

+ 22
- 0
tests/bugs150/pr73856/MissingAccessor.java View File

@@ -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());
}
}

+ 21
- 0
tests/bugs150/pr73856/MissingAccessor2.java View File

@@ -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());
}
}

+ 33
- 0
tests/bugs150/pr90143/A.aj View File

@@ -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();
}
};
}
}


+ 15
- 0
tests/bugs150/pr92311.aj View File

@@ -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);
}
}

Loading…
Cancel
Save