<run class="ConvertToUnchecked"/>
</ajc-test>
+ <ajc-test dir="bugs/interAbstract"
+ title="inter-type declaration bug with abstract classes"
+ pr="36046">
+ <compile files="Driver.java"/>
+ <run class="Driver"/>
+ </ajc-test>
+
</suite>
--- /dev/null
+//Bugzilla Bug 36046
+// inter-type declaration bug with abstract classes
+
+public class Driver {
+ public static void main(String args[]) {
+ Derived generator = new Derived();
+ System.out.println(generator.getExecutions("processEvents"));
+ }
+ static aspect MonitorBase {
+ declare parents: Base implements ExecutionMonitor.MonitoredItem;
+ }
+}
+
+class Derived extends Base {
+ public String getName() {
+ return null;
+ }
+}
+
+abstract class Base {
+ abstract public String getName();
+}
+
+aspect ExecutionMonitor {
+ /** marker interface to indicate the execution monitor should track calls
+and executions on this class. */
+ public interface MonitoredItem {
+ int getExecutions(String methodName);
+ }
+
+ /** a Map of events to mutable integers */
+ public int MonitoredItem.getExecutions(String methodName) {
+ return 0;
+ }
+}
\ No newline at end of file
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
<suite>
- <ajc-test dir="new" title="new around construct"
- keywords="from-resolved_10x">
- <compile files="AroundAdvice.java"/>
- <run class="AroundAdvice"/>
- </ajc-test>
+
<!--
<ajc-test dir="new" pr="885"
private boolean alreadyDefined(LazyClassGen clazz, LazyMethodGen mg) {
for (Iterator i = clazz.getMethodGens().iterator(); i.hasNext(); ) {
- if (signaturesMatch(mg, (LazyMethodGen)i.next())) {
+ LazyMethodGen existing = (LazyMethodGen)i.next();
+ if (signaturesMatch(mg, existing)) {
+ if (!mg.isAbstract() && existing.isAbstract()) {
+ i.remove();
+ return false;
+ }
return true;
}
}
}
public List getMethodGens() {
- return Collections.unmodifiableList(methodGens);
+ return methodGens; //???Collections.unmodifiableList(methodGens);
}
return prevLine;
}
- public boolean isStatic() {
- return Modifier.isStatic(getAccessFlags());
- }
+ public boolean isStatic() {
+ return Modifier.isStatic(getAccessFlags());
+ }
+
+ public boolean isAbstract() {
+ return Modifier.isAbstract(getAccessFlags());
+ }
public void addExceptionHandler(
InstructionHandle start,