aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-04-22 17:55:13 +0000
committerjhugunin <jhugunin>2003-04-22 17:55:13 +0000
commit0a8dbdeed13fe79ddfd7a291e2b45b50b9a90579 (patch)
tree296eb9f5aad3f8f3e3b3507d637529e928b2e0dd
parentfefd4559fb4a9eefcf4528526ad2448b9a6e3489 (diff)
downloadaspectj-0a8dbdeed13fe79ddfd7a291e2b45b50b9a90579.tar.gz
aspectj-0a8dbdeed13fe79ddfd7a291e2b45b50b9a90579.zip
test and fix for Bugzilla Bug 36564
Internal compiler error
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java6
-rw-r--r--tests/ajcTests.xml6
-rw-r--r--tests/bugs/tjpStaticPart/Exceptions.java18
-rw-r--r--tests/bugs/tjpStaticPart/Test.java14
-rw-r--r--tests/jimTests.xml7
5 files changed, 43 insertions, 8 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java
index f1602b41d..2ec487518 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java
@@ -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) {
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml
index 388fafac6..845d21687 100644
--- a/tests/ajcTests.xml
+++ b/tests/ajcTests.xml
@@ -5828,4 +5828,10 @@
<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
index 000000000..056443e8b
--- /dev/null
+++ b/tests/bugs/tjpStaticPart/Exceptions.java
@@ -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
index 000000000..1438698f5
--- /dev/null
+++ b/tests/bugs/tjpStaticPart/Test.java
@@ -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) {
+ }
+
+ }
+}
diff --git a/tests/jimTests.xml b/tests/jimTests.xml
index 3d842760f..7664c3799 100644
--- a/tests/jimTests.xml
+++ b/tests/jimTests.xml
@@ -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"