@@ -0,0 +1,41 @@ | |||
import java.lang.annotation.*; | |||
enum Store {YES,NO;} | |||
@Retention(RetentionPolicy.RUNTIME) | |||
@interface SearchableProperty { Store store(); } | |||
public class FieldJP { | |||
@SearchableProperty(store=Store.YES) | |||
public static int fieldOne; | |||
@SearchableProperty(store=Store.NO) | |||
public static int fieldTwo; | |||
public static int fieldThree; | |||
public static void main(String[] args) { | |||
System.err.println("fone="+fieldOne); | |||
System.err.println("ftwo="+fieldTwo); | |||
System.err.println("fthr="+fieldThree); | |||
fieldOne = 5; | |||
fieldTwo = 6; | |||
fieldThree = 7; | |||
} | |||
} | |||
aspect X { | |||
before(): get(@SearchableProperty(store=Store.YES) * *) { | |||
System.err.println("get of YES field"); | |||
} | |||
before(): get(@SearchableProperty(store=Store.NO) * *) { | |||
System.err.println("get of NO field"); | |||
} | |||
before(): set(@SearchableProperty(store=Store.YES) * *) { | |||
System.err.println("set of YES field"); | |||
} | |||
before(): set(@SearchableProperty(store=Store.NO) * *) { | |||
System.err.println("set of NO field"); | |||
} | |||
} |
@@ -19,6 +19,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase; | |||
public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | |||
// AspectJ1.6.1 | |||
public void testFieldJoinpointsAndAnnotationValues_pr227993() { runTest("field jp anno value"); } | |||
public void testGenericsBoundsDecp_pr231187() { runTest("generics bounds decp"); } | |||
public void testGenericsBoundsDecp_pr231187_2() { runTest("generics bounds decp - 2"); } | |||
public void testLtwInheritedCflow_pr230134() { runTest("ltw inherited cflow"); } |
@@ -3,6 +3,22 @@ | |||
<!-- AspectJ v1.6.1 Tests --> | |||
<suite> | |||
<ajc-test dir="bugs161/pr227993" title="field jp anno value"> | |||
<compile files="FieldJP.java" options="-1.5"/> | |||
<run class="FieldJP"> | |||
<stderr> | |||
<line text="get of YES field"/> | |||
<line text="fone=0"/> | |||
<line text="get of NO field"/> | |||
<line text="ftwo=0"/> | |||
<line text="fthr=0"/> | |||
<line text="set of YES field"/> | |||
<line text="set of NO field"/> | |||
</stderr> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="bugs161/pr231187x" title="generics bounds decp"> | |||
<compile files="Cement.java ConcreteClass.java SuperClass.java SuperClassAspect.aj WetCement.java Main.java" options="-1.5"/> | |||
<run class="concrete.Main"> |