admin@glassfish.java.net

CODE REVIEW: various FindBugs fixes (simple ones)

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Tue, 27 Mar 2007 15:16:32 -0700

Please review no later than noon on Thursday 3/30.

These are diffs for various FindBugs complaints, the fixes for which
are straightforward. I examined files reported as seen here:
https://glassfish.dev.java.net/quality/fb-developer-report.html

for the following packages:
com.sun.enterprise.admin (exclude sub-package selfmanagement)
com.sun.enterprise.ee.admin
com.sun.enterprise.management (exclude sub-package selfmanagement)
com.sun.enterprise.config
com.sun.enterprise.cli
com.sun.enterprise.ee.nodeagent
com.sun.enterprise.ee.synchronization

The most complex changes seen in this email involve the use of a
temporary variable to allow a static or instance variable to be 'final'.

Lloyd

-------------

RCS file: /cvs/glassfish/admin/ws-mgmt/src/java/com/sun/enterprise/
admin/wsmgmt/agent/AuthenticationListenerImpl.java,v
retrieving revision 1.6
diff -r1.6 AuthenticationListenerImpl.java
63a64,65
> // use a temporary variable so that 'final' may be used
for 'cfgProv'
> ConfigProvider provider = null;
65c67
< cfgProv = ConfigFactory.getConfigFactory
().getConfigProvider();
---
 >             provider = ConfigFactory.getConfigFactory 
().getConfigProvider();
69a72,74
 >         finally {
 >             cfgProv = provider;
 >         }
164c169
<     private ConfigProvider cfgProv = null;
---
 >     private final ConfigProvider cfgProv;
RCS file: /cvs/glassfish/admin-cli/commands/src/java/com/sun/ 
enterprise/cli/commands/CreateDomainCommand.java,v
retrieving revision 1.21
diff -w -u -r1.21 CreateDomainCommand.java
--- admin-cli/commands/src/java/com/sun/enterprise/cli/commands/ 
CreateDomainCommand.java        1 Mar 2007 00:49:56 -0000       1.21
+++ admin-cli/commands/src/java/com/sun/enterprise/cli/commands/ 
CreateDomainCommand.java        27 Mar 2007 17:46:55 -0000
@@ -83,9 +83,9 @@
      private static final int PORTBASE_JMX_SUFFIX              = 86;
-    public static String DOMAINDIR_OPTION = "domaindir";
-    public static String PROFILE_OPTION = "profile";
-    private static String SAVELOGIN_OPTION = "savelogin";
+    public static final String DOMAINDIR_OPTION = "domaindir";
+    public static final String PROFILE_OPTION = "profile";
+    private static final String SAVELOGIN_OPTION = "savelogin";
      private String domainName = null;
      private String adminUser = null;
RCS file: /cvs/glassfish/admin-cli/commands/src/java/com/sun/ 
enterprise/cli/commands/DomainReporter.java,v
retrieving revision 1.4
diff -r1.4 DomainReporter.java
85c85,88
<         } catch(final Exception e) {}//squelch
---
 >         } catch(final Exception e) {
 >             // squelch, it's OK if we couldn't get the debug flag
 >             e.hashCode();   // silence FindBugs
 >         }
