aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-07-23 01:05:55 +0000
committerjhugunin <jhugunin>2003-07-23 01:05:55 +0000
commita1bb5dae64e5e5bc3541d426d9a160ffb5fbec35 (patch)
tree5759a3a580e37305f1fdf10e2876387f2d18be16
parent54a8e9ae3854be8bc202eb55fd1c4e0f735bd424 (diff)
downloadaspectj-a1bb5dae64e5e5bc3541d426d9a160ffb5fbec35.tar.gz
aspectj-a1bb5dae64e5e5bc3541d426d9a160ffb5fbec35.zip
added test to try to investigate size issues, but can't reproduce for any
number of loops in BasicCommandTestCase.testSizeChanges()
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/SizeIssues.java21
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/SizeIssuesAspect.java14
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java23
3 files changed, 58 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/testdata/src1/SizeIssues.java b/org.aspectj.ajdt.core/testdata/src1/SizeIssues.java
new file mode 100644
index 000000000..18612e289
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/SizeIssues.java
@@ -0,0 +1,21 @@
+public class SizeIssues {
+
+ public static void main(String[] argv) {
+ int foo1 = 1;
+ String foo2 = "2";
+ Integer foo3 = new Integer(3);
+ String foo4 = "4";
+ callfoo(foo1,foo2,foo3,foo4);
+ }
+
+ public static void callfoo(int input1,String input2, Integer input3,String input4) {
+ bar_1(input1);
+ bar_2(input2);
+ bar_1(input3.intValue());
+ bar_2(input4);
+ }
+
+ public static void bar_1(int i) {}
+ public static void bar_2(String s) {}
+
+} \ No newline at end of file
diff --git a/org.aspectj.ajdt.core/testdata/src1/SizeIssuesAspect.java b/org.aspectj.ajdt.core/testdata/src1/SizeIssuesAspect.java
new file mode 100644
index 000000000..ca181a5a9
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/SizeIssuesAspect.java
@@ -0,0 +1,14 @@
+aspect SizeIssuesAspect {
+
+ public pointcut rasScope() : within(*);
+
+ pointcut toStringMethod() : execution(* *.toString());
+
+ pointcut publicMethods() : rasScope() &&
+ execution( public * *(..)) && !toStringMethod();
+
+ after() returning: publicMethods() {
+ System.err.println(thisJoinPointStaticPart.getSignature().toLongString());
+ }
+}
+
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java
index dff6f8144..824a85f43 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java
@@ -170,4 +170,27 @@ public class BasicCommandTestCase extends CommandTestCase {
}
+
+ public void testSizeChanges() {
+ File f1 = new File("out/SizeIssues.class");
+
+ List args = new ArrayList();
+
+ args.add("-d");
+ args.add("out");
+
+ args.add("-classpath");
+ args.add("../runtime/bin;../lib/junit/junit.jar;../testing-client/bin");
+
+ args.add("testdata/src1/SizeIssuesAspect.java");
+ args.add("testdata/src1/SizeIssues.java");
+
+ runCompiler(args, NO_ERRORS);
+ long size = f1.length();
+ for (int i=0; i < 1; i++) {
+ f1.delete();
+ runCompiler(args, NO_ERRORS);
+ assertEquals(size, f1.length());
+ }
+ }
}