diff options
author | acolyer <acolyer> | 2006-06-24 11:36:59 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2006-06-24 11:36:59 +0000 |
commit | c9f311aeeb11fb1427ec8857c24cfe3ffa6c7c9d (patch) | |
tree | 7b504df238cfdb1e0d2352c97014816eb6535f35 /org.aspectj.ajdt.core | |
parent | 16d8120ef10e7934c658c5457fb46e67d4ed9b78 (diff) | |
download | aspectj-c9f311aeeb11fb1427ec8857c24cfe3ffa6c7c9d.tar.gz aspectj-c9f311aeeb11fb1427ec8857c24cfe3ffa6c7c9d.zip |
tests and implementation for enh 147711 (use true synthetic attribute/flag for aj synthetic members).
Diffstat (limited to 'org.aspectj.ajdt.core')
4 files changed, 17 insertions, 1 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java index 6aa8bdd45..a24311236 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java @@ -22,6 +22,7 @@ import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory; import org.aspectj.ajdt.internal.compiler.lookup.PrivilegedHandler; import org.aspectj.bridge.context.CompilationAndWeavingContext; import org.aspectj.bridge.context.ContextToken; +import org.aspectj.org.eclipse.jdt.core.Flags; import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation; import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFile; import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult; @@ -123,7 +124,7 @@ public class AdviceDeclaration extends AjMethodDeclaration { if (kind == AdviceKind.Around) { ReferenceBinding[] exceptions = new ReferenceBinding[] { upperScope.getJavaLangThrowable() }; - proceedMethodBinding = new MethodBinding(Modifier.STATIC, + proceedMethodBinding = new MethodBinding(Modifier.STATIC | Flags.AccSynthetic, "proceed".toCharArray(), binding.returnType, resize(baseArgumentCount+1, binding.parameters), exceptions, binding.declaringClass); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java index 7734c6eb0..0c97ce582 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java @@ -19,6 +19,7 @@ import java.util.Collection; import java.util.Iterator; import org.aspectj.ajdt.internal.compiler.lookup.EclipseScope; +import org.aspectj.org.eclipse.jdt.core.Flags; import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFile; import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation; @@ -104,6 +105,7 @@ public class DeclareDeclaration extends AjMethodDeclaration { * corresponding method as the anchor for the declared annotation */ public void generateCode(ClassScope classScope, ClassFile classFile) { + this.binding.modifiers |= Flags.AccSynthetic; classFile.extraAttributes.add(new EclipseAttributeAdapter(new AjAttribute.DeclareAttribute(declareDecl))); if (shouldDelegateCodeGeneration()) { super.generateCode(classScope,classFile); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java index ff535e460..6dad0b35a 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java @@ -250,6 +250,7 @@ public class PointcutDeclaration extends AjMethodDeclaration { addVersionAttributeIfNecessary(classFile); if (generateSyntheticPointcutMethod) { + this.binding.modifiers |= AccSynthetic; super.generateCode(classScope,classFile); } return; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java index 34d190839..f1329fdeb 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java @@ -27,6 +27,7 @@ import org.aspectj.ajdt.internal.compiler.ast.AstUtil; import org.aspectj.ajdt.internal.core.builder.AjBuildManager; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.IMessage.Kind; +import org.aspectj.org.eclipse.jdt.core.Flags; import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; @@ -49,12 +50,14 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding; +import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeConstants; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.WildcardBinding; import org.aspectj.weaver.BoundedReferenceType; import org.aspectj.weaver.ConcreteTypeMunger; import org.aspectj.weaver.IHasPosition; import org.aspectj.weaver.Member; +import org.aspectj.weaver.NameMangler; import org.aspectj.weaver.NewFieldTypeMunger; import org.aspectj.weaver.NewMethodTypeMunger; import org.aspectj.weaver.ReferenceType; @@ -734,6 +737,10 @@ public class EclipseFactory { Constant.NotAConstant); typeVariableToTypeBinding.clear(); currentType = null; + + if (member.getName().startsWith(NameMangler.PREFIX)) { + fb.modifiers |= Flags.AccSynthetic; + } return fb; } @@ -815,6 +822,11 @@ public class EclipseFactory { if (tvbs!=null) mb.typeVariables = tvbs; typeVariableToTypeBinding.clear(); currentType = null; + + if (NameMangler.isSyntheticMethod(member.getName(), true)) { + mb.modifiers |= Flags.AccSynthetic; + } + return mb; } |