Here you can find the source of parseLongWithDefault(String s, long defValue)
public static long parseLongWithDefault(String s, long defValue)
//package com.java2s; public class Main { public static long parseLongWithDefault(String s, long defValue) { if (s == null) { return defValue; }/* w w w . j a v a2s . c o m*/ try { return Long.parseLong(s); } catch (NumberFormatException e) { return defValue; } } public static Long parseLong(String s) { try { return new Long(s); } catch (NumberFormatException e) { return null; } } }