Program: 36829
Project: 36829
Buggy source:
/** 
 * Creates an implementation of <code>listenerInterface</code> in which the method named <code>listenerMethodName</code> passes the value of the event expression, <code>eventPropertyName</code>, to the final method in the statement, <code>action</code>, which is applied to the <code>target</code>. All of the other listener methods do nothing. <p> The <code>eventPropertyName</code> string is used to extract a value from the incoming event object that is passed to the target method.  The common case is the target method takes no arguments, in which case a value of null should be used for the <code>eventPropertyName</code>.  Alternatively if you want the incoming event object passed directly to the target method use the empty string. The format of the <code>eventPropertyName</code> string is a sequence of methods or properties where each method or property is applied to the value returned by the preceeding method starting from the incoming event object. The syntax is: <code>propertyName{.propertyName}*</code> where <code>propertyName</code> matches a method or property.  For example, to extract the <code>point</code> property from a <code>MouseEvent</code>, you could use either <code>"point"</code> or <code>"getPoint"</code> as the <code>eventPropertyName</code>.  To extract the "text" property from a <code>MouseEvent</code> with a <code>JLabel</code> source use any of the following as <code>eventPropertyName</code>: <code>"source.text"</code>, <code>"getSource.text"</code> <code>"getSource.getText"</code> or <code>"source.getText"</code>.  If a method can not be found, or an exception is generated as part of invoking a method a <code>RuntimeException</code> will be thrown at dispatch time.  For example, if the incoming event object is null, and <code>eventPropertyName</code> is non-null and not empty, a <code>RuntimeException</code> will be thrown. <p> The <code>action</code> argument is of the same format as the <code>eventPropertyName</code> argument where the last property name identifies either a method name or writable property. <p> If the <code>listenerMethodName</code> is <code>null</code> <em>all</em> methods in the interface trigger the <code>action</code> to be executed on the <code>target</code>. <p> For example, to create a <code>MouseListener</code> that sets the target object's <code>origin</code> property to the incoming <code>MouseEvent</code>'s location (that's the value of <code>mouseEvent.getPoint()</code>) each time a mouse button is pressed, one would write: <blockquote> <pre> EventHandler.create(MouseListener.class, target, "origin", "point", "mousePressed"); </pre> </blockquote> This is comparable to writing a <code>MouseListener</code> in which all of the methods except <code>mousePressed</code> are no-ops: <blockquote> <pre> //Equivalent code using an inner class instead of EventHandler. new MouseAdapter() { public void mousePressed(MouseEvent e) { target.setOrigin(e.getPoint()); } }; </pre> </blockquote>
 * @param listenerInterface the listener interface to create a proxy for
 * @param target the object that will perform the action
 * @param action the name of a (possibly qualified) property or method onthe target
 * @param eventPropertyName the (possibly qualified) name of a readable property of the incoming event
 * @param listenerMethodName the name of the method in the listener interface that should trigger the action
 * @return an object that implements <code>listenerInterface</code>
 * @throws NullPointerException if <code>listenerInterface</code> is null
 * @throws NullPointerException if <code>target</code> is null
 * @throws NullPointerException if <code>action</code> is null
 * @see EventHandler
 */
@SuppressWarnings("String_Node_Str") public static <T>T create(Class<T> listenerInterface,Object target,String action,String eventPropertyName,String listenerMethodName){
  EventHandler eventHandler=new EventHandler(target,action,eventPropertyName,listenerMethodName);
  if (listenerInterface == null) {
    throw new NullPointerException("String_Node_Str");
  }
  return (T)Proxy.newProxyInstance(target.getClass().getClassLoader(),new Class<?>[]{listenerInterface},eventHandler);
}

Fixed version (ground truth):
/** 
 * Creates an implementation of <code>listenerInterface</code> in which the method named <code>listenerMethodName</code> passes the value of the event expression, <code>eventPropertyName</code>, to the final method in the statement, <code>action</code>, which is applied to the <code>target</code>. All of the other listener methods do nothing. <p> The <code>eventPropertyName</code> string is used to extract a value from the incoming event object that is passed to the target method.  The common case is the target method takes no arguments, in which case a value of null should be used for the <code>eventPropertyName</code>.  Alternatively if you want the incoming event object passed directly to the target method use the empty string. The format of the <code>eventPropertyName</code> string is a sequence of methods or properties where each method or property is applied to the value returned by the preceeding method starting from the incoming event object. The syntax is: <code>propertyName{.propertyName}*</code> where <code>propertyName</code> matches a method or property.  For example, to extract the <code>point</code> property from a <code>MouseEvent</code>, you could use either <code>"point"</code> or <code>"getPoint"</code> as the <code>eventPropertyName</code>.  To extract the "text" property from a <code>MouseEvent</code> with a <code>JLabel</code> source use any of the following as <code>eventPropertyName</code>: <code>"source.text"</code>, <code>"getSource.text"</code> <code>"getSource.getText"</code> or <code>"source.getText"</code>.  If a method can not be found, or an exception is generated as part of invoking a method a <code>RuntimeException</code> will be thrown at dispatch time.  For example, if the incoming event object is null, and <code>eventPropertyName</code> is non-null and not empty, a <code>RuntimeException</code> will be thrown. <p> The <code>action</code> argument is of the same format as the <code>eventPropertyName</code> argument where the last property name identifies either a method name or writable property. <p> If the <code>listenerMethodName</code> is <code>null</code> <em>all</em> methods in the interface trigger the <code>action</code> to be executed on the <code>target</code>. <p> For example, to create a <code>MouseListener</code> that sets the target object's <code>origin</code> property to the incoming <code>MouseEvent</code>'s location (that's the value of <code>mouseEvent.getPoint()</code>) each time a mouse button is pressed, one would write: <blockquote> <pre> EventHandler.create(MouseListener.class, target, "origin", "point", "mousePressed"); </pre> </blockquote> This is comparable to writing a <code>MouseListener</code> in which all of the methods except <code>mousePressed</code> are no-ops: <blockquote> <pre> //Equivalent code using an inner class instead of EventHandler. new MouseAdapter() { public void mousePressed(MouseEvent e) { target.setOrigin(e.getPoint()); } }; </pre> </blockquote>
 * @param < T > the type to create
 * @param listenerInterface the listener interface to create a proxy for
 * @param target the object that will perform the action
 * @param action the name of a (possibly qualified) property or method onthe target
 * @param eventPropertyName the (possibly qualified) name of a readable property of the incoming event
 * @param listenerMethodName the name of the method in the listener interface that should trigger the action
 * @return an object that implements <code>listenerInterface</code>
 * @throws NullPointerException if <code>listenerInterface</code> is null
 * @throws NullPointerException if <code>target</code> is null
 * @throws NullPointerException if <code>action</code> is null
 * @see EventHandler
 */
@SuppressWarnings("String_Node_Str") public static <T>T create(Class<T> listenerInterface,Object target,String action,String eventPropertyName,String listenerMethodName){
  EventHandler eventHandler=new EventHandler(target,action,eventPropertyName,listenerMethodName);
  if (listenerInterface == null) {
    throw new NullPointerException("String_Node_Str");
  }
  return (T)Proxy.newProxyInstance(target.getClass().getClassLoader(),new Class<?>[]{listenerInterface},eventHandler);
}