From: markt Date: Wed, 17 Nov 2010 16:27:51 +0000 (+0000) Subject: Rename attributes to align with getter/setter to make code easier to read X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=96c039c173b2aedf8aff45c1a08016e092f26801;p=tomcat7.0 Rename attributes to align with getter/setter to make code easier to read git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1036100 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/session/ManagerBase.java b/java/org/apache/catalina/session/ManagerBase.java index 9cfba8a20..48a4a67a5 100644 --- a/java/org/apache/catalina/session/ManagerBase.java +++ b/java/org/apache/catalina/session/ManagerBase.java @@ -77,8 +77,8 @@ public abstract class ManagerBase extends LifecycleMBeanBase // ----------------------------------------------------- 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 extends LifecycleMBeanBase private class PrivilegedSetRandomFile implements PrivilegedAction { 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 extends LifecycleMBeanBase 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 extends LifecycleMBeanBase 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 extends LifecycleMBeanBase } catch (Exception ex) { // Ignore } - devRandomSourceIsValid = false; + randomFileIsValid = false; closeRandomFile(); } Random random = randoms.poll();