public static long readLong(String string, long defaultValue) {
        long returnValue;
        try {
            returnValue = Long.parseLong(string);
        } catch (Exception e) {
            returnValue = defaultValue;
        }
        return returnValue;
    }
public static long readLong ( String string , long defaultValue ) { long returnValue ; try { returnValue = Long . parseLong ( string ) ; } catch ( Exception e ) { returnValue = defaultValue ; } return returnValue ; }
@param string       string representation of a long which is to be parsed and read from
@param defaultValue in case parsing fails or string is null, returns this default value
@return long parsed value or the default value in case parsing failed