Bug 107059

Summary: parser crashes on call(void (@a *)(..)
Product: [Tools] AspectJ Reporter: Samuel Gélineau <gelisam>
Component: CompilerAssignee: Adrian Colyer <adrian.colyer>
Status: REOPENED --- QA Contact:
Severity: normal    
Priority: P5    
Version: DEVELOPMENT   
Target Milestone: 1.5.0 M4   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Samuel Gélineau CLA 2005-08-15 15:37:18 EDT
public aspect Bug {
  before() : call(void (@a *)(..)) {
  }
}

/home/user/sgelin3/dev/java/ajc/new_bug/Bug.java [error] Internal compiler error
java.lang.RuntimeException: bad name:
[Lorg.aspectj.weaver.patterns.NamePattern;@530cf2
        at
org.aspectj.weaver.patterns.WildTypePattern.maybeGetCleanName(WildTypePattern.java:507)
        at
org.aspectj.weaver.patterns.WildTypePattern.resolveBindings(WildTypePattern.java:566)
        at
org.aspectj.weaver.patterns.SignaturePattern.resolveBindings(SignaturePattern.java:79)


not that the pointcut causing the crash is incorrect abd should produce an
error. the actual pointcut I intended to write was
  before() : call(void (@a *).*(..)) {}
which works fine.
Comment 1 Adrian Colyer CLA 2005-08-16 05:30:45 EDT
fix checked into tree, awaiting build.
Comment 2 Samuel Gélineau CLA 2005-08-17 16:10:11 EDT
target(@a *) also causes ajc to crash, does your change fix this too?
Comment 3 Adrian Colyer CLA 2005-08-18 05:39:04 EDT
yes.....

but ;)

it fixes the parser problem, but exposed an unrelated problem whereby we allowed
an "any" type pattern with annotation specified to slip through the net when
resolving a pattern and requiring an exact type.

The correct behaviour for target(@Foo *) is to issue an error saying that an
exact type name must be used with target.

The compiler now does this.
Comment 4 Samuel Gélineau CLA 2005-08-19 18:27:52 EDT
why such a strict requirement? you could check for the attribute at runtime.
Comment 5 Adrian Colyer CLA 2005-08-20 07:25:36 EDT
pointcuts with binding forms have never allowed patterns (what type should the
bound variable have?). If you want to match any target type but with a certain
annotation you can use @target instead which does exactly this.
Comment 6 Alexandre Vasseur CLA 2005-09-27 09:29:52 EDT
M4
Comment 7 Alexandre Vasseur CLA 2005-09-27 09:30:08 EDT
wups
Comment 8 Alexandre Vasseur CLA 2005-09-27 09:31:22 EDT
wups
Comment 9 Eclipse Webmaster CLA 2009-08-30 02:48:31 EDT
LATER/REMIND bugs are being automatically reopened as P5 because the LATER and REMIND resolutions are deprecated.