Bug 37739 - Unexpected Xlint:unresolvableMember warning with withincode
Summary: Unexpected Xlint:unresolvableMember warning with withincode
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-15 21:20 EDT by Frank Hunleth CLA
Modified: 2003-05-19 14:12 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Hunleth CLA 2003-05-15 21:20:16 EDT
The following code produces an Xlint:unresolvableMember warning:

class A {
    A(Class type) {}

    A() {
        this(String.class);
    }
}

class B {

    public void test() {
    }

    public void test2() {
        test();
    }
}

aspect C {
    void around() :
        (call (void B.test()) &&
         withincode (void B.test2())) {
        proceed();
    }
}

The warning text is:

Warning.java:22 can not resolve this member:
void A.<catch>(java.lang.ClassNotFoundException) [Xlint:unresolvableMember]

Line 22 is the line in the aspect that says "withincode".  If I comment out 
the aspect, the warning goes away.  Also, if I comment out A's default 
constructor, it goes away.  The "String.class" seems to have something to do 
with the warning.  

I can reproduce this with 1.1rc1 and 1.1rc2.
Comment 1 Jim Hugunin CLA 2003-05-19 14:12:35 EDT
fixed in cvs, test in bugs/CatchSig.java

This issue is with any code in the special pre-initialization position.  This 
is code that runs in a constructor before either this or super has been 
called.  This code doesn't have an enclosing execution join point because it 
is defined to run before constructor execution starts.  The String.class 
reference in class A is in this position and includes both method calls and an 
exception handler under AspectJ-1.1.