Bug 272233 - AspectJ Internal Compiler Error-BCException for generic type array in pointcut
Summary: AspectJ Internal Compiler Error-BCException for generic type array in pointcut
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.6.5   Edit
Assignee: Tools PMC Bugzilla inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-14 21:08 EDT by John White CLA
Modified: 2009-04-30 16:46 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John White CLA 2009-04-14 21:08:33 EDT
Build ID: M20090211-1700

Steps To Reproduce:

1. Create Aspect
2. Specify pointcut: 

@Pointcut("execution(!void<?>[] *(..))") 
void pointCutError() {}

3. Save/Build


More information:

org.aspectj.weaver.BCException
at org.aspectj.weaver.ResolvedType.getGenericType(ResolvedType.java:1956)
at org.aspectj.weaver.patterns.WildTypePattern.verifyTypeParameters(WildTypePattern.java:945)
at org.aspectj.weaver.patterns.WildTypePattern.resolveParameterizedType(WildTypePattern.java:819)
at org.aspectj.weaver.patterns.WildTypePattern.resolveBindingsForExactType(WildTypePattern.java:765)
at org.aspectj.weaver.patterns.WildTypePat ... unmscapi.jar;C:\Program Files\Java\jdk1.6.0_12\jre\lib\ext\sunpkcs11.jar;C:\eclipse\\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar;

I was try to use @Pointcut("execution(!void *(..))") to advise:

public Collection<?>[] getCollectionArray() {
	return collectionArray;
}

But the pointcut failed to pickout the desired join point. 

Changing the pointcut to @Pointcut("execution(!void[] *(..))") also fails to pickout the join point. 

@Pointcut("execution(!void<?>[] *(..))") and @Pointcut("execution(!void<?> *(..))") both lead to internal compiler errors.
Comment 1 Andrew Clement CLA 2009-04-14 23:54:27 EDT
i'll grab that bug
Comment 2 Andrew Clement CLA 2009-04-16 15:17:35 EDT
BCException is now fixed.  Additionally:

@Pointcut("execution(!void *(..))") works for me.

@Pointcut("execution(!void[] *(..))") also works for me.

---
import java.util.*;
import org.aspectj.lang.annotation.*;

@Aspect 
class Iffy2 {

  @Before("execution(!void[] *(..))") 
  public void advice1() {}

  @Before("execution(!void[] *(..))") 
  public void advice2() {}

  public Collection<?>[] getCollectionArray() {
        return null;
  }
}

---
ajc -1.5 -showWeaveInfo Iffy2.java
Join point 'method-execution(java.util.Collection[] Iffy2.getCollectionArray())' in Type 'Iffy2' (Iffy2.java:13) advised by before advice from 'Iffy2' (Iffy2.java:11)

Join point 'method-execution(java.util.Collection[] Iffy2.getCollectionArray())' in Type 'Iffy2' (Iffy2.java:13) advised by before advice from 'Iffy2' (Iffy2.java:8)

What is different in your scenario from what I show above?
Comment 3 Andrew Clement CLA 2009-04-30 16:46:49 EDT
fixed the exception - please reopen if you still have trouble writing the pointcut.