nus-yam/ex-repair huggingface dataset:
Program: 60066
Project: 60066
Buggy source:
private Image getImage(String href){
  try {
    URL u=new URL(href);
    URLConnection con=u.openConnection();
    con.setRequestProperty("String_Node_Str",UserAgentContext.DEFAULT_USER_AGENT);
    if (href.endsWith("String_Node_Str")) {
      SVGRasterizer r=new SVGRasterizer(u);
      return r.bufferedImageToImage();
    }
 else     if (href.startsWith("String_Node_Str")) {
      return Toolkit.getDefaultToolkit().createImage(ImageIO.read(con.getInputStream()).getSource());
    }
 else     if (href.endsWith("String_Node_Str")) {
      try {
        return new ImageIcon(u).getImage();
      }
 catch (      Exception e) {
        return ImageIO.read(con.getInputStream());
      }
    }
 else     if (href.endsWith("String_Node_Str")) {
      try {
        return ImageIO.read(con.getInputStream());
      }
 catch (      IOException e) {
        logger.error("String_Node_Str" + e);
      }
    }
 else {
      return ImageIO.read(con.getInputStream());
    }
  }
 catch (  Exception e) {
    logger.error(e);
  }
  return null;
}

Fixed version (ground truth):
private Image getImage(String href){
  try {
    URL u=new URL(href);
    URLConnection con=u.openConnection();
    con.setRequestProperty("String_Node_Str",UserAgentContext.DEFAULT_USER_AGENT);
    if (href.endsWith("String_Node_Str")) {
      SVGRasterizer r=new SVGRasterizer(u);
      return r.bufferedImageToImage();
    }
 else     if (href.startsWith("String_Node_Str")) {
      return Toolkit.getDefaultToolkit().createImage(ImageIO.read(con.getInputStream()).getSource());
    }
 else     if (href.endsWith("String_Node_Str")) {
      try {
        return new ImageIcon(u).getImage();
      }
 catch (      Exception e) {
        return ImageIO.read(con.getInputStream());
      }
    }
 else     if (href.endsWith("String_Node_Str")) {
      try {
        return ImageIO.read(con.getInputStream());
      }
 catch (      IOException e) {
        logger.error("String_Node_Str" + e);
      }
    }
 else {
      return ImageIO.read(con.getInputStream());
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  return null;
}
Program: 60068
Project: 60068
Buggy source:
/** 
 * Gets the child at index.
 * @param index the index
 * @return the child at index
 */
public Node getChildAtIndex(int index){
synchronized (this.getTreeLock()) {
    ArrayList<Node> nl=this.nodeList;
    try {
      return nl == null ? null : nl.get(index);
    }
 catch (    IndexOutOfBoundsException iob) {
      logger.error(iob);
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets the child at index.
 * @param index the index
 * @return the child at index
 */
public Node getChildAtIndex(int index){
synchronized (this.getTreeLock()) {
    ArrayList<Node> nl=this.nodeList;
    try {
      return nl == null ? null : nl.get(index);
    }
 catch (    IndexOutOfBoundsException iob) {
      return null;
    }
  }
}
Program: 60069
Project: 60069
Buggy source:
/** 
 * Gets the next to.
 * @param node the node
 * @return the next to
 */
private Node getNextTo(Node node){
synchronized (this.getTreeLock()) {
    ArrayList<Node> nl=this.nodeList;
    int idx=nl == null ? -1 : nl.indexOf(node);
    if (idx == -1) {
      throw new DOMException(DOMException.NOT_FOUND_ERR,"String_Node_Str");
    }
    try {
      return nl.get(idx + 1);
    }
 catch (    IndexOutOfBoundsException iob) {
      logger.error(iob);
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets the next to.
 * @param node the node
 * @return the next to
 */
private Node getNextTo(Node node){
synchronized (this.getTreeLock()) {
    ArrayList<Node> nl=this.nodeList;
    int idx=nl == null ? -1 : nl.indexOf(node);
    if (idx == -1) {
      throw new DOMException(DOMException.NOT_FOUND_ERR,"String_Node_Str");
    }
    try {
      return nl.get(idx + 1);
    }
 catch (    IndexOutOfBoundsException iob) {
      return null;
    }
  }
}
Program: 60070
Project: 60070
Buggy source:
@Override public Node getFirstChild(){
synchronized (this.getTreeLock()) {
    ArrayList<Node> nl=this.nodeList;
    try {
      return nl == null ? null : nl.get(0);
    }
 catch (    IndexOutOfBoundsException iob) {
      logger.error(iob);
      return null;
    }
  }
}

Fixed version (ground truth):
@Override public Node getFirstChild(){
synchronized (this.getTreeLock()) {
    ArrayList<Node> nl=this.nodeList;
    try {
      return nl == null ? null : nl.get(0);
    }
 catch (    IndexOutOfBoundsException iob) {
      return null;
    }
  }
}
Program: 60071
Project: 60071
Buggy source:
/** 
 * Gets the previous to.
 * @param node the node
 * @return the previous to
 */
private Node getPreviousTo(Node node){
synchronized (this.getTreeLock()) {
    ArrayList<Node> nl=this.nodeList;
    int idx=nl == null ? -1 : nl.indexOf(node);
    if (idx == -1) {
      throw new DOMException(DOMException.NOT_FOUND_ERR,"String_Node_Str");
    }
    try {
      return nl.get(idx - 1);
    }
 catch (    IndexOutOfBoundsException iob) {
      logger.error(iob);
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets the previous to.
 * @param node the node
 * @return the previous to
 */
private Node getPreviousTo(Node node){
synchronized (this.getTreeLock()) {
    ArrayList<Node> nl=this.nodeList;
    int idx=nl == null ? -1 : nl.indexOf(node);
    if (idx == -1) {
      throw new DOMException(DOMException.NOT_FOUND_ERR,"String_Node_Str");
    }
    try {
      return nl.get(idx - 1);
    }
 catch (    IndexOutOfBoundsException iob) {
      return null;
    }
  }
}
Program: 60072
Project: 60072
Buggy source:
@Override public Node getLastChild(){
synchronized (this.getTreeLock()) {
    ArrayList<Node> nl=this.nodeList;
    try {
      return nl == null ? null : nl.get(nl.size() - 1);
    }
 catch (    IndexOutOfBoundsException iob) {
      logger.error(iob);
      return null;
    }
  }
}

Fixed version (ground truth):
@Override public Node getLastChild(){
synchronized (this.getTreeLock()) {
    ArrayList<Node> nl=this.nodeList;
    try {
      return nl == null ? null : nl.get(nl.size() - 1);
    }
 catch (    IndexOutOfBoundsException iob) {
      return null;
    }
  }
}
Program: 60075
Project: 60075
Buggy source:
/** 
 * Adds the line break.
 * @param startNode the start node
 * @param breakType the break type
 */
public void addLineBreak(ModelNode startNode,int breakType){
  RLine line=this.currentLine;
  RenderState rs=startNode.getRenderState();
  if (line == null) {
    Insets insets=this.paddingInsets;
    this.addLine(startNode,null,insets.top);
    line=this.currentLine;
  }
  if (!Strings.isBlank(rs.getlineHeight())) {
    if (Strings.isNumeric(rs.getlineHeight())) {
      float flh=Float.parseFloat(rs.getlineHeight()) * LAFSettings.getInstance().getFontSize();
      line.setHeight(HtmlValues.getPixelSize(String.valueOf(flh),null,0));
    }
 else {
      line.setHeight(HtmlValues.getPixelSize(rs.getlineHeight(),null,0));
    }
  }
  if (line.getHeight() == 0) {
    int fontHeight=rs.getFontMetrics().getHeight();
    line.setHeight(fontHeight);
  }
  line.setLineBreak(new LineBreak(breakType,startNode));
  int newLineY;
  FloatingBounds fb=this.floatBounds;
  if (breakType == LineBreak.NONE || fb == null) {
    newLineY=line == null ? this.paddingInsets.top : line.y + line.height;
  }
 else {
    int prevY=line == null ? this.paddingInsets.top : line.y + line.height;
switch (breakType) {
case LineBreak.LEFT:
      newLineY=fb.getLeftClearY(prevY);
    break;
case LineBreak.RIGHT:
  newLineY=fb.getRightClearY(prevY);
break;
default :
newLineY=fb.getClearY(prevY);
break;
}
}
this.currentLine=this.addLine(startNode,line,newLineY);
}

Fixed version (ground truth):
/** 
 * Adds the line break.
 * @param startNode the start node
 * @param breakType the break type
 */
public void addLineBreak(ModelNode startNode,int breakType){
  RLine line=this.currentLine;
  RenderState rs=startNode.getRenderState();
  if (line == null) {
    Insets insets=this.paddingInsets;
    this.addLine(startNode,null,insets.top);
    line=this.currentLine;
  }
  if (!Strings.isBlank(rs.getlineHeight())) {
    Float f=Float.parseFloat(rs.getlineHeight());
    line.setHeight(f.intValue());
  }
  if (line.getHeight() == 0) {
    int fontHeight=rs.getFontMetrics().getHeight();
    line.setHeight(fontHeight);
  }
  line.setLineBreak(new LineBreak(breakType,startNode));
  int newLineY;
  FloatingBounds fb=this.floatBounds;
  if (breakType == LineBreak.NONE || fb == null) {
    newLineY=line == null ? this.paddingInsets.top : line.y + line.height;
  }
 else {
    int prevY=line == null ? this.paddingInsets.top : line.y + line.height;
switch (breakType) {
case LineBreak.LEFT:
      newLineY=fb.getLeftClearY(prevY);
    break;
case LineBreak.RIGHT:
  newLineY=fb.getRightClearY(prevY);
break;
default :
newLineY=fb.getClearY(prevY);
break;
}
}
this.currentLine=this.addLine(startNode,line,newLineY);
}
Program: 60076
Project: 60076
Buggy source:
@Override public String getlineHeight(){
  AbstractCSSProperties props=this.getCssProperties();
  String lh=props == null ? null : props.getLineHeight();
  RenderState prs=this.prevRenderState;
  if (lh == null && prs != null)   lh=prs.getlineHeight();
  if (lh == null)   return null;
switch (lh) {
case INHERIT:
    return this.getPreviousRenderState().getlineHeight();
case NORMAL:
  return String.valueOf(1.2f * LAFSettings.getInstance().getFontSize());
case INITIAL:
return String.valueOf(prs.getFontMetrics().getHeight());
default :
return lh;
}
}

Fixed version (ground truth):
@Override public String getlineHeight(){
  AbstractCSSProperties props=this.getCssProperties();
  RenderState prs=this.prevRenderState;
  String lh=props == null ? null : props.getLineHeight();
  if (this.iLineHeight != null) {
    return this.iLineHeight;
  }
  if (lh == null) {
    if (prs != null) {
      this.iLineHeight=prs.getlineHeight();
      return this.iLineHeight;
    }
    this.iLineHeight=DEFAULT_LINE_HEIGHT;
    return DEFAULT_LINE_HEIGHT;
  }
switch (lh) {
case INHERIT:
    return this.getPreviousRenderState().getlineHeight();
case NORMAL:
  return String.valueOf(1.2f * LAFSettings.getInstance().getFontSize());
case INITIAL:
return String.valueOf(prs.getFontMetrics().getHeight());
default :
int ilh=HtmlValues.getPixelSize(lh,this,1);
return String.valueOf(ilh * LAFSettings.getInstance().getFontSize());
}
}
Program: 60077
Project: 60077
Buggy source:
@Override public void invalidate(){
  Map<String,WordInfo> map=this.iWordInfoMap;
  if (map != null) {
    map.clear();
  }
  this.iFont=null;
  this.iFontMetrics=null;
  this.iColor=null;
  this.iTextDecoration=-1;
  this.iBlankWidth=-1;
  this.alignXPercent=-1;
  this.iBackgroundColor=INVALID_COLOR;
  this.iTextBackgroundColor=INVALID_COLOR;
  this.iOverlayColor=INVALID_COLOR;
  this.iBackgroundInfo=INVALID_BACKGROUND_INFO;
  this.iDisplay=null;
  this.iTextIndentText=null;
  this.iWhiteSpace=null;
  this.marginInsets=MarginRenderState.INVALID_INSETS;
  this.paddingInsets=PaddingRenderState.INVALID_INSETS;
  this.overflowX=-1;
  this.overflowY=-1;
  this.borderInfo=BorderRenderState.INVALID_BORDER_INFO;
}

Fixed version (ground truth):
@Override public void invalidate(){
  Map<String,WordInfo> map=this.iWordInfoMap;
  if (map != null) {
    map.clear();
  }
  this.iFont=null;
  this.iFontMetrics=null;
  this.iColor=null;
  this.iTextDecoration=-1;
  this.iBlankWidth=-1;
  this.alignXPercent=-1;
  this.iBackgroundColor=INVALID_COLOR;
  this.iTextBackgroundColor=INVALID_COLOR;
  this.iOverlayColor=INVALID_COLOR;
  this.iBackgroundInfo=INVALID_BACKGROUND_INFO;
  this.iDisplay=null;
  this.iTextIndentText=null;
  this.iWhiteSpace=null;
  this.iLineHeight=String.valueOf(1.6f * LAFSettings.getInstance().getFontSize());
  this.marginInsets=MarginRenderState.INVALID_INSETS;
  this.paddingInsets=PaddingRenderState.INVALID_INSETS;
  this.overflowX=-1;
  this.overflowY=-1;
  this.borderInfo=BorderRenderState.INVALID_BORDER_INFO;
}
Program: 60079
Project: 60079
Buggy source:
public SelectorInfo getSelector(String str,String selector){
  SelectorInfo si=new SelectorInfo();
  if (!selector.equals(SelectorMatcher.OP_ALL)) {
    Pattern SPACE=Pattern.compile("String_Node_Str" + selector);
    String[] arr=SPACE.split(str);
    si.setAttribute(arr[0]);
    si.setAttributeValue(arr[1]);
  }
 else {
    si.setAttribute(str);
    si.setAttributeValue("String_Node_Str");
  }
  return si;
}

Fixed version (ground truth):
public SelectorInfo getSelector(String str,String selector){
  SelectorInfo si=new SelectorInfo();
  if (!selector.equals(SelectorMatcher.OP_ALL)) {
    Pattern SPACE=Pattern.compile("String_Node_Str" + selector);
    String[] arr=SPACE.split(str);
    for (int i=0; i < arr.length; i++) {
      if (i == 0)       si.setAttribute(arr[0]);
      if (i == 1)       si.setAttributeValue(arr[1]);
    }
  }
 else {
    si.setAttribute(str);
    si.setAttributeValue("String_Node_Str");
  }
  return si;
}
Program: 60081
Project: 60081
Buggy source:
private void animateY(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (info.getY() >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setY(from_xml);
    }
  }
 else {
    from_xml++;
    info.setY(from_xml);
    ruicontrol.relayout();
  }
}

Fixed version (ground truth):
private void animateY(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (from_xml >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setY(from_xml);
    }
  }
 else {
    from_xml++;
    info.setY(from_xml);
    ruicontrol.relayout();
  }
}
Program: 60082
Project: 60082
Buggy source:
private void animateR(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (info.getR() >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setR(from_xml);
    }
  }
 else {
    from_xml++;
    info.setR(from_xml);
    ruicontrol.relayout();
  }
}

Fixed version (ground truth):
private void animateR(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (from_xml >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setR(from_xml);
    }
  }
 else {
    from_xml++;
    info.setR(from_xml);
    ruicontrol.relayout();
  }
}
Program: 60083
Project: 60083
Buggy source:
private void animateX(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (info.getX() >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setX(from_xml);
    }
  }
 else {
    from_xml++;
    info.setX(from_xml);
    ruicontrol.relayout();
  }
}

Fixed version (ground truth):
private void animateX(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (from_xml >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setX(from_xml);
    }
  }
 else {
    from_xml++;
    info.setX(from_xml);
    ruicontrol.relayout();
  }
}
Program: 60084
Project: 60084
Buggy source:
private void animateX2(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (info.getX2() >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setX2(from_xml);
    }
  }
 else {
    from_xml++;
    info.setX2(from_xml);
    ruicontrol.relayout();
  }
}

Fixed version (ground truth):
private void animateX2(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (from_xml >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setX2(from_xml);
    }
  }
 else {
    from_xml++;
    info.setX2(from_xml);
    ruicontrol.relayout();
  }
}
Program: 60085
Project: 60085
Buggy source:
private void animateX1(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (info.getX1() >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setX1(from_xml);
    }
  }
 else {
    from_xml++;
    info.setX1(from_xml);
    ruicontrol.relayout();
  }
}

Fixed version (ground truth):
private void animateX1(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (from_xml >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setX1(from_xml);
    }
  }
 else {
    from_xml++;
    info.setX1(from_xml);
    ruicontrol.relayout();
  }
}
Program: 60086
Project: 60086
Buggy source:
private void animateY2(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (info.getY2() >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setY2(from_xml);
    }
  }
 else {
    from_xml++;
    info.setY2(from_xml);
    ruicontrol.relayout();
  }
}

