private boolean shouldImport ( TypeName typeName ) { // don't import classes from the java.lang package String pkg = typeName . getPackageName ( ) ; String simpleName = typeName . getSimpleName ( ) ; boolean exclude = ( pkg . equals ( "java.lang" ) || pkg . equals ( "" ) ) && getJavaDefaultTypes ( ) . contains ( simpleName ) ; return ! exclude ; }
Determines whether the given non - wildcard import should be added . By default this returns false if the simple name is a built - in Java language type name .