code: public static Object toResultCheckIfNull(Object value, String desc) {
  		if (value == null) {
  			if (desc.length() == 1) {
  				switch (desc.charAt(0)) {
  					case 'I':
  						return DEFAULT_INT;
  					case 'B':
  						return DEFAULT_BYTE;
  					case 'C':
  						return DEFAULT_CHAR;
  					case 'S':
  						return DEFAULT_SHORT;
  					case 'J':
  						return DEFAULT_LONG;
  					case 'F':
  						return DEFAULT_FLOAT;
  					case 'D':
  						return DEFAULT_DOUBLE;
  					case 'Z':
  						return Boolean.FALSE;
  					default:
  						throw new IllegalStateException("Invalid primitive descriptor " + desc);
  				}
  			}
  			else {
  				return null;
  			}
  		}
  		else {
  			return value;
  		}
  	}
docs: Convert a value to the requested descriptor. For null values where the caller needs a primitive, this returns the
  appropriate (boxed) default. This method will not attempt conversion, it is basically checking what to do if the
  result is null - and ensuring the caller gets back what they expect (the appropriate primitive default).
  
  @param value the value
  @param desc the type the caller would like it to be
  @return the converted value or possibly a default value for the type if the incoming value is null