Skip to content

Commit

Permalink
Comment on newly pointcut parsing found problem in test class
Browse files Browse the repository at this point in the history
A pointcut like

  execution(*..Collection<?>[] *(..))

leads to an AJ core dump, which is something I noticed while fixing a
test in the previous commit. I am going to create a new issue for it and
link to this commit later.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
  • Loading branch information
kriegaex committed Jan 15, 2023
1 parent 43cb1e2 commit 5383736
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/bugs165/pr272233/Iffy2.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,31 @@ public void advice4() {}
@Before("execution(java.util.Collection<?>[] *(..))")
public void advice5() {}

/**
* TODO: This pointcut is not parsed correctly. Obviously, the combination of
* '*' and '&lt;?&gt;' leads to an AJ core dump with this error message:
* <p>
* <code>
* org.aspectj.weaver.BCException: malformed org.aspectj.weaver.PointcutDeclaration attribute (length:219)
* org.aspectj.weaver.BCException: Bad type signature *
* at org.aspectj.weaver.AjAttribute.read(AjAttribute.java:137)
* at org.aspectj.weaver.bcel.Utility.readAjAttributes(Utility.java:102)
* at org.aspectj.weaver.bcel.BcelMethod.unpackAjAttributes(BcelMethod.java:197)
* at org.aspectj.weaver.bcel.BcelMethod.&lt;init&gt;(BcelMethod.java:91)
* at org.aspectj.weaver.bcel.BcelObjectType.getDeclaredMethods(BcelObjectType.java:290)
* at org.aspectj.weaver.ReferenceType.getDeclaredMethods(ReferenceType.java:870)
* at org.aspectj.weaver.ResolvedType.getDeclaredAdvice(ResolvedType.java:1028)
* at org.aspectj.weaver.ResolvedType.getDeclaredShadowMungers(ResolvedType.java:1068)
* at org.aspectj.weaver.ResolvedType.collectShadowMungers(ResolvedType.java:868)
* at org.aspectj.weaver.ResolvedType.collectCrosscuttingMembers(ResolvedType.java:794)
* at org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect(CrosscuttingMembersSet.java:112)
* at org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect(CrosscuttingMembersSet.java:67)
* at org.aspectj.weaver.bcel.BcelWeaver.prepareForWeave(BcelWeaver.java:512)
* </code>
*/
//@Before("execution(*..Collection<?>[] *(..))")
public void advice6() {}

public Collection<?>[] getCollectionArray() {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
<message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:14)"/>
<message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:17)"/>
<message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:20)"/>
<!-- TODO: Activate 'Iffy2.advice6()' pointcut after pointcut parsing problem has been fixed. -->
<!--<message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:XX)"/>-->
</compile>
</ajc-test>

Expand Down

0 comments on commit 5383736

Please sign in to comment.