aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs1919/github_24/FuzzilyMatchingAspect.aj
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs1919/github_24/FuzzilyMatchingAspect.aj')
-rw-r--r--tests/bugs1919/github_24/FuzzilyMatchingAspect.aj26
1 files changed, 20 insertions, 6 deletions
diff --git a/tests/bugs1919/github_24/FuzzilyMatchingAspect.aj b/tests/bugs1919/github_24/FuzzilyMatchingAspect.aj
index d7c32a70a..b40c13c62 100644
--- a/tests/bugs1919/github_24/FuzzilyMatchingAspect.aj
+++ b/tests/bugs1919/github_24/FuzzilyMatchingAspect.aj
@@ -1,25 +1,39 @@
public aspect FuzzilyMatchingAspect {
- after() : execution(public MaybeMissing* MaybeMissing*.*()) {
+
+ pointcut returnRefTypeSimpleOrArray() : execution(public MaybeMissing* MaybeMissing*.*());
+ pointcut return1DimRefTypeArray() : execution(public MaybeMissing*[] MaybeMissing*.*());
+ pointcut return2DimRefTypeArray() : execution(public MaybeMissing*[][] MaybeMissing*.*());
+
+ // Return type 'MaybeMissing*' also matches array types due to the '*' at the end.
+ // Therefore, explicitly exclude array pointcuts in order to only match the method returning the simple type.
+ after() : returnRefTypeSimpleOrArray() && !return1DimRefTypeArray() && !return2DimRefTypeArray() {
System.out.println(thisJoinPoint);
}
- after() : execution(public MaybeMissing*[] MaybeMissing*.*()) {
+ after() : return1DimRefTypeArray() {
System.out.println(thisJoinPoint);
}
- after() : execution(public MaybeMissing*[][] MaybeMissing*.*()) {
+ after() : return2DimRefTypeArray() {
System.out.println(thisJoinPoint);
}
- after() : execution(public in* MaybeMissing*.*()) {
+ pointcut returnPrimitiveTypeSimpleOrArray() : execution(public in* MaybeMissing*.*());
+ pointcut return1DimPrimitiveTypeArray() : execution(public in*[] MaybeMissing*.*());
+ pointcut return2DimPrimitiveTypeArray() : execution(public in*[][] MaybeMissing*.*());
+
+ // Return type 'in*' also matches array types due to the '*' at the end.
+ // Therefore, explicitly exclude array pointcuts in order to only match the method returning the simple type.
+ after() : returnPrimitiveTypeSimpleOrArray() && !return1DimPrimitiveTypeArray() && !return2DimPrimitiveTypeArray() {
System.out.println(thisJoinPoint);
}
- after() : execution(public in*[] MaybeMissing*.*()) {
+ after() : return1DimPrimitiveTypeArray() {
System.out.println(thisJoinPoint);
}
- after() : execution(public in*[][] MaybeMissing*.*()) {
+ after() : return2DimPrimitiveTypeArray() {
System.out.println(thisJoinPoint);
}
+
}