Here you can find the source of convertStringToLong(String str, long failValue)
public static long convertStringToLong(String str, long failValue)
//package com.java2s; public class Main { public static long convertStringToLong(String str, long failValue) { if (str == null) { return failValue; }//from ww w .jav a2s. com try { return Long.parseLong(str); } catch (Exception e) { e.printStackTrace(); } return failValue; } }