commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1509290 - /commons/sandbox/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/PrivilizingVisitor.java
Date Thu, 01 Aug 2013 15:24:59 GMT
Author: mbenson
Date: Thu Aug  1 15:24:59 2013
New Revision: 1509290

URL: http://svn.apache.org/r1509290
Log:
add some debug logging, clean some ws, and the coup de gras:  the shift of one line of code
that gets privilizing policies other than ON_INIT working\!

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

Modified: commons/sandbox/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/PrivilizingVisitor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/PrivilizingVisitor.java?rev=1509290&r1=1509289&r2=1509290&view=diff
==============================================================================
--- commons/sandbox/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/PrivilizingVisitor.java
(original)
+++ commons/sandbox/weaver/trunk/modules/privilizer/weaver/src/main/java/org/apache/commons/weaver/privilizer/PrivilizingVisitor.java
Thu Aug  1 15:24:59 2013
@@ -28,10 +28,6 @@ import java.util.Map;
 import javassist.Modifier;
 
 import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.weaver.privilizer.AccessLevel;
-import org.apache.commons.weaver.privilizer.Policy;
-import org.apache.commons.weaver.privilizer.Privileged;
-import org.apache.commons.weaver.privilizer.Privilized;
 import org.objectweb.asm.AnnotationVisitor;
 import org.objectweb.asm.ClassVisitor;
 import org.objectweb.asm.FieldVisitor;
@@ -117,6 +113,7 @@ class PrivilizingVisitor extends Privili
                 final boolean instanceMethod = !Modifier.isStatic(access);
 
                 if (policy.isConditional()) {
+                    privilizer().env.debug("setting up conditional execution due to policy
%s", policy);
                     // test, loading boolean
                     if (policy == Policy.ON_INIT) {
                         getStatic(target, privilizer().generateName("hasSecurityManager"),
Type.BOOLEAN_TYPE);
@@ -124,7 +121,7 @@ class PrivilizingVisitor extends Privili
                         checkSecurityManager(this);
                     }
                     final Label doPrivileged = new Label();
-                    
+
                     // if true, goto doPrivileged:
                     ifZCmp(NE, doPrivileged);
 
@@ -139,6 +136,8 @@ class PrivilizingVisitor extends Privili
                     }
                     returnValue();
                     mark(doPrivileged);
+                } else {
+                    privilizer().env.debug("setting up unconditional privileged execution
due to policy %s", policy);
                 }
 
                 // generate action:
@@ -209,9 +208,8 @@ class PrivilizingVisitor extends Privili
             mg.putStatic(target, fieldName, Type.BOOLEAN_TYPE);
             mg.returnValue();
             mg.endMethod();
-
-            super.visitEnd();
         }
+        super.visitEnd();
     }
 
     /**



Mime
View raw message