From: aclement Date: Fri, 22 Jan 2010 19:04:07 +0000 (+0000) Subject: 299552: private ITD fields stay private in target (with unmangled name): only build... X-Git-Tag: V1_6_9M1~80 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ce191a75add393b5e9af702f062bf77d1062560b;p=aspectj.git 299552: private ITD fields stay private in target (with unmangled name): only build the attribute if it will contain anything --- diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java index 5a8426c80..6b34d0ed0 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java @@ -286,8 +286,12 @@ public class AspectDeclaration extends TypeDeclaration { classFile.extraAttributes.add(new EclipseAttributeAdapter(new AjAttribute.Aspect(perClause))); if (binding.privilegedHandler != null) { - ResolvedMember[] members = ((PrivilegedHandler) binding.privilegedHandler).getMembers(); - classFile.extraAttributes.add(new EclipseAttributeAdapter(new AjAttribute.PrivilegedAttribute(members))); + // Only build the attribute if necessary + PrivilegedHandler privilegedHandler= (PrivilegedHandler)binding.privilegedHandler; + ResolvedMember[] members = privilegedHandler.getMembers(); + if (members.length>0) { + classFile.extraAttributes.add(new EclipseAttributeAdapter(new AjAttribute.PrivilegedAttribute(members))); + } } // XXX need to get this attribute on anyone with a pointcut for good errors