Source:
<code>public Object getValue(String fieldPath, Object object) throws Exception { try { <START> if (object != null && fieldPath != null) { <END> Object currentObject = object; String[] tokens = StringUtils.split(fieldPath, FIELD_PATH_SEPARATOR); for (String token : tokens) { if (token.charAt(0) == DECODER_PREFIX) { String fieldName = token.substring(1); FieldDecoder decoder = decoders.get(fieldName); if (decoder == null) { throw new Exception("no decoder registered for " + token); } Object fieldValue = getFieldValue(fieldName, currentObject); if (decoder.canHandle(fieldValue)) { currentObject = decoder.decode(fieldValue); } else { throw new Exception(fieldValue!=null? decoder.getClass().getName() + " decoder is not capable of handling object: " + fieldValue.toString() + ", which is " + fieldValue.getClass().getName() + " class instance" :decoder.getClass().getName() + " decoder is not capable of handling null object"); } } else if (token.indexOf('[')>0) { String fieldName = token.substring(0, token.indexOf('[')); currentObject = getFieldValue(fieldName, currentObject); if (currentObject!=null) { if (currentObject.getClass().isArray()) { currentObject = Array.get(currentObject, getArrayPositionFromToken(token)); } else if (List.class.isAssignableFrom(currentObject.getClass())) { currentObject = ((List<?>)currentObject).get(getArrayPositionFromToken(token)); } else { throw new Exception("unable to extract array or list element " + "based on field path: " + fieldPath + ", " + "object is neither an array nor list:" + currentObject.getClass().getName()); } } else { throw new Exception("unable to extract array or list element " + "based on field path: " + fieldPath + ", " + "object is null!"); } } else { currentObject = getFieldValue(token, currentObject); } } return currentObject; } else { return null; } } catch (Exception e) { throw new Exception("unable to resolve field path '" + fieldPath + "' on object " + object, e); } }</code><technical_language>Do want throw for null arguments</technical_language>

Target:
public Object getValue(String fieldPath, Object object) throws FieldAccessorException { if (object != null && fieldPath != null) { try { Object currentObject = object; String[] tokens = StringUtils.split(fieldPath, FIELD_PATH_SEPARATOR); for (final String token : tokens) { String parsedToken = token; boolean useDecoder = false; Integer arrayOrListPosition = null; if (parsedToken.charAt(0) == DECODER_PREFIX) { useDecoder = true; parsedToken = parsedToken.substring(1); } if (parsedToken.indexOf('[') > 0) { arrayOrListPosition = getArrayPositionFromToken(parsedToken); parsedToken = parsedToken.substring(0, parsedToken.indexOf('[')); } currentObject = PropertyUtils.getProperty(currentObject, parsedToken); if (useDecoder) { currentObject = decode(parsedToken, currentObject); } if (arrayOrListPosition!=null) { currentObject = handleArrayOrList(arrayOrListPosition, currentObject); } } return currentObject; } catch (Exception e) { throw new FieldAccessorException("unable to resolve field path '" + fieldPath + "' on object " + object, e); } } else { throw new FieldAccessorException("Neither fieldPath nor object can be null! " + "Got fieldPath: " + fieldPath + ", object: " + object); } }