import org.aspectj.weaver.ResolvedMember;
import org.eclipse.jdt.internal.compiler.AbstractSyntaxTreeVisitorAdapter;
import org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
+import org.eclipse.jdt.internal.compiler.ast.AssertStatement;
+import org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess;
import org.eclipse.jdt.internal.compiler.ast.FieldReference;
import org.eclipse.jdt.internal.compiler.ast.MessageSend;
import org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
AspectDeclaration inAspect;
EclipseFactory world; // alias for inAspect.world
+ // set to true for ClassLiteralAccess and AssertStatement
+ // ??? A better answer would be to transform these into inlinable forms
+ public boolean isInlinable = true;
+
public AccessForInlineVisitor(AspectDeclaration inAspect, PrivilegedHandler handler) {
this.inAspect = inAspect;
this.world = inAspect.factory;
return;
}
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.compiler.IAbstractSyntaxTreeVisitor#endVisit(org.eclipse.jdt.internal.compiler.ast.AssertStatement, org.eclipse.jdt.internal.compiler.lookup.BlockScope)
+ */
+ public void endVisit(AssertStatement assertStatement, BlockScope scope) {
+ isInlinable = false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.compiler.IAbstractSyntaxTreeVisitor#endVisit(org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess, org.eclipse.jdt.internal.compiler.lookup.BlockScope)
+ */
+ public void endVisit(ClassLiteralAccess classLiteral, BlockScope scope) {
+ isInlinable = false;
+ }
+
}
AccessForInlineVisitor v = new AccessForInlineVisitor((AspectDeclaration)upperScope.referenceContext, handler);
this.traverse(v, (ClassScope) null);
+
+ // ??? if we found a construct that we can't inline, set
+ // proceedInInners so that we won't try to inline this body
+ if (!v.isInlinable) proceedInInners = true;
}
}
}
public class A1 {
public static void main(String[] args) {
new C().foo();
+ new C().bar();
}
}
void C.foo() {
System.out.println("class: " + C.class);
}
+
+ void around(): execution(void C.bar()) {
+ System.out.println("class: " + C.class);
+ proceed();
+ }
}
\ No newline at end of file
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
<suite>
-
+ <ajc-test dir="bugs/interSpecials" title="IllegalAccessError while accessing introduced variable / 1.1rc1"
+ pr="36110">
+ <compile files="p1/C.java,p2/A1.java"/>
+ <run class="p2.A1"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/interSpecials" title="testing that assert works like .class"
+ pr="36110">
+ <compile files="p1/C.java,p2/A2.java" options="-source14"/>
+ <run class="p2.A2" vm="1.4"/>
+ </ajc-test>
<!--