ソースを参照

357012/357013

tags/V1_6_12
aclement 12年前
コミット
6398f8e61d

+ 4
- 5
tests/bugs1612/prx/C.java ファイルの表示

@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@interface Anno { @interface Anno {
Class value(); Class value();
//int i();
} }


public class C { public class C {


@Anno(String.class) @Anno(String.class)
//@Anno(i=3)
public int i; public int i;


@Anno(Integer.class)
public int j;

public static void main(String []argv) { public static void main(String []argv) {
System.out.println(new C().i); System.out.println(new C().i);
System.out.println(new C().j);
} }
} }

aspect X { aspect X {
//before(): get(@Anno(String.class) * *(..)) {}
before(): get(@Anno(value=String.class) * *) {} before(): get(@Anno(value=String.class) * *) {}
//before(): get(@Anno(i=3) * *) {}
} }

+ 11
- 4
tests/bugs1612/prx/D.java ファイルの表示

int i(); int i();
} }


public class C {
public class D {


@Anno(i=3) @Anno(i=3)
public int i; public int i;


@Anno(i=4)
public int j;

@Anno(i=5)
public int k;

public static void main(String []argv) { public static void main(String []argv) {
System.out.println(new C().i);
System.out.println(new D().i);
System.out.println(new D().j);
System.out.println(new D().k);
} }
} }

aspect X { aspect X {
before(): get(@Anno(i!=3) * *) {}
before(): get(@Anno(i!=5) * *) {}
} }

+ 23
- 0
tests/bugs1612/prx/E.java ファイルの表示

import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME)
@interface Anno {
Class value() default String.class;
}

public class E {

@Anno
public int i;

@Anno(Integer.class)
public int j;

public static void main(String []argv) {
System.out.println(new E().i);
System.out.println(new E().j);
}
}
aspect X {
before(): get(@Anno(value=String.class) * *) {}
}

+ 27
- 0
tests/bugs1612/prx/F.java ファイルの表示

import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME)
@interface Anno {
Class i() default Number.class;
}

public class F {

@Anno(i=Integer.class)
public int i;

@Anno
public int j;

@Anno(i=String.class)
public int k;

public static void main(String []argv) {
System.out.println(new F().i);
System.out.println(new F().j);
System.out.println(new F().k);
}
}
aspect X {
before(): get(@Anno(i!=String.class) * *) {}
}

+ 23
- 0
tests/bugs1612/prx/G.java ファイルの表示

import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME)
@interface Anno {
Class value();
}

public class G {

@Anno(String.class)
public int i;

@Anno(Integer.class)
public int j;

public static void main(String []argv) {
System.out.println(new G().i);
System.out.println(new G().j);
}
}
aspect X {
before(): get(@Anno(value=Foo.class) * *) {}
}

+ 15
- 3
tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java ファイルの表示

// runTest("itd split compilation"); // runTest("itd split compilation");
// } // }


public void testClassRef() throws Exception {
public void testNotEqualWithAnnotationValues_357013() throws Exception {
runTest("annotation values not equal");
}

public void testNotEqualWithAnnotationValues_357013_2() throws Exception {
runTest("annotation values not equal 2");
}

public void testClassRef_357012() throws Exception {
runTest("class reference in annotation value"); runTest("class reference in annotation value");
} }


public void testClassRef2() throws Exception {
runTest("class reference in annotation value 2");
public void testClassRefInvalidName_357012_2() throws Exception {
runTest("class reference in annotation value - invalid typename");
}

public void testClassRef_357012_3() throws Exception {
runTest("class reference in annotation value 3");
} }


public void testAnnotationFieldBindingOptimization_356612() throws Exception { public void testAnnotationFieldBindingOptimization_356612() throws Exception {

+ 32
- 3
tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml ファイルの表示

<suite> <suite>


<ajc-test dir="bugs1612/prx" title="class reference in annotation value"> <ajc-test dir="bugs1612/prx" title="class reference in annotation value">
<compile files="C.java" options="-1.5"/>
<compile files="C.java" options="-1.5 -showWeaveInfo">
<message kind="weave" text="Join point 'field-get(int C.i)' in Type 'C' (C.java:17) advised by before advice from 'X' (C.java:22)"/>
</compile>
<run class="C"> <run class="C">
</run> </run>
</ajc-test> </ajc-test>


<ajc-test dir="bugs1612/prx" title="class reference in annotation value 2">
<compile files="D.java" options="-1.5"/>
<ajc-test dir="bugs1612/prx" title="annotation values not equal">
<compile files="D.java" options="-1.5 -showWeaveInfo">
<message kind="weave" text="Join point 'field-get(int D.i)' in Type 'D' (D.java:20) advised by before advice from 'X' (D.java:26)"/>
<message kind="weave" text="Join point 'field-get(int D.j)' in Type 'D' (D.java:21) advised by before advice from 'X' (D.java:26)"/>
</compile>
<run class="D"> <run class="D">
</run> </run>
</ajc-test> </ajc-test>


<ajc-test dir="bugs1612/prx" title="class reference in annotation value 3">
<compile files="E.java" options="-1.5 -showWeaveInfo">
<message kind="weave" text="Join point 'field-get(int E.i)' in Type 'E' (E.java:17) advised by before advice from 'X' (E.java:22)"/>
</compile>
<run class="E">
</run>
</ajc-test>

<ajc-test dir="bugs1612/prx" title="annotation values not equal 2">
<compile files="F.java" options="-1.5 -showWeaveInfo">
<message kind="weave" text="Join point 'field-get(int F.i)' in Type 'F' (F.java:20) advised by before advice from 'X' (F.java:26)"/>
<message kind="weave" text="Join point 'field-get(int F.j)' in Type 'F' (F.java:21) advised by before advice from 'X' (F.java:26)"/>
</compile>
<run class="F">
</run>
</ajc-test>


<ajc-test dir="bugs1612/prx" title="class reference in annotation value - invalid typename">
<compile files="G.java" options="-1.5 -showWeaveInfo">
<message kind="weave" text="Join point 'field-get(int C.i)' in Type 'C' (C.java:17) advised by before advice from 'X' (C.java:22)"/>
</compile>
</ajc-test>

<ajc-test dir="bugs1612/pr356612" title="annotation field binding optimization"> <ajc-test dir="bugs1612/pr356612" title="annotation field binding optimization">
<compile files="AnnoBinding.java" options="-1.5"/> <compile files="AnnoBinding.java" options="-1.5"/>
<run class="AnnoBinding"> <run class="AnnoBinding">

読み込み中…
キャンセル
保存