RCS file: /cvs/glassfish/admin-cli/commands/src/java/com/sun/ 
enterprise/cli/commands/HelpCommand.java,v
retrieving revision 1.3
diff -w -u -r1.3 HelpCommand.java
--- admin-cli/commands/src/java/com/sun/enterprise/cli/commands/ 
HelpCommand.java        25 Dec 2005 03:46:29 -0000      1.3
+++ admin-cli/commands/src/java/com/sun/enterprise/cli/commands/ 
HelpCommand.java        27 Mar 2007 17:46:55 -0000
@@ -65,8 +65,7 @@
    {
         try {
-
-       final More m = new More(getPageLength(),
+       new More(getPageLength(),
                                                         getSource(),
                                                          
getDestination(),
                                                         getUserInput(),
RCS file: /cvs/glassfish/admin-cli/commands/src/java/com/sun/ 
enterprise/cli/commands/S1ASCommand.java,v
retrieving revision 1.33
diff -w -u -r1.33 S1ASCommand.java
--- admin-cli/commands/src/java/com/sun/enterprise/cli/commands/ 
S1ASCommand.java        3 Mar 2007 09:03:14 -0000       1.33
+++ admin-cli/commands/src/java/com/sun/enterprise/cli/commands/ 
S1ASCommand.java        27 Mar 2007 17:46:55 -0000
@@ -124,8 +124,14 @@
      protected static final String SET_DELIMETER = "=";
      protected final static String ENV_PREFIX = "AS_ADMIN_";
-    protected static String NOT_DEPRECATED_PASSWORDFILE_OPTIONS =
+
+    protected static final String  
DEFAULT_NOT_DEPRECATED_PASSWORDFILE_OPTIONS =
          "password|adminpassword|userpassword|masterpassword| 
aliaspassword|mappedpassword";
+
+    // this variable ought to be renamed to avoid confusing it with  
a constant
+    protected String NOT_DEPRECATED_PASSWORDFILE_OPTIONS =
+        DEFAULT_NOT_DEPRECATED_PASSWORDFILE_OPTIONS;
+
      protected final static String COMMENT_PREFIX = "#";
RCS file: /cvs/glassfish/admin-cli/framework/src/java/com/sun/ 
enterprise/cli/framework/LocalStringsManager.java,v
retrieving revision 1.3
diff -w -u -r1.3 LocalStringsManager.java
--- admin-cli/framework/src/java/com/sun/enterprise/cli/framework/ 
LocalStringsManager.java      25 Dec 2005 03:47:02 -0000      1.3
+++ admin-cli/framework/src/java/com/sun/enterprise/cli/framework/ 
LocalStringsManager.java      27 Mar 2007 17:46:55 -0000
@@ -44,29 +44,32 @@
   */
public class LocalStringsManager {
-    private String          packageName;
-    private String          propertyFile;
-    private Vector          resourceBundles = new Vector();
-    public  static String   DEFAULT_STRING_VALUE = "Key not found";
+    private final String          packageName;
+    private final String          propertyFile;
+    private final Vector<ResourceBundle> resourceBundles = new  
Vector<ResourceBundle>();
+    public static final String   DEFAULT_STRING_VALUE = "Key not  
found";
      /** Creates a new instance of LocalStringsManager */
-    public LocalStringsManager(String packageName, String propertyFile)
+    public LocalStringsManager(String packageNameIn, String  
propertyFileIn)
      {
-        this.packageName = packageName;
-        this.propertyFile = propertyFile;
+        this.packageName = packageNameIn;
+        this.propertyFile = propertyFileIn;
          ResourceBundle resourceBundle =
-                ResourceBundle.getBundle(packageName + "." +  
propertyFile);
+                ResourceBundle.getBundle(packageNameIn + "." +  
propertyFile);
          resourceBundles.add(resourceBundle);
      }
      /** Creates a new instance of LocalStringsManager from the
          properties Vector
       */
-    public LocalStringsManager(Vector localizePropertiesList)
+    public LocalStringsManager(Vector<Properties>  
localizePropertiesList)
      {
+        this.packageName    = null;
+        this.propertyFile   = null;
+
          for (int i = 0; i < localizePropertiesList.size(); i++)
          {
-            Properties properties = (Properties)  
localizePropertiesList.get(i);
+            Properties properties = localizePropertiesList.get(i);
              String packageNameStr = (String) properties.get("base- 
package");
              String propertyFileStr = (String) properties.get 
("property-file-name");
              ResourceBundle resourceBundle =
@@ -79,12 +82,15 @@
      /** Creates a new instance of LocalStringsManager from the
          properties Vector of Strings and locale
       */
-    public LocalStringsManager(Vector localizeStringList, Locale  
locale)
+    public LocalStringsManager(Vector<String> localizeStringList,  
Locale locale)
      {
+        this.packageName    = null;
+        this.propertyFile   = null;
+
          for (int i = 0; i < localizeStringList.size(); i++)
          {
              ResourceBundle resourceBundle =
-                ResourceBundle.getBundle((String) 
localizeStringList.get(i),
+                ResourceBundle.getBundle(localizeStringList.get(i),
                                           locale);
              resourceBundles.add(resourceBundle);
          }
@@ -111,7 +117,7 @@
      /*
       *returns resourceBundles
       */
-    public Vector getResourceBundles()
+    public Vector<ResourceBundle> getResourceBundles()
      {
          return resourceBundles;
      }
RCS file: /cvs/glassfish/admin-core/admin/src/java/com/sun/enterprise/ 
admin/BaseAdminMBean.java,v
retrieving revision 1.3
diff -w -u -r1.3 BaseAdminMBean.java
--- admin-core/admin/src/java/com/sun/enterprise/admin/ 
BaseAdminMBean.java      25 Dec 2005 03:47:28 -0000      1.3
+++ admin-core/admin/src/java/com/sun/enterprise/admin/ 
BaseAdminMBean.java      27 Mar 2007 17:46:55 -0000
@@ -119,8 +119,8 @@
      protected String              mbeanType = "unknown";
      // Logging
-    static protected Logger _sLogger = LogDomains.getLogger 
(LogDomains.ADMIN_LOGGER);
-    protected StringManager _localStrings = null;
+    static final protected Logger _sLogger = LogDomains.getLogger 
(LogDomains.ADMIN_LOGGER);
+    protected final StringManager _localStrings;
      public BaseAdminMBean() {
          _localStrings = StringManager.getManager 
( BaseAdminMBean.class );
      }
RCS file: /cvs/glassfish/admin-core/admin/src/java/com/sun/enterprise/ 
admin/MBeanHelper.java,v
retrieving revision 1.5
diff -w -u -r1.5 MBeanHelper.java
--- admin-core/admin/src/java/com/sun/enterprise/admin/ 
MBeanHelper.java 8 Mar 2006 01:34:34 -0000       1.5
+++ admin-core/admin/src/java/com/sun/enterprise/admin/ 
MBeanHelper.java 27 Mar 2007 17:46:55 -0000
@@ -157,10 +157,10 @@
public class MBeanHelper implements MBeanMetaConstants
{
      // Logging
-    static protected Logger _sLogger = LogDomains.getLogger 
(LogDomains.ADMIN_LOGGER);
-    static protected StringManager _localStrings =  
StringManager.getManager( BaseAdminMBean.class );
+    static protected final Logger _sLogger = LogDomains.getLogger 
(LogDomains.ADMIN_LOGGER);
+    static protected final StringManager _localStrings =  
StringManager.getManager( BaseAdminMBean.class );
-    public static Object INVOKE_ERROR_SIGNAL_OBJECT = new Object();
+    public static final Object INVOKE_ERROR_SIGNAL_OBJECT = new  
Object();
      // 
************************************************************************ 
********************************************
      // get Descriptor's field value by its name
RCS file: /cvs/glassfish/admin-core/admin/src/java/com/sun/enterprise/ 
admin/config/ConfigBeanHelper.java,v
retrieving revision 1.4
diff -w -u -r1.4 ConfigBeanHelper.java
--- admin-core/admin/src/java/com/sun/enterprise/admin/config/ 
ConfigBeanHelper.java     12 Mar 2006 01:26:56 -0000      1.4
+++ admin-core/admin/src/java/com/sun/enterprise/admin/config/ 
ConfigBeanHelper.java     27 Mar 2007 17:46:55 -0000
@@ -324,9 +324,8 @@
      static public boolean  
checkIfAttributesAndPropertiesAreResolvable(ConfigBean element,  
String instanceName)
                                throws ConfigException
      {
-        PropertyResolver resolver = new PropertyResolver 
(element.getConfigContext(), instanceName);
-        StringBuffer buf  = new StringBuffer();
-        String[] attrNames = element.getAttributeNames();
+        final PropertyResolver resolver = new PropertyResolver 
(element.getConfigContext(), instanceName);
+        final String[] attrNames = element.getAttributeNames();
          //first - check attributes;
          if(attrNames!=null)
          {
RCS file: /cvs/glassfish/admin-core/admin/src/java/com/sun/enterprise/ 
admin/meta/DottedNameHelper.java,v
retrieving revision 1.2
diff -w -u -r1.2 DottedNameHelper.java
--- admin-core/admin/src/java/com/sun/enterprise/admin/meta/ 
DottedNameHelper.java       16 May 2006 18:26:26 -0000      1.2
+++ admin-core/admin/src/java/com/sun/enterprise/admin/meta/ 
DottedNameHelper.java       27 Mar 2007 17:46:55 -0000
@@ -409,11 +409,13 @@
          return new ArrayList(map.values());
      }
-    public static ArrayList filterStringValues(ArrayList list,  
String mask)
+    public static ArrayList filterStringValues(
+        final ArrayList list,
+        final String mask)
      {
-        if(list==null || mask==null|
-           list.size()==0)
+        if(list==null || mask==null || list.size()==0)
              return list;
+
          String regexp;
          boolean bRemovePrefixBeforeMatching = true;
          final String MUSTBE_PREFIX = "[\\"+VALUE_PREFIX_SYMB+"]";
@@ -436,7 +438,7 @@
              regexp = regexp.replace("$", "\\$");
              regexp = regexp.replace("*",  ".*");
          }
-        ArrayList out = new ArrayList();
+        final ArrayList out = new ArrayList();
          for(int i=0; i<list.size(); i++)
          {
              String dottedName = (String)list.get(i);
RCS file: /cvs/glassfish/admin-core/admin/src/java/com/sun/enterprise/ 
admin/meta/MBeanRegistry.java,v
retrieving revision 1.10
diff -w -u -r1.10 MBeanRegistry.java
--- admin-core/admin/src/java/com/sun/enterprise/admin/meta/ 
MBeanRegistry.java  13 Jan 2007 03:25:41 -0000      1.10
+++ admin-core/admin/src/java/com/sun/enterprise/admin/meta/ 
MBeanRegistry.java  27 Mar 2007 17:46:55 -0000
@@ -243,9 +243,9 @@
      private final static String MSG_FINDREGISTRYENTRY_FAILED =  
"mbean.config.findregistryentry_failed";
      // Logging
-    static protected Logger _sLogger = LogDomains.getLogger 
(LogDomains.ADMIN_LOGGER);
+    protected static final Logger _sLogger = LogDomains.getLogger 
(LogDomains.ADMIN_LOGGER);
-    private MBeanRegistryEntry[] entries = null;
+    private volatile MBeanRegistryEntry[] entries = null;
      public String toString()
      {
RCS file: /cvs/glassfish/admin-core/admin/src/java/com/sun/enterprise/ 
admin/meta/MBeanRegistryEntry.java,v
retrieving revision 1.7
diff -w -u -r1.7 MBeanRegistryEntry.java
--- admin-core/admin/src/java/com/sun/enterprise/admin/meta/ 
MBeanRegistryEntry.java     8 May 2006 17:18:53 -0000       1.7
+++ admin-core/admin/src/java/com/sun/enterprise/admin/meta/ 
MBeanRegistryEntry.java     27 Mar 2007 17:46:55 -0000
@@ -503,7 +503,6 @@
          AttributeInfo ai = findAttributeInfo(attrName);
          if(ai==null)
          {
-            String str[] = new String[2];
              ai = new AttributeInfo();
              ai.setName(attrName);
              ai.setType(attrType);
RCS file: /cvs/glassfish/admin-core/admin/src/java/com/sun/enterprise/ 
admin/meta/MBeanRegistryFactory.java,v
retrieving revision 1.8
diff -r1.8 MBeanRegistryFactory.java
159c159
<     private static AdminContext  adminContext = null;
---
 >     private static volatile AdminContext  adminContext = null;
173c173
<     static public void setAdminMBeanRegistry(MBeanRegistry registry)
---
 >     static public synchronized void setAdminMBeanRegistry 
(MBeanRegistry registry)
RCS file: /cvs/glassfish/admin-core/monitor/src/java/com/sun/ 
enterprise/admin/monitor/stats/StatisticImpl.java,v
retrieving revision 1.2
diff -r1.2 StatisticImpl.java
57,58c57,58
<       public static String    DEFAULT_UNIT = null;
<     public static StringManager localStrMgr = null;
---
 >       public static final String      DEFAULT_UNIT;
 >     public static final StringManager localStrMgr;
RCS file: /cvs/glassfish/admin-core/monitor/src/java/com/sun/ 
enterprise/admin/monitor/stats/lb/ClusterStats.java,v
retrieving revision 1.2
diff -w -u -r1.2 ClusterStats.java
--- admin-core/monitor/src/java/com/sun/enterprise/admin/monitor/ 
stats/lb/ClusterStats.java     25 Dec 2005 03:52:29 -0000      1.2
+++ admin-core/monitor/src/java/com/sun/enterprise/admin/monitor/ 
stats/lb/ClusterStats.java     27 Mar 2007 17:46:55 -0000
@@ -32,7 +32,7 @@
public class ClusterStats implements  
com.sun.enterprise.admin.monitor.stats.lb.ClusterStatsInterface,  
com.sun.enterprise.admin.monitor.stats.lb.CommonBean {
         private java.lang.String _Id;
-       private java.util.List _InstanceStats = new  
java.util.ArrayList();      // List<InstanceStats>
+       private final java.util.List _InstanceStats = new  
java.util.ArrayList();        // List<InstanceStats>
         public ClusterStats() {
                 _Id = "";
@@ -172,20 +172,20 @@
         public void changePropertyByName(String name, Object value) {
                 if (name == null) return;
                 name = name.intern();
-               if (name == "id")
+               if (name.equals("id"))
                         setId((java.lang.String)value);
-               else if (name == "instanceStats")
+               else if (name.equals("instanceStats"))
                         addInstanceStats((InstanceStats)value);
-               else if (name == "instanceStats[]")
+               else if (name.equals("instanceStats[]"))
                         setInstanceStats((InstanceStats[]) value);
                 else
                         throw new IllegalArgumentException(name+" is  
not a valid property name for ClusterStats");
         }
         public Object fetchPropertyByName(String name) {
-               if (name == "id")
+               if (name.equals("id"))
                         return getId();
-               if (name == "instanceStats[]")
+               if (name.equals("instanceStats[]"))
                         return getInstanceStats();
                 throw new IllegalArgumentException(name+" is not a  
valid property name for ClusterStats");
         }
RCS file: /cvs/glassfish/admin-core/monitor/src/java/com/sun/ 
enterprise/admin/monitor/stats/lb/LoadBalancerStats.java,v
retrieving revision 1.2
diff -w -u -r1.2 LoadBalancerStats.java
--- admin-core/monitor/src/java/com/sun/enterprise/admin/monitor/ 
stats/lb/LoadBalancerStats.java        25 Dec 2005 03:52:32  
-0000      1.2
+++ admin-core/monitor/src/java/com/sun/enterprise/admin/monitor/ 
stats/lb/LoadBalancerStats.java        27 Mar 2007 17:46:55 -0000
@@ -279,8 +279,8 @@
                         throw new IllegalArgumentException(name+" is  
not a valid property name for LoadBalancerStats");
         }
-       public Object fetchPropertyByName(String name) {
-               if (name == "clusterStats[]")
+       public Object fetchPropertyByName(final String name) {
+               if (name.equals("clusterStats[]"))
                         return getClusterStats();
                 throw new IllegalArgumentException(name+" is not a  
valid property name for LoadBalancerStats");
         }
RCS file: /cvs/glassfish/admin-core/util/src/java/com/sun/enterprise/ 
admin/util/JvmOptionsHelper.java,v
retrieving revision 1.2
diff -w -u -r1.2 JvmOptionsHelper.java
--- admin-core/util/src/java/com/sun/enterprise/admin/util/ 
JvmOptionsHelper.java        25 Dec 2005 03:53:09 -0000      1.2
+++ admin-core/util/src/java/com/sun/enterprise/admin/util/ 
JvmOptionsHelper.java        27 Mar 2007 17:46:55 -0000
@@ -235,7 +235,7 @@
              String getJvmOptionsAsStoredInXml() { return ""; }
              ArrayList getJvmOptions() { return new ArrayList(); }
              boolean hasNext() { return false; }
-            void setNext() { throw new UnsupportedOperationException 
(); }
+            void setNext(JvmOptionsElement element) { throw new  
UnsupportedOperationException(); }
          };
      private final Set jvmOptions = new LinkedHashSet();
RCS file: /cvs/glassfish/admin-core/util/src/java/com/sun/enterprise/ 
admin/util/XMLAlterUtil.java,v
retrieving revision 1.2
diff -w -u -r1.2 XMLAlterUtil.java
--- admin-core/util/src/java/com/sun/enterprise/admin/util/ 
XMLAlterUtil.java    25 Dec 2005 03:53:17 -0000      1.2
+++ admin-core/util/src/java/com/sun/enterprise/admin/util/ 
XMLAlterUtil.java    27 Mar 2007 17:46:55 -0000
@@ -72,9 +72,9 @@
* @author
*/
-class NOOPHandler extends DefaultHandler {
+final class NOOPHandler extends DefaultHandler {
-    static String _dtdFileName;
+    private final String _dtdFileName;
      NOOPHandler(String dtdFileName) {
          super();
RCS file: /cvs/glassfish/admin-ee/jes-mf/src/java/com/sun/mfwk/agent/ 
appserv/util/BundleReader.java,v
retrieving revision 1.1.1.1
diff -w -u -r1.1.1.1 BundleReader.java
--- admin-ee/jes-mf/src/java/com/sun/mfwk/agent/appserv/util/ 
BundleReader.java  18 Jan 2007 23:29:29 -0000      1.1.1.1
+++ admin-ee/jes-mf/src/java/com/sun/mfwk/agent/appserv/util/ 
BundleReader.java  27 Mar 2007 17:46:55 -0000
@@ -23,7 +23,7 @@
     /**
      * A resource bundle of this reader.
      */
-    private static ResourceBundle resourceBundle;
+    private static volatile ResourceBundle resourceBundle;
      /** Creates a new instance of BundleReader */
RCS file: /cvs/glassfish/appserv-addons/impl/src/java/com/sun/ 
enterprise/addons/AddonController.java,v
retrieving revision 1.4
diff -r1.4 AddonController.java
48a49
 >  * <p><b>NOT THREAD SAFE: mutable instance variable: logger,  
installRoot, servicesAreLoaded</b>
57,60c58,61
<     private HashMap apiBasedServices = new HashMap();
<     private HashMap mainClassBasedServices = new HashMap();
<     private HashMap simpleJars = new HashMap();
<     private File installRoot = null;
---
 >     private final HashMap apiBasedServices = new HashMap();
 >     private final HashMap mainClassBasedServices = new HashMap();
 >     private final HashMap simpleJars = new HashMap();
 >     private volatile File installRoot = null;
63,65c64,66
<     private Logger logger = null;
<     protected static StringManager localStrings =
<     StringManager.getManager(AddonController.class);
---
 >     private volatile Logger logger = null;
 >     protected static final StringManager localStrings =
 >         StringManager.getManager(AddonController.class);
254c255
<     protected Logger getLogger() {
---
 >     protected synchronized Logger getLogger() {
RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/ 
corba/ee/internal/util/LogWrap.java,v
retrieving revision 1.3
diff -r1.3 LogWrap.java
38c38
<     public static Logger logger;
---
 >     public static final Logger logger;
50a51,53
 >         // use a temp variable so that 'logger' may be 'final'
 >         Logger tempLogger=null;
 >
52,53c55,56
<             logger = getLoggerUsingLogDomainsAPI();
<             if (logger == null) {
---
 >             tempLogger = getLoggerUsingLogDomainsAPI();
 >             if (tempLogger == null) {
60c63
<         if (logger == null) {
---
 >         if (tempLogger == null) {
62,63c65,66
<                 logger = getLoggerUsingJavaLoggingAPI();
<                 if (logger == null) {
---
 >                 tempLogger = getLoggerUsingJavaLoggingAPI();
 >                 if (tempLogger == null) {
70a74
 >         logger = tempLogger;
RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/ 
log/Log.java,v
retrieving revision 1.3
diff -w -u -r1.3 Log.java
--- appserv-commons/src/java/com/sun/enterprise/log/Log.java    25  
Dec 2005 04:11:54 -0000      1.3
+++ appserv-commons/src/java/com/sun/enterprise/log/Log.java    27  
Mar 2007 17:46:57 -0000
@@ -35,9 +35,9 @@
   *  Error log is set to the the PrintStream System.err.
   * @author Harish Prabandham
   */
-public class Log {
-    public static PrintStream out = System.out;
-    public static PrintStream err = System.err;
+public final class Log {
+    public static final PrintStream out = System.out;
+    public static final PrintStream err = System.err;
      public static void flushAll() {
         if(System.out != null)
RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/ 
util/XMLFileTransformer.java,v
retrieving revision 1.3
diff -w -u -r1.3 XMLFileTransformer.java
--- appserv-commons/src/java/com/sun/enterprise/util/ 
XMLFileTransformer.java    25 Dec 2005 04:12:06 -0000      1.3
+++ appserv-commons/src/java/com/sun/enterprise/util/ 
XMLFileTransformer.java    27 Mar 2007 17:46:57 -0000
@@ -58,8 +58,7 @@
   * constructor of this class.
   **/
class NOOPHandler extends DefaultHandler {
-
-    static String _dtdFileName;
+    private final String _dtdFileName;
      NOOPHandler(String dtdFileName) {
          super();
RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/ 
util/pool/AbstractPool.java,v
retrieving revision 1.3
diff -w -u -r1.3 AbstractPool.java
--- appserv-commons/src/java/com/sun/enterprise/util/pool/ 
AbstractPool.java     25 Dec 2005 04:12:26 -0000      1.3
+++ appserv-commons/src/java/com/sun/enterprise/util/pool/ 
AbstractPool.java     27 Mar 2007 17:46:57 -0000
@@ -90,7 +90,7 @@
      protected Object                   onHold = null;
      protected Object                   closed = null;
-    protected static ApproximateClock                  _clock = new  
ApproximateClock(15000);
+    protected static final ApproximateClock _clock = new  
ApproximateClock(15000);
      protected PeriodicEventScheduler   scheduler;
RCS file: /cvs/glassfish/appserv-commons-ee/appserv-commons/src/java/ 
com/sun/enterprise/ee/util/zip/Unzipper.java,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 Unzipper.java
60c60
<     protected static Logger _logger =
---
 >     protected static final Logger _logger =
66c66
<     protected String _targetDirectory;
---
 >     protected final String _targetDirectory;
69c69
<     protected List _ignoreList;
---
 >     protected final List _ignoreList;
72c72
<     protected static String _useNio = null;
---
 >     protected static final String _useNio;
74a75,76
 >         // use a temp variable so that '_useNio' can be 'final'
 >         String useNioTemp = null;
76c78
<             _useNio = System.getProperty(Zipper.USE_NIO_KEY);
---
 >             useNioTemp = System.getProperty(Zipper.USE_NIO_KEY);
79a82
 >         _useNio = useNioTemp;
RCS file: /cvs/glassfish/appserv-commons-ee/appserv-commons/src/java/ 
com/sun/enterprise/ee/util/zip/Zipper.java,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 Zipper.java
56a57
 >  * <b>NOT THREAD SAFE: mutable instance variables</b>
60c61
<     protected static Logger _logger =
---
 >     protected static final Logger _logger =
72c73
<     protected List _excludeList = new ArrayList();
---
 >     protected final List _excludeList = new ArrayList();
75c76
<     protected List _excludePatternList = new ArrayList();
---
 >     protected final List _excludePatternList = new ArrayList();
78c79
<     protected List _includePatternList = new ArrayList();
---
 >     protected final List _includePatternList = new ArrayList();
81c82
<     protected List _alwaysIncludeList = new ArrayList();
---
 >     protected final List _alwaysIncludeList = new ArrayList();
96c97
<     protected static String _useNio = null;
---
 >     protected static final String _useNio;
98c99
<     protected static StringManager _localStrMgr =
---
 >     protected static final StringManager _localStrMgr =
101a103,104
 >         // use a temp variable so that '_useNio' can be 'final'
 >         String useNioTemp = null;
103c106
<             _useNio = System.getProperty(USE_NIO_KEY);
---
 >             useNioTemp = System.getProperty(USE_NIO_KEY);
106a110
 >         _useNio = useNioTemp;
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/appserv/ 
management/alert/UnitTest.java,v
retrieving revision 1.5
diff -w -u -r1.5 UnitTest.java
--- appserv-core/src/java/com/sun/appserv/management/alert/ 
UnitTest.java        13 Jan 2007 03:27:35 -0000      1.5
+++ appserv-core/src/java/com/sun/appserv/management/alert/ 
UnitTest.java        27 Mar 2007 17:46:58 -0000
@@ -37,11 +37,11 @@
      static final int UNIT_TEST_MAIL_FILTER = 2;
-    private int unitTestMode = 0;
+    private final int unitTestMode;
-    private String unitTestData = null;
+    private final String unitTestData;
-    private Object mailAlertOrFilter = null;
+    private final Object mailAlertOrFilter;
      /**
       * UnitTest class is used to test MailAlert and Filter facility.
@@ -60,7 +60,11 @@
              // We need to sleep for 1 second to allow the complete
              // initialization of the object which needs to be tested.
              sleep( 1000 );
-        } catch( Exception e ) { }
+        }
+        catch( Exception e )
+        {
+            e.hashCode();  // silence FindBugs
+        }
          StringTokenizer tokenizer = new StringTokenizer 
( unitTestData, ";" );
          switch( unitTestMode ) {
              case UNIT_TEST_MAIL_ALERT:
@@ -168,11 +172,12 @@
      private void unitTestFailed( String propertyName, String  
expectedValue,
          String realValue )
      {
-        System.out.println( "UNIT TEST FAILED FOR ALERTS : " +
+        final String msg =  "UNIT TEST FAILED FOR ALERTS : " +
                              "\nPropertyName -> " + propertyName +
                              "\nexpectedValue -> " + expectedValue +
-                            "\nrealValue -> " + realValue  );
-         new RuntimeException( "Unit Test Failed For Alerts.." );
+                            "\nrealValue -> " + realValue;
+        System.out.println( msg );
+        throw new RuntimeException( msg );
      }
}
RCS file: /cRCS file: /cvs/glassfish/appserv-core/src/java/com/sun/ 
appserv/naming/S1ASCtxFactory.java,v
retrieving revision 1.7
diff -w -r1.7 S1ASCtxFactory.java
64c64
<     protected static Logger _logger = LogDomains.getLogger(
---
 >     protected static final Logger _logger = LogDomains.getLogger(
67c67
<     private static RoundRobinPolicy rrPolicy = null;
---
 >     private static final RoundRobinPolicy rrPolicy;
79c79
<     private Hashtable defaultEnv;
---
 >     private final Hashtable defaultEnv;
81c81
<     private static GroupInfoService gis;
---
 >     private static final GroupInfoService gis;
89c89
<     private static GroupInfoServiceObserverImpl giso;
---
 >     private static final GroupInfoServiceObserverImpl giso;
151a152,154
 >         // use temp variables so that 'gis' and 'giso' can be 'final'
 >         GroupInfoService gisTemp = null;
 >         GroupInfoServiceObserverImpl gisoTemp = null;
169,171c172,175
<             gis = (GroupInfoService) ((ORBManager.getORB 
(props)).resolve_initial_references 
(ORBConstants.FOLB_CLIENT_GROUP_INFO_SERVICE));
<             giso = new GroupInfoServiceObserverImpl(gis);
<             gis.addObserver(giso);
---
 >             gisTemp = (GroupInfoService)
 >             ((ORBManager.getORB(props)).resolve_initial_references 
(ORBConstants.FOLB_CLIENT_GROUP_INFO_SERVICE));
 >             gisoTemp = new GroupInfoServiceObserverImpl(gisTemp);
 >             gisTemp.addObserver(gisoTemp);
176a181,184
 >         finally {
 >             gis     = gisTemp;
 >             giso    = gisoTemp;
 >         }
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/common/DownloadRequestInfo.java,v
retrieving revision 1.3
diff -w -u -r1.3 DownloadRequestInfo.java
--- appserv-core/src/java/com/sun/enterprise/admin/common/ 
DownloadRequestInfo.java      25 Dec 2005 04:13:49 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/common/ 
DownloadRequestInfo.java      27 Mar 2007 17:46:58 -0000
@@ -27,6 +27,7 @@
/**
   * Contains information pertaining to a download request.
+ * <p><b>NOT THREAD SAFE: mutable instance variables</b>
   *
   * @author  Nazrul Islam
   * @since   J2SE1.4
@@ -55,10 +56,10 @@
              _totalFileSize   = f.length();
              // total number of chunks
-            _numChunks  = Math.round(_totalFileSize/ 
ByteChunk.kChunkMaxSize);
+            _numChunks  = (int)(_totalFileSize/ (long) 
ByteChunk.kChunkMaxSize);
              // verifies the total
-            if (_numChunks * ByteChunk.kChunkMaxSize <  
_totalFileSize) {
+            if (_numChunks * (long)ByteChunk.kChunkMaxSize <  
_totalFileSize) {
                  _numChunks += 1;
              }
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/common/JMXFileTransfer.java,v
retrieving revision 1.3
diff -w -u -r1.3 JMXFileTransfer.java
--- appserv-core/src/java/com/sun/enterprise/admin/common/ 
JMXFileTransfer.java  25 Dec 2005 04:13:50 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/common/ 
JMXFileTransfer.java  27 Mar 2007 17:46:58 -0000
@@ -374,7 +374,6 @@
      public String downloadFile(String filePath, String  
destinationDirPath, String appName)
          throws IOException
      {
-        File destDir = new File(destinationDirPath);
          File destPath = null;
          if(appName == null)
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/common/NameParser.java,v
retrieving revision 1.3
diff -w -u -r1.3 NameParser.java
--- appserv-core/src/java/com/sun/enterprise/admin/common/ 
NameParser.java       25 Dec 2005 04:13:51 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/common/ 
NameParser.java       27 Mar 2007 17:46:58 -0000
@@ -46,7 +46,7 @@
      private Vector          mNameParts      =       null;
         // i18n SOMLocalStringsManager
-       private static SOMLocalStringsManager localizedStrMgr =
+       private static final SOMLocalStringsManager localizedStrMgr =
                 SOMLocalStringsManager.getManager( NameParser.class );
      /**
@@ -521,12 +521,12 @@
              Returns the same string if no subscript characters are  
present.
      */
-    private String removeSubscript(String npString)
+    private String removeSubscript(final String npString)
      {
          String  subscriptLessString = null;
          int     leftIndex           = npString.indexOf 
(Tokens.kSubScriptBeginnerChar);
-        if (npString != null || npString.length() > 0)
+        if ( npString.length() > 0 )
          {
              if(leftIndex != -1)
              {
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/common/domains/registry/ContactData.java,v
retrieving revision 1.3
diff -w -u -r1.3 ContactData.java
--- appserv-core/src/java/com/sun/enterprise/admin/common/domains/ 
registry/ContactData.java     25 Dec 2005 04:13:53 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/common/domains/ 
registry/ContactData.java     27 Mar 2007 17:46:58 -0000
@@ -91,7 +91,7 @@
    }
-  public int hashcode(){
+  public int hashCode(){
         final String s = host+port+(useSSL ? "t" : "f");
         return s.hashCode();
    }
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/common/domains/registry/DomainEntry.java,v
retrieving revision 1.3
diff -w -u -r1.3 DomainEntry.java
--- appserv-core/src/java/com/sun/enterprise/admin/common/domains/ 
registry/DomainEntry.java     25 Dec 2005 04:13:54 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/common/domains/ 
registry/DomainEntry.java     27 Mar 2007 17:46:58 -0000
@@ -39,7 +39,7 @@
   */
-public class DomainEntry implements Cloneable, Serializable
+public final class DomainEntry implements Cloneable, Serializable
{
           /**
@@ -107,7 +107,7 @@
         }
    }
-  public int hashcode(){
+  public int hashCode(){
         final String s = this.name+this.root.toString();
         return s.hashCode();
    }
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/common/domains/registry/DomainRegistry.java,v
retrieving revision 1.3
diff -w -u -r1.3 DomainRegistry.java
--- appserv-core/src/java/com/sun/enterprise/admin/common/domains/ 
registry/DomainRegistry.java  25 Dec 2005 04:13:54 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/common/domains/ 
registry/DomainRegistry.java  27 Mar 2007 17:46:58 -0000
@@ -137,7 +137,7 @@
         }
-       void reset() throws IOException {
+       synchronized void reset() throws IOException {
           store.unlock();
           registry = null;
           store = null;
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/event/pluggable/PERestartEventHelper.java,v
retrieving revision 1.4
diff -w -u -r1.4 PERestartEventHelper.java
--- appserv-core/src/java/com/sun/enterprise/admin/event/pluggable/ 
PERestartEventHelper.java    26 Feb 2007 21:29:54 -0000      1.4
+++ appserv-core/src/java/com/sun/enterprise/admin/event/pluggable/ 
PERestartEventHelper.java    27 Mar 2007 17:46:58 -0000
@@ -47,10 +47,10 @@
   *
   * @author: Satish Viswanatham
   */
-public class PERestartEventHelper implements RestartEventHelper{
+public final class PERestartEventHelper implements RestartEventHelper{
      // i18n StringManager
-    private static Logger _logger     =
+    private static final Logger _logger     =
                          Logger.getLogger(LogDomains.ADMIN_LOGGER);
      public PERestartEventHelper() {
@@ -76,7 +76,6 @@
                      getXPathesForDynamicallyNotReconfigurableElements(
                      configChangeList);
-                Set targetSet = new HashSet();
                  Iterator iter = nonDynSet.iterator();
                  if (iter.hasNext()) {
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/server/core/jmx/nonssl/RMIMultiHomedServerSocketFactory.java,v
retrieving revision 1.3
diff -w -u -r1.3 RMIMultiHomedServerSocketFactory.java
--- appserv-core/src/java/com/sun/enterprise/admin/server/core/jmx/ 
nonssl/RMIMultiHomedServerSocketFactory.java 25 Dec 2005 04:14:26  
-0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/server/core/jmx/ 
nonssl/RMIMultiHomedServerSocketFactory.java 27 Mar 2007 17:46:58 -0000
@@ -67,7 +67,7 @@
      private static final String DEFAULT_ADDRESS = "0.0.0.0";
-    private String address = DEFAULT_ADDRESS;
+    private final String address;
      public RMIMultiHomedServerSocketFactory(String host) {
         address = host;
@@ -104,6 +104,11 @@
          } catch (Exception e) {
              throw new IOException(e.getMessage());
          }
+    }
+
+        public int
+    hashCode() {
+        return super.hashCode() ^ address.hashCode();
      }
      /**
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/server/core/mbean/config/ManagedAdminServerInstance.java,v
retrieving revision 1.3
diff -w -u -r1.3 ManagedAdminServerInstance.java
--- appserv-core/src/java/com/sun/enterprise/admin/server/core/mbean/ 
config/ManagedAdminServerInstance.java     25 Dec 2005 04:14:29  
-0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/server/core/mbean/ 
config/ManagedAdminServerInstance.java     27 Mar 2007 17:46:58 -0000
@@ -164,8 +164,8 @@
          boolean canApply = false;
          try {
              initDelegate();
-            InstanceEnvironment ie = new InstanceEnvironment(
-                    ServerManager.ADMINSERVER_ID);
+            //InstanceEnvironment ie = new InstanceEnvironment(
+                   // ServerManager.ADMINSERVER_ID);
              /*
              if (ie.hasHotXmlChanged()) {
                  if (ie.canReloadManualXmlChanges()) {
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/server/core/mbean/config/ManagedStandaloneConnectorModule.java,v
retrieving revision 1.3
diff -w -u -r1.3 ManagedStandaloneConnectorModule.java
--- appserv-core/src/java/com/sun/enterprise/admin/server/core/mbean/ 
config/ManagedStandaloneConnectorModule.java       25 Dec 2005  
04:14:32 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/server/core/mbean/ 
config/ManagedStandaloneConnectorModule.java       27 Mar 2007  
17:46:58 -0000
@@ -247,8 +247,8 @@
      private void multicastAdminEvent(String entityName, String  
actionCode)
                          throws J2EEConnectorModuleException {
          String instanceName = super.getServerInstanceName();
-        InstanceEnvironment instEnv = new InstanceEnvironment 
(instanceName);
          /*
+        InstanceEnvironment instEnv = new InstanceEnvironment 
(instanceName);
          try {
                  instEnv.applyServerXmlChanges(false);
          } catch (Exception e) {
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/server/core/mbean/config/ManagedStandaloneJ2EEWebModule.java,v
retrieving revision 1.3
diff -w -u -r1.3 ManagedStandaloneJ2EEWebModule.java
--- appserv-core/src/java/com/sun/enterprise/admin/server/core/mbean/ 
config/ManagedStandaloneJ2EEWebModule.java 25 Dec 2005 04:14:33  
-0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/server/core/mbean/ 
config/ManagedStandaloneJ2EEWebModule.java 27 Mar 2007 17:46:58 -0000
@@ -298,8 +298,8 @@
      private void multicastAdminEvent(String entityName, String  
actionCode)
                          throws J2EEWebModuleException {
          String instanceName = super.getServerInstanceName();
-        InstanceEnvironment instEnv = new InstanceEnvironment 
(instanceName);
          /*
+        InstanceEnvironment instEnv = new InstanceEnvironment 
(instanceName);
          try {
                  instEnv.applyServerXmlChanges(false);
          } catch (Exception e) {
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/server/core/mbean/config/ModulesXMLHelper.java,v
retrieving revision 1.3
diff -w -u -r1.3 ModulesXMLHelper.java
--- appserv-core/src/java/com/sun/enterprise/admin/server/core/mbean/ 
config/ModulesXMLHelper.java       25 Dec 2005 04:14:33 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/server/core/mbean/ 
config/ModulesXMLHelper.java       27 Mar 2007 17:46:58 -0000
@@ -264,7 +264,6 @@
      private Node findChildNodeByName(Node node, String name)
      {
-        ArrayList resNodes = new ArrayList();
          for (node = node.getFirstChild(); node != null; node =  
node.getNextSibling())
          {
              if(node.getNodeName().equalsIgnoreCase(name))
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/server/core/mbean/config/ServerController.java,v
retrieving revision 1.4
diff -w -u -r1.4 ServerController.java
--- appserv-core/src/java/com/sun/enterprise/admin/server/core/mbean/ 
config/ServerController.java       3 Nov 2006 19:13:26 -0000       1.4
+++ appserv-core/src/java/com/sun/enterprise/admin/server/core/mbean/ 
config/ServerController.java       27 Mar 2007 17:46:58 -0000
@@ -710,8 +710,8 @@
          }
          downloadInfo.downloadFile = downloadFile;
          long size   = downloadInfo.downloadFile.length();
-        downloadInfo.numChunks   = Math.round(size/ 
ByteChunk.kChunkMaxSize);
-        if (downloadInfo.numChunks * ByteChunk.kChunkMaxSize < size)
+        downloadInfo.numChunks   = (int)(size /  
ByteChunk.kChunkMaxSize);
+        if (downloadInfo.numChunks * (long)ByteChunk.kChunkMaxSize <  
size)
          {
              downloadInfo.numChunks += 1;
          }
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/target/TargetBuilder.java,v
retrieving revision 1.4
diff -w -u -r1.4 TargetBuilder.java
--- appserv-core/src/java/com/sun/enterprise/admin/target/ 
TargetBuilder.java    25 Dec 2005 04:14:39 -0000      1.4
+++ appserv-core/src/java/com/sun/enterprise/admin/target/ 
TargetBuilder.java    27 Mar 2007 17:46:58 -0000
@@ -46,7 +46,7 @@
public class TargetBuilder
{
-    public static TargetBuilder INSTANCE;
+    public static final TargetBuilder INSTANCE;
      static {
          PluggableFeatureFactory featureFactory =
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/verifier/Result.java,v
retrieving revision 1.3
diff -w -u -r1.3 Result.java
--- appserv-core/src/java/com/sun/enterprise/admin/verifier/ 
Result.java 25 Dec 2005 04:14:43 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/verifier/ 
Result.java 27 Mar 2007 21:38:47 -0000
@@ -33,22 +33,23 @@
      public static final int NOT_APPLICABLE = 3;
      public static final int NOT_RUN = 4;
      public static final int NOT_IMPLEMENTED = 5;
+
      private int status = NOT_RUN;
      private String componentName;
      private String assertion;
      private String testName;
-    private Vector errorDetails =  new Vector();
-    private Vector goodDetails =  new Vector();
-    private Vector warningDetails =  new Vector();
-    private Vector naDetails =  new Vector();
+    private final Vector errorDetails =  new Vector();
+    private final Vector goodDetails =  new Vector();
+    private final Vector warningDetails =  new Vector();
+    private final Vector naDetails =  new Vector();
      //boolean debug = Verifier.getDebug();
-    boolean debug = false;
+    final boolean debug = false;
      /**
       * Result Constructor
       *
       */
-    public void Result(){
+    public Result(){
      }
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/verifier/ServerMgr.java,v
retrieving revision 1.3
diff -w -u -r1.3 ServerMgr.java
--- appserv-core/src/java/com/sun/enterprise/admin/verifier/ 
ServerMgr.java      25 Dec 2005 04:14:43 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/verifier/ 
ServerMgr.java      27 Mar 2007 17:46:58 -0000
@@ -56,23 +56,25 @@
/**
   *  ServerMgr reads all TestCases and verifies it with server.xml file
   *
+ * <p><b>NOT THREAD SAFE: mutable instance variables with stomp:  
'result'</b>
   */
public class ServerMgr implements ConfigContextEventListener {
      // Logging
-    static Logger _logger = LogDomains.getLogger 
(LogDomains.APPVERIFY_LOGGER);
+    static final Logger _logger = LogDomains.getLogger 
(LogDomains.APPVERIFY_LOGGER);
-    public String testFileName = "ServerTestList.xml";
-    public static HashMap testCases = new HashMap();
-    public static String fileUrl = null;
-    public String description = "Tests for server.xml";
-    public boolean debug;
+    public final String testFileName = "ServerTestList.xml";
+    public static final HashMap testCases = new HashMap();
+    public static volatile String fileUrl = null;
+    public volatile String description = "Tests for server.xml";
+    public final boolean debug;
-    public com.sun.enterprise.admin.verifier.Result result=null;
-    public Vector vresult=null;
+    public volatile com.sun.enterprise.admin.verifier.Result  
result=null;
+   // public final Vector vresult=null;
-    public com.sun.enterprise.util.LocalStringManagerImpl smh =  
StringManagerHelper.getLocalStringsManager();
+    public final com.sun.enterprise.util.LocalStringManagerImpl smh =
+            StringManagerHelper.getLocalStringsManager();
      /** Creates a new instance of ServerCheck */
      public ServerMgr() {
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
admin/verifier/tests/StaticTest.java,v
retrieving revision 1.3
diff -w -u -r1.3 StaticTest.java
--- appserv-core/src/java/com/sun/enterprise/admin/verifier/tests/ 
StaticTest.java       25 Dec 2005 04:14:47 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/admin/verifier/tests/ 
StaticTest.java       27 Mar 2007 17:46:58 -0000
@@ -110,7 +110,7 @@
       */
      public static boolean checkObjectName(String id) throws  
MalformedObjectNameException {
          String name = IAS_NAME + id;
-        ObjectName validObjectName = new ObjectName(name);
+        new ObjectName(name);  // verify that it's good
          return true;
      }
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
deployment/autodeploy/JBIAutoDeployer.java,v
retrieving revision 1.4
diff -w -u -r1.4 JBIAutoDeployer.java
--- appserv-core/src/java/com/sun/enterprise/deployment/autodeploy/ 
JBIAutoDeployer.java 6 Mar 2007 18:35:22 -0000       1.4
+++ appserv-core/src/java/com/sun/enterprise/deployment/autodeploy/ 
JBIAutoDeployer.java 27 Mar 2007 17:46:58 -0000
@@ -64,7 +64,7 @@
   */
public class JBIAutoDeployer {
-    private static JBIAutoDeployer jad = new JBIAutoDeployer();
+    private static final JBIAutoDeployer jad = new JBIAutoDeployer();
      private static final String JBI_STATUS_DIR = ".jbi";
      private static final String DELIMITER = "__";
@@ -75,10 +75,10 @@
              "jbi:jbi/jbi:service-assembly/jbi:identification/ 
jbi:name";
      private String JBIXML = "META-INF/jbi.xml";
-    private JBIDeployer deployer;
+    private final JBIDeployer deployer;
      private static final Logger  
sLogger=AutoDeployControllerImpl.sLogger;
-    private static StringManager localStrings =
+    private static final StringManager localStrings =
              StringManager.getManager( AutoDeployer.class );
@@ -121,6 +121,8 @@
                      jf.close();
                  }
              } catch (Exception e) {
+                // ignore
+                e.hashCode();   // silence FindBugs
              }
          }
      }
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
diagnostics/TargetType.java,v
retrieving revision 1.4
diff -w -u -r1.4 TargetType.java
--- appserv-core/src/java/com/sun/enterprise/diagnostics/ 
TargetType.java        19 Jan 2007 09:13:24 -0000      1.4
+++ appserv-core/src/java/com/sun/enterprise/diagnostics/ 
TargetType.java        27 Mar 2007 17:46:58 -0000
@@ -30,7 +30,7 @@
      public static final TargetType DAS = new TargetType("server");
      public static final TargetType INSTANCE = new TargetType 
("instance");
-    private String type;
+    private final String type;
      /** Creates a new instance of TargetType */
      public TargetType(String type) {
@@ -39,6 +39,11 @@
      public String getType() {
          return type;
+    }
+
+        public int
+    hashCode() {
+        return super.hashCode() ^ type.hashCode();
      }
      public boolean equals(TargetType targetType) {
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
iiop/AlternateIIOPAddressComponent.java,v
retrieving revision 1.3
diff -w -u -r1.3 AlternateIIOPAddressComponent.java
--- appserv-core/src/java/com/sun/enterprise/iiop/ 
AlternateIIOPAddressComponent.java    25 Dec 2005 04:15:36 -0000       
1.3
+++ appserv-core/src/java/com/sun/enterprise/iiop/ 
AlternateIIOPAddressComponent.java    27 Mar 2007 17:46:58 -0000
@@ -34,11 +34,13 @@
public final class AlternateIIOPAddressComponent implements  
org.omg.CORBA.portable.IDLEntity
{
    public static final int TAG_ALTERNATE_IIOP_ADDRESS_ID = 89374;
-  public String host = null;
-  public short port = (short)0;
+  public final String host;
+  public final short port;
    public AlternateIIOPAddressComponent ()
    {
+    host = null;
+    port = 0;
    } // ctor
    public AlternateIIOPAddressComponent (String _host, short _port)
@@ -47,6 +49,11 @@
      port = _port;
    } // ctor
+        public int
+    hashCode() {
+        return super.hashCode() ^ (host == null ? 0 : host.hashCode 
()) ^ port;
+    }
+
      public boolean equals(Object o)
      {
         if (o == null) {
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
iiop/AlternateIIOPAddressComponentHelper.java,v
retrieving revision 1.3
diff -w -u -r1.3 AlternateIIOPAddressComponentHelper.java
--- appserv-core/src/java/com/sun/enterprise/iiop/ 
AlternateIIOPAddressComponentHelper.java      25 Dec 2005 04:15:36  
-0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/iiop/ 
AlternateIIOPAddressComponentHelper.java      27 Mar 2007 17:46:58 -0000
@@ -91,10 +91,9 @@
    public static  
com.sun.enterprise.iiop.AlternateIIOPAddressComponent read  
(org.omg.CORBA.portable.InputStream istream)
    {
-    com.sun.enterprise.iiop.AlternateIIOPAddressComponent value =  
new com.sun.enterprise.iiop.AlternateIIOPAddressComponent ();
-    value.host = istream.read_string ();
-    value.port = istream.read_short ();
-    return value;
+    final String host = istream.read_string ();
+    final short  port = istream.read_short ();
+    return new com.sun.enterprise.iiop.AlternateIIOPAddressComponent 
(host, port);
    }
    public static void write (org.omg.CORBA.portable.OutputStream  
ostream, com.sun.enterprise.iiop.AlternateIIOPAddressComponent value)
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
iiop/POAProtocolMgr.java,v
retrieving revision 1.11
diff -w -u -r1.11 POAProtocolMgr.java
--- appserv-core/src/java/com/sun/enterprise/iiop/ 
POAProtocolMgr.java   23 Dec 2006 13:48:58 -0000      1.11
+++ appserv-core/src/java/com/sun/enterprise/iiop/ 
POAProtocolMgr.java   27 Mar 2007 17:46:58 -0000
@@ -87,10 +87,10 @@
      private static final String ORG_OMG_STUB_PREFIX = "org.omg.stub.";
-    private ORB orb;
-    private Switch theSwitch;
-    private ContainerFactory containerFactory;
-    private PresentationManager presentationMgr;
+    private final ORB orb;
+    private final Switch theSwitch;
+    private volatile ContainerFactory containerFactory;
+    private final PresentationManager presentationMgr;
      public POAProtocolMgr(ORB o)
      {
@@ -123,8 +123,14 @@
      private ContainerFactory getContainerFactory()
      {
-       if ( containerFactory == null )
+        // containerFactory must be 'volatile' for this test to work
+        if ( containerFactory != null ) {
+            return containerFactory;
+        }
+
+        synchronized( this ) {
             containerFactory = theSwitch.getContainerFactory();
+        }
         return containerFactory;
      }
@@ -132,8 +138,7 @@
      public void initializeNaming(File dbDir, int orbInitialPort)  
throws Exception
      {
         // NOTE: The TransientNameService reference is NOT HA.
-        TransientNameService nameService = new
-            TransientNameService((com.sun.corba.ee.spi.orb.ORB)orb);
+        new TransientNameService((com.sun.corba.ee.spi.orb.ORB)orb);
         _logger.log(Level.FINE, "POAProtocolMgr.initializeNaming:  
complete");
      }
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
instance/BaseManager.java,v
retrieving revision 1.15
diff -w -u -r1.15 BaseManager.java
--- appserv-core/src/java/com/sun/enterprise/instance/ 
BaseManager.java  15 Feb 2007 18:30:01 -0000      1.15
+++ appserv-core/src/java/com/sun/enterprise/instance/ 
BaseManager.java  27 Mar 2007 17:46:58 -0000
@@ -75,15 +75,15 @@
   */
public abstract class BaseManager {
-    protected ConfigContext configContext;
-    protected ConfigBean configBean;
-    private DasConfig appConfig;
-    protected InstanceEnvironment instanceEnvironment;
-    protected boolean useBackupServerXml = true;
+    protected volatile ConfigContext configContext;
+    protected volatile ConfigBean configBean;
+    private final DasConfig appConfig;
+    protected final InstanceEnvironment instanceEnvironment;
+    protected final boolean useBackupServerXml;
      protected static final String SYSTEM_PREFIX = "system-";
      protected static final String SYSTEM_ADMIN_PREFIX = "system- 
admin";
-    protected static Logger _logger=LogDomains.getLogger 
(LogDomains.CORE_LOGGER);
-    private static Map registeredDescriptors;
+    protected static final Logger _logger=LogDomains.getLogger 
(LogDomains.CORE_LOGGER);
+    //private static Map registeredDescriptors;
      /** javac debug option */
      private static final String DEBUG_OPTION = "-g";
@@ -118,6 +118,7 @@
              if (configContext == null) {
                  configContext = ConfigFactory.createConfigContext 
(fileUrl);
              }
+
              configBean = ConfigBeansFactory.getConfigBeanByXPath 
(this.configContext,
                                           
ServerXPathHelper.XPATH_APPLICATIONS);
              //RAMAKANTH
@@ -126,14 +127,17 @@
              }
              //ROB: config changes
-            appConfig = ServerBeansFactory.getDasConfigBean 
(configContext);
-
+            // use 'appConfigTemp' so that 'appConfig' can be 'final'
+            DasConfig appConfigTemp =
+                ServerBeansFactory.getDasConfigBean(configContext);
              //RAMAKANTH
              //Why?? what does this mean??
-            if (appConfig == null) {
-                appConfig = new DasConfig();
+            if (appConfigTemp == null) {
+                appConfigTemp = new DasConfig();
              }
+            appConfig   = appConfigTemp;
+
          }
          catch(Exception e) {
                         throw new ConfigException(Localizer.getValue 
(ExceptionType.MISSING_SERVER_NODE), e);
@@ -551,7 +555,7 @@
       * @throws   ConfigException    if null config context or an  
error while
       *                              retrieving the config bean
       */
-    public void refreshConfigContext(ConfigContext ctx) throws  
ConfigException {
+    public synchronized void refreshConfigContext(ConfigContext ctx)  
throws ConfigException {
          this.configContext = ctx;
          this.configBean = ConfigBeansFactory.
@@ -559,7 +563,7 @@
                                       
ServerXPathHelper.XPATH_APPLICATIONS);
      }
-    public void refreshConfigContext() throws ConfigException {
+    public synchronized void refreshConfigContext() throws  
ConfigException {
          configContext.refresh(true);
          configBean = ConfigBeansFactory.getConfigBeanByXPath 
(this.configContext,
                                       
ServerXPathHelper.XPATH_APPLICATIONS);
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
launcher/StatusProber.java,v
retrieving revision 1.3
diff -w -u -r1.3 StatusProber.java
--- appserv-core/src/java/com/sun/enterprise/launcher/ 
StatusProber.java 25 Dec 2005 04:15:44 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/launcher/ 
StatusProber.java 27 Mar 2007 17:46:58 -0000
@@ -40,7 +40,7 @@
   */
public class StatusProber {
-    String domainConfigFilePath = "domain.xml";
+    final String domainConfigFilePath;
      public static void main( String[] args ) {
          if ( args.length != 1 ) {
@@ -51,8 +51,7 @@
          String domainConfigFilePath = instanceRoot + File.separator +
                  "config" + File.separator +
                  "domain.xml";
-        StatusProber sp = new StatusProber( domainConfigFilePath);
-
+        new StatusProber( domainConfigFilePath);
              //System.out.println("Domain Config Path -> "  
+domainConfigFilePath);
      }
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
loader/ClassLoaderUtils.java,v
retrieving revision 1.5
diff -w -u -r1.5 ClassLoaderUtils.java
--- appserv-core/src/java/com/sun/enterprise/loader/ 
ClassLoaderUtils.java       25 Dec 2005 04:15:45 -0000      1.5
+++ appserv-core/src/java/com/sun/enterprise/loader/ 
ClassLoaderUtils.java       27 Mar 2007 17:46:58 -0000
@@ -265,18 +265,21 @@
          return list;
      }
+    private static final URL[] EMPTY_URL_ARRAY = new URL[0];
+
      /**
       * get URL[] from classpath
       * catches exception for wrong files
       */
      public static URL[] getUrlsFromClasspath(String classpath) {
+        final List<URL> urls  = new ArrayList<URL>();
-        List urls  = new ArrayList();
-
-        if (classpath == null) return (URL[]) urls.toArray(); // 
return empty arr
+        if (classpath == null) {
+            return EMPTY_URL_ARRAY;
+        }
          // tokenize classpath
-        StringTokenizer st = new StringTokenizer(classpath,  
File.pathSeparator);
+        final StringTokenizer st = new StringTokenizer(classpath,  
File.pathSeparator);
          while (st.hasMoreTokens()) {
              try {
                  File f = new File(st.nextToken());
@@ -291,7 +294,7 @@
          URL[] ret;
          if (urls.size() > 0) {
              ret = new URL[urls.size()];
-            ret = (URL[]) urls.toArray(ret);
+            ret = urls.toArray(ret);
          } else {
              ret = new URL[0];
          }
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
loader/EJBClassLoader.java,v
retrieving revision 1.19
diff -w -u -r1.19 EJBClassLoader.java
--- appserv-core/src/java/com/sun/enterprise/loader/ 
EJBClassLoader.java 11 Dec 2006 15:24:29 -0000      1.19
+++ appserv-core/src/java/com/sun/enterprise/loader/ 
EJBClassLoader.java 27 Mar 2007 17:46:58 -0000
@@ -92,29 +92,29 @@
          implements JasperAdapter, InstrumentableClassLoader {
      /** logger for this class */
-    static Logger _logger=LogDomains.getLogger 
(LogDomains.LOADER_LOGGER);
+    static final Logger _logger=LogDomains.getLogger 
(LogDomains.LOADER_LOGGER);
      /** list of url entries of this class loader */
-    private List<URLEntry> urlSet = Collections.synchronizedList(new  
ArrayList());
+    private final List<URLEntry> urlSet =  
Collections.synchronizedList(new ArrayList());
      /** cache of not found resources */
-    private Map notFoundResources   = new HashMap();
+    private final Map<String,String> notFoundResources   = new  
HashMap<String,String>();
      /** cache of not found classes */
-    private Map notFoundClasses     = new HashMap();
+    private final Map<String,String> notFoundClasses     = new  
HashMap<String,String>();
      /** state flag to track whether this instance has been shut  
off.  */
-    private boolean doneCalled = false;
+    private volatile boolean doneCalled = false;
      /** snapshot of classloader state at the time done was called */
-    private String doneSnapshot;
+    private volatile String doneSnapshot;
      /** streams opened by this loader */
-    private Vector<SentinelInputStream> streams = null;
+    private volatile Vector<SentinelInputStream> streams = null;
-    private ArrayList<ClassTransformer> transformers =
+    private final ArrayList<ClassTransformer> transformers =
              new ArrayList<ClassTransformer>(1);
-    private static StringManager sm =
+    private static final StringManager sm =
          StringManager.getManager(EJBClassLoader.class);
      private static final String LINE_SEP = System.getProperty 
("line.separator");
@@ -189,9 +189,9 @@
          if (this.notFoundClasses != null)    
{ this.notFoundClasses.clear();   }
          // sets all the objects to null
-        this.urlSet              = null;
-        this.notFoundResources   = null;
-        this.notFoundClasses     = null;
+        //this.urlSet              = null;
+        //this.notFoundResources   = null;
+        //this.notFoundClasses     = null;
      }
@@ -1087,7 +1087,7 @@
       *Returns the vector of open streams; creates it if needed.
       *_at_return Vector<SentinelInputStream> holding open streams
       */
-    private Vector<SentinelInputStream> getStreams() {
+    private synchronized Vector<SentinelInputStream> getStreams() {
          if (streams == null) {
              streams = new Vector<SentinelInputStream>();
          }
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
management/selfmanagement/SelfManagementService.java,v
retrieving revision 1.12
diff -w -u -r1.12 SelfManagementService.java
--- appserv-core/src/java/com/sun/enterprise/management/ 
selfmanagement/SelfManagementService.java       22 Jan 2007 12:51:28  
-0000      1.12
+++ appserv-core/src/java/com/sun/enterprise/management/ 
selfmanagement/SelfManagementService.java       27 Mar 2007 17:46:58  
-0000
@@ -69,7 +69,7 @@
   */
public class SelfManagementService implements ServerLifecycle {
-    static private Logger _logger = LogDomains.getLogger(
+    static private final Logger _logger = LogDomains.getLogger(
                                               
LogDomains.SELF_MANAGEMENT_LOGGER);
      private static SelfManagementService serviceInstance = null;
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
naming/SerialContext.java,v
retrieving revision 1.9
diff -w -u -r1.9 SerialContext.java
--- appserv-core/src/java/com/sun/enterprise/naming/ 
SerialContext.java  16 Oct 2006 23:36:03 -0000      1.9
+++ appserv-core/src/java/com/sun/enterprise/naming/ 
SerialContext.java  27 Mar 2007 17:46:58 -0000
@@ -47,26 +47,28 @@
   * are serviced by SerialContext. The namespace is implemented in
   * the J2EE server in the SerialContextProviderImpl object, which is
   * accessed over RMI-IIOP from clients.
+ * <p><b>NOT THREAD SAFE: mutable instance variables</b>
   */
public class SerialContext implements Context {
-    static Logger _logger=LogDomains.getLogger(LogDomains.JNDI_LOGGER);
+    private static final Logger _logger=LogDomains.getLogger 
(LogDomains.JNDI_LOGGER);
-    static private NameParser myParser = new SerialNameParser();
+    private static final NameParser myParser = new SerialNameParser();
-    private Hashtable myEnv;
-    private SerialContextProvider provider;
+    private Hashtable myEnv=null;  // THREAD UNSAFE
+
+    private SerialContextProvider provider;  // THREAD UNSAFE
      private static Hashtable providerCache = new Hashtable();
-    private String myName;
-    private javaURLContext javaUrlContext = null;
+    private final String myName;
+    private final javaURLContext javaUrlContext;
-    private final static String JAVA_URL = "java:";
-    private InitialContext cosContext;
-    private static Boolean threadlock = new Boolean(true);
+    private static final String JAVA_URL = "java:";
+    // private InitialContext cosContext;
+    private static final Boolean threadlock = new Boolean(true);
-    private static ThreadLocal stickyContext = new ThreadLocal();
+    private static final ThreadLocal stickyContext = new ThreadLocal();
-    private boolean isEE = false;
+    private final boolean isEE;
      /**
       * set and get methods for preserving stickiness.
@@ -161,6 +163,7 @@
                     } else {
                         provider = (SerialContextProvider)  
providerCache.get(orb);
+            // thread-safety: race condition
                         if (provider == null) {
                             ref = orb.resolve_initial_references 
("NameService");
                             provider = narrowProvider(ref);
@@ -201,7 +204,7 @@
       * Constructor for the context. Initializes the object reference
       * to the remote provider object.
       */
-    public SerialContext(Hashtable environment) throws  
NamingException {
+    public SerialContext(String name, Hashtable environment) throws  
NamingException {
          myEnv = (environment != null)
             ? (Hashtable)(environment.clone())
@@ -211,23 +214,31 @@
         // if J2EEServer is not yet started. Get it lazily when needed.
         //provider = SerialContext.getProvider(myEnv);
-       this.myName = "";
+        this.myName = name;
         if (_logger.isLoggable(Level.FINE))
             _logger.fine("SerialContext ==> SerialContext instance  
created : " + this);
+        // using these two temp variables allows instance variables
+        // to be 'final'.
+        javaURLContext  urlContextTemp = null;
+        boolean         isEETemp    = false;
         if (myEnv.get("com.sun.appserv.ee.iiop.endpointslist") !=  
null) {
-           isEE = true;
-           javaUrlContext = new javaURLContext(myEnv, this);
-       } else javaUrlContext = new javaURLContext(myEnv, null);
+            isEETemp = true;
+            urlContextTemp = new javaURLContext(myEnv, this);
+        }
+        else {
+            urlContextTemp = new javaURLContext(myEnv, null);
+        }
+        javaUrlContext  = urlContextTemp;
+        isEE    = isEETemp;
      }
      /**
       * This constructor takes the component id as an argument. All
       * name arguments to operations are prepended by the component id.
       */
-    public SerialContext(String name, Hashtable env) throws  
NamingException {
-       this(env);
-       this.myName = name;
+    public SerialContext(Hashtable env) throws NamingException {
+        this("", env);
      }
@@ -853,22 +864,21 @@
          Context ctx;
          int count = 0;
-        public ThreadLocalIC(Context ctx, int count) {
-           this.ctx = ctx;
-           this.count = count;
+        public ThreadLocalIC(Context ctxIn, int countIn) {
+            ctx = ctxIn;
+            count = countIn;
         }
-        public void setStickyContext(Context ctx) {
-           ctx = ctx;
+        public void setStickyContext(Context ctxIn) {
+            ctx = ctxIn;
         }
          public Context getStickyContext() {
             return ctx;
         }
-        public void setStickyCount(int count) {
-           count = count;
-
+        public void setStickyCount(int countIn) {
+            count = countIn;
         }
          public int getStickyCount() {
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
repository/ExternalJndiResource.java,v
retrieving revision 1.3
diff -w -u -r1.3 ExternalJndiResource.java
--- appserv-core/src/java/com/sun/enterprise/repository/ 
ExternalJndiResource.java       25 Dec 2005 04:15:51 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/repository/ 
ExternalJndiResource.java       27 Mar 2007 17:46:58 -0000
@@ -27,6 +27,7 @@
/**
   * Resource info for ExternalJndiResource.
   * IASRI #4626188
+ * <p><b>NOT THREAD SAFE: mutable instance variables</b>
   * @author Sridatta Viswanath
   */
public class ExternalJndiResource extends J2EEResourceBase implements  
Serializable {
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
repository/IASJ2EEResourceFactoryImpl.java,v
retrieving revision 1.4
diff -w -u -r1.4 IASJ2EEResourceFactoryImpl.java
--- appserv-core/src/java/com/sun/enterprise/repository/ 
IASJ2EEResourceFactoryImpl.java 14 Nov 2006 18:52:14 -0000      1.4
+++ appserv-core/src/java/com/sun/enterprise/repository/ 
IASJ2EEResourceFactoryImpl.java 27 Mar 2007 17:46:59 -0000
@@ -53,15 +53,14 @@
   * Implementation of J2EEResourceFactory.  Reads and writes
   * XML Resource properties and converts them to J2EEResources.
   * IASRI #4626188
+ * <p><b>NOT THREAD SAFE: mutable instance variables</b>
   * @author Sridatta Viswanath
   */
public class IASJ2EEResourceFactoryImpl implements J2EEResourceFactory {
// IASRI 4660742 START
-    private static Logger _logger=null;
-    static{
-       _logger=LogDomains.getLogger(LogDomains.ROOT_LOGGER);
-        }
+    private static final Logger _logger=LogDomains.getLogger 
(LogDomains.ROOT_LOGGER);
+
// IASRI 4660742 END
      static final String JMS_QUEUE = "javax.jms.Queue";
      static final String JMS_TOPIC = "javax.jms.Topic";
@@ -97,18 +96,19 @@
      private Resources rBean = null;
      private String serverName = null;
-    private static J2EEResourceCollection  resources = null;
+    private volatile J2EEResourceCollection  resources = null;
      public J2EEResourceCollection loadDefaultResourceCollection()
                                              throws  
J2EEResourceException {
          if (resources != null) {
              return resources;
-        } else {
-            return loadResourceCollection(null);
          }
+
+        return loadResourceCollection(null);
      }
-    public J2EEResourceCollection loadResourceCollection(String  
resourcesURL)
+    public synchronized J2EEResourceCollection
+    loadResourceCollection(String resourcesURL)
                                              throws  
J2EEResourceException {
          resources = new J2EEResourceCollectionImpl();
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
repository/J2EEResource.java,v
retrieving revision 1.3
diff -w -u -r1.3 J2EEResource.java
--- appserv-core/src/java/com/sun/enterprise/repository/ 
J2EEResource.java       25 Dec 2005 04:15:51 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/repository/ 
J2EEResource.java       27 Mar 2007 17:46:59 -0000
@@ -34,21 +34,21 @@
      /**
       * Resource Types
       */
-    int JMS_DESTINATION    = 1;
-    int JMS_CNX_FACTORY    = 2;
-    int JDBC_RESOURCE      = 3;
-    int JDBC_XA_RESOURCE   = 4;
-    int JDBC_DRIVER        = 5;
-    int CONNECTOR_RESOURCE = 6;
-    int RESOURCE_ADAPTER   = 7;
+    final int JMS_DESTINATION    = 1;
+    final int JMS_CNX_FACTORY    = 2;
+    final int JDBC_RESOURCE      = 3;
+    final int JDBC_XA_RESOURCE   = 4;
+    final int JDBC_DRIVER        = 5;
+    final int CONNECTOR_RESOURCE = 6;
+    final int RESOURCE_ADAPTER   = 7;
      // START OF IASRI #4626188
-    int JDBC_CONNECTION_POOL   = 8;
-    int PMF_RESOURCE           = 9;
-    int EXTERNAL_JNDI_RESOURCE = 10;
-    int CUSTOM_RESOURCE        = 11;
+    final int JDBC_CONNECTION_POOL   = 8;
+    final int PMF_RESOURCE           = 9;
+    final int EXTERNAL_JNDI_RESOURCE = 10;
+    final int CUSTOM_RESOURCE        = 11;
      // START OF IASRI #4650786
-    int MAIL_RESOURCE          = 12;
+    final int MAIL_RESOURCE          = 12;
      // END OF IASRI #4650786
      // END OF IASRI #4626188
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
server/logging/LogMBean.java,v
retrieving revision 1.12
diff -w -u -r1.12 LogMBean.java
--- appserv-core/src/java/com/sun/enterprise/server/logging/ 
LogMBean.java       13 Mar 2006 23:32:07 -0000      1.12
+++ appserv-core/src/java/com/sun/enterprise/server/logging/ 
LogMBean.java       27 Mar 2007 17:47:00 -0000
@@ -254,18 +254,16 @@
              ATTR_ERROR_STATISTICS_INTERVAL_DURATION_DESCRIPTION =
          "Duration of each interval for which error statistics are  
retained.";
-    private static MBeanOperationInfo[] operationInfoArray =
+    private static final MBeanOperationInfo[] operationInfoArray =
          new MBeanOperationInfo[11];
-    private static MBeanAttributeInfo[] attributeInfoArray =
+    private static final MBeanAttributeInfo[] attributeInfoArray =
          new MBeanAttributeInfo[7];
      /**
       * Info on this MBean
       */
-    private static MBeanInfo mBeanInfo;
-
-    private MBeanServer mbeanServer = null;
+    private static final MBeanInfo _mBeanInfo = initializeMBeanInfo();
      private static LogMBean mbeanInstance = null;
@@ -275,7 +273,6 @@
      public synchronized static LogMBean getInstance( ) {
          if( mbeanInstance == null ) {
              mbeanInstance = new LogMBean();
-            mbeanInstance.initialize( );
          }
          return mbeanInstance;
      }
@@ -286,7 +283,8 @@
      private LogMBean( ) { }
-    public void initialize( ) {
+    public static MBeanInfo initializeMBeanInfo( ) {
+        MBeanInfo mBeanInfo = null;
          try {
              if ( attributeInfoArray.length != 7 ) {
@@ -440,6 +438,8 @@
                  "Error in LogMBean Initialization", e,
                  ErrorManager.GENERIC_FAILURE );
          }
+
+       return mBeanInfo;
      }
@@ -787,7 +787,7 @@
       *         by this monitoring MBean.
       */
      public MBeanInfo getMBeanInfo() {
-        return mBeanInfo;
+        return _mBeanInfo;
      }
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
server/logging/ServerLogManager.java,v
retrieving revision 1.12
diff -w -u -r1.12 ServerLogManager.java
--- appserv-core/src/java/com/sun/enterprise/server/logging/ 
ServerLogManager.java       1 Sep 2006 20:37:27 -0000       1.12
+++ appserv-core/src/java/com/sun/enterprise/server/logging/ 
ServerLogManager.java       27 Mar 2007 17:47:00 -0000
@@ -56,6 +56,7 @@
   * first to set the log levels correctly. We may miss setting some  
of the
   * loglevels, because the values in domain.xml is not available  
when some
   * loggers are created
+ * <p><b>NOT THREAD SAFE: mutable instance variables: verboseMode,  
customFilterError</b>
   */
public class ServerLogManager extends BaseLogManager {
@@ -103,7 +104,14 @@
      public ServerLogManager() {
          super();
-        thisInstance = this;
+    }
+
+        public static synchronized ServerLogManager
+    getInstance() {
+        if ( thisInstance == null ) {
+            thisInstance    = new ServerLogManager();
+        }
+        return thisInstance;
      }
      /**
@@ -548,8 +556,9 @@
                  return;
              }
              Iterator listIterator =  
listOfUnInitializedLoggers.iterator( );
+            final ServerLogManager mgr = getInstance();
              while( listIterator.hasNext( ) ) {
-                thisInstance.initializeLogger( (Logger)  
listIterator.next() );
+                mgr.initializeLogger( (Logger) listIterator.next() );
              }
          } catch( Exception e ) {
              new ErrorManager().error(
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
server/logging/logviewer/backend/LogFilter.java,v
retrieving revision 1.6
diff -w -u -r1.6 LogFilter.java
--- appserv-core/src/java/com/sun/enterprise/server/logging/logviewer/ 
backend/LogFilter.java    24 Feb 2006 17:42:43 -0000      1.6
+++ appserv-core/src/java/com/sun/enterprise/server/logging/logviewer/ 
backend/LogFilter.java    27 Mar 2007 17:47:00 -0000
@@ -423,15 +423,18 @@
      }
-    protected static boolean levelCheck(String loggedLevel, String  
queryLevel,
-            boolean isOnlyLevelFlag)
+    protected static boolean levelCheck(
+        final String loggedLevel,
+        final String queryLevelIn,
+        final boolean isOnlyLevelFlag)
      {
          // If queryLevel is null, that means user is not interested in
          // running the query on the Log Level field.
-        if (queryLevel == null) {
+        if (queryLevelIn == null) {
              return true;
          }
-        queryLevel.trim();
+        final String queryLevel = queryLevelIn.trim();
+
          if (isOnlyLevelFlag) {
              // This means the user is interested in seeing log  
messages whose
              // log level is equal to what is specified
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
server/ondemand/EjbServiceGroup.java,v
retrieving revision 1.15
diff -w -u -r1.15 EjbServiceGroup.java
--- appserv-core/src/java/com/sun/enterprise/server/ondemand/ 
EjbServiceGroup.java       20 Mar 2007 23:42:36 -0000      1.15
+++ appserv-core/src/java/com/sun/enterprise/server/ondemand/ 
EjbServiceGroup.java       27 Mar 2007 17:47:00 -0000
@@ -462,7 +462,7 @@
                 // the remote object then can give the client info  
about all the cluster
                 //instances.
                 _logger.fine("initializing iGIS");
-               InitialGroupInfoService iGIS = new  
InitialGroupInfoService(orb);
+               new InitialGroupInfoService(orb);
                 _logger.fine("binding name INITIAL_GIS...");
             }
             // Initialize Transaction Service
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
server/ondemand/ServiceGroup.java,v
retrieving revision 1.8
diff -w -u -r1.8 ServiceGroup.java
--- appserv-core/src/java/com/sun/enterprise/server/ondemand/ 
ServiceGroup.java  25 Dec 2005 04:16:31 -0000      1.8
+++ appserv-core/src/java/com/sun/enterprise/server/ondemand/ 
ServiceGroup.java  27 Mar 2007 17:47:00 -0000
@@ -57,8 +57,8 @@
   */
public abstract class ServiceGroup {
-    protected static Logger _logger = LogDomains.getLogger 
(LogDomains.CORE_LOGGER);
-    private ArrayList sgList = new ArrayList();
+    protected static final Logger _logger = LogDomains.getLogger 
(LogDomains.CORE_LOGGER);
+    private final ArrayList sgList = new ArrayList();
      public static final int NOTSTARTED = 0;
      public static final int STARTING = 1;
@@ -69,7 +69,7 @@
      private int state = NOTSTARTED;
      private ServerLifecycle[] services = {};
-    private static ArrayList<ServiceGroupListener> listeners;
+    private static final ArrayList<ServiceGroupListener> listeners;
      static {
          listeners = new ArrayList();
cvs server: Diffing appserv-core/src/java/com/sun/enterprise/server/ 
ondemand/entry
cvs server: Diffing appserv-core/src/java/com/sun/enterprise/server/ 
pluggable
cvs server: Diffing appserv-core/src/java/com/sun/enterprise/server/ss
Index: appserv-core/src/java/com/sun/enterprise/server/ss/ 
ASSocketService.java
retrieving revision 1.13
diff -w -u -r1.13 ASSocketService.java
--- appserv-core/src/java/com/sun/enterprise/server/ss/ 
ASSocketService.java     17 Mar 2007 02:31:52 -0000      1.13
+++ appserv-core/src/java/com/sun/enterprise/server/ss/ 
ASSocketService.java     27 Mar 2007 17:47:00 -0000
@@ -314,7 +314,6 @@
             }
             // If client is in this JVM, dont wait
-           Integer remotePort = new Integer(s.getPort());
             synchronized ( peMain ) {
                 while ( peMain.isStartingUp() && !  
hasClientSocketLocalPorts(s) ) {
                      if ( logger.isLoggable(Level.FINE) ) {
@@ -346,7 +345,6 @@
             int localPort = s.getLocalPort();
             // If client is in this JVM, dont wait
-           Integer remotePort = new Integer(s.getPort());
             synchronized ( acceptLock ) {
                 while ( entryBeingProcessed() &&
                          ! ASSocketService.hasClientSocketLocalPorts 
(s) ) {
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
server/ss/provider/ASPlainSocketImpl.java,v
retrieving revision 1.1
diff -w -u -r1.1 ASPlainSocketImpl.java
--- appserv-core/src/java/com/sun/enterprise/server/ss/provider/ 
ASPlainSocketImpl.java  17 Mar 2007 02:31:54 -0000      1.1
+++ appserv-core/src/java/com/sun/enterprise/server/ss/provider/ 
ASPlainSocketImpl.java  27 Mar 2007 17:47:01 -0000
@@ -76,7 +76,7 @@
                 Class tmpClass = Class.forName(SOCKET_IMPL_CLASS);
                 Constructor cons = tmpClass.getDeclaredConstructor 
(new Class[] {});
                 cons.setAccessible(true);
-               Object obj = cons.newInstance(null);
+               Object obj = cons.newInstance( (Class[])null);
                 while (tmpClass.getName().
                 equalsIgnoreCase("JAVA.NET.SOCKETIMPL") == false) {
                     _setupMethods(tmpClass);
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
tools/common/util/diagnostics/ReporterTester.java,v
retrieving revision 1.3
diff -w -u -r1.3 ReporterTester.java
--- appserv-core/src/java/com/sun/enterprise/tools/common/util/ 
diagnostics/ReporterTester.java  25 Dec 2005 04:16:41 -0000      1.3
+++ appserv-core/src/java/com/sun/enterprise/tools/common/util/ 
diagnostics/ReporterTester.java  27 Mar 2007 17:47:01 -0000
@@ -76,9 +76,7 @@
                 rj.verbose(new StackTrace());
*/
                 CallerInfo.addToGlobalIgnore(rt);
-               Goo goo = new Goo();
-
-
+               new Goo();
         }
         private int junk = 5;   // so dump() has something to work  
with!
         protected String sss = "Foo";//NOI18N
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
transaction/OracleXAResource.java,v
retrieving revision 1.6
diff -w -u -r1.6 OracleXAResource.java
--- appserv-core/src/java/com/sun/enterprise/transaction/ 
OracleXAResource.java  8 Mar 2007 06:16:15 -0000       1.6
+++ appserv-core/src/java/com/sun/enterprise/transaction/ 
OracleXAResource.java  27 Mar 2007 17:47:01 -0000
@@ -45,8 +45,8 @@
{
         // Sting Manager for Localization
-    private static StringManager sm = StringManager.getManager 
(OracleXAResource.class);
-    private static Logger _logger = LogDomains.getLogger 
(LogDomains.JTA_LOGGER);
+    private static final StringManager sm = StringManager.getManager 
(OracleXAResource.class);
+    private static final Logger _logger = LogDomains.getLogger 
(LogDomains.JTA_LOGGER);
    /**
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
util/JarClassLoader.java,v
retrieving revision 1.4
diff -w -u -r1.4 JarClassLoader.java
--- appserv-core/src/java/com/sun/enterprise/util/ 
JarClassLoader.java   25 Dec 2005 04:16:46 -0000      1.4
+++ appserv-core/src/java/com/sun/enterprise/util/ 
JarClassLoader.java   27 Mar 2007 17:47:01 -0000
@@ -43,10 +43,10 @@
// IASRI 4709925 - updated ejb class loader
import com.sun.enterprise.loader.EJBClassLoader;
-public class JarClassLoader extends EJBClassLoader {
+public final class JarClassLoader extends EJBClassLoader {
      // START OF IASRI 4660742
-    static Logger _logger=LogDomains.getLogger(LogDomains.UTIL_LOGGER);
+    static final Logger _logger=LogDomains.getLogger 
(LogDomains.UTIL_LOGGER);
      // END OF IASRI 4660742
      // START OF IASRI 4679641
@@ -98,7 +98,14 @@
          appendURL(url);
      }
+    /**
+     @deprecated use getClasspath()
+     */
      public String getClassPath() {
+        return getClasspath();
+    }
+
+    public final String getClasspath() {
         String cpath = "";
         URL[] urls = getURLs();
         String sep = File.pathSeparator;
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
webservice/EjbRuntimeEndpointInfo.java,v
retrieving revision 1.32
diff -w -u -r1.32 EjbRuntimeEndpointInfo.java
--- appserv-core/src/java/com/sun/enterprise/webservice/ 
EjbRuntimeEndpointInfo.java     7 Mar 2007 21:20:51 -0000       1.32
+++ appserv-core/src/java/com/sun/enterprise/webservice/ 
EjbRuntimeEndpointInfo.java     27 Mar 2007 17:47:01 -0000
@@ -74,22 +74,23 @@
   * endpoint.  This class must support concurrent access,
   * since a single instance will be used for all web
   * service invocations through the same ejb endpoint.
- *
+ * <p><b>NOT THREAD SAFE</b>
   * @author Jerome Dochez
   */
public class EjbRuntimeEndpointInfo {
-    protected static Logger logger =
+    protected static final Logger logger =
          LogDomains.getLogger(LogDomains.EJB_LOGGER);
-    protected WebServiceEndpoint endpoint;
+    protected final WebServiceEndpoint endpoint;
-    protected StatelessSessionContainer container;
+    protected final StatelessSessionContainer container;
-    protected Object webServiceEndpointServant;
+    protected final Object webServiceEndpointServant;
-    protected InvocationManager invManager;
+    protected final InvocationManager invManager;
+    // the variables below are access in non-thread-safe ways
      private ServletAdapter adapter = null;
      private ServletAdapterList adapterList = null;
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
webservice/ServiceEngineUtil.java,v
retrieving revision 1.12
diff -w -u -r1.12 ServiceEngineUtil.java
--- appserv-core/src/java/com/sun/enterprise/webservice/ 
ServiceEngineUtil.java  8 Mar 2007 03:49:45 -0000       1.12
+++ appserv-core/src/java/com/sun/enterprise/webservice/ 
ServiceEngineUtil.java  27 Mar 2007 17:47:03 -0000
@@ -33,17 +33,18 @@
/**
   * If web service client is JBI enabled, transport factory is set  
to NMR, otherwise
   * ususal JAXWS stack is used.
+  * <p><b>Not thread-safe</b>
   * @author Manisha Umbarje
   */
public class ServiceEngineUtil {
-    public static String JBI_ENABLED = "jbi-enabled";
+    public static final String JBI_ENABLED = "jbi-enabled";
      private static final String SE_DISABLE_PROPERTY =  
"com.sun.enterprise.jbi.se.disable";
      private static String seDisablePropertyValue = null;
      private static boolean seEnabledFlag = true;
-    private static ApplicationLoaderEventListenerImpl listener=new  
ApplicationLoaderEventListenerImpl();
+    private static final ApplicationLoaderEventListenerImpl  
listener=new ApplicationLoaderEventListenerImpl();
-    private static Logger logger =
+    private static final Logger logger =
              LogDomains.getLogger(LogDomains.SERVER_LOGGER);
      /** Creates a new instance of ServiceEngineUtil */
      public ServiceEngineUtil() {
@@ -85,8 +86,9 @@
      }
-     public static boolean isServiceEngineEnabled() {
+     public static synchronized boolean isServiceEngineEnabled() {
          //safe to assume that JBI is installed
+        // WHY IS THIS CHECKED EVERY TIME (if the property is null)
          if(seDisablePropertyValue == null) {
              seDisablePropertyValue = System.getProperty 
(SE_DISABLE_PROPERTY);
              logger.log(Level.FINE,SE_DISABLE_PROPERTY ," value is "  
+ seDisablePropertyValue);
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
webservice/WebServiceContextImpl.java,v
retrieving revision 1.10
diff -w -u -r1.10 WebServiceContextImpl.java
--- appserv-core/src/java/com/sun/enterprise/webservice/ 
WebServiceContextImpl.java      13 Nov 2006 22:24:11 -0000      1.10
+++ appserv-core/src/java/com/sun/enterprise/webservice/ 
WebServiceContextImpl.java      27 Mar 2007 17:47:03 -0000
@@ -36,11 +36,14 @@
import com.sun.xml.ws.api.server.WSWebServiceContext;
import com.sun.xml.ws.api.message.Packet;
-public class WebServiceContextImpl implements WSWebServiceContext {
+/**
+ * <p><b>NOT THREAD SAFE: mutable instance variables</b>
+ */
+public final class WebServiceContextImpl implements  
WSWebServiceContext {
-    public static ThreadLocal msgContext = new ThreadLocal();
+    public static final ThreadLocal msgContext = new ThreadLocal();
-    public static ThreadLocal principal = new ThreadLocal();
+    public static final ThreadLocal principal = new ThreadLocal();
      private WSWebServiceContext jaxwsContextDelegate;
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
webservice/monitoring/MessageTraceImpl.java,v
retrieving revision 1.6
diff -w -u -r1.6 MessageTraceImpl.java
--- appserv-core/src/java/com/sun/enterprise/webservice/monitoring/ 
MessageTraceImpl.java        18 Nov 2006 02:47:59 -0000      1.6
+++ appserv-core/src/java/com/sun/enterprise/webservice/monitoring/ 
MessageTraceImpl.java        27 Mar 2007 17:47:03 -0000
@@ -40,6 +40,7 @@
   * An invocation trace contains the timestamp os a particular
   * message invocation, the stringified SOAP request and
   * response or the SOAP Faults if the invocation resulted in one.
+ * <p><b>NOT THREAD SAFE: mutable instance variables</b>
   *
   * @author Jerome Dochez
   */
RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/ 
webservice/monitoring/WebServiceEngineImpl.java,v
retrieving revision 1.15
diff -w -u -r1.15 WebServiceEngineImpl.java
--- appserv-core/src/java/com/sun/enterprise/webservice/monitoring/ 
WebServiceEngineImpl.java    9 Dec 2006 03:27:25 -0000       1.15
+++ appserv-core/src/java/com/sun/enterprise/webservice/monitoring/ 
WebServiceEngineImpl.java    27 Mar 2007 17:47:03 -0000
@@ -64,20 +64,21 @@
   * This class acts as a factory to create TracingSystemHandler
   * instances. It also provides an API to register listeners
   * of SOAP messages.
+ * <p><b>NOT THREAD SAFE: mutable instance variable:  
globalMessageListener</b>
   *
   * @author Jerome Dochez
   */
public final class WebServiceEngineImpl implements WebServiceEngine {
-    protected Map<String, Endpoint> endpoints = new HashMap<String,  
Endpoint>();
-    protected List<EndpointLifecycleListener> lifecycleListeners =
+    protected final Map<String, Endpoint> endpoints = new  
HashMap<String, Endpoint>();
+    protected final List<EndpointLifecycleListener>  
lifecycleListeners =
              new ArrayList<EndpointLifecycleListener>();
-    protected List<AuthenticationListener> authListeners =
+    protected final List<AuthenticationListener> authListeners =
              new ArrayList<AuthenticationListener>();
-    protected GlobalMessageListener globalMessageListener = null;
+    protected volatile GlobalMessageListener globalMessageListener =  
null;
-    static ThreadLocal servletThreadLocal = new ThreadLocal();
-    public static Logger sLogger = LogDomains.getLogger 
(LogDomains.CORE_LOGGER);
+    static final ThreadLocal servletThreadLocal = new ThreadLocal();
+    public static final Logger sLogger = LogDomains.getLogger 
(LogDomains.CORE_LOGGER);
      /** Creates a new instance of TracingSystemHandlerFactory */
RCS file: /cvs/glassfish/appserv-core-ee/appserv-core/src/java/com/ 
sun/enterprise/ee/admin/target/EETargetBuilder.java,v
retrieving revision 1.1.1.1
diff -w -u -r1.1.1.1 EETargetBuilder.java
--- appserv-core-ee/appserv-core/src/java/com/sun/enterprise/ee/admin/ 
target/EETargetBuilder.java       8 Aug 2006 19:48:22 -0000        
1.1.1.1
+++ appserv-core-ee/appserv-core/src/java/com/sun/enterprise/ee/admin/ 
target/EETargetBuilder.java       27 Mar 2007 17:47:03 -0000
@@ -33,7 +33,7 @@
import com.sun.enterprise.admin.target.TargetBuilder;
import com.sun.enterprise.admin.target.TargetType;
-public class EETargetBuilder extends TargetBuilder
+public final class EETargetBuilder extends TargetBuilder
      implements IAdminConstants
{
RCS file: /cvs/glassfish/appserv-core-ee/appserv-core/src/java/com/ 
sun/enterprise/ee/diagnostics/EETargetType.java,v
retrieving revision 1.2
diff -w -u -r1.2 EETargetType.java
--- appserv-core-ee/appserv-core/src/java/com/sun/enterprise/ee/ 
diagnostics/EETargetType.java   19 Jan 2007 09:13:25 -0000      1.2
+++ appserv-core-ee/appserv-core/src/java/com/sun/enterprise/ee/ 
diagnostics/EETargetType.java   27 Mar 2007 17:47:03 -0000
@@ -28,7 +28,7 @@
   *
   * @author mu125243
   */
-public class EETargetType extends TargetType {
+public final class EETargetType extends TargetType {
      public static final TargetType NODEAGENT = new TargetType 
("nodeagent");
      public static final TargetType CLUSTER = new TargetType 
("cluster");
RCS file: /cvs/glassfish/appserv-core-ee/appserv-core/src/java/com/ 
sun/enterprise/ee/selfmanagement/actions/InstanceHangAction.java,v
retrieving revision 1.1.1.1
diff -w -u -r1.1.1.1 InstanceHangAction.java
--- appserv-core-ee/appserv-core/src/java/com/sun/enterprise/ee/ 
selfmanagement/actions/InstanceHangAction.java  8 Aug 2006 19:48:22  
-0000       1.1.1.1
+++ appserv-core-ee/appserv-core/src/java/com/sun/enterprise/ee/ 
selfmanagement/actions/InstanceHangAction.java  27 Mar 2007 17:47:03  
-0000
@@ -138,21 +138,18 @@
                                           MBeanRegistration,
                                           NotificationListener {
      /** Config context */
-    static ConfigContext configCtx = null;
+    static final ConfigContext configCtx =
+        ApplicationServer.getServerContext().getConfigContext();
      /** Logger for self management service */
-    private static Logger _logger =  null;
+    private static final Logger _logger =
+        LogDomains.getLogger(LogDomains.SELF_MANAGEMENT_LOGGER);
      /** String manager for local strings */
      private static StringManager localStrings = null;
      /** Messgae prefix */
      private static String msgPrefix = null;
-
-    static {
-        _logger = LogDomains.getLogger 
(LogDomains.SELF_MANAGEMENT_LOGGER);
-        configCtx = ApplicationServer.getServerContext 
().getConfigContext();
-    }
      /** List of names of instances,cluster */
      public String checkList = null;
RCS file: /cvs/glassfish/appserv-core-ee/ejb/src/java/com/sun/ejb/ee/ 
sfsb/store/EJBStoreBase.java,v
retrieving revision 1.1
diff -w -u -r1.1 EJBStoreBase.java
--- appserv-core-ee/ejb/src/java/com/sun/ejb/ee/sfsb/store/ 
EJBStoreBase.java    8 Nov 2006 20:58:33 -0000       1.1
+++ appserv-core-ee/ejb/src/java/com/sun/ejb/ee/sfsb/store/ 
EJBStoreBase.java    27 Mar 2007 17:47:04 -0000
@@ -30,22 +30,26 @@
   *
   * <p>Company: Sun Microsystems Inc.</p>
   * @author Sridhar Satuloori <Sridhar.Satuloori_at_Sun.Com>
+ * <p><b>NOT THREAD SAFE: mutable instance variables</b>
   *
   */
public abstract class EJBStoreBase implements StorePoolElement {
      /**
       * The descriptive information about this implementation.
+     * NOTE: subclasses modify this variable
       */
      protected static String info = "EJBStoreBase/1.0";
      /**
       * Name to register for the background thread.
+     * NOTE: subclasses modify this variable
       */
      protected String threadName = "EJBStoreBase";
      /**
       * Name to register for this Store, used for logging.
+     * NOTE: subclasses modify this variable
       */
      protected static String storeName = "EJBStoreBase";
@@ -57,6 +61,7 @@
      /**
       * The number of seconds to wait before timing out a transaction
       * Default is 5 minutes.
+     * NOTE: subclasses modify this variable
       */
      protected String timeoutSecs = new Long(5 * 60).toString();
RCS file: /cvs/glassfish/jmx-remote/rjmx-impl/src/java/com/sun/ 
enterprise/admin/jmx/remote/UrlConnector.java,v
retrieving revision 1.4
diff -w -u -r1.4 UrlConnector.java
--- jmx-remote/rjmx-impl/src/java/com/sun/enterprise/admin/jmx/remote/ 
UrlConnector.java 25 Dec 2005 04:26:30 -0000      1.4
+++ jmx-remote/rjmx-impl/src/java/com/sun/enterprise/admin/jmx/remote/ 
UrlConnector.java 27 Mar 2007 17:47:16 -0000
@@ -294,6 +294,8 @@
                         System.out.println("Attached the debugger?  
Provide an integer to go ahead...");
                         final int r = System.in.read();
                 }
-               catch(Exception e) {}
+               catch(Exception e) {
+                       System.out.println( e );
+        }
         }
}
RCS file: /cvs/glassfish/jmx-remote/rjmx-impl/src/java/com/sun/ 
enterprise/admin/jmx/remote/notification/ 
ClientNotificationManager.java,v
retrieving revision 1.3
diff -w -u -r1.3 ClientNotificationManager.java
--- jmx-remote/rjmx-impl/src/java/com/sun/enterprise/admin/jmx/remote/ 
notification/ClientNotificationManager.java       25 Dec 2005  
04:26:34 -0000      1.3
+++ jmx-remote/rjmx-impl/src/java/com/sun/enterprise/admin/jmx/remote/ 
notification/ClientNotificationManager.java       27 Mar 2007  
17:47:16 -0000
@@ -48,29 +48,32 @@
   * The ClientNotificationManager when constructed will make a  
connection
   * to the server-side with an unique id identifying this  
ClientNotificationManager.
   */
-public class ClientNotificationManager implements Runnable {
-    private Map env = null;
-    private HashMap listenerMap = null;
-    private String  mgrId          = null;
-    private SimpleQueue que = null;
-    private NotificationReceiver receiver = null;
-    private Thread eventThread = null;
-    private boolean exit = false;
+public final class ClientNotificationManager implements Runnable {
+    private final Map env;
+    private final HashMap listenerMap;
+    private final String  mgrId;
+    private final SimpleQueue que;
+    private final NotificationReceiver receiver;
+    private final Thread eventThread;
+    private volatile boolean exit = false;
      private static final Logger logger = Logger.getLogger(
          DefaultConfiguration.JMXCONNECTOR_LOGGER);/*,
          DefaultConfiguration.LOGGER_RESOURCE_BUNDLE_NAME );*/
-    public ClientNotificationManager(HttpConnectorAddress ad, Map env)
+    public ClientNotificationManager(HttpConnectorAddress ad, Map  
envIn)
              throws IOException {
-        this.env = env;
+        env = envIn;
          que = new SimpleQueue();
          listenerMap = new HashMap();
          String hname="null";
          try {
              hname = InetAddress.getLocalHost().getHostName();
-        } catch (Exception ex) { /*ignore*/ }
+        } catch (Exception ex) {
+            /*ignore*/
+            hname = "null";
+        }
          mgrId = (new java.rmi.server.UID()).toString() + ":" + hname;
          eventThread = new Thread(this);
RCS file: /cvs/glassfish/tools/src/java/PLBootstrap.java,v
retrieving revision 1.3
diff -w -u -r1.3 PLBootstrap.java
--- tools/src/java/PLBootstrap.java     25 Dec 2005 04:27:44  
-0000      1.3
+++ tools/src/java/PLBootstrap.java     27 Mar 2007 17:47:19 -0000
@@ -44,13 +44,13 @@
public class PLBootstrap {
-    public static String  
INSTALL_ROOT_PROPERTY_NAME="com.sun.aas.installRoot";
-    public static String  
PROCESS_LAUCHER_PROPERTIES_FILE_NAME="processLauncher.properties";
-    public static String  
PROCESS_LAUCHER_LIBRARIES="processLauncher.libraries";
-    public static String  
PROCESS_LAUCHER_MAIN_CLASS="processLauncher.main.class";
+    public static final String  
INSTALL_ROOT_PROPERTY_NAME="com.sun.aas.installRoot";
+    public static final String  
PROCESS_LAUCHER_PROPERTIES_FILE_NAME="processLauncher.properties";
+    public static final String  
PROCESS_LAUCHER_LIBRARIES="processLauncher.libraries";
+    public static final String  
PROCESS_LAUCHER_MAIN_CLASS="processLauncher.main.class";
-    public static boolean bDebug=false;
+    public static final boolean bDebug=false;
      public static void main(String[] args) {
RCS file: /cvs/glassfish/tools/src/java/com/sun/enterprise/tools/ 
common/util/JWhich.java,v
retrieving revision 1.3
diff -w -u -r1.3 JWhich.java
--- tools/src/java/com/sun/enterprise/tools/common/util/ 
JWhich.java     25 Dec 2005 04:28:18 -0000      1.3
+++ tools/src/java/com/sun/enterprise/tools/common/util/ 
JWhich.java     27 Mar 2007 17:47:20 -0000
@@ -46,8 +46,6 @@
                 int argNum = 0;
-               JWhich jwhich;
-
                 if(args[0].toLowerCase().equals("-classpath"))//NOI18N
                 {
                         if(args.length != 3)
@@ -56,17 +54,17 @@
                                 return;
                         }
-                       jwhich = new JWhich(args[2], args[1]);
+                       new JWhich(args[2], args[1]);
                 }
                 else
-                       jwhich = new JWhich(args[0]);
+                       new JWhich(args[0]);
         }
         ///////////////////////////////////////////////////////////
-       public JWhich(String classname, String classpathArg)
+       public JWhich(String classname, String classpathArgIn)
         {
-               this.classpathArg = classpathArg;
+               classpathArg = classpathArgIn;
                 ctor(classname);
         }
RCS file: /cvs/glassfish/tools/src/java/com/sun/enterprise/tools/ 
upgrade/common/DomainsProcessor.java,v
retrieving revision 1.14
diff -w -u -r1.14 DomainsProcessor.java
--- tools/src/java/com/sun/enterprise/tools/upgrade/common/ 
DomainsProcessor.java        16 Feb 2007 16:41:52 -0000      1.14
+++ tools/src/java/com/sun/enterprise/tools/upgrade/common/ 
DomainsProcessor.java        27 Mar 2007 17:47:20 -0000
@@ -75,13 +75,13 @@
public class DomainsProcessor {
      private static CommonInfoModel commonInfo;
-    private java.util.Vector httpSSLPorts;
-    private java.util.Vector iiopSSLPorts;
-    private java.util.Vector iiopMutualAuthPorts;
-    private java.util.Vector sourceXMLCorePorts;
-    private java.util.Vector adminJMXPorts;
-    private java.util.Vector iiopPorts;
-    private java.util.Vector httpPorts;
+    private final Vector httpSSLPorts;
+    private final Vector iiopSSLPorts;
+    private final Vector iiopMutualAuthPorts;
+    private final Vector sourceXMLCorePorts;
+    private final Vector adminJMXPorts;
+    private final Vector iiopPorts;
+    private final Vector httpPorts;
      private static int iiopPortToStartWith = 1071;
      private static int adminPortToStartWith = 4858;
@@ -93,13 +93,13 @@
      /** Creates a new instance of DomainsProcessor */
      public DomainsProcessor(CommonInfoModel ci) {
          this.commonInfo = ci;
-        httpSSLPorts = new java.util.Vector();
-        iiopSSLPorts = new java.util.Vector();
-        iiopMutualAuthPorts = new java.util.Vector();
-        sourceXMLCorePorts = new java.util.Vector();
-        adminJMXPorts = new java.util.Vector();
-        iiopPorts = new java.util.Vector();
-        httpPorts = new java.util.Vector();
+        httpSSLPorts = new Vector();
+        iiopSSLPorts = new Vector();
+        iiopMutualAuthPorts = new Vector();
+        sourceXMLCorePorts = new Vector();
+        adminJMXPorts = new Vector();
+        iiopPorts = new Vector();
+        httpPorts = new Vector();
          // Prefill with ports used in default domain and samples  
domain.
          // default domain xml file ports:
          File domainDir =  new File(ci.getTargetDomainRoot() +  
File.separator + "domain1");
@@ -153,9 +153,6 @@
          // Store source xml ports core ports: http,iiop,jms
          // TO-DO collect these ports from all source domains  
iteratively and store them in sourceXMLCorePorts vector
          // Only for testing purposes.....
-    }
-    private DomainsProcessor(CommonInfoModel ci, boolean nothing) {
-
      }
      public void processTargetDomains() throws HarnessException{