You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/11/17 17:27:51 UTC

svn commit: r1036100 - /tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java

Author: markt
Date: Wed Nov 17 16:27:51 2010
New Revision: 1036100

URL: http://svn.apache.org/viewvc?rev=1036100&view=rev
Log:
Rename attributes to align with getter/setter to make code easier to read

Modified:
    tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java

Modified: tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java?rev=1036100&r1=1036099&r2=1036100&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java Wed Nov 17 16:27:51 2010
@@ -77,8 +77,8 @@ public abstract class ManagerBase extend
     // ----------------------------------------------------- Instance Variables
 
     protected volatile InputStream randomIS = null;
-    protected volatile String devRandomSource = "/dev/urandom";
-    protected volatile boolean devRandomSourceIsValid = true;
+    protected volatile String randomFile = "/dev/urandom";
+    protected volatile boolean randomFileIsValid = true;
 
     /**
      * The default message digest algorithm to use if we cannot use
@@ -255,27 +255,27 @@ public abstract class ManagerBase extend
     private class PrivilegedSetRandomFile implements PrivilegedAction<Void> {
         
         public PrivilegedSetRandomFile(String s) {
-            devRandomSource = s;
+            randomFile = s;
         }
         
         @Override
         public Void run(){
             try {
-                File f = new File(devRandomSource);
+                File f = new File(randomFile);
                 if (!f.exists()) {
-                    devRandomSourceIsValid = false;
+                    randomFileIsValid = false;
                     closeRandomFile();
                     return null;
                 }
                 InputStream is = new FileInputStream(f);
                 is.read();
                 if( log.isDebugEnabled() )
-                    log.debug( "Opening " + devRandomSource );
+                    log.debug( "Opening " + randomFile );
                 randomIS = is;
-                devRandomSourceIsValid = true;
+                randomFileIsValid = true;
             } catch (IOException ex){
-                log.warn("Error reading " + devRandomSource, ex);
-                devRandomSourceIsValid = false;
+                log.warn("Error reading " + randomFile, ex);
+                randomFileIsValid = false;
                 closeRandomFile();
             }
             return null;
@@ -574,29 +574,29 @@ public abstract class ManagerBase extend
             AccessController.doPrivileged(new PrivilegedSetRandomFile(s));
         } else {
             try{
-                devRandomSource = s;
-                File f = new File(devRandomSource);
+                randomFile = s;
+                File f = new File(randomFile);
                 if (!f.exists()) {
-                    devRandomSourceIsValid = false;
+                    randomFileIsValid = false;
                     closeRandomFile();
                     return;
                 }
                 InputStream is = new FileInputStream(f);
                 is.read();
                 if( log.isDebugEnabled() )
-                    log.debug( "Opening " + devRandomSource );
+                    log.debug( "Opening " + randomFile );
                 randomIS = is;
-                devRandomSourceIsValid = true;
+                randomFileIsValid = true;
             } catch( IOException ex ) {
-                log.warn("Error reading " + devRandomSource, ex);
-                devRandomSourceIsValid = false;
+                log.warn("Error reading " + randomFile, ex);
+                randomFileIsValid = false;
                 closeRandomFile();
             }
         }
     }
 
     public String getRandomFile() {
-        return devRandomSource;
+        return randomFile;
     }
 
 
@@ -1010,10 +1010,10 @@ public abstract class ManagerBase extend
 
     protected void getRandomBytes(byte bytes[]) {
         // Generate a byte array containing a session identifier
-        if (devRandomSourceIsValid && randomIS == null) {
+        if (randomFileIsValid && randomIS == null) {
             synchronized (this) {
-                if (devRandomSourceIsValid && randomIS == null) {
-                    setRandomFile(devRandomSource);
+                if (randomFileIsValid && randomIS == null) {
+                    setRandomFile(randomFile);
                 }
             }
         }
@@ -1035,7 +1035,7 @@ public abstract class ManagerBase extend
             } catch (Exception ex) {
                 // Ignore
             }
-            devRandomSourceIsValid = false;
+            randomFileIsValid = false;
             closeRandomFile();
         }
         Random random = randoms.poll();



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org