nus-yam/ex-repair huggingface dataset:
Program: 15792
Project: 15792
Buggy source:
Object[] packArgs(Object[] args,List modelArgs,BeansWrapper w) throws TemplateModelException {
  final int actualArgCount=args.length;
  final int fixArgCount=argCount - 1;
  if (args.length != argCount) {
    Object[] newargs=new Object[argCount];
    System.arraycopy(args,0,newargs,0,fixArgCount);
    Object array=Array.newInstance(varArgType,actualArgCount - fixArgCount);
    for (int i=fixArgCount; i < actualArgCount; ++i) {
      Object val=w.unwrapInternal((TemplateModel)modelArgs.get(i),varArgType);
      if (val == BeansWrapper.CAN_NOT_UNWRAP) {
        return null;
      }
      Array.set(array,i - fixArgCount,val);
    }
    newargs[fixArgCount]=array;
    return newargs;
  }
 else {
    Object val=w.unwrap((TemplateModel)modelArgs.get(fixArgCount),varArgType);
    if (val == BeansWrapper.CAN_NOT_UNWRAP) {
      return null;
    }
    Object array=Array.newInstance(varArgType,1);
    Array.set(array,0,val);
    args[fixArgCount]=array;
    return args;
  }
}

Fixed version (ground truth):
Object[] packArgs(Object[] args,List modelArgs,BeansWrapper w) throws TemplateModelException {
  final int actualArgCount=args.length;
  final int fixArgCount=argCount - 1;
  if (args.length != argCount) {
    Object[] newargs=new Object[argCount];
    System.arraycopy(args,0,newargs,0,fixArgCount);
    Object array=Array.newInstance(varArgType,actualArgCount - fixArgCount);
    for (int i=fixArgCount; i < actualArgCount; ++i) {
      Object val=w.unwrapInternal((TemplateModel)modelArgs.get(i),varArgType);
      if (val == BeansWrapper.CAN_NOT_UNWRAP) {
        return null;
      }
      Array.set(array,i - fixArgCount,val);
    }
    newargs[fixArgCount]=array;
    return newargs;
  }
 else {
    Object val=w.unwrapInternal((TemplateModel)modelArgs.get(fixArgCount),varArgType);
    if (val == BeansWrapper.CAN_NOT_UNWRAP) {
      return null;
    }
    Object array=Array.newInstance(varArgType,1);
    Array.set(array,0,val);
    args[fixArgCount]=array;
    return args;
  }
}
Program: 15794
Project: 15794
Buggy source:
private void addLocationsFromWebApp() throws Exception {
  Set libs=ctx.getResourcePaths("String_Node_Str");
  for (Iterator iter=libs.iterator(); iter.hasNext(); ) {
    String path=(String)iter.next();
    if (path.startsWith("String_Node_Str") && (path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str"))) {
      addLocationsFromJarFile(path);
    }
 else     if (path.endsWith("String_Node_Str")) {
      addLocationFromTldFile(path);
    }
  }
}

Fixed version (ground truth):
private void addLocationsFromWebApp() throws Exception {
  Set libs=ctx.getResourcePaths("String_Node_Str");
  if (libs != null) {
    for (Iterator iter=libs.iterator(); iter.hasNext(); ) {
      String path=(String)iter.next();
      if (path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str")) {
        addLocationsFromJarFile(path);
      }
 else       if (path.endsWith("String_Node_Str")) {
        addLocationFromTldFile(path);
      }
    }
  }
  libs=ctx.getResourcePaths("String_Node_Str");
  if (libs != null) {
    for (Iterator iter=libs.iterator(); iter.hasNext(); ) {
      String path=(String)iter.next();
      if (path.endsWith("String_Node_Str")) {
        addLocationFromTldFile(path);
      }
    }
  }
}
Program: 15795
Project: 15795
Buggy source:
public Set getResourcePaths(String path){
  if (path.equals("String_Node_Str")) {
    return new HashSet(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str"}));
  }
 else {
    return Collections.EMPTY_SET;
  }
}

Fixed version (ground truth):
public Set getResourcePaths(String path){
  if (path.equals("String_Node_Str")) {
    return new HashSet(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str"}));
  }
 else   if (path.equals("String_Node_Str")) {
    return new HashSet(Arrays.asList(new String[]{"String_Node_Str"}));
  }
 else {
    return null;
  }
}
Program: 15796
Project: 15796
Buggy source:
public Object exec(List args) throws TemplateModelException {
  if (args.size() != 1) {
    throw new TemplateModelException("String_Node_Str" + biName + "String_Node_Str"+ args.size()+ "String_Node_Str");
  }
  TemplateModel tzArgTM=(TemplateModel)args.get(0);
  TimeZone tzArg;
  if (tzArgTM instanceof AdapterTemplateModel) {
    Object adaptedObj=((AdapterTemplateModel)tzArgTM).getAdaptedObject(TimeZone.class);
    if (!(adaptedObj instanceof TimeZone)) {
      throw new TemplateModelException("String_Node_Str" + biName + "String_Node_Str"+ "String_Node_Str"+ tzArgTM.getClass().getName()+ "String_Node_Str"+ (adaptedObj != null ? adaptedObj.getClass().getName() : "String_Node_Str")+ "String_Node_Str");
    }
    tzArg=(TimeZone)adaptedObj;
  }
 else   if (tzArgTM instanceof TemplateScalarModel) {
    String tzName=((TemplateScalarModel)tzArgTM).getAsString();
    try {
      tzArg=DateUtil.getTimeZone(tzName);
    }
 catch (    UnrecognizedTimeZoneException e) {
      throw new TemplateModelException("String_Node_Str" + biName + "String_Node_Str"+ StringUtil.jQuote(tzName));
    }
  }
 else {
    throw new TemplateModelException("String_Node_Str" + biName + "String_Node_Str"+ "String_Node_Str"+ (tzArgTM != null ? tzArgTM.getClass().getName() : "String_Node_Str")+ "String_Node_Str");
  }
  return new SimpleScalar(DateUtil.dateToISO8601String(date,dateType != TemplateDateModel.TIME,dateType != TemplateDateModel.DATE,showOffset && dateType != TemplateDateModel.DATE,accuracy,tzArg,env.getISOBuiltInCalendar()));
}

Fixed version (ground truth):
public Object exec(List args) throws TemplateModelException {
  if (args.size() != 1) {
    throw new TemplateModelException("String_Node_Str" + biName + "String_Node_Str"+ args.size()+ "String_Node_Str");
  }
  TemplateModel tzArgTM=(TemplateModel)args.get(0);
  TimeZone tzArg;
  Object adaptedObj;
  if (tzArgTM instanceof AdapterTemplateModel && (adaptedObj=((AdapterTemplateModel)tzArgTM).getAdaptedObject(TimeZone.class)) instanceof TimeZone) {
    tzArg=(TimeZone)adaptedObj;
  }
 else   if (tzArgTM instanceof TemplateScalarModel) {
    String tzName=((TemplateScalarModel)tzArgTM).getAsString();
    try {
      tzArg=DateUtil.getTimeZone(tzName);
    }
 catch (    UnrecognizedTimeZoneException e) {
      throw new TemplateModelException("String_Node_Str" + biName + "String_Node_Str"+ StringUtil.jQuote(tzName));
    }
  }
 else {
    throw new TemplateModelException("String_Node_Str" + biName + "String_Node_Str"+ "String_Node_Str"+ (tzArgTM != null ? tzArgTM.getClass().getName() : "String_Node_Str")+ "String_Node_Str");
  }
  return new SimpleScalar(DateUtil.dateToISO8601String(date,dateType != TemplateDateModel.TIME,dateType != TemplateDateModel.DATE,showOffset && dateType != TemplateDateModel.DATE,accuracy,tzArg,env.getISOBuiltInCalendar()));
}
Program: 15799
Project: 15799
Buggy source:
Object getMemberAndArguments(List arguments,BeansWrapper w) throws TemplateModelException {
  if (arguments == null) {
    arguments=Collections.EMPTY_LIST;
  }
  int l=arguments.size();
  Class[][] marshalTypes=getMarshalTypes();
  if (marshalTypes.length <= l) {
    return NO_SUCH_METHOD;
  }
  Class[] types=marshalTypes[l];
  if (types == null) {
    return NO_SUCH_METHOD;
  }
  Object[] args=new Object[l];
  Iterator it=arguments.iterator();
  for (int i=0; i < l; ++i) {
    Object obj=w.unwrap((TemplateModel)it.next(),types[i]);
    if (obj == BeansWrapper.CAN_NOT_UNWRAP) {
      return NO_SUCH_METHOD;
    }
    args[i]=obj;
  }
  Object objMember=getMemberForArgs(args,false);
  if (objMember instanceof Member) {
    Member member=(Member)objMember;
    BeansWrapper.coerceBigDecimals(getSignature(member),args);
    return new MemberAndArguments(member,args);
  }
  return objMember;
}

Fixed version (ground truth):
Object getMemberAndArguments(List arguments,BeansWrapper w) throws TemplateModelException {
  if (arguments == null) {
    arguments=Collections.EMPTY_LIST;
  }
  int l=arguments.size();
  Class[][] marshalTypes=getMarshalTypes();
  if (marshalTypes.length <= l) {
    return NO_SUCH_METHOD;
  }
  Class[] types=marshalTypes[l];
  if (types == null) {
    return NO_SUCH_METHOD;
  }
  Object[] args=new Object[l];
  Iterator it=arguments.iterator();
  for (int i=0; i < l; ++i) {
    Object obj=w.unwrapInternal((TemplateModel)it.next(),types[i]);
    if (obj == BeansWrapper.CAN_NOT_UNWRAP) {
      return NO_SUCH_METHOD;
    }
    args[i]=obj;
  }
  Object objMember=getMemberForArgs(args,false);
  if (objMember instanceof Member) {
    Member member=(Member)objMember;
    BeansWrapper.coerceBigDecimals(getSignature(member),args);
    return new MemberAndArguments(member,args);
  }
  return objMember;
}
Program: 15800
Project: 15800
Buggy source:
Object[] packArgs(Object[] args,List modelArgs,BeansWrapper w) throws TemplateModelException {
  final int actualArgCount=args.length;
  final int fixArgCount=argCount - 1;
  if (args.length != argCount) {
    Object[] newargs=new Object[argCount];
    System.arraycopy(args,0,newargs,0,fixArgCount);
    Object array=Array.newInstance(varArgType,actualArgCount - fixArgCount);
    for (int i=fixArgCount; i < actualArgCount; ++i) {
      Object val=w.unwrap((TemplateModel)modelArgs.get(i),varArgType);
      if (val == BeansWrapper.CAN_NOT_UNWRAP) {
        return null;
      }
      Array.set(array,i - fixArgCount,val);
    }
    newargs[fixArgCount]=array;
    return newargs;
  }
 else {
    Object val=w.unwrap((TemplateModel)modelArgs.get(fixArgCount),varArgType);
    if (val == BeansWrapper.CAN_NOT_UNWRAP) {
      return null;
    }
    Object array=Array.newInstance(varArgType,1);
    Array.set(array,0,val);
    args[fixArgCount]=array;
    return args;
  }
}

Fixed version (ground truth):
Object[] packArgs(Object[] args,List modelArgs,BeansWrapper w) throws TemplateModelException {
  final int actualArgCount=args.length;
  final int fixArgCount=argCount - 1;
  if (args.length != argCount) {
    Object[] newargs=new Object[argCount];
    System.arraycopy(args,0,newargs,0,fixArgCount);
    Object array=Array.newInstance(varArgType,actualArgCount - fixArgCount);
    for (int i=fixArgCount; i < actualArgCount; ++i) {
      Object val=w.unwrapInternal((TemplateModel)modelArgs.get(i),varArgType);
      if (val == BeansWrapper.CAN_NOT_UNWRAP) {
        return null;
      }
      Array.set(array,i - fixArgCount,val);
    }
    newargs[fixArgCount]=array;
    return newargs;
  }
 else {
    Object val=w.unwrap((TemplateModel)modelArgs.get(fixArgCount),varArgType);
    if (val == BeansWrapper.CAN_NOT_UNWRAP) {
      return null;
    }
    Object array=Array.newInstance(varArgType,1);
    Array.set(array,0,val);
    args[fixArgCount]=array;
    return args;
  }
}
Program: 15801
Project: 15801
Buggy source:
Object getMemberAndArguments(List arguments,BeansWrapper w) throws TemplateModelException {
  if (arguments == null) {
    arguments=Collections.EMPTY_LIST;
  }
  int l=arguments.size();
  Class[][] marshalTypes=getMarshalTypes();
  Object[] args=new Object[l];
  outer:   for (int j=Math.min(l + 1,marshalTypes.length - 1); j >= 0; --j) {
    Class[] types=marshalTypes[j];
    if (types == null) {
      if (j == 0) {
        return NO_SUCH_METHOD;
      }
      continue;
    }
    Iterator it=arguments.iterator();
    for (int i=0; i < l; ++i) {
      Object dst=w.unwrap((TemplateModel)it.next(),i < j ? types[i] : types[j - 1]);
      if (dst == BeansWrapper.CAN_NOT_UNWRAP) {
        continue outer;
      }
      if (dst != args[i]) {
        args[i]=dst;
      }
    }
    break;
  }
  Object objMember=getMemberForArgs(args,true);
  if (objMember instanceof Member) {
    Member member=(Member)objMember;
    args=((ArgumentPacker)argPackers.get(member)).packArgs(args,arguments,w);
    if (args == null) {
      return NO_SUCH_METHOD;
    }
    BeansWrapper.coerceBigDecimals(getSignature(member),args);
    return new MemberAndArguments(member,args);
  }
  return objMember;
}

Fixed version (ground truth):
Object getMemberAndArguments(List arguments,BeansWrapper w) throws TemplateModelException {
  if (arguments == null) {
    arguments=Collections.EMPTY_LIST;
  }
  int l=arguments.size();
  Class[][] marshalTypes=getMarshalTypes();
  Object[] args=new Object[l];
  outer:   for (int j=Math.min(l + 1,marshalTypes.length - 1); j >= 0; --j) {
    Class[] types=marshalTypes[j];
    if (types == null) {
      if (j == 0) {
        return NO_SUCH_METHOD;
      }
      continue;
    }
    Iterator it=arguments.iterator();
    for (int i=0; i < l; ++i) {
      Object dst=w.unwrapInternal((TemplateModel)it.next(),i < j ? types[i] : types[j - 1]);
      if (dst == BeansWrapper.CAN_NOT_UNWRAP) {
        continue outer;
      }
      if (dst != args[i]) {
        args[i]=dst;
      }
    }
    break;
  }
  Object objMember=getMemberForArgs(args,true);
  if (objMember instanceof Member) {
    Member member=(Member)objMember;
    args=((ArgumentPacker)argPackers.get(member)).packArgs(args,arguments,w);
    if (args == null) {
      return NO_SUCH_METHOD;
    }
    BeansWrapper.coerceBigDecimals(getSignature(member),args);
    return new MemberAndArguments(member,args);
  }
  return objMember;
}
Program: 15802
Project: 15802
Buggy source:
private static Object unwrapArgument(TemplateModel model,Class type,BeansWrapper w) throws TemplateModelException {
  Object val=w.unwrap(model,type);
  if (val == BeansWrapper.CAN_NOT_UNWRAP) {
    throw new TemplateModelException("String_Node_Str" + model + "String_Node_Str"+ type.getName());
  }
  return val;
}

Fixed version (ground truth):
private static Object unwrapArgument(TemplateModel model,Class type,BeansWrapper w) throws TemplateModelException {
  Object val=w.unwrapInternal(model,type);
  if (val == BeansWrapper.CAN_NOT_UNWRAP) {
    throw new TemplateModelException("String_Node_Str" + model + "String_Node_Str"+ type.getName());
  }
  return val;
}
Program: 15803
Project: 15803
Buggy source:
/** 
 * Creates a new instance of AllHttpScopesHashModel for handling a single  HTTP servlet request.
 * @param wrapper the object wrapper to use
 * @param context the servlet context of the web application
 * @param request the HTTP servlet request being processed
 */
public AllHttpScopesHashModel(ObjectWrapper wrapper,ServletContext context,HttpServletRequest request){
  this.wrapper=wrapper;
  this.context=context;
  this.request=request;
}

Fixed version (ground truth):
/** 
 * Creates a new instance of AllHttpScopesHashModel for handling a single  HTTP servlet request.
 * @param wrapper the object wrapper to use
 * @param context the servlet context of the web application
 * @param request the HTTP servlet request being processed
 */
public AllHttpScopesHashModel(ObjectWrapper wrapper,ServletContext context,HttpServletRequest request){
  setObjectWrapper(wrapper);
  this.context=context;
  this.request=request;
}
Program: 15804
Project: 15804
Buggy source:
public TemplateModel get(String key) throws TemplateModelException {
  TemplateModel model=super.get(key);
  if (model != null) {
    return model;
  }
  model=(TemplateModel)unlistedModels.get(key);
  if (model != null) {
    return model;
  }
  Object obj=request.getAttribute(key);
  if (obj != null) {
    return wrapper.wrap(obj);
  }
  HttpSession session=request.getSession(false);
  if (session != null) {
    obj=session.getAttribute(key);
    if (obj != null) {
      return wrapper.wrap(obj);
    }
  }
  obj=context.getAttribute(key);
  if (obj != null) {
    return wrapper.wrap(obj);
  }
  return wrapper.wrap(null);
}

Fixed version (ground truth):
public TemplateModel get(String key) throws TemplateModelException {
  TemplateModel model=super.get(key);
  if (model != null) {
    return model;
  }
  model=(TemplateModel)unlistedModels.get(key);
  if (model != null) {
    return model;
  }
  Object obj=request.getAttribute(key);
  if (obj != null) {
    return wrap(obj);
  }
  HttpSession session=request.getSession(false);
  if (session != null) {
    obj=session.getAttribute(key);
    if (obj != null) {
      return wrap(obj);
    }
  }
  obj=context.getAttribute(key);
  if (obj != null) {
    return wrap(obj);
  }
  return wrap(null);
}
Program: 15805
Project: 15805
Buggy source:
public void testJQuoteNoXSS(){
  assertEquals("String_Node_Str",StringUtil.jQuoteNoXSS(null));
  assertEquals("String_Node_Str",StringUtil.jQuoteNoXSS("String_Node_Str"));
  assertEquals("String_Node_Str",StringUtil.jQuoteNoXSS(Integer.valueOf(123)));
  assertEquals("String_Node_Str",StringUtil.jQuoteNoXSS("String_Node_Str"));
  assertEquals("String_Node_Str",StringUtil.jQuoteNoXSS("String_Node_Str"));
  assertEquals("String_Node_Str",StringUtil.jQuoteNoXSS("String_Node_Str"));
}

Fixed version (ground truth):
public void testJQuoteNoXSS(){
  assertEquals("String_Node_Str",StringUtil.jQuoteNoXSS(null));
  assertEquals("String_Node_Str",StringUtil.jQuoteNoXSS("String_Node_Str"));
  assertEquals("String_Node_Str",StringUtil.jQuoteNoXSS(Integer.valueOf(123)));
  assertEquals("String_Node_Str",StringUtil.jQuoteNoXSS("String_Node_Str"));
  assertEquals("String_Node_Str",StringUtil.jQuoteNoXSS("String_Node_Str"));
  assertEquals("String_Node_Str",StringUtil.jQuoteNoXSS("String_Node_Str"));
  assertEquals("String_Node_Str",StringUtil.jQuoteNoXSS((Object)"String_Node_Str"));
}
Program: 15808
Project: 15808
Buggy source:
/** 
 * Returns the desktop from the given websocket session.
 * @param wsession websocket session
 * @return a desktop, null if desktop not found
 */
public static Desktop getDesktop(Session wsession){
  org.zkoss.zk.ui.Session session=(org.zkoss.zk.ui.Session)wsession.getUserProperties().get(ZKWebSocket.class.getName());
  if (session == null)   throw new IllegalStateException("String_Node_Str");
  List<String> dtids=wsession.getRequestParameterMap().get("String_Node_Str");
  if (dtids.isEmpty())   throw new IllegalStateException("String_Node_Str");
  return ((SessionCtrl)session).getDesktopCache().getDesktopIfAny(dtids.get(0));
}

Fixed version (ground truth):
/** 
 * Returns the desktop from the given websocket session.
 * @param wsession websocket session
 * @return a desktop, null if desktop not found
 */
public static Desktop getDesktop(Session wsession){
  org.zkoss.zk.ui.Session session=(org.zkoss.zk.ui.Session)wsession.getUserProperties().get(ZKWebSocket.class.getName());
  if (session == null)   throw new IllegalStateException("String_Node_Str");
  List<String> dtids=wsession.getRequestParameterMap().get("String_Node_Str");
  if (dtids.isEmpty())   throw new IllegalStateException("String_Node_Str");
  DesktopCache desktopCache=((SessionCtrl)session).getDesktopCache();
  return desktopCache != null ? desktopCache.getDesktopIfAny(dtids.get(0)) : null;
}
Program: 15809
Project: 15809
Buggy source:
/** 
 * Returns the desktop from the given websocket session.
 * @param wsession websocket session
 * @return a desktop, null if desktop not found
 */
public static Desktop getDesktop(Session wsession){
  org.zkoss.zk.ui.Session session=(org.zkoss.zk.ui.Session)wsession.getUserProperties().get(ZKWebSocket.class.getName());
  if (session == null)   throw new IllegalStateException("String_Node_Str");
  List<String> dtids=wsession.getRequestParameterMap().get("String_Node_Str");
  if (dtids.isEmpty())   throw new IllegalStateException("String_Node_Str");
  return ((SessionCtrl)session).getDesktopCache().getDesktopIfAny(dtids.get(0));
}

Fixed version (ground truth):
/** 
 * Returns the desktop from the given websocket session.
 * @param wsession websocket session
 * @return a desktop, null if desktop not found
 */
public static Desktop getDesktop(Session wsession){
  org.zkoss.zk.ui.Session session=(org.zkoss.zk.ui.Session)wsession.getUserProperties().get(ZKWebSocket.class.getName());
  if (session == null)   throw new IllegalStateException("String_Node_Str");
  List<String> dtids=wsession.getRequestParameterMap().get("String_Node_Str");
  if (dtids.isEmpty())   throw new IllegalStateException("String_Node_Str");
  DesktopCache desktopCache=((SessionCtrl)session).getDesktopCache();
  return desktopCache != null ? desktopCache.getDesktopIfAny(dtids.get(0)) : null;
}
Program: 15810
Project: 15810
Buggy source:
protected void removeAllFromBeanMap(Collection<TrackerNode> removed){
  final Collection<Entry<Object,Set<TrackerNode>>> nodesets=_beanMap.entrySet();
  for (final Iterator<Entry<Object,Set<TrackerNode>>> it=nodesets.iterator(); it.hasNext(); ) {
    final Entry<Object,Set<TrackerNode>> nodeset=it.next();
    final Object bean=nodeset.getKey();
    nodeset.getValue().removeAll(removed);
    if (nodeset.getValue().isEmpty()) {
      it.remove();
      _equalBeansMap.remove(bean);
    }
  }
}

Fixed version (ground truth):
protected void removeAllFromBeanMap(Collection<TrackerNode> removed){
  for (  TrackerNode tn : removed) {
    Set<Object> beans=_nodeMap.get(tn);
    for (    Object o : beans) {
      Set<TrackerNode> tns=_beanMap.get(o);
      tns.removeAll(removed);
      if (tns.isEmpty()) {
        _beanMap.remove(o);
        _equalBeansMap.remove(o);
      }
    }
  }
  _nodeMap.keySet().removeAll(removed);
}
Program: 15811
Project: 15811
Buggy source:
protected void addBeanMap(TrackerNode node,Object value,Object basePath){
  if (!testEqualsBean(node.getBean(),value)) {
    removeBeanMap(node);
    Set<TrackerNode> nodes=_beanMap.get(value);
    final Set<TrackerNode> nodes0=AllocUtil.inst.addLinkedHashSet(nodes,node);
    if (nodes == null) {
      _equalBeansMap.put(value);
    }
    if (nodes != nodes0) {
      _beanMap.put(value,nodes0);
    }
    node.setBean(value);
  }
  removeNullMap(node);
}

Fixed version (ground truth):
protected void addBeanMap(TrackerNode node,Object value,Object basePath){
  if (!testEqualsBean(node.getBean(),value)) {
    removeBeanMap(node);
    Set<TrackerNode> nodes=_beanMap.get(value);
    final Set<TrackerNode> nodes0=AllocUtil.inst.addLinkedHashSet(nodes,node);
    if (nodes == null) {
      _equalBeansMap.put(value);
    }
    if (nodes != nodes0) {
      _beanMap.put(value,nodes0);
    }
    node.setBean(value);
    Set<Object> values=_nodeMap.get(node);
    final Set<Object> values0=AllocUtil.inst.addLinkedHashSet(values,value);
    if (values != values0) {
      _nodeMap.put(node,values0);
    }
  }
  removeNullMap(node);
}
Program: 15812
Project: 15812
Buggy source:
/** 
 * Retrieves the content of the given path.
 * @since 5.0.4
 */
protected byte[] retrieve(HttpServletRequest request,HttpServletResponse response,String path) throws ServletException, IOException {
  byte[] data;
  String pkg=null;
  String resourceCache=Library.getProperty("String_Node_Str");
  if (resourceCache != null && "String_Node_Str".equalsIgnoreCase(resourceCache))   _cache.clear();
  final Content content=(Content)_cache.get(path);
  if (content == null) {
    if (Servlets.isIncluded(request)) {
      log.error("String_Node_Str" + path);
      throw new java.io.FileNotFoundException("String_Node_Str" + path);
    }
    response.sendError(response.SC_NOT_FOUND,path);
    return null;
  }
  final boolean cacheable;
  final RequestContext reqctx=new RequestContext(this,request,response);
  final Object rawdata=content.parse(reqctx);
  if (rawdata instanceof ByteContent) {
    final ByteContent bc=(ByteContent)rawdata;
    data=bc.content;
    cacheable=bc.cacheable;
  }
 else {
    final WpdContent wc=(WpdContent)rawdata;
    data=wc.toByteArray(reqctx);
    pkg=wc.name;
    cacheable=wc.cacheable;
  }
  if (cacheable)   org.zkoss.zk.fn.JspFns.setCacheControl(getServletContext(),request,response,"String_Node_Str",8760);
  return pkg != null ? mergeJavaScript(request,response,pkg,data) : data;
}

Fixed version (ground truth):
/** 
 * Retrieves the content of the given path.
 * @since 5.0.4
 */
protected byte[] retrieve(HttpServletRequest request,HttpServletResponse response,String path) throws ServletException, IOException {
  byte[] data;
  String pkg=null;
  String resourceCache=Library.getProperty("String_Node_Str");
  if (resourceCache != null && "String_Node_Str".equalsIgnoreCase(resourceCache))   _cache.clear();
  final Content content=(Content)_cache.get(path);
  if (content == null) {
    if (Servlets.isIncluded(request)) {
      log.error("String_Node_Str" + path);
      throw new java.io.FileNotFoundException("String_Node_Str" + path);
    }
    response.sendError(response.SC_NOT_FOUND,path);
    return null;
  }
  final boolean cacheable;
  final RequestContext reqctx=new RequestContext(this,request,response);
synchronized (content) {
    final Object rawdata=content.parse(reqctx);
    if (rawdata instanceof ByteContent) {
      final ByteContent bc=(ByteContent)rawdata;
      data=bc.content;
      cacheable=bc.cacheable;
    }
 else {
      final WpdContent wc=(WpdContent)rawdata;
      data=wc.toByteArray(reqctx);
      pkg=wc.name;
      cacheable=wc.cacheable;
    }
  }
  if (cacheable)   org.zkoss.zk.fn.JspFns.setCacheControl(getServletContext(),request,response,"String_Node_Str",8760);
  return pkg != null ? mergeJavaScript(request,response,pkg,data) : data;
}
Program: 15814
Project: 15814
Buggy source:
private static Component[] execCreateChild(CreateInfo ci,Component parent,ComponentInfo childInfo,ReplaceableText replaceableText,Component insertBefore){
  final ComponentDefinition childdef=childInfo.getComponentDefinition();
  if (childdef.isInlineMacro()) {
    if (insertBefore != null)     throw new UnsupportedOperationException("String_Node_Str");
    final Map<String,Object> props=new HashMap<String,Object>();
    props.put("String_Node_Str",parent);
    childInfo.evalProperties(props,ci.page,parent,true);
    return new Component[]{ci.exec.createComponents(childdef.getMacroURI(),parent,props)};
  }
 else {
    String rt=null;
    if (replaceableText != null) {
      rt=replaceableText.text;
      replaceableText.text=childInfo.getReplaceableText();
      if (replaceableText.text != null)       return new Component[0];
    }
    Component child=execCreateChild0(ci,parent,childInfo,rt,insertBefore);
    return child != null ? new Component[]{child} : new Component[0];
  }
}

Fixed version (ground truth):
private static Component[] execCreateChild(CreateInfo ci,Component parent,ComponentInfo childInfo,ReplaceableText replaceableText,Component insertBefore){
  final ComponentDefinition childdef=childInfo.getComponentDefinition();
  if (childdef.isInlineMacro()) {
    if (insertBefore != null)     throw new UnsupportedOperationException("String_Node_Str");
    final Map<String,Object> props=new HashMap<String,Object>();
    props.put("String_Node_Str",parent);
    childInfo.evalProperties(props,ci.page,parent,true);
    return new Component[]{ci.exec.createComponents(childdef.getMacroURI(),parent,props)};
  }
 else {
    String rt=null;
    if (replaceableText != null) {
      if (parent == null || parent.getDefinition().isBlankPreserved()) {
        rt=replaceableText.text;
      }
      replaceableText.text=childInfo.getReplaceableText();
      if (replaceableText.text != null)       return new Component[0];
    }
    Component child=execCreateChild0(ci,parent,childInfo,rt,insertBefore);
    return child != null ? new Component[]{child} : new Component[0];
  }
}
Program: 15817
Project: 15817
Buggy source:
private String fixName(String name,boolean prefix){
  name=name.length() > 0 && name.charAt(0) != '/' ? _dir != null ? _dir + name : prefix && _prefix != null ? '/' + name : name : name;
  return prefix && _prefix != null ? _prefix + name : name;
}

Fixed version (ground truth):
private String fixName(String name,boolean prefix){
  name=name.length() > 0 && name.charAt(0) != '/' ? _dir != null ? _dir + name : prefix && _prefix != null ? '/' + name : name : name;
  return prefix && _prefix != null ? _prefix + name : (_externalPrefix == null ? "String_Node_Str" : _externalPrefix) + name;
}
Program: 15819
Project: 15819
Buggy source:
private String expendValue(Map labels,String value){
  if (labels != null && value != null) {
    int offset=0;
    while (offset < value.length()) {
      int start=value.indexOf("String_Node_Str",offset);
      if (start != -1) {
        int end=value.indexOf("String_Node_Str",start);
        if (end != -1) {
          String exp=value.substring(start,end + 1);
          String expStr=exp.substring(2,exp.length() - 1);
          if (expStr.endsWith("String_Node_Str"))           expStr=expStr.substring(0,expStr.length() - 2);
          Object expend=labels.get(expStr);
          String expended="String_Node_Str";
          if (expend instanceof String)           expended=expendValue(labels,(String)expend);
 else           if (expend instanceof ExValue)           expended=expendValue(labels,((ExValue)expend).getValue());
          value=value.substring(0,start) + expended + value.substring(start + exp.length());
          offset+=start + expended.length();
        }
 else {
          break;
        }
      }
 else {
        break;
      }
    }
  }
  return value;
}

Fixed version (ground truth):
private String expendValue(Map labels,String value){
  if (labels != null && value != null) {
    int offset=0;
    while (offset < value.length()) {
      int start=value.indexOf("String_Node_Str",offset);
      if (start != -1) {
        int end=value.indexOf("String_Node_Str",start);
        if (end != -1) {
          String exp=value.substring(start,end + 1);
          String expStr=exp.substring(2,exp.length() - 1);
          if (expStr.endsWith("String_Node_Str"))           expStr=expStr.substring(0,expStr.length() - 2);
          Object expend=labels.get(expStr);
          String expended="String_Node_Str";
          if (expend instanceof String)           expended=expendValue(labels,(String)expend);
 else           if (expend instanceof ExValue)           expended=expendValue(labels,((ExValue)expend).getValue());
          value=value.substring(0,start) + expended + value.substring(start + exp.length());
          offset=start + expended.length();
        }
 else {
          break;
        }
      }
 else {
        break;
      }
    }
  }
  return value;
}
Program: 15820
Project: 15820
Buggy source:
private String expendValue(Map labels,String value){
  if (labels != null && value != null && value.startsWith("String_Node_Str") && value.endsWith("String_Node_Str")) {
    String expStr=value.substring(2,value.length() - 1);
    if (expStr.endsWith("String_Node_Str"))     expStr=expStr.substring(0,expStr.length() - 2);
    Object expend=labels.get(expStr);
    if (expend != null) {
      if (expend instanceof String)       return expendValue(labels,(String)expend);
 else       if (expend instanceof ExValue)       return expendValue(labels,((ExValue)expend).getValue());
    }
  }
  return value;
}

Fixed version (ground truth):
private String expendValue(Map labels,String value){
  if (labels != null && value != null) {
    int offset=0;
    while (offset < value.length()) {
      int start=value.indexOf("String_Node_Str",offset);
      if (start != -1) {
        int end=value.indexOf("String_Node_Str",start);
        if (end != -1) {
          String exp=value.substring(start,end + 1);
          String expStr=exp.substring(2,exp.length() - 1);
          if (expStr.endsWith("String_Node_Str"))           expStr=expStr.substring(0,expStr.length() - 2);
          Object expend=labels.get(expStr);
          String expended="String_Node_Str";
          if (expend instanceof String)           expended=expendValue(labels,(String)expend);
 else           if (expend instanceof ExValue)           expended=expendValue(labels,((ExValue)expend).getValue());
          value=value.substring(0,start) + expended + value.substring(start + exp.length());
          offset+=start + expended.length();
        }
 else {
          break;
        }
      }
 else {
        break;
      }
    }
  }
  return value;
}
Program: 15821
Project: 15821
Buggy source:
/** 
 * Returns the tab order of this component. <p>Default: 0
 */
public int getTabindex(){
  return _auxinf != null ? _auxinf.tabindex : 0;
}

Fixed version (ground truth):
/** 
 * Returns the tab order of this component. <p>Default: 0
 */
public int getTabindex(){
  return (_auxinf != null && _auxinf.tabindex != null) ? _auxinf.tabindex : 0;
}
Program: 15822
Project: 15822
Buggy source:
private static void desktopDestroyed(Desktop desktop){
  final Session sess=desktop.getSession();
  final Execution exec=new ExecutionImpl(desktop.getWebApp().getServletContext(),null,null,desktop,null);
  final DesktopCtrl desktopCtrl=(DesktopCtrl)desktop;
  final Execution oldExce=desktop.getExecution();
  final Visualizer oldVi=desktopCtrl.getVisualizer();
  try {
    ExecutionsCtrl.setCurrent(exec);
    final UiVisualizer uv=new UiVisualizer(exec,true,false);
    desktopCtrl.setVisualizer(uv);
    desktopCtrl.setExecution(exec);
    final WebApp wapp=desktop.getWebApp();
    ((DesktopCtrl)desktop).invokeDesktopCleanups();
    final Configuration config=wapp.getConfiguration();
    config.invokeDesktopCleanups(desktop);
    ((WebAppCtrl)wapp).getUiEngine().desktopDestroyed(desktop);
    final Monitor monitor=desktop.getWebApp().getConfiguration().getMonitor();
    if (monitor != null) {
      try {
        monitor.desktopDestroyed(desktop);
      }
 catch (      Throwable ex) {
        log.error("String_Node_Str",ex);
      }
    }
    final DesktopRecycle dtrc=config.getDesktopRecycle();
    if (dtrc != null) {
      try {
        dtrc.afterRemove(sess,desktop);
      }
 catch (      Throwable ex) {
        log.error("String_Node_Str",ex);
      }
    }
  }
  finally {
    ExecutionsCtrl.setCurrent(null);
    desktopCtrl.setVisualizer(oldVi);
    desktopCtrl.setExecution(oldExce);
  }
}

Fixed version (ground truth):
private static void desktopDestroyed(Desktop desktop){
  final Session sess=desktop.getSession();
  final Execution exec=new ExecutionImpl(desktop.getWebApp().getServletContext(),null,null,desktop,null);
  final DesktopCtrl desktopCtrl=(DesktopCtrl)desktop;
  final Execution oldExec=desktop.getExecution();
  final Visualizer oldVi=desktopCtrl.getVisualizer();
  final Execution currentExec=Executions.getCurrent();
  try {
    ExecutionsCtrl.setCurrent(exec);
    final UiVisualizer uv=new UiVisualizer(exec,true,false);
    desktopCtrl.setVisualizer(uv);
    desktopCtrl.setExecution(exec);
    final WebApp wapp=desktop.getWebApp();
    ((DesktopCtrl)desktop).invokeDesktopCleanups();
    final Configuration config=wapp.getConfiguration();
    config.invokeDesktopCleanups(desktop);
    ((WebAppCtrl)wapp).getUiEngine().desktopDestroyed(desktop);
    final Monitor monitor=desktop.getWebApp().getConfiguration().getMonitor();
    if (monitor != null) {
      try {
        monitor.desktopDestroyed(desktop);
      }
 catch (      Throwable ex) {
        log.error("String_Node_Str",ex);
      }
    }
    final DesktopRecycle dtrc=config.getDesktopRecycle();
    if (dtrc != null) {
      try {
        dtrc.afterRemove(sess,desktop);
      }
 catch (      Throwable ex) {
        log.error("String_Node_Str",ex);
      }
    }
  }
  finally {
    ExecutionsCtrl.setCurrent((sess != Sessions.getCurrent()) ? currentExec : null);
    desktopCtrl.setVisualizer(oldVi);
    desktopCtrl.setExecution(oldExec);
  }
}
Program: 15823
Project: 15823
Buggy source:
/** 
 * Parse the XEL method. 
 */
private static void parseXelMethod(PageDefinition pgdef,ProcessingInstruction pi,Map<String,String> params) throws Exception {
  final String prefix=params.remove("String_Node_Str");
  noELnorEmpty("String_Node_Str",prefix,pi);
  final String nm=params.remove("String_Node_Str");
  noELnorEmpty("String_Node_Str",nm,pi);
  final String clsnm=params.remove("String_Node_Str");
  noELnorEmpty("String_Node_Str",clsnm,pi);
  final String sig=params.remove("String_Node_Str");
  noELnorEmpty("String_Node_Str",sig,pi);
  final Method mtd;
  try {
    final ClassResolver clsresolver=pgdef.getImportedClassResolver();
    final Class cls=clsresolver.resolveClass(clsnm);
    mtd=Classes.getMethodBySignature(cls,sig,null,clsresolver);
  }
 catch (  ClassNotFoundException ex) {
    throw new UiException(message("String_Node_Str" + clsnm,pi));
  }
catch (  Exception ex) {
    throw new UiException(message("String_Node_Str" + sig + "String_Node_Str"+ clsnm,pi));
  }
  if ((mtd.getModifiers() & Modifier.STATIC) == 0)   throw new UiException(message("String_Node_Str" + mtd,pi));
  pgdef.addXelMethod(prefix,nm,new MethodFunction(mtd));
}

Fixed version (ground truth):
/** 
 * Parse the XEL method. 
 */
private static void parseXelMethod(PageDefinition pgdef,ProcessingInstruction pi,Map<String,String> params) throws Exception {
  final String prefix=params.remove("String_Node_Str");
  noELnorEmpty("String_Node_Str",prefix,pi);
  final String nm=params.remove("String_Node_Str");
  noELnorEmpty("String_Node_Str",nm,pi);
  final String clsnm=params.remove("String_Node_Str");
  noELnorEmpty("String_Node_Str",clsnm,pi);
  final String sig=params.remove("String_Node_Str");
  noELnorEmpty("String_Node_Str",sig,pi);
  final Method mtd;
  try {
    final ClassResolver clsresolver=pgdef.getImportedClassResolver();
    final Class cls=clsresolver.resolveClass(clsnm);
    mtd=Classes.getMethodBySignature(cls,sig,null,clsresolver);
  }
 catch (  ClassNotFoundException ex) {
    throw new UiException(message("String_Node_Str" + ex.getMessage(),pi));
  }
catch (  Exception ex) {
    throw new UiException(message("String_Node_Str" + sig + "String_Node_Str"+ clsnm,pi));
  }
  if ((mtd.getModifiers() & Modifier.STATIC) == 0)   throw new UiException(message("String_Node_Str" + mtd,pi));
  pgdef.addXelMethod(prefix,nm,new MethodFunction(mtd));
}
Program: 15824
Project: 15824
Buggy source:
@SuppressWarnings("String_Node_Str") private void toExValue(Map labels){
  if (!labels.isEmpty())   for (Iterator it=labels.entrySet().iterator(); it.hasNext(); ) {
    final Map.Entry me=(Map.Entry)it.next();
    me.setValue(new ExValue((String)me.getValue()));
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void toExValue(Map labels){
  if (!labels.isEmpty())   for (Iterator it=labels.entrySet().iterator(); it.hasNext(); ) {
    final Map.Entry me=(Map.Entry)it.next();
    String value=expendValue(labels,(String)me.getValue());
    me.setValue(new ExValue(value));
  }
}
Program: 15825
Project: 15825
Buggy source:
public <T>Form initFormBean(Object bean,Class<Object> class1){
  Form form=((BinderCtrl)getBinder()).getForm(getComponent(),_formId);
  if (form == null) {
    form=(Form)ProxyHelper.createFormProxy(bean,class1);
    ((BinderCtrl)getBinder()).storeForm(getComponent(),_formId,form);
  }
  if (!(bean instanceof Form) && form instanceof FormProxyObject)   ((FormProxyObject)form).setFormOwner(bean,this);
  return form;
}

Fixed version (ground truth):
public <T>Form initFormBean(Object bean,Class<Object> class1,BindContext bindContext){
  Form form=((BinderCtrl)getBinder()).getForm(getComponent(),_formId);
  if (form == null) {
    Class[] interfaces=null;
    if (bindContext.getAttribute(String.valueOf(Method.class)) != null) {
      Annotation[] annotations=(Annotation[])bindContext.getAttribute(String.valueOf(Method.class));
      if (annotations != null) {
        boolean found=false;
        for (        Annotation annot : annotations) {
          if (annot.annotationType() == ImmutableFields.class) {
            found=true;
            break;
          }
        }
        if (found)         interfaces=new Class[]{ImmutableFields.class};
      }
    }
    form=(Form)ProxyHelper.createFormProxy(bean,class1,interfaces);
    ((BinderCtrl)getBinder()).storeForm(getComponent(),_formId,form);
  }
  if (!(bean instanceof Form) && form instanceof FormProxyObject)   ((FormProxyObject)form).setFormOwner(bean,this);
  return form;
}
Program: 15826
Project: 15826
Buggy source:
public void load(BindContext ctx){
  final Component comp=getComponent();
  final BindEvaluatorX eval=getBinder().getEvaluatorX();
  final Binder binder=getBinder();
  Object value=eval.getValue(ctx,comp,_accessInfo.getProperty());
  if (!(value instanceof Form)) {
    initFormBean(value,(Class<Object>)(value != null ? value.getClass() : eval.getType(ctx,comp,_accessInfo.getProperty())));
    BindingExecutionInfoCollector collector=((BinderCtrl)getBinder()).getBindingExecutionInfoCollector();
    if (collector != null) {
      collector.addInfo(new LoadInfo(LoadInfo.FORM_INIT,comp,null,getPropertyString(),getFormId(),value,getArgs(),null));
    }
  }
 else {
    ((BinderCtrl)binder).storeForm(getComponent(),getFormId(),(Form)value);
  }
}

Fixed version (ground truth):
public void load(BindContext ctx){
  final Component comp=getComponent();
  final BindEvaluatorX eval=getBinder().getEvaluatorX();
  final Binder binder=getBinder();
  Object value=eval.getValue(ctx,comp,_accessInfo.getProperty());
  if (!(value instanceof Form)) {
    initFormBean(value,(Class<Object>)(value != null ? value.getClass() : eval.getType(ctx,comp,_accessInfo.getProperty())),ctx);
    BindingExecutionInfoCollector collector=((BinderCtrl)getBinder()).getBindingExecutionInfoCollector();
    if (collector != null) {
      collector.addInfo(new LoadInfo(LoadInfo.FORM_INIT,comp,null,getPropertyString(),getFormId(),value,getArgs(),null));
    }
  }
 else {
    ((BinderCtrl)binder).storeForm(getComponent(),getFormId(),(Form)value);
  }
}
Program: 15827
Project: 15827
Buggy source:
public void load(BindContext ctx){
  final Binder binder=getBinder();
  final BindEvaluatorX eval=binder.getEvaluatorX();
  final Component comp=getComponent();
  final BindingExecutionInfoCollector collector=((BinderCtrl)getBinder()).getBindingExecutionInfoCollector();
  final Object bean=eval.getValue(ctx,comp,_accessInfo.getProperty());
  final ValueReference valref=eval.getValueReference(ctx,comp,_accessInfo.getProperty());
  if ((valref != null && valref.getBase() instanceof Form) || bean instanceof Form) {
    throw new UiException(MiscUtil.formatLocationMessage("String_Node_Str" + getFormId(),comp));
  }
  final Form form=initFormBean(bean,(Class<Object>)(bean != null ? bean.getClass() : eval.getType(ctx,comp,_accessInfo.getProperty())));
  final boolean activating=((BinderCtrl)getBinder()).isActivating();
  comp.setAttribute(BinderCtrl.LOAD_FORM_EXPRESSION,getPropertyString());
  if (activating)   return;
  FormStatus formStatus=form.getFormStatus();
  formStatus.reset();
  binder.notifyChange(form,"String_Node_Str");
  binder.notifyChange(formStatus,"String_Node_Str");
  if (collector != null) {
    collector.addInfo(new LoadInfo(LoadInfo.FORM_LOAD,comp,getConditionString(ctx),getPropertyString(),getFormId(),bean,getArgs(),null));
  }
}

Fixed version (ground truth):
public void load(BindContext ctx){
  final Binder binder=getBinder();
  final BindEvaluatorX eval=binder.getEvaluatorX();
  final Component comp=getComponent();
  final BindingExecutionInfoCollector collector=((BinderCtrl)getBinder()).getBindingExecutionInfoCollector();
  final Object bean=eval.getValue(ctx,comp,_accessInfo.getProperty());
  final ValueReference valref=eval.getValueReference(ctx,comp,_accessInfo.getProperty());
  if ((valref != null && valref.getBase() instanceof Form) || bean instanceof Form) {
    throw new UiException(MiscUtil.formatLocationMessage("String_Node_Str" + getFormId(),comp));
  }
  final Form form=initFormBean(bean,(Class<Object>)(bean != null ? bean.getClass() : eval.getType(ctx,comp,_accessInfo.getProperty())),ctx);
  final boolean activating=((BinderCtrl)getBinder()).isActivating();
  comp.setAttribute(BinderCtrl.LOAD_FORM_EXPRESSION,getPropertyString());
  if (activating)   return;
  FormStatus formStatus=form.getFormStatus();
  formStatus.reset();
  binder.notifyChange(form,"String_Node_Str");
  binder.notifyChange(formStatus,"String_Node_Str");
  if (collector != null) {
    collector.addInfo(new LoadInfo(LoadInfo.FORM_LOAD,comp,getConditionString(ctx),getPropertyString(),getFormId(),bean,getArgs(),null));
  }
}
Program: 15828
Project: 15828
Buggy source:
public Form getFormBean(BindContext ctx){
  Form form=getFormBean();
  if (form == null) {
    final Binder binder=getBinder();
    final BindEvaluatorX eval=binder.getEvaluatorX();
    final Component comp=getComponent();
    final Object bean=eval.getValue(ctx,comp,_accessInfo.getProperty());
    ;
    form=initFormBean(bean,(Class<Object>)(bean == null ? eval.getType(ctx,comp,_accessInfo.getProperty()) : bean.getClass()));
  }
  return form;
}

Fixed version (ground truth):
public Form getFormBean(BindContext ctx){
  Form form=getFormBean();
  if (form == null) {
    final Binder binder=getBinder();
    final BindEvaluatorX eval=binder.getEvaluatorX();
    final Component comp=getComponent();
    final Object bean=eval.getValue(ctx,comp,_accessInfo.getProperty());
    ;
    form=initFormBean(bean,(Class<Object>)(bean == null ? eval.getType(ctx,comp,_accessInfo.getProperty()) : bean.getClass()),ctx);
  }
  return form;
}
Program: 15830
Project: 15830
Buggy source:
/** 
 * Creates a proxy form object from the given origin object, if any.
 * @param origin the origin data object
 * @param type the class type of the data object
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static <T extends Object>T createFormProxy(T origin,Class<?> type){
  if (origin instanceof Form)   return origin;
  ProxyFactory factory=new ProxyFactory();
  factory.setFilter(FormProxyHandler.FORM_METHOD_FILTER);
  if (origin instanceof FormProxyObject)   type=((FormProxyObject)origin).getOriginObject().getClass();
  factory.setSuperclass(type);
  factory.setInterfaces(new Class[]{FormProxyObject.class,Form.class,FormFieldCleaner.class});
  Class<?> proxyClass=factory.createClass();
  Object p1=null;
  try {
    p1=proxyClass.newInstance();
  }
 catch (  Exception e) {
    throw UiException.Aide.wrap(e,"String_Node_Str" + origin.getClass() + "String_Node_Str");
  }
  ((Proxy)p1).setHandler(new FormProxyHandler<T>(origin));
  return (T)p1;
}

Fixed version (ground truth):
/** 
 * Creates a proxy form object from the given origin object, if any.
 * @param origin the origin data object
 * @param type the class type of the data object
 * @param interfaces the interface type of the data object, if any.
 * @since 8.0.1
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static <T extends Object>T createFormProxy(T origin,Class<?> type,Class[] interfaces){
  if (origin instanceof Form)   return origin;
  ProxyFactory factory=new ProxyFactory();
  factory.setFilter(FormProxyHandler.FORM_METHOD_FILTER);
  if (origin instanceof FormProxyObject)   type=((FormProxyObject)origin).getOriginObject().getClass();
  factory.setSuperclass(type);
  if (interfaces == null) {
    factory.setInterfaces(new Class[]{FormProxyObject.class,Form.class,FormFieldCleaner.class});
  }
 else {
    int len0=interfaces.length;
    Class[] newArray=new Class[len0 + 3];
    System.arraycopy(interfaces,0,newArray,0,len0);
    newArray[len0]=FormProxyObject.class;
    newArray[len0 + 1]=Form.class;
    newArray[len0 + 2]=FormFieldCleaner.class;
    factory.setInterfaces(newArray);
  }
  Class<?> proxyClass=factory.createClass();
  Object p1=null;
  try {
    p1=proxyClass.newInstance();
  }
 catch (  Exception e) {
    throw UiException.Aide.wrap(e,"String_Node_Str" + origin.getClass() + "String_Node_Str");
  }
  ((Proxy)p1).setHandler(new FormProxyHandler<T>(origin));
  return (T)p1;
}