Sfoglia il codice sorgente

fix for Bugzilla Bug 71723

 	Inconsistency in scoping of protected members in ITDs
tags/V1_2_1
acolyer 20 anni fa
parent
commit
dfb15c1777

BIN
org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip Vedi File


BIN
org.eclipse.jdt.core/jdtcore-for-aspectj.jar Vedi File


+ 36
- 0
tests/bugs/pr71723/bar/Bar.aj Vedi File

@@ -0,0 +1,36 @@
package bar;

import foo.Foo;

aspect Bar {
public void Foo.doing() {
try {
System.out.println(i()); // CE L8
System.out.println(ancientI()); // CE L9
System.out.println(ancientJ()); // CE L10
System.out.println(this.clone()); // CE L11
System.out.println(clone()); // CE L12
}
catch(Throwable t) { }
}
before(Foo f) : call(* doStuff(..)) && target(f) {
f.doing();
}
}


privileged aspect PBar {
public void Foo.doingMore() {
try {
System.out.println(i());
System.out.println(ancientI());
System.out.println(ancientJ());
}
catch(Throwable t) { }
}
before(Foo f) : call(* doStuff(..)) && target(f) {
f.doing();
}
}



+ 17
- 0
tests/bugs/pr71723/foo/Foo.java Vedi File

@@ -0,0 +1,17 @@
package foo;



public class Foo extends AncientFoo {
protected int i() { return 42; }
public static void main(String[] args) {
new Foo().doStuff();
}
public void doStuff() { }
protected int ancientI() { return 42; }
}

class AncientFoo {
protected int ancientI() { return -42; }
protected int ancientJ() { return 0; }
}

+ 4
- 1
tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java Vedi File

@@ -236,10 +236,13 @@ public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// s.indexOf("CAUSE=org.aspectj.lang.NoAspectBoundException")!=-1);
}
public void test044_ITDnameClashes() {
runTest("ITD name clashes with private members");
}
public void test045_ITDprotectedVisibility() {
runTest("Inconsistency in scoping of protected members in ITDs");
}
}


+ 10
- 0
tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml Vedi File

@@ -345,3 +345,13 @@
</compile>
</ajc-test>

<ajc-test dir="bugs/pr71723" pr="71723"
title="Inconsistency in scoping of protected members in ITDs">
<compile files="foo/Foo.java,bar/Bar.aj">
<message kind="error" line="8" text="The method i() from the type Foo is not visible"/>
<message kind="error" line="9" text="The method ancientI() from the type Foo is not visible"/>
<message kind="error" line="10" text="The method ancientJ() from the type AncientFoo is not visible"/>
<message kind="error" line="11" text="The method clone() from the type Object is not visible"/>
<message kind="error" line="12" text="The method clone() from the type Object is not static"/>
</compile>
</ajc-test>

Loading…
Annulla
Salva