nus-yam/ex-repair huggingface dataset:
Program: 15993
Project: 15993
Buggy source:
public Class<?> getType(ELContext ctx,Object base,Object property) throws NullPointerException, PropertyNotFoundException, ELException {
  if (ctx == null) {
    throw new NullPointerException();
  }
  Integer numOfKids=_numOfKids.pop();
  Path path=_paths.pop();
  int nums=numOfKids.intValue() - 1;
  numOfKids=new Integer(nums);
  ctx.putContext(Integer.class,numOfKids);
  path.add(toNodeString(ctx),Objects.toString(property));
  ctx.putContext(Path.class,path);
  return null;
}

Fixed version (ground truth):
public Class<?> getType(ELContext ctx,Object base,Object property) throws NullPointerException, PropertyNotFoundException, ELException {
  if (ctx == null) {
    throw new NullPointerException();
  }
  if (!_numOfKids.isEmpty()) {
    Integer numOfKids=_numOfKids.pop();
    Path path=_paths.pop();
    int nums=numOfKids.intValue() - 1;
    numOfKids=new Integer(nums);
    ctx.putContext(Integer.class,numOfKids);
    path.add(toNodeString(ctx),Objects.toString(property));
    ctx.putContext(Path.class,path);
  }
  return null;
}
Program: 15994
Project: 15994
Buggy source:
@SuppressWarnings("String_Node_Str") public Map<String,Property> getProperties(Object base){
  if (base == null)   throw new IllegalArgumentException("String_Node_Str");
  Map<Object,Map<String,Property>> m=(Map<Object,Map<String,Property>>)_ctx.getAttribute(BASED_VALIDATION_PROPERTIES);
  if (m == null) {
    _ctx.setAttribute(BASED_VALIDATION_PROPERTIES,m=new HashMap<Object,Map<String,Property>>());
  }
  Map<String,Property> mp=m.get(base);
  if (mp != null)   return mp;
  mp=new HashMap<String,Property>();
  m.put(base,mp);
  for (  Entry<String,Property[]> e : _properties.entrySet()) {
    for (    Property p : e.getValue()) {
      if (base.equals(p.getBase())) {
        mp.put(e.getKey(),p);
      }
    }
  }
  return mp;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Map<String,Property> getProperties(Object base){
  if (base == null)   throw new IllegalArgumentException("String_Node_Str");
  Map<Object,Map<String,Property>> m=(Map<Object,Map<String,Property>>)_ctx.getAttribute(BASED_VALIDATION_PROPERTIES);
  if (m == null) {
    _ctx.setAttribute(BASED_VALIDATION_PROPERTIES,m=new HashMap<Object,Map<String,Property>>());
  }
  Map<String,Property> mp=m.get(base);
  if (mp != null)   return mp;
  mp=new HashMap<String,Property>();
  m.put(base,mp);
  Object obase=base;
  if (obase instanceof FormProxyObject) {
    obase=((FormProxyObject)obase).getOriginObject();
  }
  for (  Entry<String,Property[]> e : _properties.entrySet()) {
    for (    Property p : e.getValue()) {
      Object pbase=p.getBase();
      if (pbase instanceof FormProxyObject) {
        pbase=((FormProxyObject)pbase).getOriginObject();
      }
      if (obase.equals(pbase)) {
        mp.put(e.getKey(),p);
      }
    }
  }
  return mp;
}
Program: 15995
Project: 15995
Buggy source:
protected void addItemReference(Component modelOwner,final Component comp,int index,String varnm){
  if (comp.getDefinition().isNative()) {
    for (    Component child : comp.getChildren()) {
      addItemReference(modelOwner,child,index,varnm);
    }
  }
 else {
    final Binder binder=BinderUtil.getBinder(comp,true);
    if (binder == null)     return;
    final String expression;
    if (comp.getAttribute(IS_TEMPLATE_MODEL_ENABLED_ATTR) != null) {
      expression=BindELContext.getModelName(modelOwner) + "String_Node_Str" + CURRENT_INDEX_RESOLVER_ATTR+ "String_Node_Str";
    }
 else {
      expression=BindELContext.getModelName(modelOwner) + "String_Node_Str" + index+ "String_Node_Str";
    }
    comp.setAttribute(varnm,new ReferenceBindingImpl(binder,comp,varnm,expression));
  }
}

Fixed version (ground truth):
protected void addItemReference(Component modelOwner,final Component comp,int index,String varnm){
  if (comp.getDefinition().isNative()) {
    for (    Component child : comp.getChildren()) {
      addItemReference(modelOwner,child,index,varnm);
    }
  }
 else {
    final Binder binder=BinderUtil.getBinder(comp,true);
    if (binder == null)     return;
    final String expression=BindELContext.getModelName(modelOwner) + "String_Node_Str" + index+ "String_Node_Str";
    comp.setAttribute(varnm,new ReferenceBindingImpl(binder,comp,varnm,expression));
  }
}
Program: 16003
Project: 16003
Buggy source:
public Template resolveTemplate(Component eachComp,final Object eachData,final int index,final int size,final String subType){
  final Object value=evaluateTemplate(eachComp,eachData,index,size,subType);
  if (value instanceof Template) {
    return (Template)value;
  }
 else   if (value instanceof String) {
    Template template=lookupTemplate(eachComp,subType == null ? (String)value : (String)value + "String_Node_Str" + subType);
    if (template == null && ((String)value).indexOf('.') > 0) {
      try {
        template=(Template)_comp.getPage().resolveClass(((String)value)).newInstance();
      }
 catch (      Exception e) {
      }
    }
    return template;
  }
 else {
    throw new UiException("String_Node_Str" + value);
  }
}

Fixed version (ground truth):
public Template resolveTemplate(Component eachComp,final Object eachData,final int index,final int size,final String subType){
  final Object value=evaluateTemplate(eachComp,eachData,index,size,subType);
  if (value instanceof Template) {
    return (Template)value;
  }
 else   if (value instanceof String) {
    Template template;
    if (subType == null) {
      template=lookupTemplate(eachComp,(String)value);
    }
 else {
      template=lookupTemplate(eachComp,(String)value + "String_Node_Str" + subType);
      if (template == null) {
        template=lookupTemplate(eachComp,(String)value);
      }
    }
    if (template == null && ((String)value).indexOf('.') > 0) {
      try {
        template=(Template)_comp.getPage().resolveClass(((String)value)).newInstance();
      }
 catch (      Exception e) {
      }
    }
    return template;
  }
 else {
    throw new UiException("String_Node_Str" + value);
  }
}
Program: 16006
Project: 16006
Buggy source:
public Template resolveTemplate(Component eachComp,final Object eachData,final int index,final int size,final String subType){
  final Object value=evaluateTemplate(eachComp,eachData,index,size,subType);
  if (value instanceof Template) {
    return (Template)value;
  }
 else   if (value instanceof String) {
    Template template=lookupTemplate(eachComp,subType == null ? (String)value : (String)value + "String_Node_Str" + subType);
    if (template == null && ((String)value).indexOf('.') > 0) {
      try {
        template=(Template)_comp.getPage().resolveClass(((String)value)).newInstance();
      }
 catch (      Exception e) {
      }
    }
    return template;
  }
 else {
    throw new UiException("String_Node_Str" + value);
  }
}

Fixed version (ground truth):
public Template resolveTemplate(Component eachComp,final Object eachData,final int index,final int size,final String subType){
  final Object value=evaluateTemplate(eachComp,eachData,index,size,subType);
  if (value instanceof Template) {
    return (Template)value;
  }
 else   if (value instanceof String) {
    Template template;
    if (subType == null) {
      template=lookupTemplate(eachComp,(String)value);
    }
 else {
      template=lookupTemplate(eachComp,(String)value + "String_Node_Str" + subType);
      if (template == null) {
        template=lookupTemplate(eachComp,(String)value);
      }
    }
    if (template == null && ((String)value).indexOf('.') > 0) {
      try {
        template=(Template)_comp.getPage().resolveClass(((String)value)).newInstance();
      }
 catch (      Exception e) {
      }
    }
    return template;
  }
 else {
    throw new UiException("String_Node_Str" + value);
  }
}
Program: 16007
Project: 16007
Buggy source:
public Object resolveVariable(Component child,String name,boolean recurse){
  if (_firstInsertion == null)   return null;
  if (child == null || child.getParent() == null) {
    return getAttributeOrFellow(name,recurse);
  }
  List<Component> children=child.getParent().getChildren();
  int insertIndex=children.indexOf(child);
  int selfFirstIndex=children.indexOf(_firstInsertion);
  if (insertIndex < selfFirstIndex)   return null;
  Map<Component,Integer> indexMap=fillUpIndexMap(_firstInsertion,_lastInsertion);
  int[] selfIndex=getInsertionIndex(_firstInsertion,_lastInsertion,indexMap);
  if (selfIndex[1] < insertIndex)   return null;
  HtmlShadowElement node=queryIntersectedShadowIfAny(insertIndex,indexMap);
  if (node != null)   return node.getShadowVariable(name,recurse);
  return null;
}

Fixed version (ground truth):
public Object resolveVariable(Component child,String name,boolean recurse){
  if (_firstInsertion == null)   return null;
  if (child == null || child.getParent() == null) {
    return getAttributeOrFellow(name,recurse);
  }
  List<Component> children=child.getParent().getChildren();
  int insertIndex=children.indexOf(child);
  int selfFirstIndex=children.indexOf(_firstInsertion);
  if (insertIndex < selfFirstIndex)   return null;
  Map<Component,Integer> indexMap=fillUpIndexMap(_firstInsertion,_lastInsertion);
  int[] selfIndex=getInsertionIndex(_firstInsertion,_lastInsertion,indexMap);
  if (selfIndex[1] < insertIndex)   return null;
  HtmlShadowElement node=queryIntersectedShadowIfAny(insertIndex,indexMap);
  if (node != null)   return node.resolveVariable(child,name,recurse);
  return null;
}
Program: 16008
Project: 16008
Buggy source:
public int compareTo(Object o){
  if (!(o instanceof Path))   throw new WrongValueException(o + "String_Node_Str");
  int length=path.length;
  Path toCompared=(Path)o;
  int[] toPath=toCompared.path;
  int toLength=toCompared.path.length;
  if (length < 1 || toLength < 1)   throw new WrongValueException(this + "String_Node_Str" + o);
  int smaller=(length < toLength ? length : toLength);
  for (int i=0; i < smaller; i++) {
    if (path[i] != toPath[i])     return path[i] - toPath[i];
  }
  return length - toLength;
}

Fixed version (ground truth):
public int compareTo(Object o){
  if (!(o instanceof Path))   throw new WrongValueException(o + "String_Node_Str");
  int length=path.length;
  Path toCompared=(Path)o;
  int[] toPath=toCompared.path;
  int toLength=toCompared.path.length;
  int smaller=(length < toLength ? length : toLength);
  for (int i=0; i < smaller; i++) {
    if (path[i] != toPath[i])     return path[i] - toPath[i];
  }
  return length - toLength;
}
Program: 16009
Project: 16009
Buggy source:
@SuppressWarnings("String_Node_Str") private void updatePath(TreeDataEvent event){
  final int type=event.getType();
  final int[] affectedPath=event.getAffectedPath();
  if (affectedPath == null || affectedPath.length < 1)   return;
switch (type) {
case TreeDataEvent.INTERVAL_REMOVED:
    List<Path> l=new ArrayList<Path>(_opens);
  Collections.sort(l);
for (int i=0; i < l.size(); i++) {
  Path p=l.get(i);
  _opens.remove(p);
  boolean isPrefix=p.isPrefix(affectedPath,-1);
  if (!isPrefix)   _opens.add(p);
}
l=new ArrayList<Path>(_selection);
Collections.sort(l);
for (int i=0; i < l.size(); i++) {
Path p=l.get(i);
_selection.remove(p);
boolean isPrefix=p.isPrefix(affectedPath,-1);
if (!isPrefix) _selection.add(p);
}
break;
case TreeDataEvent.INTERVAL_ADDED:
l=new ArrayList<Path>(_opens);
Collections.sort(l);
for (int i=l.size() - 1; i > -1; i--) {
Path p=l.get(i);
_opens.remove(p);
p.isPrefix(affectedPath,1);
_opens.add(p);
}
l=new ArrayList<Path>(_selection);
Collections.sort(l);
for (int i=0; i < l.size(); i++) {
Path p=l.get(i);
_opens.remove(p);
p.isPrefix(affectedPath,1);
_opens.add(p);
}
break;
}
}

Fixed version (ground truth):
private void updatePath(TreeDataEvent event){
  final int type=event.getType();
  final int[] affectedPath=event.getAffectedPath();
  if (affectedPath == null || affectedPath.length < 1)   return;
switch (type) {
case TreeDataEvent.INTERVAL_REMOVED:
    internalDataChange(_opens,affectedPath,true);
  internalDataChange(_selection,affectedPath,true);
break;
case TreeDataEvent.INTERVAL_ADDED:
internalDataChange(_opens,affectedPath,false);
internalDataChange(_selection,affectedPath,false);
break;
}
}
Program: 16010
Project: 16010
Buggy source:
protected Path(int[] path){
  this.path=path;
}

Fixed version (ground truth):
protected Path(Path p){
  int length=p.path.length;
  this.path=new int[length];
  for (int i=0; i < length; i++) {
    this.path[i]=p.path[i];
  }
}
Program: 16011
Project: 16011
Buggy source:
protected void addItemReference(Component modelOwner,final Component comp,int index,String varnm){
  if (comp.getDefinition().isNative()) {
    for (    Component child : comp.getChildren()) {
      addItemReference(modelOwner,child,index,varnm);
    }
  }
 else {
    final Binder binder=BinderUtil.getBinder(comp,true);
    if (binder == null)     return;
    final String expression=BindELContext.getModelName(modelOwner) + "String_Node_Str" + index+ "String_Node_Str";
    comp.setAttribute(varnm,new ReferenceBindingImpl(binder,comp,varnm,expression));
  }
}

Fixed version (ground truth):
protected void addItemReference(Component modelOwner,final Component comp,int index,String varnm){
  if (comp.getDefinition().isNative()) {
    for (    Component child : comp.getChildren()) {
      addItemReference(modelOwner,child,index,varnm);
    }
  }
 else {
    final Binder binder=BinderUtil.getBinder(comp,true);
    if (binder == null)     return;
    final String expression;
    if (comp.getAttribute(IS_TEMPLATE_MODEL_ENABLED_ATTR) != null) {
      expression=BindELContext.getModelName(modelOwner) + "String_Node_Str" + CURRENT_INDEX_RESOLVER_ATTR+ "String_Node_Str";
    }
 else {
      expression=BindELContext.getModelName(modelOwner) + "String_Node_Str" + index+ "String_Node_Str";
    }
    comp.setAttribute(varnm,new ReferenceBindingImpl(binder,comp,varnm,expression));
  }
}
Program: 16020
Project: 16020
Buggy source:
public void redraw(Writer out) throws IOException {
  final Execution exec=Executions.getCurrent();
  if (!HtmlPageRenders.isDirectContent(exec)) {
    super.redraw(out);
    return;
  }
  final boolean idRequired=isIdRequired();
  if (idRequired) {
    out.write("String_Node_Str");
    out.write(getUuid());
    out.write("String_Node_Str");
  }
  out.write(_encode ? XMLs.encodeText(_value) : _value);
  if (idRequired)   out.write("String_Node_Str");
  final TagRenderContext rc=PageRenderer.getTagRenderContext(exec);
  if (rc != null) {
    rc.renderBegin(this,getClientEvents(),false);
    rc.renderEnd(this);
  }
}

Fixed version (ground truth):
public void redraw(Writer out) throws IOException {
  final Execution exec=Executions.getCurrent();
  if (!HtmlPageRenders.isDirectContent(exec)) {
    super.redraw(out);
    return;
  }
  final boolean idRequired=isIdRequired();
  if (idRequired) {
    out.write("String_Node_Str");
    out.write(getUuid());
    out.write("String_Node_Str");
  }
  out.write(_encode ? XMLs.encodeText(_value) : _value);
  if (idRequired)   out.write("String_Node_Str");
  final TagRenderContext rc=PageRenderer.getTagRenderContext(exec);
  if (rc != null) {
    rc.renderBegin(this,getClientEvents(),getSpecialRendererOutput(this),false);
    rc.renderEnd(this);
  }
}
Program: 16021
Project: 16021
Buggy source:
/** 
 * Renders the children directly to the given output. Notice it is called only if   {@link #redraw} is going to renderthe content (HTML tags) directly. If it is about to generate the JavaScript code {@link #redrawChildren} will be called instead.<p>You have to override this method if the deriving class has additional information to render.
 * @since 5.0.7
 */
protected void redrawChildrenDirectly(TagRenderContext rc,Execution exec,java.io.Writer out) throws java.io.IOException {
  for (Component child=getFirstChild(); child != null; ) {
    Component next=child.getNextSibling();
    if (((ComponentCtrl)child).getExtraCtrl() instanceof DirectContent) {
      ((ComponentCtrl)child).redraw(out);
    }
 else {
      HtmlPageRenders.setDirectContent(exec,false);
      rc.renderBegin(child,null,true);
      HtmlPageRenders.outStandalone(exec,child,out);
      rc.renderEnd(child);
      HtmlPageRenders.setDirectContent(exec,true);
    }
    child=next;
  }
}

Fixed version (ground truth):
/** 
 * Renders the children directly to the given output. Notice it is called only if   {@link #redraw} is going to renderthe content (HTML tags) directly. If it is about to generate the JavaScript code {@link #redrawChildren} will be called instead.<p>You have to override this method if the deriving class has additional information to render.
 * @since 5.0.7
 */
protected void redrawChildrenDirectly(TagRenderContext rc,Execution exec,java.io.Writer out) throws java.io.IOException {
  for (Component child=getFirstChild(); child != null; ) {
    Component next=child.getNextSibling();
    if (((ComponentCtrl)child).getExtraCtrl() instanceof DirectContent) {
      ((ComponentCtrl)child).redraw(out);
    }
 else {
      HtmlPageRenders.setDirectContent(exec,false);
      rc.renderBegin(child,null,getSpecialRendererOutput(child),true);
      HtmlPageRenders.outStandalone(exec,child,out);
      rc.renderEnd(child);
      HtmlPageRenders.setDirectContent(exec,true);
    }
    child=next;
  }
}
Program: 16022
Project: 16022
Buggy source:
public void redraw(java.io.Writer out) throws java.io.IOException {
  if (_tagnm == null)   throw new UiException("String_Node_Str");
  final Execution exec=Executions.getCurrent();
  if (exec == null || exec.isAsyncUpdate(null) || !HtmlPageRenders.isDirectContent(exec)) {
    super.redraw(out);
    return;
  }
  TagRenderContext rc=PageRenderer.getTagRenderContext(exec);
  final boolean rcRequired=rc == null;
  Object ret=null;
  if (rcRequired) {
    ret=PageRenderer.beforeRenderTag(exec);
    rc=PageRenderer.getTagRenderContext(exec);
  }
  out.write(getPrologHalf(false));
  rc.renderBegin(this,getClientEvents(),false);
  redrawChildrenDirectly(rc,exec,out);
  out.write(getEpilogHalf());
  rc.renderEnd(this);
  if (rcRequired) {
    out.write(rc.complete());
    PageRenderer.afterRenderTag(exec,ret);
  }
}

Fixed version (ground truth):
public void redraw(java.io.Writer out) throws java.io.IOException {
  if (_tagnm == null)   throw new UiException("String_Node_Str");
  final Execution exec=Executions.getCurrent();
  if (exec == null || exec.isAsyncUpdate(null) || !HtmlPageRenders.isDirectContent(exec)) {
    super.redraw(out);
    return;
  }
  TagRenderContext rc=PageRenderer.getTagRenderContext(exec);
  final boolean rcRequired=rc == null;
  Object ret=null;
  if (rcRequired) {
    ret=PageRenderer.beforeRenderTag(exec);
    rc=PageRenderer.getTagRenderContext(exec);
  }
  out.write(getPrologHalf(false));
  rc.renderBegin(this,getClientEvents(),getSpecialRendererOutput(this),false);
  redrawChildrenDirectly(rc,exec,out);
  out.write(getEpilogHalf());
  rc.renderEnd(this);
  if (rcRequired) {
    out.write(rc.complete());
    PageRenderer.afterRenderTag(exec,ret);
  }
}
Program: 16024
Project: 16024
Buggy source:
public void setDynamicProperty(String name,Object value) throws WrongValueException {
  if (name == null)   throw new WrongValueException("String_Node_Str");
  if (value == null) {
    if (_props != null)     _props.remove(name);
  }
 else {
    if (_props == null)     _props=new LinkedHashMap<String,Object>();
    _props.put(name,value);
  }
}

Fixed version (ground truth):
public void setDynamicProperty(String name,Object value) throws WrongValueException {
  if (name == null)   throw new WrongValueException("String_Node_Str");
  if (value == null) {
    if (_props != null)     _props.remove(name);
  }
 else {
    if (_props == null)     _props=new LinkedHashMap<String,Object>();
    if ("String_Node_Str".equals(name))     _props.put("String_Node_Str",value);
 else     _props.put(name,value);
  }
}
Program: 16025
Project: 16025
Buggy source:
/** 
 * @param hideUuidIfNoId whether not to generate UUID if possible
 */
String getPrologHalf(boolean hideUuidIfNoId){
  final StringBuilder sb=new StringBuilder(128).append('<').append(_tagnm);
  if ((!hideUuidIfNoId && !shallHideId()) || getId().length() > 0)   sb.append("String_Node_Str").append(getUuid()).append('"');
  if (_props != null) {
    for (Iterator it=_props.entrySet().iterator(); it.hasNext(); ) {
      final Map.Entry me=(Map.Entry)it.next();
      sb.append(' ').append(me.getKey()).append("String_Node_Str").append(XMLs.encodeAttribute(Objects.toString(me.getValue()))).append('"');
    }
  }
  if (!isOrphanTag())   sb.append('/');
  sb.append('>');
  Object textContent=getDynamicProperty("String_Node_Str");
  if (textContent != null)   sb.append((String)textContent);
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * @param hideUuidIfNoId whether not to generate UUID if possible
 */
String getPrologHalf(boolean hideUuidIfNoId){
  final StringBuilder sb=new StringBuilder(128).append('<').append(_tagnm);
  if ((!hideUuidIfNoId && !shallHideId()) || getId().length() > 0)   sb.append("String_Node_Str").append(getUuid()).append('"');
  if (_props != null) {
    for (Iterator it=_props.entrySet().iterator(); it.hasNext(); ) {
      final Map.Entry me=(Map.Entry)it.next();
      sb.append(' ').append(me.getKey()).append("String_Node_Str").append(XMLs.encodeAttribute(Objects.toString(me.getValue()))).append('"');
    }
  }
  if (!isOrphanTag())   sb.append('/');
  sb.append('>');
  Object textContent=getDynamicProperty("String_Node_Str");
  if (textContent != null)   sb.append(XMLs.escapeXML((String)textContent));
  return sb.toString();
}
Program: 16028
Project: 16028
Buggy source:
protected void onHostAttached(Component host){
  Iterable<EventListener<? extends Event>> eventListeners=host.getEventListeners(ON_REBUILD_SHADOW_TREE_LATER);
  if (!eventListeners.iterator().hasNext()) {
    host.addEventListener(ON_REBUILD_SHADOW_TREE_LATER,new SerializableEventListener<Event>(){
      public void onEvent(      Event event) throws Exception {
        Component target=event.getTarget();
        if (target instanceof ComponentCtrl) {
          for (          ShadowElement se : new ArrayList<ShadowElement>(((ComponentCtrl)target).getShadowRoots())) {
            if (se instanceof HtmlShadowElement) {
              ((HtmlShadowElement)se).rebuildShadowTree();
            }
          }
        }
      }
    }
);
  }
}

Fixed version (ground truth):
protected void onHostAttached(Component host){
  Iterable<EventListener<? extends Event>> eventListeners=host.getEventListeners(ON_REBUILD_SHADOW_TREE_LATER);
  if (!eventListeners.iterator().hasNext()) {
    host.addEventListener(ON_REBUILD_SHADOW_TREE_LATER,new SerializableEventListener<Event>(){
      public void onEvent(      Event event) throws Exception {
        Component target=event.getTarget();
        if (target instanceof ComponentCtrl && target.getDesktop() != null) {
          for (          ShadowElement se : new ArrayList<ShadowElement>(((ComponentCtrl)target).getShadowRoots())) {
            if (se instanceof HtmlShadowElement) {
              ((HtmlShadowElement)se).rebuildShadowTree();
            }
          }
        }
 else {
          Iterable<EventListener<? extends Event>> eventListeners=target.getEventListeners(ON_REBUILD_SHADOW_TREE_LATER);
          for (          EventListener<? extends Event> listener : eventListeners) {
            target.removeEventListener(ON_REBUILD_SHADOW_TREE_LATER,listener);
          }
        }
      }
    }
);
  }
}
Program: 16029
Project: 16029
Buggy source:
public void onEvent(Event event) throws Exception {
  Component target=event.getTarget();
  if (target instanceof ComponentCtrl) {
    for (    ShadowElement se : new ArrayList<ShadowElement>(((ComponentCtrl)target).getShadowRoots())) {
      if (se instanceof HtmlShadowElement) {
        ((HtmlShadowElement)se).rebuildShadowTree();
      }
    }
  }
}

Fixed version (ground truth):
public void onEvent(Event event) throws Exception {
  Component target=event.getTarget();
  if (target instanceof ComponentCtrl && target.getDesktop() != null) {
    for (    ShadowElement se : new ArrayList<ShadowElement>(((ComponentCtrl)target).getShadowRoots())) {
      if (se instanceof HtmlShadowElement) {
        ((HtmlShadowElement)se).rebuildShadowTree();
      }
    }
  }
 else {
    Iterable<EventListener<? extends Event>> eventListeners=target.getEventListeners(ON_REBUILD_SHADOW_TREE_LATER);
    for (    EventListener<? extends Event> listener : eventListeners) {
      target.removeEventListener(ON_REBUILD_SHADOW_TREE_LATER,listener);
    }
  }
}
Program: 16030
Project: 16030
Buggy source:
/** 
 * Removes the relation points between shadow host and this shadow element.
 */
public void detach(){
  Component prevhost=getShadowHostIfAny();
  if (_host != null) {
    ComponentCtrl host=(ComponentCtrl)_host;
    _host=null;
    ((ComponentCtrl)host).removeShadowRoot(this);
    onHostDetached((Component)host);
  }
  setParent0(null);
  if (prevhost != null) {
    prevhost.getDesktop().getWebApp().getConfiguration().afterShadowDetached(this,prevhost);
  }
}

Fixed version (ground truth):
/** 
 * Removes the relation points between shadow host and this shadow element.
 */
public void detach(){
  Component prevhost=getShadowHostIfAny();
  if (_host != null) {
    ComponentCtrl host=(ComponentCtrl)_host;
    _host=null;
    ((ComponentCtrl)host).removeShadowRoot(this);
    onHostDetached((Component)host);
  }
  setParent0(null);
  if (prevhost != null && prevhost.getDesktop() != null) {
    prevhost.getDesktop().getWebApp().getConfiguration().afterShadowDetached(this,prevhost);
  }
}
Program: 16031
Project: 16031
Buggy source:
protected ELContext newELContext(XelContext xelc){
  return new XelELContext(xelc);
}

Fixed version (ground truth):
protected ELContext newELContext(XelContext xelc){
  return new StandardELContext(new XelELContext(xelc));
}
Program: 16032
Project: 16032
Buggy source:
public void remove(){
  _it.remove();
}

Fixed version (ground truth):
public void remove(){
  _it.remove();
  _nextAvail=false;
}
Program: 16033
Project: 16033
Buggy source:
private void triggerBeforeHostParentChanged(Component parent){
  List<ShadowElement> shadowRoots=getShadowRoots();
  if (!shadowRoots.isEmpty()) {
    try {
      initIndexCacheMap();
      for (      ShadowElement se : getShadowRoots()) {
        if (se instanceof ShadowElementCtrl) {
          ((ShadowElementCtrl)se).beforeHostParentChanged(parent);
        }
      }
    }
  finally {
      destroyIndexCacheMap();
    }
  }
}

Fixed version (ground truth):
private void triggerBeforeHostParentChanged(Component parent){
  List<ShadowElement> shadowRoots=getShadowRoots();
  if (!shadowRoots.isEmpty()) {
    try {
      initIndexCacheMap();
      for (      ShadowElement se : new LinkedList<ShadowElement>(shadowRoots)) {
        if (se instanceof ShadowElementCtrl) {
          ((ShadowElementCtrl)se).beforeHostParentChanged(parent);
        }
      }
    }
  finally {
      destroyIndexCacheMap();
    }
  }
}
Program: 16034
Project: 16034
Buggy source:
private void triggerAfterHostChildRemoved(Component child){
  List<ShadowElement> shadowRoots=getShadowRoots();
  if (!shadowRoots.isEmpty()) {
    try {
      initIndexCacheMap();
      for (      ShadowElement se : getShadowRoots()) {
        if (se instanceof ShadowElementCtrl) {
          ((ShadowElementCtrl)se).afterHostChildRemoved(child);
        }
      }
    }
  finally {
      destroyIndexCacheMap();
    }
  }
}

Fixed version (ground truth):
private void triggerAfterHostChildRemoved(Component child){
  List<ShadowElement> shadowRoots=getShadowRoots();
  if (!shadowRoots.isEmpty()) {
    try {
      initIndexCacheMap();
      for (      ShadowElement se : new LinkedList<ShadowElement>(shadowRoots)) {
        if (se instanceof ShadowElementCtrl) {
          ((ShadowElementCtrl)se).afterHostChildRemoved(child);
        }
      }
    }
  finally {
      destroyIndexCacheMap();
    }
  }
}
Program: 16035
Project: 16035
Buggy source:
private void triggerAfterHostChildAdded(Component child){
  List<ShadowElement> shadowRoots=getShadowRoots();
  if (!shadowRoots.isEmpty()) {
    try {
      initIndexCacheMap();
      final int indexOf=getChildren().indexOf(child);
      for (      ShadowElement se : getShadowRoots()) {
        if (se instanceof ShadowElementCtrl) {
          ((ShadowElementCtrl)se).afterHostChildAdded(child,indexOf);
        }
      }
    }
  finally {
      destroyIndexCacheMap();
    }
  }
}

Fixed version (ground truth):
private void triggerAfterHostChildAdded(Component child){
  List<ShadowElement> shadowRoots=getShadowRoots();
  if (!shadowRoots.isEmpty()) {
    try {
      initIndexCacheMap();
      final int indexOf=getChildren().indexOf(child);
      for (      ShadowElement se : new LinkedList<ShadowElement>(shadowRoots)) {
        if (se instanceof ShadowElementCtrl) {
          ((ShadowElementCtrl)se).afterHostChildAdded(child,indexOf);
        }
      }
    }
  finally {
      destroyIndexCacheMap();
    }
  }
}
Program: 16036
Project: 16036
Buggy source:
private void triggerBeforeHostChildAdded(Component child,Component insertBefore){
  List<ShadowElement> shadowRoots=getShadowRoots();
  if (!shadowRoots.isEmpty()) {
    try {
      initIndexCacheMap();
      final int indexOfInsertBefore=insertBefore == null ? -1 : getChildren().indexOf(insertBefore);
      for (      ShadowElement se : getShadowRoots()) {
        if (se instanceof ShadowElementCtrl) {
          ((ShadowElementCtrl)se).beforeHostChildAdded(child,insertBefore,indexOfInsertBefore);
        }
      }
    }
  finally {
      destroyIndexCacheMap();
    }
  }
}

Fixed version (ground truth):
private void triggerBeforeHostChildAdded(Component child,Component insertBefore){
  List<ShadowElement> shadowRoots=getShadowRoots();
  if (!shadowRoots.isEmpty()) {
    try {
      initIndexCacheMap();
      final int indexOfInsertBefore=insertBefore == null ? -1 : getChildren().indexOf(insertBefore);
      for (      ShadowElement se : new LinkedList<ShadowElement>(shadowRoots)) {
        if (se instanceof ShadowElementCtrl) {
          ((ShadowElementCtrl)se).beforeHostChildAdded(child,insertBefore,indexOfInsertBefore);
        }
      }
    }
  finally {
      destroyIndexCacheMap();
    }
  }
}
Program: 16037
Project: 16037
Buggy source:
private void triggerBeforeHostChildRemoved(Component child){
  List<ShadowElement> shadowRoots=getShadowRoots();
  if (!shadowRoots.isEmpty()) {
    try {
      initIndexCacheMap();
      final int indexOf=getChildren().indexOf(child);
      for (      ShadowElement se : getShadowRoots()) {
        if (se instanceof ShadowElementCtrl) {
          ((ShadowElementCtrl)se).beforeHostChildRemoved(child,indexOf);
        }
      }
    }
  finally {
      destroyIndexCacheMap();
    }
  }
}

Fixed version (ground truth):
private void triggerBeforeHostChildRemoved(Component child){
  List<ShadowElement> shadowRoots=getShadowRoots();
  if (!shadowRoots.isEmpty()) {
    try {
      initIndexCacheMap();
      final int indexOf=getChildren().indexOf(child);
      for (      ShadowElement se : new LinkedList<ShadowElement>(shadowRoots)) {
        if (se instanceof ShadowElementCtrl) {
          ((ShadowElementCtrl)se).beforeHostChildRemoved(child,indexOf);
        }
      }
    }
  finally {
      destroyIndexCacheMap();
    }
  }
}
Program: 16038
Project: 16038
Buggy source:
public void beforeHostParentChanged(Component parent){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + parent + "String_Node_Str"+ ShadowElementsCtrl.getCurrentInfo());
  }
}