Fixed version (ground truth):
private void animateY2(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (from_xml >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setY2(from_xml);
    }
  }
 else {
    from_xml++;
    info.setY2(from_xml);
    ruicontrol.relayout();
  }
}
Program: 60087
Project: 60087
Buggy source:
private void animateY1(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (info.getY1() >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setY1(from_xml);
    }
  }
 else {
    from_xml++;
    info.setY1(from_xml);
    ruicontrol.relayout();
  }
}

Fixed version (ground truth):
private void animateY1(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (from_xml >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setY1(from_xml);
    }
  }
 else {
    from_xml++;
    info.setY1(from_xml);
    ruicontrol.relayout();
  }
}
Program: 60088
Project: 60088
Buggy source:
private void animateWidth(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (info.getWidth() >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setWidth(from_xml);
    }
  }
 else {
    from_xml++;
    info.setWidth(from_xml);
    ruicontrol.relayout();
  }
}

Fixed version (ground truth):
private void animateWidth(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (from_xml >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setWidth(from_xml);
    }
  }
 else {
    from_xml++;
    info.setWidth(from_xml);
    ruicontrol.relayout();
  }
}
Program: 60089
Project: 60089
Buggy source:
private void animateHeight(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (info.getHeight() >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setHeight(from_xml);
    }
  }
 else {
    from_xml++;
    info.setHeight(from_xml);
    ruicontrol.relayout();
  }
}

