]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for Bugzilla Bug 36564
authorjhugunin <jhugunin>
Tue, 22 Apr 2003 17:55:13 +0000 (17:55 +0000)
committerjhugunin <jhugunin>
Tue, 22 Apr 2003 17:55:13 +0000 (17:55 +0000)
   Internal compiler error

org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java
tests/ajcTests.xml
tests/bugs/tjpStaticPart/Exceptions.java [new file with mode: 0644]
tests/bugs/tjpStaticPart/Test.java [new file with mode: 0644]
tests/jimTests.xml

index f1602b41dd7b2dfbbb59644cafc8ff8f539a2e8c..2ec487518f0cb1b79be770cd6a47dcfbf257b4e0 100644 (file)
@@ -106,8 +106,10 @@ public class ThisJoinPointVisitor extends AbstractSyntaxTreeVisitorAdapter {
                        || 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) {
index 388fafac64c7287871c310e183e479a7e6b9c088..845d21687997856f5cf0112917a6deeca933ae96 100644 (file)
         <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>
diff --git a/tests/bugs/tjpStaticPart/Exceptions.java b/tests/bugs/tjpStaticPart/Exceptions.java
new file mode 100644 (file)
index 0000000..056443e
--- /dev/null
@@ -0,0 +1,18 @@
+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
diff --git a/tests/bugs/tjpStaticPart/Test.java b/tests/bugs/tjpStaticPart/Test.java
new file mode 100644 (file)
index 0000000..1438698
--- /dev/null
@@ -0,0 +1,14 @@
+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) {
+               }
+               
+       }
+}
index 3d842760f13accdc575904c35b96358b11ba0074..7664c379982f33b79e28be5dfb6be6dee5b8a25d 100644 (file)
@@ -1,12 +1,7 @@
 <!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"