Bug 209831 - ExactAnnotationTypePattern.java:56
Summary: ExactAnnotationTypePattern.java:56
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.0 M2   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-14 11:26 EST by tomasz CLA
Modified: 2008-02-20 22:19 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomasz CLA 2007-11-14 11:26:05 EST
AJDT Version: 1.4.2.200705221209
AspectJ version: 1.5.4.200705211336

I try compile sht like:

public aspect ExactAnnotationTypePatternBug {
  
  before(Throwable e) : handler(Throwable+)  && args(e) && !args(@NoDefaultHandler Throwable+) {

  }
}


@Retention(RetentionPolicy.CLASS)
@Target(ElementType.PARAMETER)
public @interface NoDefaultHandler {
}

public class Test {

  /**
   * @param args
   */
  public static void main(String[] args) {
    // TODO Auto-generated method stub

  }
  
  private void th() throws Throwable {
    throw new Throwable();
  }
  
  private void test() {
    try {
      th();
    } catch (Throwable e) {
      
    }
  }

}

result:


java.lang.IllegalStateException
at org.aspectj.weaver.patterns.ExactAnnotationTypePattern.getResolvedAnnotationType(ExactAnnotationTypePattern.java:56)
at org.aspectj.weaver.patterns.ExactAnnotationTypePattern.matches(ExactAnnotationTypePattern.java:76)
at org.aspectj.weaver.patterns.ExactTypePattern.matchesInstanceof(ExactTypePattern.java:141)
at org.aspectj.weaver.patterns.TypePattern.matches(TypePattern.java:140)
at org.aspectj.weave ... RE_1   (line 19)
    |           L0: RETURN   (line 22)
    method-execution(void Test.test())
  end private void test()

end public class Test
Comment 1 Andrew Clement CLA 2008-02-20 22:19:11 EST
fix committed - thanks for the clear testcase.  Will appear in an AspectJ dev build shortly and probably in an AJDT build at the end of the week.