Fixed version (ground truth):
private void animateHeight(){
  if (this.animate.getRepeatDur() <= (System.currentTimeMillis() - repeatDuration)) {
    stopAnimation();
  }
  if (from_xml >= to_xml) {
    if (this.animate.getRepeatCount() == count) {
      stopAnimation();
    }
 else {
      count++;
      from_xml=Float.parseFloat(this.animate.getFrom());
      info.setHeight(from_xml);
    }
  }
 else {
    from_xml++;
    info.setHeight(from_xml);
    ruicontrol.relayout();
  }
}
Program: 60091
Project: 60091
Buggy source:
public String getD(){
  return this.getAttribute(D);
}

Fixed version (ground truth):
public String getD(){
  String d=this.getAttribute(D);
  if (d != null) {
    d.replaceAll("String_Node_Str","String_Node_Str");
  }
  return d;
}
Program: 60092
Project: 60092
Buggy source:
@Override public Object setUserData(String key,Object data,UserDataHandler handler){
  if (HtmlParser.MODIFYING_KEY.equals(key)) {
    boolean ns=(boolean)data;
    this.notificationsSuspended=ns;
    if (!ns) {
      this.informNodeLoaded();
    }
  }
synchronized (this) {
    if (handler != null) {
      if (this.userDataHandlers == null) {
        this.userDataHandlers=new HashMap<String,UserDataHandler>();
      }
 else {
        this.userDataHandlers.put(key,handler);
      }
    }
    Map<String,Object> userData=this.userData;
    if (data != null) {
      if (userData == null) {
        userData=new HashMap<String,Object>();
        this.userData=userData;
      }
      return userData.put(key,data);
    }
 else     if (userData != null) {
      return userData.remove(key);
    }
 else {
      return null;
    }
  }
}

