[Bug 23] New: declare parents/protected access/inner classes

From: <abc-bugs@comlab.ox.ac.uk>
Date: Thu Sep 23 2004 - 20:17:34 BST

http://abc.comlab.ox.ac.uk/cgi-bin/bugzilla/show_bug.cgi?id=23

           Summary: declare parents/protected access/inner classes
           Product: abc
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: AspectJ compiler
        AssignedTo: abc-bugs@comlab.ox.ac.uk
        ReportedBy: olhotak@sable.mcgill.ca

This bug seems to require a combination of all three of declare
parents/protected access/inner classes. Consider the following code:

public class A {
    public A() {
        super();
    }
}

package bar;
public class C {
    protected static class D {
        public D() {
        }
    }
}
aspect B {
    declare parents: A extends bar.C.D;
}

ajc compiles it fine. abc fails with the error:
A.java:3: No valid constructor found for bar.C.D().
        super();
        ^------^

1 error.
Compiler failed.

Note that the constructor of bar.C.D is protected, so only subclasses should be
able to call it. However, the declare parents makes A into a subclass of
bar.C.D. But, it seems that for some reason, the check of the protected doesn't
seem to know that A is now a subclass of bar.C.D, and rejects the call to the
protected constructor.

A similar thing (but more complicated) appears in atrack.

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
Received on Thu Sep 23 20:20:18 2004

This archive was generated by hypermail 2.1.8 : Thu Sep 23 2004 - 20:30:02 BST