Bug 32421

Summary: can't resolve nested public interfaces
Product: [Tools] AspectJ Reporter: Ron Bodkin <rbodkin+LISTS>
Component: CompilerAssignee: Jim Hugunin <jim-aj>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Ron Bodkin CLA 2003-02-20 17:33:37 EST
This may be caused by the bug as 32399

file TransactionTest.java:
import sub.ExecutionMonitor;

public class TransactionTest {
    static Transaction theTransaction;

    private void assertCommitted() {
        theTransaction.getCount("method-execution", "commit");
    }

    static aspect MonitorTest {
        declare parents: Transaction implements ExecutionMonitor.MonitoredItem;
    }
}

class Transaction {
}

file sub/ExecutionMonitor.aj:
package sub;

public aspect ExecutionMonitor {
    public interface MonitoredItem {
        int getCount(String eventType, String eventName);
    }

    public int MonitoredItem.getCount(String eventType, String eventName) {
            return 0;
    } 
}         

sample compilation:
C:\devel>ajc -1.4 TransactionTest.java sub\ExecutionMonitor.aj
can't bind type name 'ExecutionMonitor$MonitoredItem'
C:/devel/TransactionTest.java:7: The method getCount(java.lang.String, java.lang
.String) is undefined for the type Transaction
theTransaction.getCount("method-execution", "commit");
               ^^^^^^^^

2 errors
Comment 1 Jim Hugunin CLA 2003-03-06 17:03:27 EST
fixed in current tree, test in bugs/interfaceNames/*