Bug 371998 - org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Summary: org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 1.7.0   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-19 15:42 EST by Jad Naous CLA
Modified: 2012-03-02 11:20 EST (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 Jad Naous CLA 2012-02-19 15:42:42 EST
Build Identifier: 20110916-0149

Using:

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.DeclareParents;

@Aspect
public class AspectTest {
    
    private interface X {}
    private static class XImpl {}

    @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable",  defaultImpl=XImpl.class)
    private X xImpl;
  
}


Throws:

org.aspectj.weaver.BCException
at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312)
at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121)
at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746)
at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384)
at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar;

Current workaround is to use multiple DeclareParents annotations on different variables.

Reproducible: Always

Steps to Reproduce:
1. Create new class given the code in the details.
2. Save and compile in Eclipse.
Comment 1 Andrew Clement CLA 2012-03-02 11:20:23 EST
fixed.  avoid secondary resolve.  Only happens for non simple patterns where there is a tree structure of patterns (in this case an Or node with two children).