Fixed version (ground truth):
public void beforeHostParentChanged(Component parent){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + parent + "String_Node_Str"+ ShadowElementsCtrl.getCurrentInfo());
  }
  if (parent == null) {
    ((ComponentCtrl)_host).removeShadowRoot(this);
  }
 else   if (_host.getParent() == null) {
    onHostAttached(_host);
  }
}
Program: 16039
Project: 16039
Buggy source:
/** 
 * Merge the host into the current shadow, unlike  {@link #setShadowHost(Component,Component)}
 * @param child
 */
public boolean mergeToHost(Component host){
  if (host == null)   throw new UiException("String_Node_Str");
  if (host == _host)   return false;
  if (_parent == null)   throw new UiException("String_Node_Str");
  HtmlShadowElement oldParent=(HtmlShadowElement)_parent;
  if (host != _host) {
    _parent=null;
    ((ComponentCtrl)host).addShadowRoot(this);
    _host=host;
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Merge the host into the current shadow, unlike  {@link #setShadowHost(Component,Component)}
 * @param child
 */
public boolean mergeToHost(Component host){
  if (host == null)   throw new UiException("String_Node_Str");
  if (host == _host)   return false;
  if (_parent == null)   throw new UiException("String_Node_Str");
  HtmlShadowElement oldParent=(HtmlShadowElement)_parent;
  if (host != _host) {
    HtmlShadowElement parent=(HtmlShadowElement)_parent;
    _parent=null;
    ((ComponentCtrl)host).addShadowRootBefore(this,(ShadowElement)parent);
    _host=host;
    ++parent._chdinf.modCntChd;
    --parent._chdinf.nChild;
    if (this._prev == null)     parent._chdinf.first=this._next;
    if (this._next == null)     parent._chdinf.last=this._prev;
    return true;
  }
  return false;
}
Program: 16040
Project: 16040
Buggy source:
public void setParent(Component parent){
  if (_host != null && parent != null) {
    throw new UiException("String_Node_Str");
  }
  if (parent == null && _host == null) {
    setPrevInsertion(_nextInsertion,_previousInsertion);
    _previousInsertion=null;
    _firstInsertion=null;
    _lastInsertion=null;
    _nextInsertion=null;
  }
  super.setParent(parent);
  if (parent != null) {
    Component host=getShadowHostIfAny();
    if (host != null)     host.getDesktop().getWebApp().getConfiguration().afterShadowAttached(this,host);
  }
}

Fixed version (ground truth):
public void setParent(Component parent){
  Component host=getShadowHostIfAny();
  setParent0(parent);
  if (host == null)   host=getShadowHostIfAny();
  if (host != null) {
    if (parent != null) {
      host.getDesktop().getWebApp().getConfiguration().afterShadowAttached(this,host);
    }
 else {
      host.getDesktop().getWebApp().getConfiguration().afterShadowDetached(this,host);
    }
  }
}
Program: 16041
Project: 16041
Buggy source:
/** 
 * Merge the all sub-tree into the parent's insertions, unlike  {@link #appendChild(Component)}
 */
public void mergeSubTree(){
  List<HtmlShadowElement> children=getChildren();
  if (children == null || children.isEmpty())   return;
  for (  HtmlShadowElement child : new ArrayList<HtmlShadowElement>(children)) {
    Component previous=child._previousInsertion;
    Component next=child._nextInsertion;
    _parent.insertBefore(child,this);
    if (previous != null && !(previous instanceof HtmlShadowElement)) {
      Component newPrevious=child._previousInsertion;
      setPrevInsertion(previous,newPrevious);
      setPrevInsertion(child,previous);
    }
    if (next != null && !(next instanceof HtmlShadowElement)) {
      Component newNext=child._nextInsertion;
      setPrevInsertion(newNext,next);
      setPrevInsertion(next,child);
    }
  }
}

Fixed version (ground truth):
/** 
 * Merge the all sub-tree into the parent's insertions, unlike  {@link #appendChild(Component)}
 */
public void mergeSubTree(){
  List<HtmlShadowElement> children=getChildren();
  if (children == null || children.isEmpty())   return;
  if (_parent != null) {
    for (    HtmlShadowElement child : new ArrayList<HtmlShadowElement>(children)) {
      Component previous=child._previousInsertion;
      Component next=child._nextInsertion;
      _parent.insertBefore(child,this);
      if (previous != null && !(previous instanceof HtmlShadowElement)) {
        Component newPrevious=child._previousInsertion;
        setPrevInsertion(previous,newPrevious);
        setPrevInsertion(child,previous);
      }
      if (next != null && !(next instanceof HtmlShadowElement)) {
        Component newNext=child._nextInsertion;
        setPrevInsertion(newNext,next);
        setPrevInsertion(next,child);
      }
    }
  }
 else {
    for (    HtmlShadowElement child : new ArrayList<HtmlShadowElement>(children)) {
      Component previous=_previousInsertion;
      child.mergeToHost(_host);
      if (previous != null) {
        Component newPrevious=child._previousInsertion;
        if (newPrevious == null) {
          setPrevInsertion(child,previous);
        }
 else {
          setPrevInsertion(newPrevious,previous);
        }
      }
      Component newNext=child._nextInsertion;
      if (newNext == null) {
        setPrevInsertion(this,child);
      }
 else {
        setPrevInsertion(this,newNext);
      }
    }
  }
}
Program: 16042
Project: 16042
Buggy source:
/** 
 * Removes the relation points between shadow host and this shadow element.
 */
public void detach(){
  Component prevhost=getShadowHostIfAny();
  if (_host != null) {
    ComponentCtrl host=(ComponentCtrl)_host;
    _host=null;
    ((ComponentCtrl)host).removeShadowRoot(this);
    onHostDetached((Component)host);
  }
  setParent(null);
  if (prevhost != null) {
    prevhost.getDesktop().getWebApp().getConfiguration().afterShadowDetached(this,prevhost);
  }
}

Fixed version (ground truth):
/** 
 * Removes the relation points between shadow host and this shadow element.
 */
public void detach(){
  Component prevhost=getShadowHostIfAny();
  if (_host != null) {
    ComponentCtrl host=(ComponentCtrl)_host;
    _host=null;
    ((ComponentCtrl)host).removeShadowRoot(this);
    onHostDetached((Component)host);
  }
  setParent0(null);
  if (prevhost != null) {
    prevhost.getDesktop().getWebApp().getConfiguration().afterShadowDetached(this,prevhost);
  }
}
Program: 16043
Project: 16043
Buggy source:
/** 
 * Removes the given shadow root from this host.
 * @param shadow a shadow element
 * @return true if child is added successfully
 * @since 8.0.0
 */
public boolean removeShadowRoot(ShadowElement shadow);

Fixed version (ground truth):
/** 
 * Removes the given shadow root from this host. (Shadow developer use only)
 * @param shadow a shadow element
 * @return true if child is added successfully
 * @since 8.0.0
 */
public boolean removeShadowRoot(ShadowElement shadow);
Program: 16044
Project: 16044
Buggy source:
/** 
 * Removes the given shadow root from this host.
 * @param shadow a shadow element
 * @return true if child is removed successfully; false if it doesn'thave the specified child
 * @since 8.0.0
 */
public boolean addShadowRoot(ShadowElement shadow);

Fixed version (ground truth):
/** 
 * Adds the given shadow root from this host. (Shadow developer use only)
 * @param shadow a shadow element
 * @return true if child is removed successfully; false if it doesn'thave the specified child
 * @since 8.0.0
 */
public boolean addShadowRoot(ShadowElement shadow);
Program: 16045
Project: 16045
Buggy source:
public void setParent(Component parent){
  if (_host != null && parent != null) {
    throw new UiException("String_Node_Str");
  }
  if (parent == null && _host == null) {
    Component next=_nextInsertion == null ? _lastInsertion : _nextInsertion;
    setPrevInsertion(next,_previousInsertion);
    _previousInsertion=null;
    _firstInsertion=null;
    _lastInsertion=null;
    _nextInsertion=null;
  }
  super.setParent(parent);
  if (parent != null) {
    Component host=getShadowHostIfAny();
    if (host != null)     host.getDesktop().getWebApp().getConfiguration().afterShadowAttached(this,host);
  }
}

Fixed version (ground truth):
public void setParent(Component parent){
  if (_host != null && parent != null) {
    throw new UiException("String_Node_Str");
  }
  if (parent == null && _host == null) {
    setPrevInsertion(_nextInsertion,_previousInsertion);
    _previousInsertion=null;
    _firstInsertion=null;
    _lastInsertion=null;
    _nextInsertion=null;
  }
  super.setParent(parent);
  if (parent != null) {
    Component host=getShadowHostIfAny();
    if (host != null)     host.getDesktop().getWebApp().getConfiguration().afterShadowAttached(this,host);
  }
}
Program: 16046
Project: 16046
Buggy source:
/** 
 * Merge the all sub-tree into the parent's insertions, unlike  {@link #appendChild(Component)}
 */
public void mergeSubTree(){
  List<HtmlShadowElement> children=getChildren();
  if (children == null || children.isEmpty())   return;
  for (  HtmlShadowElement child : new ArrayList<HtmlShadowElement>(children)) {
    _parent.insertBefore(child,this);
  }
}

Fixed version (ground truth):
/** 
 * Merge the all sub-tree into the parent's insertions, unlike  {@link #appendChild(Component)}
 */
public void mergeSubTree(){
  List<HtmlShadowElement> children=getChildren();
  if (children == null || children.isEmpty())   return;
  for (  HtmlShadowElement child : new ArrayList<HtmlShadowElement>(children)) {
    Component previous=child._previousInsertion;
    Component next=child._nextInsertion;
    _parent.insertBefore(child,this);
    if (previous != null && !(previous instanceof HtmlShadowElement)) {
      Component newPrevious=child._previousInsertion;
      setPrevInsertion(previous,newPrevious);
      setPrevInsertion(child,previous);
    }
    if (next != null && !(next instanceof HtmlShadowElement)) {
      Component newNext=child._nextInsertion;
      setPrevInsertion(newNext,next);
      setPrevInsertion(next,child);
    }
  }
}
Program: 16047
Project: 16047
Buggy source:
protected Object getShadowVariable0(AbstractComponent baseChild,String name,boolean recurse){
  Object val=getAttribute(name);
  if (val != null || hasAttribute(name))   return val;
  if (!(this instanceof ShadowElement)) {
    ComponentCtrl ctrl=this;
    List<HtmlShadowElement> shadowRoots=ctrl.getShadowRoots();
    if (!shadowRoots.isEmpty()) {
      Map<Component,Integer> indexCacheMap=getIndexCacheMap();
      try {
        if (indexCacheMap == null)         initIndexCacheMap();
        for (        HtmlShadowElement shadow : shadowRoots) {
          val=shadow.resolveVariable(baseChild,name,recurse);
          if (val != null)           return val;
        }
      }
  finally {
        ShadowElementsCtrl.setDistributedIndexInfo(indexCacheMap);
      }
    }
  }
  if (recurse) {
    if (_parent != null)     return _parent.getShadowVariable0(this,name,recurse);
    if (this instanceof ShadowElement) {
      AbstractComponent shadowHost=(AbstractComponent)((ShadowElement)this).getShadowHost();
      if (shadowHost != null) {
        if (shadowHost._variableSeeking) {
          if (shadowHost.getParent() != null) {
            return ((AbstractComponent)shadowHost.getParent()).getShadowVariable(name,recurse);
          }
          return null;
        }
        return shadowHost.getShadowVariable(name,recurse);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
protected Object getShadowVariable0(AbstractComponent baseChild,String name,boolean recurse){
  Object val=getAttribute(name);
  if (val != null || hasAttribute(name))   return val;
  if (!(this instanceof ShadowElement)) {
    ComponentCtrl ctrl=this;
    List<HtmlShadowElement> shadowRoots=ctrl.getShadowRoots();
    if (!shadowRoots.isEmpty()) {
      Map<Component,Integer> indexCacheMap=getIndexCacheMap();
      try {
        if (indexCacheMap != null) {
          destroyIndexCacheMap();
        }
        initIndexCacheMap();
        for (        HtmlShadowElement shadow : shadowRoots) {
          val=shadow.resolveVariable(baseChild,name,recurse);
          if (val != null)           return val;
        }
      }
  finally {
        ShadowElementsCtrl.setDistributedIndexInfo(indexCacheMap);
      }
    }
  }
  if (recurse) {
    if (_parent != null)     return _parent.getShadowVariable0(this,name,recurse);
    if (this instanceof ShadowElement) {
      AbstractComponent shadowHost=(AbstractComponent)((ShadowElement)this).getShadowHost();
      if (shadowHost != null) {
        if (shadowHost._variableSeeking) {
          if (shadowHost.getParent() != null) {
            return ((AbstractComponent)shadowHost.getParent()).getShadowVariable(name,recurse);
          }
          return null;
        }
        return shadowHost.getShadowVariable(name,recurse);
      }
    }
  }
  return null;
}
Program: 16048
Project: 16048
Buggy source:
/** 
 * Merge the all sub-tree into the parent's insertions, unlike  {@link #appendChild(Component)}
 */
public void mergeSubTree(){
  List<HtmlShadowElement> children=getChildren();
  if (children == null || children.isEmpty())   return;
  if (_parent != null) {
    for (    HtmlShadowElement child : new ArrayList<HtmlShadowElement>(children)) {
      Component previous=child._previousInsertion;
      Component next=child._nextInsertion;
      _parent.insertBefore(child,this);
      if (previous != null && !(previous instanceof HtmlShadowElement)) {
        Component newPrevious=child._previousInsertion;
        setPrevInsertion(previous,newPrevious);
        setPrevInsertion(child,previous);
      }
      if (next != null && !(next instanceof HtmlShadowElement)) {
        Component newNext=child._nextInsertion;
        setPrevInsertion(newNext,next);
        setPrevInsertion(next,child);
      }
    }
  }
 else {
    for (    HtmlShadowElement child : new ArrayList<HtmlShadowElement>(children)) {
      Component previous=_previousInsertion;
      child.mergeToHost(_host);
      if (previous != null) {
        Component newPrevious=child._previousInsertion;
        if (newPrevious == null) {
          setPrevInsertion(child,previous);
        }
 else {
          setPrevInsertion(newPrevious,previous);
        }
      }
      Component newNext=child._nextInsertion;
      if (newNext == null) {
        setPrevInsertion(this,child);
      }
 else {
        setPrevInsertion(this,newNext);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Merge the all sub-tree into the parent's insertions, unlike  {@link #appendChild(Component)}
 */
protected void mergeSubTree(){
  List<HtmlShadowElement> children=getChildren();
  if (children == null || children.isEmpty())   return;
  if (_parent != null) {
    for (    HtmlShadowElement child : new ArrayList<HtmlShadowElement>(children)) {
      Component previous=child._previousInsertion;
      Component next=child._nextInsertion;
      _parent.insertBefore(child,this);
      if (previous != null && !(previous instanceof HtmlShadowElement)) {
        Component newPrevious=child._previousInsertion;
        setPrevInsertion(previous,newPrevious);
        setPrevInsertion(child,previous);
      }
      if (next != null && !(next instanceof HtmlShadowElement)) {
        Component newNext=child._nextInsertion;
        setPrevInsertion(newNext,next);
        setPrevInsertion(next,child);
      }
    }
  }
 else {
    for (    HtmlShadowElement child : new ArrayList<HtmlShadowElement>(children)) {
      Component previous=_previousInsertion;
      child.mergeToHost(_host);
      if (previous != null) {
        Component newPrevious=child._previousInsertion;
        if (newPrevious == null) {
          setPrevInsertion(child,previous);
        }
 else {
          setPrevInsertion(newPrevious,previous);
        }
      }
      Component newNext=child._nextInsertion;
      if (newNext == null) {
        setPrevInsertion(this,child);
      }
 else {
        setPrevInsertion(this,newNext);
      }
    }
  }
}
Program: 16049
Project: 16049
Buggy source:
private void setParent0(Component parent){
  if (_host != null && parent != null) {
    throw new UiException("String_Node_Str");
  }
  if (parent == null && _host == null) {
    setPrevInsertion(_nextInsertion,_previousInsertion);
    _previousInsertion=null;
    _firstInsertion=null;
    _lastInsertion=null;
    _nextInsertion=null;
  }
  super.setParent(parent);
}

Fixed version (ground truth):
private void setParent0(Component parent){
  if (_host != null && parent != null) {
    throw new UiException("String_Node_Str");
  }
  if (parent == null && _host == null) {
    if (_firstInsertion != null) {
      setPrevInsertion(_firstInsertion,_previousInsertion);
      setPrevInsertion(_nextInsertion,_lastInsertion);
    }
 else {
      setPrevInsertion(_nextInsertion,_previousInsertion);
    }
    _previousInsertion=null;
    _firstInsertion=null;
    _lastInsertion=null;
    _nextInsertion=null;
  }
  super.setParent(parent);
}