Fixed version (ground truth):
@Override public Object setUserData(String key,Object data,UserDataHandler handler){
  if (HtmlParser.MODIFYING_KEY.equals(key) && data instanceof Boolean) {
    boolean ns=(boolean)data;
    this.notificationsSuspended=ns;
    if (!ns) {
      this.informNodeLoaded();
    }
  }
synchronized (this) {
    if (handler != null) {
      if (this.userDataHandlers == null) {
        this.userDataHandlers=new HashMap<String,UserDataHandler>();
      }
 else {
        this.userDataHandlers.put(key,handler);
      }
    }
    Map<String,Object> userData=this.userData;
    if (data != null) {
      if (userData == null) {
        userData=new HashMap<String,Object>();
        this.userData=userData;
      }
      return userData.put(key,data);
    }
 else     if (userData != null) {
      return userData.remove(key);
    }
 else {
      return null;
    }
  }
}
Program: 60093
Project: 60093
Buggy source:
@Override public Object setUserData(String key,Object data,UserDataHandler handler){
  boolean dataBool=(boolean)data;
  if (HtmlParser.MODIFYING_KEY.equals(key) && !dataBool) {
    this.processBaseTag();
  }
  return super.setUserData(key,data,handler);
}

Fixed version (ground truth):
@Override public Object setUserData(String key,Object data,UserDataHandler handler){
  if (HtmlParser.MODIFYING_KEY.equals(key) && data instanceof Boolean && !(boolean)data) {
    this.processBaseTag();
  }
  return super.setUserData(key,data,handler);
}
Program: 60094
Project: 60094
Buggy source:
@Override public Object setUserData(String key,Object data,UserDataHandler handler){
  Function onloadHandler=this.onloadHandler;
  if (onloadHandler != null) {
    boolean dataBool=(boolean)data;
    if (HtmlParser.MODIFYING_KEY.equals(key) && !dataBool) {
      Executor.executeFunction(this,onloadHandler,null);
    }
  }
  return super.setUserData(key,data,handler);
}

