This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Cattle Drive and the fly likes CastMap  tools (and JDBC assignment) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "CastMap  tools (and JDBC assignment)" Watch "CastMap  tools (and JDBC assignment)" New topic

CastMap tools (and JDBC assignment)

Peter Gragert
Ranch Hand

Joined: Jan 16, 2001
Posts: 424
I do not like a title of spaces only therefore I 'trimmed' strings and this is already available in 'CastMap':
public String getTrimmedString( String key )
String returnVal = null ;
String s = (String)get( key );
if ( s == null )
returnVal = null ;
returnVal = s.trim();
return returnVal ;
Isn't it just as clear if one would replace
if-else because of initialization of 'returnVal'
if( s != null)
returnVal = s.trim();
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9056
Yes, Peter. It's already been changed but the changed jar file isn't available yet. Good catch.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
subject: CastMap tools (and JDBC assignment)
It's not a secret anymore!