private static int parseInt(String s) {
        int val = -1;

        if (s != null) {
            try {
                val = Integer.parseInt(s);

            } catch (NumberFormatException e) {
                val = -1;
            }
        }

        return val;
    }