Fixed version (ground truth):
@Override public Object setUserData(String key,Object data,UserDataHandler handler){
  Function onloadHandler=this.onloadHandler;
  if (onloadHandler != null && data instanceof Boolean) {
    boolean dataBool=(boolean)data;
    if (HtmlParser.MODIFYING_KEY.equals(key) && !dataBool) {
      Executor.executeFunction(this,onloadHandler,null);
    }
  }
  return super.setUserData(key,data,handler);
}
Program: 60095
Project: 60095
Buggy source:
@Override public Object setUserData(String key,Object data,UserDataHandler handler){
  boolean dataBool=(boolean)data;
  if (HtmlParser.MODIFYING_KEY.equals(key) && !dataBool) {
    this.processLink();
  }
 else   if ("String_Node_Str".equals(key)) {
    this.informDocumentInvalid();
  }
  return super.setUserData(key,data,handler);
}

Fixed version (ground truth):
@Override public Object setUserData(String key,Object data,UserDataHandler handler){
  if (HtmlParser.MODIFYING_KEY.equals(key) && data instanceof Boolean && !(boolean)data) {
    this.processLink();
  }
 else   if ("String_Node_Str".equals(key)) {
    this.informDocumentInvalid();
  }
  return super.setUserData(key,data,handler);
}
Program: 60096
Project: 60096
Buggy source:
@Override public Object setUserData(String key,Object data,UserDataHandler handler){
  boolean dataBool=(boolean)data;
  if (HtmlParser.MODIFYING_KEY.equals(key) && !dataBool) {
    this.processScript();
  }
  return super.setUserData(key,data,handler);
}

Fixed version (ground truth):
@Override public Object setUserData(String key,Object data,UserDataHandler handler){
  if (HtmlParser.MODIFYING_KEY.equals(key) && data instanceof Boolean && !(boolean)data) {
    this.processScript();
  }
  return super.setUserData(key,data,handler);
}
Program: 60097
Project: 60097
Buggy source:
@Override public Object setUserData(String key,Object data,UserDataHandler handler){
  boolean dataBool=(boolean)data;
  if (HtmlParser.MODIFYING_KEY.equals(key) && !dataBool) {
    Document document=this.document;
    if (document instanceof HTMLDocumentImpl) {
      String textContent=this.getTextContent();
      String title=textContent == null ? null : textContent.trim();
      ((HTMLDocumentImpl)document).setTitle(title);
    }
  }
  return super.setUserData(key,data,handler);
}

Fixed version (ground truth):
@Override public Object setUserData(String key,Object data,UserDataHandler handler){
  if (HtmlParser.MODIFYING_KEY.equals(key) && data instanceof Boolean && !(boolean)data) {
    Document document=this.document;
    if (document instanceof HTMLDocumentImpl) {
      String textContent=this.getTextContent();
      String title=textContent == null ? null : textContent.trim();
      ((HTMLDocumentImpl)document).setTitle(title);
    }
  }
  return super.setUserData(key,data,handler);
}
Program: 60099
Project: 60099
Buggy source:
@Override public boolean equals(final Object other){
  if (other == this) {
    return true;
  }
  FontKey ors;
  try {
    ors=(FontKey)other;
  }
 catch (  ClassCastException cce) {
    return false;
  }
  return (this.fontSize == ors.fontSize) && (this.fontFamily.equals(ors.fontFamily)) && (this.fontStyle.equals(ors.fontStyle))&& (this.fontWeight.equals(ors.fontWeight))&& (this.fontVariant.equals(ors.fontVariant))&& (this.superscript.intValue() == ors.superscript.intValue())&& Objects.equals(this.locales,ors.locales);
}

Fixed version (ground truth):
@Override public boolean equals(final Object other){
  if (other == this) {
    return true;
  }
  FontKey ors;
  try {
    ors=(FontKey)other;
  }
 catch (  ClassCastException cce) {
    return false;
  }
  return (this.fontSize == ors.fontSize) && (this.fontFamily != null && this.fontFamily.equals(ors.fontFamily)) && (this.fontStyle != null && this.fontStyle.equals(ors.fontStyle))&& (this.fontWeight != null && this.fontWeight.equals(ors.fontWeight))&& (this.fontWeight != null && this.fontWeight.equals(ors.fontVariant))&& (this.superscript != null && this.superscript.intValue() == ors.superscript.intValue())&& Objects.equals(this.locales,ors.locales);
}
Program: 60100
Project: 60100
Buggy source:
@Override public final void paintTranslated(Graphics g){
  int x=this.x;
  int y=this.y;
  logger.error(y + "String_Node_Str" + x);
  g.translate(x,y);
  try {
    this.paint(g);
  }
  finally {
    g.translate(-x,-y);
  }
}

Fixed version (ground truth):
@Override public final void paintTranslated(Graphics g){
  int x=this.x;
  int y=this.y;
  g.translate(x,y);
  try {
    this.paint(g);
  }
  finally {
    g.translate(-x,-y);
  }
}
Program: 60101
Project: 60101
Buggy source:
/** 
 * Checks for declared width.
 * @return true, if successful
 */
public final boolean hasDeclaredWidth(){
  Integer dw=this.declaredWidth;
  if (dw.intValue() == INVALID_SIZE.intValue()) {
    Object rootNode=this.modelNode;
    if (rootNode instanceof HTMLElementImpl) {
      HTMLElementImpl element=(HTMLElementImpl)rootNode;
      CSS2Properties props=element.getCurrentStyle();
      if (props == null) {
        return false;
      }
      return !Strings.isBlank(props.getWidth());
    }
    return false;
  }
  return dw != null;
}

Fixed version (ground truth):
/** 
 * Checks for declared width.
 * @return true, if successful
 */
