]> source.dussan.org Git - aspectj.git/commitdiff
299552: private ITD fields stay private in target (with unmangled name): only build...
authoraclement <aclement>
Fri, 22 Jan 2010 19:04:07 +0000 (19:04 +0000)
committeraclement <aclement>
Fri, 22 Jan 2010 19:04:07 +0000 (19:04 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java

index 5a8426c801d272a2a7927b6d66cc1dbf9b973c15..6b34d0ed0d7af43fea0480d5798b18c20d909a3c 100644 (file)
@@ -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