Program: 64417
Project: 64417
Buggy source:
/** 
 * <p>Query the object model based on the corresponding XML document.  The following pairings are equivalent:</p>  <i>Return the Customer's ID</i> <pre> Integer id = xmlContext.getValueByXPath(customer, "@id", null, Integer.class); Integer id = customer.getId();</pre> <i>Return the Customer's Name</i> <pre> String name = xmlContext.getValueByXPath(customer, "ns:personal-info/ns:name/text()", null, String.class); String name = customer.getName();</pre> <i>Return the Customer's Address</i> <pre> Address address = xmlContext.getValueByXPath(customer, "ns:contact-info/ns:address", aNamespaceResolver, Address.class); Address address = customer.getAddress();</pre> <i>Return all the Customer's PhoneNumbers</i>  <pre> List phoneNumbers = xmlContext.getValueByXPath(customer, "ns:contact-info/ns:phone-number", aNamespaceResolver, List.class); List phoneNumbers = customer.getPhoneNumbers();</pre> <i>Return the Customer's second PhoneNumber</i> <pre> PhoneNumber phoneNumber = xmlContext.getValueByXPath(customer, "ns:contact-info/ns:phone-number[2]", aNamespaceResolver, PhoneNumber.class); PhoneNumber phoneNumber = customer.getPhoneNumbers().get(1);</pre> <i>Return the base object</i> <pre> Customer customer = xmlContext.getValueByXPath(customer, ".", aNamespaceResolver, Customer.class); Customer customer = customer; </pre>
 * @param < T > The return type of this method corresponds to the returnType parameter.
 * @param object  The XPath will be executed relative to this object.
 * @param xPath The XPath statement
 * @param namespaceResolver A NamespaceResolver containing the prefix/URI pairings from the XPath statement.
 * @param returnType The return type.
 * @return The object corresponding to the XPath or null if no result was found.
 */
public abstract <T>T getValueByXPath(Object object,String xPath,NamespaceResolver namespaceResolver,Class<T> returnType);

Fixed version (ground truth):
/** 
 * <p>Query the object model based on the corresponding XML document.  The following pairings are equivalent:</p>  <i>Return the Customer's ID</i> <pre> Integer id = xmlContext.getValueByXPath(customer, "@id", null, Integer.class); Integer id = customer.getId();</pre> <i>Return the Customer's Name</i> <pre> String name = xmlContext.getValueByXPath(customer, "ns:personal-info/ns:name/text()", null, String.class); String name = customer.getName();</pre> <i>Return the Customer's Address</i> <pre> Address address = xmlContext.getValueByXPath(customer, "ns:contact-info/ns:address", aNamespaceResolver, Address.class); Address address = customer.getAddress();</pre> <i>Return all the Customer's PhoneNumbers</i>  <pre> List phoneNumbers = xmlContext.getValueByXPath(customer, "ns:contact-info/ns:phone-number", aNamespaceResolver, List.class); List phoneNumbers = customer.getPhoneNumbers();</pre> <i>Return the Customer's second PhoneNumber</i> <pre> PhoneNumber phoneNumber = xmlContext.getValueByXPath(customer, "ns:contact-info/ns:phone-number[2]", aNamespaceResolver, PhoneNumber.class); PhoneNumber phoneNumber = customer.getPhoneNumbers().get(1);</pre> <i>Return the base object</i> <pre> Customer customer = xmlContext.getValueByXPath(customer, ".", aNamespaceResolver, Customer.class); Customer customer = customer; </pre>
 * @param < T > The return type of this method corresponds to the returnType parameter.
 * @param object  The XPath will be executed relative to this object.
 * @param xPath The XPath statement
 * @param namespaceResolver A NamespaceResolver containing the prefix/URI pairings from the XPath statement.
 * @param returnType The return type.
 * @return The object corresponding to the XPath or null if no result was found.
 */
public abstract <T>T getValueByXPath(Object object,String xPath,NAMESPACE_RESOLVER namespaceResolver,Class<T> returnType);