private String error ( ) { Map < String , List < ConversionMethod > > conversions = xml . conversionsLoad ( ) ; String methodName = "illegalCode" ; String paramater = "" ; String resource = xml . getXmlPath ( ) ; if ( ! isNull ( resource ) ) { boolean isPath = isPath ( resource ) ; methodName = ! isPath ? "illegalCodeContent" : "illegalCode" ; if ( ! conversions . isEmpty ( ) && ! isNull ( conversions . get ( configClass . getName ( ) ) ) ) { // if is a content, the double quotes must be handled if ( ! isPath ) resource = doubleQuotesHandling ( resource ) ; paramater = write ( ",\"" , resource , "\"" ) ; } } return write ( "com.googlecode.jmapper.config.Error#" , methodName , "(e,\"" , methodToGenerate . getOriginalName ( ) , "\",\"" , configClass . getSimpleName ( ) , "\"" , paramater , ");" ) ; }
This method surrounds the explicit conversion defined with a try - catch to handle null pointers .