|| id.equals("toLongString")
|| id.equals("getKind")
|| id.equals("getSignature")
- || id.equals("getSourceLocation")
- || id.equals("getStaticPart");
+ || id.equals("getSourceLocation");
+ //TODO: This is a good optimization, but requires more work than the above
+ // we have to replace a call with a direct reference, not just a different call
+ //|| id.equals("getStaticPart");
}
// boolean canTreatAsStatic(VarExpr varExpr) {
<run class="Privilege"/>
</ajc-test>
+ <ajc-test dir="bugs" pr="36564"
+ title="Internal compiler error with thisJoinPoint.getStaticPart()">
+ <compile files="tjpStaticPart/Test.java,tjpStaticPart/Exceptions.java"/>
+ <run class="tjpStaticPart.Test"/>
+ </ajc-test>
+
</suite>
--- /dev/null
+package tjpStaticPart;
+
+import java.io.*;
+
+import org.aspectj.lang.*;
+
+public aspect Exceptions {
+
+ pointcut exceptionMethods () :
+ call(java.io.*.new(..) throws FileNotFoundException);
+
+ Object around () throws FileNotFoundException : exceptionMethods() && !within(Exceptions) {
+ System.err.println("before: " + thisJoinPoint.getStaticPart());
+ Object obj = proceed();
+ System.err.println("after: " + thisJoinPoint.getStaticPart());
+ return obj;
+ }
+}
\ No newline at end of file
--- /dev/null
+package tjpStaticPart;
+
+import java.io.*;
+
+public class Test {
+
+ public static void main(String[] args) throws Exception{
+ try {
+ FileInputStream in = new FileInputStream("file-does-not-exist");
+ } catch (FileNotFoundException e) {
+ }
+
+ }
+}
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
<suite>
- <ajc-test dir="new" pr="559"
- title="subclass advice not run for join points selected by superclass cflow-based pointcuts"
- keywords="from-resolved_10rc3">
- <compile files="PR559.java"/>
- <run class="PR559"/>
- </ajc-test>
+
<!--
<ajc-test dir="new" pr="885"