summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2009-05-05 23:41:20 +0000
committeraclement <aclement>2009-05-05 23:41:20 +0000
commita8c1caa33da4f62b452f18a3304116cbfdcab4d0 (patch)
tree584a102ffcbe6544c354816a8caf40086cce0f4e /org.aspectj.ajdt.core
parentb187712e592887ab56f1a1712de72ebce44ee475 (diff)
downloadaspectj-a8c1caa33da4f62b452f18a3304116cbfdcab4d0.tar.gz
aspectj-a8c1caa33da4f62b452f18a3304116cbfdcab4d0.zip
275032: test and fix: itd of no-arg constructor should overwrite a generated default constructor
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java3
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java17
2 files changed, 20 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java
index 3aed8f22b..d0088e164 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java
@@ -15,6 +15,7 @@ import org.aspectj.apache.bcel.classfile.annotation.ElementValueGen;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayInitializer;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MarkerAnnotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MemberValuePair;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NormalAnnotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
@@ -100,6 +101,8 @@ public class EclipseAnnotationConvertor {
annotationAJ.addNameValuePair(new AnnotationNameValuePair(new String(
singleMemberAnnotation.memberValuePairs()[0].name), av));
}
+ } else if (annotation instanceof MarkerAnnotation) {
+ MarkerAnnotation markerAnnotation = (MarkerAnnotation) annotation;
} else {
// this is a marker annotation (no member value pairs)
throw new MissingImplementationException(
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java
index 365373c5a..463ecc5eb 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java
@@ -26,6 +26,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.IntConstant;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
@@ -52,6 +53,7 @@ public class EclipseResolvedMember extends ResolvedMemberImpl {
private ResolvedType[] cachedAnnotationTypes;
private EclipseFactory eclipseFactory;
+
public EclipseResolvedMember(MethodBinding binding, MemberKind memberKind, ResolvedType realDeclaringType, int modifiers,
UnresolvedType rettype, String name, UnresolvedType[] paramtypes, UnresolvedType[] extypes,
EclipseFactory eclipseFactory) {
@@ -235,4 +237,19 @@ public class EclipseResolvedMember extends ResolvedMemberImpl {
return null;
}
+ /**
+ * Return true if this is the default constructor. The default constructor
+ * is the one generated if there isn't one in the source. Eclipse
+ * helpfully uses a bit to indicate the default constructor.
+ *
+ * @return true if this is the default constructor.
+ */
+ public boolean isDefaultConstructor() {
+ if (!(realBinding instanceof MethodBinding)) {
+ return false;
+ }
+ MethodBinding mb = (MethodBinding) realBinding;
+ return mb.isConstructor() && ((mb.modifiers & ExtraCompilerModifiers.AccIsDefaultConstructor) != 0);
+ }
+
}