commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1426354 - /commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java
Date Thu, 27 Dec 2012 22:36:56 GMT
Author: struberg
Date: Thu Dec 27 22:36:56 2012
New Revision: 1426354

URL: http://svn.apache.org/viewvc?rev=1426354&view=rev
Log:
generate the hasSecurityManager flag as static final field

otherwise it's not accessible from static methods

Modified:
    commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java

Modified: commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java?rev=1426354&r1=1426353&r2=1426354&view=diff
==============================================================================
--- commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java
(original)
+++ commons/sandbox/privilizer/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/Privilizer.java
Thu Dec 27 22:36:56 2012
@@ -201,8 +201,9 @@ public abstract class Privilizer<SELF ex
             if (policy == Policy.ON_INIT) {
                 debug("Initializing field %s to %s", policy.condition, HAS_SECURITY_MANAGER_CONDITION);
 
-                type.addField(new CtField(CtClass.booleanType, policy.condition, type),
-                    CtField.Initializer.byExpr(HAS_SECURITY_MANAGER_CONDITION));
+                CtField securityManager = new CtField(CtClass.booleanType, policy.condition,
type);
+                securityManager.setModifiers(Modifier.STATIC | Modifier.PRIVATE | Modifier.FINAL);
+                type.addField(securityManager, CtField.Initializer.byExpr(HAS_SECURITY_MANAGER_CONDITION));
             }
             for (final CtMethod m : getPrivilegedMethods(type)) {
                 result |= weave(type, m);



Mime
View raw message