public final boolean hasDeclaredWidth(){
  Integer dw=this.declaredWidth == null ? 0 : this.declaredWidth;
  if (dw.intValue() == INVALID_SIZE.intValue()) {
    Object rootNode=this.modelNode;
    if (rootNode instanceof HTMLElementImpl) {
      HTMLElementImpl element=(HTMLElementImpl)rootNode;
      CSS2Properties props=element.getCurrentStyle();
      if (props == null) {
        return false;
      }
      return !Strings.isBlank(props.getWidth());
    }
    return false;
  }
  return dw != null;
}
Program: 60102
Project: 60102
Buggy source:
/** 
 * Gets the declared height.
 * @param renderState the render state
 * @param actualAvailHeight the actual avail height
 * @return the declared height
 */
protected Integer getDeclaredHeight(RenderState renderState,int actualAvailHeight){
  Integer dh=this.declaredHeight;
  if ((dh.intValue() == INVALID_SIZE.intValue()) || (actualAvailHeight != this.lastAvailHeightForDeclared)) {
    this.lastAvailHeightForDeclared=actualAvailHeight;
    int dhInt=this.getDeclaredHeightImpl(renderState,actualAvailHeight);
    dh=dhInt == -1 ? null : Integer.valueOf(dhInt);
    this.declaredHeight=dh;
  }
  return dh;
}

Fixed version (ground truth):
/** 
 * Gets the declared height.
 * @param renderState the render state
 * @param actualAvailHeight the actual avail height
 * @return the declared height
 */
protected Integer getDeclaredHeight(RenderState renderState,int actualAvailHeight){
  Integer dh=this.declaredHeight == null ? 0 : this.declaredHeight;
  if ((dh.intValue() == INVALID_SIZE.intValue()) || (actualAvailHeight != this.lastAvailHeightForDeclared)) {
    this.lastAvailHeightForDeclared=actualAvailHeight;
    int dhInt=this.getDeclaredHeightImpl(renderState,actualAvailHeight);
    dh=dhInt == -1 ? null : Integer.valueOf(dhInt);
    this.declaredHeight=dh;
  }
  return dh;
}
Program: 60104
Project: 60104
Buggy source:
/** 
 * Gets the declared width.
 * @param renderState the render state
 * @param actualAvailWidth the actual avail width
 * @return the declared width
 */
protected Integer getDeclaredWidth(RenderState renderState,int actualAvailWidth){
  Integer dw=this.declaredWidth;
  if ((dw.intValue() == INVALID_SIZE.intValue()) || (actualAvailWidth != this.lastAvailWidthForDeclared)) {
    this.lastAvailWidthForDeclared=actualAvailWidth;
    int dwInt=this.getDeclaredWidthImpl(renderState,actualAvailWidth);
    dw=dwInt == -1 ? null : Integer.valueOf(dwInt);
    this.declaredWidth=dw;
  }
  return dw;
}

Fixed version (ground truth):
/** 
 * Gets the declared width.
 * @param renderState the render state
 * @param actualAvailWidth the actual avail width
 * @return the declared width
 */
