Here you can find the source of convertBoolean(String str, boolean defaults)
public static boolean convertBoolean(String str, boolean defaults)
//package com.java2s; //License from project: Apache License public class Main { public static boolean convertBoolean(String str, boolean defaults) { if (str == null) { return defaults; }/* w w w .j ava 2s.com*/ try { return Boolean.parseBoolean(str); } catch (Exception e) { return defaults; } } }