summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2011-04-26 16:11:25 +0000
committeraclement <aclement>2011-04-26 16:11:25 +0000
commit4341109730bdb423b0eecc5b01327febc4f0b230 (patch)
tree3664f30516d3f330421154c1ad445dc5c325568c /org.aspectj.ajdt.core
parenta1c251df1f0ade186946b18d68a16c10bcbc84f2 (diff)
downloadaspectj-4341109730bdb423b0eecc5b01327febc4f0b230.tar.gz
aspectj-4341109730bdb423b0eecc5b01327febc4f0b230.zip
343051
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java
index 92ffd5105..11097ea59 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java
@@ -12,12 +12,14 @@
package org.aspectj.ajdt.internal.compiler.ast;
+import java.lang.reflect.Modifier;
import java.util.HashSet;
import java.util.Set;
import org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
import org.aspectj.ajdt.internal.compiler.lookup.InterTypeMethodBinding;
+import org.aspectj.asm.internal.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend;
@@ -26,6 +28,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding;
@@ -51,8 +54,24 @@ public class SuperFixerVisitor extends ASTVisitor {
this.method = method;
this.targetClass = targetClass;
}
+
+ private static final char[] ctor = "<init>".toCharArray();
public boolean visit(TypeDeclaration localTypeDeclaration, BlockScope scope) {
+ if (localTypeDeclaration.binding instanceof LocalTypeBinding) {
+ if (((LocalTypeBinding)localTypeDeclaration.binding).isAnonymousType()) {
+ localTypeDeclaration.binding.modifiers |=Modifier.PUBLIC;
+ MethodBinding[] bindings = localTypeDeclaration.binding.methods;
+ if (bindings!=null) {
+ for (int i=0,max=bindings.length;i<max;i++) {
+ if (CharOperation.equals(bindings[i].selector,ctor)) {
+ bindings[i].modifiers|=Modifier.PUBLIC;
+ }
+ }
+ }
+// localTypeDeclaration.modifiers|=Modifier.PUBLIC;
+ }
+ }
depthCounter++;
return super.visit(localTypeDeclaration, scope);
}