aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-05-02 20:36:06 +0000
committerjhugunin <jhugunin>2003-05-02 20:36:06 +0000
commitbcdbd68f76629692a5e780702086bff96cdc4c7c (patch)
treef34261e11877f35a765cc5c10e570eab1af9b6d3 /org.aspectj.ajdt.core
parentfafdaa404c28c821c3349e7d950afb6a4c8dd790 (diff)
downloadaspectj-bcdbd68f76629692a5e780702086bff96cdc4c7c.tar.gz
aspectj-bcdbd68f76629692a5e780702086bff96cdc4c7c.zip
fix and better tests for
Bugzilla Bug 37152 java.lang.VerifyError:
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java15
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java10
2 files changed, 20 insertions, 5 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java
index aa195135e..76acd7306 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java
@@ -13,6 +13,8 @@
package org.aspectj.ajdt.internal.compiler.ast;
+import java.util.Arrays;
+
import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
import org.aspectj.ajdt.internal.compiler.lookup.InlineAccessFieldBinding;
import org.aspectj.ajdt.internal.compiler.lookup.InterTypeFieldBinding;
@@ -77,9 +79,18 @@ public class AccessForInlineVisitor extends AbstractSyntaxTreeVisitorAdapter {
}
public void endVisit(QualifiedNameReference ref, BlockScope scope) {
+ //System.err.println("qref: " + ref + ", " + ref.binding.getClass().getName() + ", " + ref.codegenBinding.getClass().getName());
+ //System.err.println(" others: " + Arrays.asList(ref.otherBindings));
if (ref.binding instanceof FieldBinding) {
ref.binding = getAccessibleField((FieldBinding)ref.binding);
}
+ if (ref.otherBindings != null) {
+ for (int i=0, len=ref.otherBindings.length; i < len; i++) {
+ if (ref.otherBindings[i] instanceof FieldBinding) {
+ ref.otherBindings[i] = getAccessibleField((FieldBinding)ref.otherBindings[i]);
+ }
+ }
+ }
}
public void endVisit(FieldReference ref, BlockScope scope) {
@@ -121,6 +132,7 @@ public class AccessForInlineVisitor extends AbstractSyntaxTreeVisitorAdapter {
}
private FieldBinding getAccessibleField(FieldBinding binding) {
+ //System.err.println("checking field: " + binding);
if (!binding.isValidBinding()) return binding;
makePublic(binding.declaringClass);
@@ -135,6 +147,9 @@ public class AccessForInlineVisitor extends AbstractSyntaxTreeVisitorAdapter {
ResolvedMember m = EclipseFactory.makeResolvedMember(binding);
if (inAspect.accessForInline.containsKey(m)) return (FieldBinding)inAspect.accessForInline.get(m);
FieldBinding ret = new InlineAccessFieldBinding(inAspect, binding);
+
+ //System.err.println(" made accessor: " + ret);
+
inAspect.accessForInline.put(m, ret);
return ret;
}
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java
index c86d1c50f..d63418ff6 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java
@@ -49,8 +49,8 @@ public class WorkingTestMain {
//args.add("-aspectpath");
//args.add("../weaver/testdata/megatrace.jar");
- args.add("testdata/src1/AroundA1.java");
- args.add("-XnoInline");
+ args.add("c:/aspectj/scratch/arno/*.java");
+ //args.add("-XnoInline");
//args.add("../tests/new/Counting1.java");
//args.add("-Xlint:error");
//args.add("testdata/src1/InterType.java");
@@ -60,11 +60,11 @@ public class WorkingTestMain {
CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
//CommandTestCase.runCompiler(args, new int[] {11, 14, 18, 32, 43});
- CommandTestCase.printGenerated("../out", "AroundA1");
+ //CommandTestCase.printGenerated("../out", "AroundA1");
// CommandTestCase.printGenerated("../out", "SuperC");
-// CommandTestCase.printGenerated("../out", "SubC");
+ CommandTestCase.printGenerated("../out", "org.schmidmeier.unittests.cache.TimeCacheTestsWorking");
- TestUtil.runMain("out;../lib/test/testing-client.jar", "AroundA1");
+ TestUtil.runMain("out;../lib/test/testing-client.jar", "org.schmidmeier.unittests.cache.AllTimeCacheTests");
}
private static String examplesDir = "../docs/dist/doc/examples/";