Here you can find the source of longToInt(final Long l, final String name, final int deflt)
public static int longToInt(final Long l, final String name, final int deflt)
//package com.java2s; //License from project: Open Source License public class Main { public static int longToInt(final Long l, final String name, final int deflt) { if (l == null) { return deflt; }//from w w w .j a va 2 s . co m if (l > Integer.MAX_VALUE) { throw new IllegalArgumentException(name + " can be no greater than " + Integer.MAX_VALUE); } return new Long(l).intValue(); } }