admin@glassfish.java.net

CODE REVIEW: FindBugs fixes (DLS dead store [more])

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

Same situation in appserv-commons/com/sun/enterprise/config/clientbeans

Index: src/java/com/sun/enterprise/config/clientbeans/CertDb.java
===================================================================
RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/
config/clientbeans/CertDb.java,v
retrieving revision 1.8
diff -r1.8 CertDb.java
139,141c139
< if(attr == null) return null;
< attr = attr.trim();
< return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/clientbeans/ 
ClientCredential.java
===================================================================
RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/ 
config/clientbeans/ClientCredential.java,v
retrieving revision 1.8
diff -r1.8 ClientCredential.java
252,254c252
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/clientbeans/ 
ElementProperty.java
===================================================================
RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/ 
config/clientbeans/ElementProperty.java,v
retrieving revision 1.8
diff -r1.8 ElementProperty.java
139,141c139
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/clientbeans/ 
MessageSecurityConfig.java
===================================================================
RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/ 
config/clientbeans/MessageSecurityConfig.java,v
retrieving revision 1.8
diff -r1.8 MessageSecurityConfig.java
259,261c259
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/clientbeans/ 
ProviderConfig.java
===================================================================
RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/ 
config/clientbeans/ProviderConfig.java,v
retrieving revision 1.8
diff -r1.8 ProviderConfig.java
320,322c320
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/clientbeans/RequestPolicy.java
===================================================================
RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/ 
config/clientbeans/RequestPolicy.java,v
retrieving revision 1.8
diff -r1.8 RequestPolicy.java
139,141c139
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/clientbeans/ 
ResponsePolicy.java
===================================================================
RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/ 
config/clientbeans/ResponsePolicy.java,v
retrieving revision 1.8
diff -r1.8 ResponsePolicy.java
139,141c139
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/clientbeans/Security.java
===================================================================
RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/ 
config/clientbeans/Security.java,v
retrieving revision 1.8
diff -r1.8 Security.java
166,168c166
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
Index: src/java/com/sun/enterprise/config/clientbeans/TargetServer.java
===================================================================
RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/ 
config/clientbeans/TargetServer.java,v
retrieving revision 1.8
diff -r1.8 TargetServer.java
200,202c200
<               if(attr == null) return null;
<               attr = attr.trim();
<       return null;
---
 >         return null;
---------------------------------------------
On Sep 25, 2007, at 3:33 PM, Lloyd L Chambers wrote:
> (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.
>