admin@glassfish.java.net

CODE REVIEW: FindBugs fixes (DLS dead store)

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Tue, 25 Sep 2007 15:33:44 -0700

(This is for the trunk)

All of the form:

DLS: Dead store to attr in <class>.getDefaultAttributeValue(String) (H)

in admin-core/config-api/src/java/com/sun/enterprise/config/serverbeans

Original code looks like:
     public static String getDefaultAttributeValue(String attr) {
        if(attr == null) return null;
        attr = attr.trim();
        return null;
     }

Changed to:
     public static String getDefaultAttributeValue(String attr) {
         return null;
     }

Looks like this has been there forever, no doubt a copy/paste thing.
Certain other files insert code in between; these are files that
don't do anything except return null.

-----------------
Index: src/java/com/sun/enterprise/config/serverbeans/AlertService.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/
enterprise/config/serverbeans/AlertService.java,v
retrieving revision 1.8
diff -r1.8 AlertService.java
251,253c251
< if(attr == null) return null;
< attr = attr.trim();
< return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
AlertSubscription.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/AlertSubscription.java,v
retrieving revision 1.7
diff -r1.7 AlertSubscription.java
157,159c157
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/Applications.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/Applications.java,v
retrieving revision 1.12
diff -r1.12 Applications.java
878,880c878
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/AuditModule.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/AuditModule.java,v
retrieving revision 1.8
diff -r1.8 AuditModule.java
212,213d211
<               if(attr == null) return null;
<               attr = attr.trim();
Index: src/java/com/sun/enterprise/config/serverbeans/AuthRealm.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/AuthRealm.java,v
retrieving revision 1.8
diff -r1.8 AuthRealm.java
212,213d211
<               if(attr == null) return null;
<               attr = attr.trim();
Index: src/java/com/sun/enterprise/config/serverbeans/ 
BackendPrincipal.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/BackendPrincipal.java,v
retrieving revision 1.7
diff -r1.7 BackendPrincipal.java
126,128c126
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/Clusters.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/Clusters.java,v
retrieving revision 1.10
diff -r1.10 Clusters.java
177,179c177
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/Configs.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/Configs.java,v
retrieving revision 1.8
diff -r1.8 Configs.java
168,170c168
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
ElementProperty.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/ElementProperty.java,v
retrieving revision 1.7
diff -r1.7 ElementProperty.java
143,144d142
<               if(attr == null) return null;
<               attr = attr.trim();
Index: src/java/com/sun/enterprise/config/serverbeans/HttpService.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/HttpService.java,v
retrieving revision 1.11
diff -r1.11 HttpService.java
622,624c622
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/JaccProvider.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/JaccProvider.java,v
retrieving revision 1.8
diff -r1.8 JaccProvider.java
234,236c234
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/LbConfigs.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/LbConfigs.java,v
retrieving revision 1.8
diff -r1.8 LbConfigs.java
180,182c180
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
ListenerConfig.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/ListenerConfig.java,v
retrieving revision 1.8
diff -r1.8 ListenerConfig.java
212,213d211
<               if(attr == null) return null;
<               attr = attr.trim();
Index: src/java/com/sun/enterprise/config/serverbeans/LoadBalancers.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/LoadBalancers.java,v
retrieving revision 1.8
diff -r1.8 LoadBalancers.java
171,173c171
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
ManagerProperties.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/ManagerProperties.java,v
retrieving revision 1.8
diff -r1.8 ManagerProperties.java
256,258c256
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
MessageSecurityConfig.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/MessageSecurityConfig.java,v
retrieving revision 1.8
diff -r1.8 MessageSecurityConfig.java
237,239c237
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
MonitoringService.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/MonitoringService.java,v
retrieving revision 1.8
diff -r1.8 MonitoringService.java
223,225c223
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/NodeAgents.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/NodeAgents.java,v
retrieving revision 1.8
diff -r1.8 NodeAgents.java
171,173c171
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
ProviderConfig.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/ProviderConfig.java,v
retrieving revision 1.8
diff -r1.8 ProviderConfig.java
290,292c290
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
RegistryLocation.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/RegistryLocation.java,v
retrieving revision 1.7
diff -r1.7 RegistryLocation.java
104,106c104
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/RequestPolicy.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/RequestPolicy.java,v
retrieving revision 1.7
diff -r1.7 RequestPolicy.java
126,128c126
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/Resources.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/Resources.java,v
retrieving revision 1.10
diff -r1.10 Resources.java
1161,1163c1161
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
ResponsePolicy.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/ResponsePolicy.java,v
retrieving revision 1.7
diff -r1.7 ResponsePolicy.java
126,128c126
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/SecurityMap.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/SecurityMap.java,v
retrieving revision 1.7
diff -r1.7 SecurityMap.java
230,232c230
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/Servers.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/Servers.java,v
retrieving revision 1.8
diff -r1.8 Servers.java
174,176c174
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/SessionConfig.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/SessionConfig.java,v
retrieving revision 1.7
diff -r1.7 SessionConfig.java
129,131c129
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
SessionManager.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/SessionManager.java,v
retrieving revision 1.7
diff -r1.7 SessionManager.java
144,146c144
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
SessionProperties.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/SessionProperties.java,v
retrieving revision 1.8
diff -r1.8 SessionProperties.java
190,192c190
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
SslClientConfig.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/SslClientConfig.java,v
retrieving revision 1.7
diff -r1.7 SslClientConfig.java
128,130c128
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
StoreProperties.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/StoreProperties.java,v
retrieving revision 1.8
diff -r1.8 StoreProperties.java
212,214c212
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ 
SystemProperty.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/SystemProperty.java,v
retrieving revision 1.7
diff -r1.7 SystemProperty.java
143,145c143
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/ThreadPools.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/ThreadPools.java,v
retrieving revision 1.8
diff -r1.8 ThreadPools.java
177,179c177
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/serverbeans/WebContainer.java
===================================================================
RCS file: /cvs/glassfish/admin-core/config-api/src/java/com/sun/ 
enterprise/config/serverbeans/WebContainer.java,v
retrieving revision 1.8
diff -r1.8 WebContainer.java
190,192c190
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;