protected Integer getDeclaredWidth(RenderState renderState,int actualAvailWidth){
  Integer dw=this.declaredWidth == null ? 0 : this.declaredWidth;
  if ((dw.intValue() == INVALID_SIZE.intValue()) || (actualAvailWidth != this.lastAvailWidthForDeclared)) {
    this.lastAvailWidthForDeclared=actualAvailWidth;
    int dwInt=this.getDeclaredWidthImpl(renderState,actualAvailWidth);
    dw=dwInt == -1 ? null : Integer.valueOf(dwInt);
    this.declaredWidth=dw;
  }
  return dw;
}
Program: 60106
Project: 60106
Buggy source:
@Override public void paint(Graphics g){
  logger.error("String_Node_Str");
  RenderState rs=this.modelNode.getRenderState();
  if (rs != null) {
    Color textColor=rs.getColor();
    g.setColor(textColor);
    Font font=rs.getFont();
    g.setFont(font);
  }
  Iterator<Renderable> i=this.renderables.iterator();
  if (i != null) {
    while (i.hasNext()) {
      Object r=i.next();
      if (r instanceof RElement) {
        RElement relement=(RElement)r;
        Graphics newG=g.create(relement.getX(),relement.getY(),relement.getWidth(),relement.getHeight());
        try {
          relement.paint(newG);
        }
  finally {
          newG.dispose();
        }
      }
 else       if (r instanceof BoundableRenderable) {
        BoundableRenderable br=(BoundableRenderable)r;
        br.paintTranslated(g);
      }
 else {
        ((Renderable)r).paint(g);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void paint(Graphics g){
  RenderState rs=this.modelNode.getRenderState();
  if (rs != null) {
    Color textColor=rs.getColor();
    g.setColor(textColor);
    Font font=rs.getFont();
    g.setFont(font);
  }
  Iterator<Renderable> i=this.renderables.iterator();
  if (i != null) {
    while (i.hasNext()) {
      Object r=i.next();
      if (r instanceof RElement) {
        RElement relement=(RElement)r;
        Graphics newG=g.create(relement.getX(),relement.getY(),relement.getWidth(),relement.getHeight());
        try {
          relement.paint(newG);
        }
  finally {
          newG.dispose();
        }
      }
 else       if (r instanceof BoundableRenderable) {
        BoundableRenderable br=(BoundableRenderable)r;
        br.paintTranslated(g);
      }
 else {
        ((Renderable)r).paint(g);
      }
    }
  }
}
Program: 60107
Project: 60107
Buggy source:
/** 
 * @inheritDoc
 */
@Override public String toString(){
  StringBuffer buffer=new StringBuffer();
  buffer.append("String_Node_Str").append(statusCode).append("String_Node_Str");
  for (  Header h : getHeaders()) {
    buffer.append("String_Node_Str").append(h.getName()).append("String_Node_Str").append(h.getValue());
    buffer.append("String_Node_Str");
  }
  buffer.append(getBody());
  return buffer.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuffer buffer=new StringBuffer();
  buffer.append("String_Node_Str").append(statusCode).append("String_Node_Str");
  for (  Header h : getHeaders()) {
    buffer.append("String_Node_Str").append(h.getName()).append("String_Node_Str").append(h.getValue());
    buffer.append("String_Node_Str");
  }
  buffer.append(getBody());
  return buffer.toString();
}
Program: 60110
Project: 60110
Buggy source:
/** 
 * Intializes security by installing a security policy and a security manager. Programs that use the browser API should invoke this method (or  {@link #init(boolean,boolean) init }) to prevent web content from having full access to the user's computer.
 * @see #addPrivilegedPermission(Permission)
 */
public void initSecurity(){
  Policy.setPolicy(LocalSecurityPolicy.getInstance());
  System.setSecurityManager(new LocalSecurityManager());
}

Fixed version (ground truth):
/** 
 * Intializes security by installing a security policy and a security manager. Programs that use the browser API should invoke this method (or  {@link #init(boolean) init }) to prevent web content from having full access to the user's computer.
 * @see #addPrivilegedPermission(Permission)
 */
public void initSecurity(){
  Policy.setPolicy(LocalSecurityPolicy.getInstance());
  System.setSecurityManager(new LocalSecurityManager());
}
Program: 60111
Project: 60111
Buggy source:
/** 
 * Initializes some Java properties required by the browser. <p> This method is called by   {@link #init(boolean,boolean)}.
 */
public void initOtherProperties(){
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Initializes some Java properties required by the browser. <p> This method is called by   {@link #init(boolean)}.
 */
public void initOtherProperties(){
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
}
Program: 60112
Project: 60112
Buggy source:
/** 
 * Initializes security, protocols, look feel, console, the default window factory, extensions and <code>java.library.path</code>. This method should be invoked before using other functionality in the browser API. If this method is not called, at the very least  {@link #initOtherProperties()},   {@link #initProtocols()} and{@link #initExtensions()} should be called.<p> Applications that need to install their own security manager and policy should not call this method.
 * @param exitWhenAllWindowsAreClosed Whether the JVM should exit when all windows created by the default window factory are closed.
 * @param initConsole If this parameter is <code>true</code>, standard output is redirected to a browser console. See {@link org.lobobrowser.gui.ConsoleModel}.
 * @throws Exception the exception
 * @see #initSecurity()
 * @see #initProtocols()
 * @see #initExtensions()
 */
public void init(boolean exitWhenAllWindowsAreClosed) throws Exception {
  initOtherProperties();
  initNative(NATIVE_DIR_NAME);
  initSecurity();
  initProtocols();
  initHTTP();
  initLookAndFeel();
  initWindowFactory(exitWhenAllWindowsAreClosed);
  initExtensions();
}

Fixed version (ground truth):
/** 
 * Initializes security, protocols, look feel, console, the default window factory, extensions and <code>java.library.path</code>. This method should be invoked before using other functionality in the browser API. If this method is not called, at the very least  {@link #initOtherProperties()},   {@link #initProtocols()} and{@link #initExtensions()} should be called.<p> Applications that need to install their own security manager and policy should not call this method.
 * @param exitWhenAllWindowsAreClosed Whether the JVM should exit when all windows created by the default window factory are closed.
 * @throws Exception the exception
 * @see #initSecurity()
 * @see #initProtocols()
 * @see #initExtensions()
 */
public void init(boolean exitWhenAllWindowsAreClosed) throws Exception {
  initOtherProperties();
  initNative(NATIVE_DIR_NAME);
  initSecurity();
  initProtocols();
  initHTTP();
  initLookAndFeel();
  initWindowFactory(exitWhenAllWindowsAreClosed);
  initExtensions();
}
Program: 60113
Project: 60113
Buggy source:
/** 
 * Initializes the HTTP authenticator and the cookie handler. This is essential for the browser to work properly. <p> This method is invoked by   {@link #init(boolean,boolean)}.
 */
public void initHTTP(){
  Authenticator.setDefault(new AuthenticatorImpl());
  CookieHandler.setDefault(new CookieManager());
}

Fixed version (ground truth):
/** 
 * Initializes the HTTP authenticator and the cookie handler. This is essential for the browser to work properly. <p> This method is invoked by   {@link #init(boolean)}.
 */
public void initHTTP(){
  Authenticator.setDefault(new AuthenticatorImpl());
  CookieHandler.setDefault(new CookieManager());
}
Program: 60114
Project: 60114
Buggy source:
/** 
 * Initializes the global URLStreamHandlerFactory. <p> This method is invoked by   {@link #init(boolean,boolean)}.
 */
public void initProtocols(){
  PlatformStreamHandlerFactory factory=PlatformStreamHandlerFactory.getInstance();
  URL.setURLStreamHandlerFactory(factory);
  factory.addFactory(new LocalStreamHandlerFactory());
}

Fixed version (ground truth):
/** 
 * Initializes the global URLStreamHandlerFactory. <p> This method is invoked by   {@link #init(boolean)}.
 */
public void initProtocols(){
  PlatformStreamHandlerFactory factory=PlatformStreamHandlerFactory.getInstance();
  URL.setURLStreamHandlerFactory(factory);
  factory.addFactory(new LocalStreamHandlerFactory());
}
Program: 60115
Project: 60115
Buggy source:
/** 
 * Initializes platform logging. Note that this method is not implicitly called by   {@link #init(boolean,boolean)}.
 * @param debugOn Debugging mode. This determines which one of two different logging configurations is used.
 * @throws Exception the exception
 */
public void initLogging() throws Exception {
  Logger logger=LogManager.getLogger(PlatformInit.class);
  if (logger.isInfoEnabled()) {
    logger.warn("String_Node_Str");
    Properties properties=System.getProperties();
    Iterator i=properties.entrySet().iterator();
    while (i.hasNext()) {
      Map.Entry entry=(Map.Entry)i.next();
      logger.info("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue());
    }
  }
}

Fixed version (ground truth):
/** 
 * Initializes platform logging. Note that this method is not implicitly called by   {@link #init(boolean)}.
 * @throws Exception the exception
 */
public void initLogging() throws Exception {
  Logger logger=LogManager.getLogger(PlatformInit.class);
  if (logger.isInfoEnabled()) {
    logger.warn("String_Node_Str");
    Properties properties=System.getProperties();
    Iterator i=properties.entrySet().iterator();
    while (i.hasNext()) {
      Map.Entry entry=(Map.Entry)i.next();
      logger.info("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue());
    }
  }
}
Program: 60116
Project: 60116
Buggy source:
/** 
 * Initializers the <code>java.library.path</code> property. <p> This method is called by   {@link #init(boolean,boolean)}.
 * @param dirName A directory name relative to the browser application directory.
 */
public void initNative(String dirName){
  File appDir=this.getApplicationDirectory();
  File nativeDir=new File(appDir,dirName);
  System.setProperty("String_Node_Str",nativeDir.getAbsolutePath());
}

Fixed version (ground truth):
/** 
 * Initializers the <code>java.library.path</code> property. <p> This method is called by   {@link #init(boolean)}.
 * @param dirName A directory name relative to the browser application directory.
 */
public void initNative(String dirName){
  File appDir=this.getApplicationDirectory();
  File nativeDir=new File(appDir,dirName);
  System.setProperty("String_Node_Str",nativeDir.getAbsolutePath());
}
Program: 60117
Project: 60117
Buggy source:
/** 
 * Initializes browser extensions. Invoking this method is essential to enable the primary extension and all basic browser functionality. This method is invoked by   {@link #init(boolean,boolean)}.
 */
public void initExtensions(){
  ExtensionManager.getInstance().initExtensions();
}

Fixed version (ground truth):
/** 
 * Initializes browser extensions. Invoking this method is essential to enable the primary extension and all basic browser functionality. This method is invoked by   {@link #init(boolean)}.
 */
public void initExtensions(){
  ExtensionManager.getInstance().initExtensions();
}
Program: 60118
Project: 60118
Buggy source:
/** 
 * Adds one permission to the base set of permissions assigned to privileged code, i.e. code loaded from the local system rather than a remote location. This method must be called before a security manager has been set, that is, before   {@link #init(boolean,boolean)} or{@link #initSecurity()} are invoked. The purpose of the method is to addpermissions otherwise missing from the security policy installed by this facility.
 * @param permission A <code>Permission</code> instance.
 */
public void addPrivilegedPermission(Permission permission){
  LocalSecurityPolicy.addPrivilegedPermission(permission);
}

Fixed version (ground truth):
/** 
 * Adds one permission to the base set of permissions assigned to privileged code, i.e. code loaded from the local system rather than a remote location. This method must be called before a security manager has been set, that is, before   {@link #init(boolean)} or{@link #initSecurity()} are invoked. The purpose of the method is to addpermissions otherwise missing from the security policy installed by this facility.
 * @param permission A <code>Permission</code> instance.
 */
public void addPrivilegedPermission(Permission permission){
  LocalSecurityPolicy.addPrivilegedPermission(permission);
}
Program: 60119
Project: 60119
Buggy source:
/** 
 * Instantiates a new cloned window action.
 * @param componentSource the component source
 * @param window the window
 * @param action the action
 */
public ScreenShotAction(NavigatorWindow window){
  this.window=window;
}

Fixed version (ground truth):
/** 
 * Instantiates a new cloned window action.
 * @param window the window
 */
public ScreenShotAction(NavigatorWindow window){
  this.window=window;
}
Program: 60120
Project: 60120
Buggy source:
/** 
 * Gets the head match items.
 * @param itemPrefix the item prefix
 * @param maxNumItems the max num items
 * @return the head match items
 */
public Collection<String> getHeadMatchItems(String itemPrefix){
synchronized (this) {
    Object[] array=this.historySortedSet.toArray();
    Collection<String> items=new ArrayList<String>();
    for (int i=0; i < array.length; i++) {
      String potentialItem=(String)array[i];
      if (potentialItem.contains(itemPrefix)) {
        items.add(potentialItem);
      }
    }
    return items;
  }
}

Fixed version (ground truth):
/** 
 * Gets the head match items.
 * @param itemPrefix the item prefix
 * @return the head match items
 */
public Collection<String> getHeadMatchItems(String itemPrefix){
synchronized (this) {
    Object[] array=this.historySortedSet.toArray();
    Collection<String> items=new ArrayList<String>();
    for (int i=0; i < array.length; i++) {
      String potentialItem=(String)array[i];
      if (potentialItem.contains(itemPrefix)) {
        items.add(potentialItem);
      }
    }
    return items;
  }
}
Program: 60121
Project: 60121
Buggy source:
/** 
 * Gets the potential matches.
 * @param urlPrefix the url prefix
 * @param max the max
 * @return the potential matches
 */
public Collection<String> getPotentialMatches(String urlPrefix){
  return NavigationHistory.getInstance().getHeadMatchItems(urlPrefix);
}

Fixed version (ground truth):
/** 
 * Gets the potential matches.
 * @param urlPrefix the url prefix
 * @return the potential matches
 */
public Collection<String> getPotentialMatches(String urlPrefix){
  return NavigationHistory.getInstance().getHeadMatchItems(urlPrefix);
}