nus-yam/ex-repair huggingface dataset:
Program: 145406
Project: 145406
Buggy source:
public DataSource obtainDataSource(String aDataSourceName) throws Exception {
  if (aDataSourceName == null) {
    aDataSourceName=defaultDatasourceName;
  }
  if (aDataSourceName != null) {
    Context initContext=new InitialContext();
    try {
      return (DataSource)initContext.lookup(aDataSourceName);
    }
 catch (    NamingException ex) {
      try {
        Context envContext=(Context)initContext.lookup("String_Node_Str");
        return (DataSource)envContext.lookup(aDataSourceName);
      }
 catch (      NamingException ex1) {
        return GeneralResourceProvider.getInstance().getPooledDataSource(aDataSourceName);
      }
    }
  }
 else {
    throw new NamingException("String_Node_Str");
  }
}

Fixed version (ground truth):
public DataSource obtainDataSource(String aDataSourceName) throws Exception {
  if (aDataSourceName == null) {
    aDataSourceName=defaultDatasourceName;
  }
  if (aDataSourceName != null && !aDataSourceName.isEmpty()) {
    Context initContext=new InitialContext();
    try {
      return (DataSource)initContext.lookup(aDataSourceName);
    }
 catch (    NamingException ex) {
      try {
        Context envContext=(Context)initContext.lookup("String_Node_Str");
        return (DataSource)envContext.lookup(aDataSourceName);
      }
 catch (      NamingException ex1) {
        return GeneralResourceProvider.getInstance().getPooledDataSource(aDataSourceName);
      }
    }
  }
 else {
    throw new NamingException("String_Node_Str");
  }
}
Program: 145409
Project: 145409
Buggy source:
protected ImageParagraph(Element aContainer,String aTitle,boolean asHtml,ImageResource aImage){
  super();
  text=aTitle;
  html=asHtml;
  image=aImage;
  container=aContainer;
  container.getStyle().setPosition(Style.Position.RELATIVE);
  container.getStyle().setDisplay(Style.Display.INLINE_BLOCK);
  container.getStyle().setCursor(Cursor.DEFAULT);
  container.getStyle().setPadding(0,Unit.PX);
  content=Document.get().createPElement();
  content.getStyle().setMargin(0,Unit.PX);
  aligner=Document.get().createDivElement();
  aligner.getStyle().setDisplay(Style.Display.INLINE_BLOCK);
  aligner.getStyle().setPosition(Style.Position.RELATIVE);
  aligner.getStyle().setHeight(100,Style.Unit.PCT);
  aligner.getStyle().setVerticalAlign(Style.VerticalAlign.MIDDLE);
  aligner.getStyle().setVisibility(Style.Visibility.HIDDEN);
  container.insertFirst(content);
  container.insertAfter(aligner,content);
  setElement(container);
}

Fixed version (ground truth):
protected ImageParagraph(Element aContainer,String aTitle,boolean asHtml,ImageResource aImage){
  super();
  text=aTitle;
  html=asHtml;
  image=aImage;
  container=aContainer;
  container.getStyle().setPosition(Style.Position.RELATIVE);
  container.getStyle().setDisplay(Style.Display.INLINE_BLOCK);
  container.getStyle().setCursor(Cursor.DEFAULT);
  container.getStyle().setPadding(0,Unit.PX);
  content=Document.get().createPElement();
  content.getStyle().setMargin(0,Unit.PX);
  content.getStyle().setPosition(Style.Position.RELATIVE);
  content.getStyle().setDisplay(Style.Display.INLINE_BLOCK);
  aligner=Document.get().createDivElement();
  aligner.getStyle().setDisplay(Style.Display.INLINE_BLOCK);
  aligner.getStyle().setPosition(Style.Position.RELATIVE);
  aligner.getStyle().setHeight(100,Style.Unit.PCT);
  aligner.getStyle().setVerticalAlign(Style.VerticalAlign.MIDDLE);
  aligner.getStyle().setVisibility(Style.Visibility.HIDDEN);
  container.insertFirst(content);
  container.insertAfter(aligner,content);
  setElement(container);
}
Program: 145410
Project: 145410
Buggy source:
private void organize(){
  if (isAttached()) {
    final Style contentStyle=content.getStyle();
    organizeText();
    organizeImage();
    if (isAttached() && (getParent() instanceof FlowPanel || getParent() instanceof RootPanel || getParent() instanceof ScrollPanel)) {
      contentStyle.setPosition(Style.Position.RELATIVE);
    }
 else {
      contentStyle.setPosition(Style.Position.ABSOLUTE);
    }
    organizeHorizontalAlignment();
    organizeVerticalAlignment();
  }
}

Fixed version (ground truth):
private void organize(){
  if (isAttached()) {
    organizeText();
    organizeImage();
    organizeHorizontalAlignment();
    organizeVerticalAlignment();
  }
}
Program: 145411
Project: 145411
Buggy source:
protected void organizeVerticalAlignment(){
  final Style contentStyle=content.getStyle();
  final Style alignerStyle=aligner.getStyle();
  contentStyle.clearDisplay();
  contentStyle.clearProperty("String_Node_Str");
  alignerStyle.setDisplay(Style.Display.NONE);
switch (verticalAlignment) {
case TOP:
    contentStyle.setTop(0,Style.Unit.PX);
  contentStyle.clearBottom();
break;
case BOTTOM:
{
contentStyle.clearTop();
contentStyle.setBottom(0,Style.Unit.PX);
break;
}
case CENTER:
{
contentStyle.clearTop();
contentStyle.clearBottom();
contentStyle.setPosition(Style.Position.RELATIVE);
contentStyle.setDisplay(Style.Display.INLINE_BLOCK);
contentStyle.setVerticalAlign(Style.VerticalAlign.MIDDLE);
alignerStyle.setDisplay(Style.Display.INLINE_BLOCK);
break;
}
}
}

Fixed version (ground truth):
protected void organizeVerticalAlignment(){
  final Style contentStyle=content.getStyle();
  final Style alignerStyle=aligner.getStyle();
switch (verticalAlignment) {
case TOP:
    contentStyle.setVerticalAlign(Style.VerticalAlign.TOP);
  break;
case BOTTOM:
{
  contentStyle.setVerticalAlign(Style.VerticalAlign.BOTTOM);
  break;
}
case CENTER:
{
contentStyle.setVerticalAlign(Style.VerticalAlign.MIDDLE);
break;
}
}
}
Program: 145413
Project: 145413
Buggy source:
@Override public String getText(){
  return renderer.render(value);
}

Fixed version (ground truth):
@Override public String getText(){
  return super.getText();
}
Program: 145414
Project: 145414
Buggy source:
private String params(Parameters parameters){
  String[] res=new String[parameters.getParametersCount()];
  for (int i=0; i < parameters.getParametersCount(); i++) {
    Parameter p=parameters.get(i + 1);
    String sv="String_Node_Str";
    if (p.getValue() != null && p.getValue() != RowsetUtils.UNDEFINED_SQL_VALUE) {
      if (p.getValue() instanceof Date) {
        sv=defaultDateFormat.format((Date)p.getValue());
      }
 else {
        sv=p.getValue().toString();
      }
    }
    res[i]=param(p.getName(),sv);
  }
  return params(res);
}

Fixed version (ground truth):
private String params(Parameters parameters){
  String[] res=new String[parameters.getParametersCount()];
  for (int i=0; i < parameters.getParametersCount(); i++) {
    Parameter p=parameters.get(i + 1);
    String sv="String_Node_Str";
    if (p.getValue() != null && p.getValue() != RowsetUtils.UNDEFINED_SQL_VALUE) {
      if (p.getValue() instanceof Date) {
        sv=JsObject.formatDateValueWithJSON(Long.valueOf(((Date)p.getValue()).getTime()).doubleValue());
        sv=sv.substring(1,sv.length() - 1);
      }
 else {
        sv=p.getValue().toString();
      }
    }
    res[i]=param(p.getName(),sv);
  }
  return params(res);
}
Program: 145415
Project: 145415
Buggy source:
private static Object adoptValue(JSONValue aValue,Field aField) throws Exception {
  if (aValue != null && aValue.isNull() == null) {
    if (aValue.isArray() != null) {
      throw new Exception("String_Node_Str");
    }
 else {
      JSONBoolean jsb=aValue.isBoolean();
      if (jsb != null) {
        return jsb.booleanValue();
      }
 else {
        JSONNumber jsn=aValue.isNumber();
        if (jsn != null) {
          return jsn.doubleValue();
        }
 else {
          JSONString jss=aValue.isString();
          if (jss != null) {
            String sVal=jss.stringValue();
            if (aField.getTypeInfo().getType() == Types.TIMESTAMP || aField.getTypeInfo().getType() == Types.TIME || aField.getTypeInfo().getType() == Types.DATE) {
              return ISO_DATE_FORMAT.parse(sVal);
            }
 else             return sVal;
          }
 else {
            JSONObject jso=aValue.isObject();
            if (jso != null) {
              throw new Exception("String_Node_Str");
            }
 else {
              throw new Exception("String_Node_Str");
            }
          }
        }
      }
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private static Object adoptValue(JSONValue aValue,Field aField) throws Exception {
  if (aValue != null && aValue.isNull() == null) {
    if (aValue.isArray() != null) {
      throw new Exception("String_Node_Str");
    }
 else {
      JSONBoolean jsb=aValue.isBoolean();
      if (jsb != null) {
        return jsb.booleanValue();
      }
 else {
        JSONNumber jsn=aValue.isNumber();
        if (jsn != null) {
          return jsn.doubleValue();
        }
 else {
          JSONString jss=aValue.isString();
          if (jss != null) {
            String sVal=jss.stringValue();
            if (aField.getTypeInfo().getType() == Types.TIMESTAMP || aField.getTypeInfo().getType() == Types.TIME || aField.getTypeInfo().getType() == Types.DATE) {
              return new Date(Math.round(JsDate.create(sVal).getTime()));
            }
 else             return sVal;
          }
 else {
            JSONObject jso=aValue.isObject();
            if (jso != null) {
              throw new Exception("String_Node_Str");
            }
 else {
              throw new Exception("String_Node_Str");
            }
          }
        }
      }
    }
  }
 else {
    return null;
  }
}
Program: 145416
Project: 145416
Buggy source:
/** 
 * Utility method that tries to clone an object. Objects of explicitly specified types are constructed directly, other are serialized and deserialized (if not serializable exception is thrown).
 * @param o object to clone.
 * @return cloned of the given object.
 * @throws java.lang.CloneNotSupportedException when cloning wasunsuccessful.
 */
public static Object cloneObject(Object o) throws CloneNotSupportedException {
  if (o == null) {
    return null;
  }
  if ((o instanceof Byte) || (o instanceof Short) || (o instanceof Integer)|| (o instanceof Long)|| (o instanceof Float)|| (o instanceof Double)|| (o instanceof Boolean)|| (o instanceof Character)|| (o instanceof String)) {
    return o;
  }
  if (o instanceof Font) {
    return o;
  }
  if (o instanceof Dimension) {
    return new Dimension((Dimension)o);
  }
  if (o instanceof Point) {
    return new Point((Point)o);
  }
  if (o instanceof Rectangle) {
    return new Rectangle((Rectangle)o);
  }
  if (o instanceof Insets) {
    return ((Insets)o).clone();
  }
  if (o instanceof Cursor) {
    return new com.eas.gui.Cursor(((Cursor)o).getType());
  }
  if (o instanceof Paint) {
    return o;
  }
  if (o instanceof JSObject) {
    return o;
  }
  throw new CloneNotSupportedException();
}

Fixed version (ground truth):
/** 
 * Utility method that tries to clone an object. Objects of explicitly specified types are constructed directly, other are serialized and deserialized (if not serializable exception is thrown).
 * @param o object to clone.
 * @return cloned of the given object.
 * @throws java.lang.CloneNotSupportedException when cloning wasunsuccessful.
 */
public static Object cloneObject(Object o) throws CloneNotSupportedException {
  if (o == null) {
    return null;
  }
  if ((o instanceof Byte) || (o instanceof Short) || (o instanceof Integer)|| (o instanceof Long)|| (o instanceof Float)|| (o instanceof Double)|| (o instanceof Boolean)|| (o instanceof Character)|| (o instanceof String)) {
    return o;
  }
  if (o instanceof Font) {
    return o;
  }
  if (o instanceof Dimension) {
    return new Dimension((Dimension)o);
  }
  if (o instanceof Point) {
    return new Point((Point)o);
  }
  if (o instanceof Rectangle) {
    return new Rectangle((Rectangle)o);
  }
  if (o instanceof Insets) {
    return ((Insets)o).clone();
  }
  if (o instanceof Cursor) {
    return new com.eas.gui.Cursor(((Cursor)o).getType());
  }
  if (o instanceof Paint) {
    return o;
  }
  if (o instanceof JSObject) {
    return o;
  }
  if (o instanceof IconEditor.NbImageIcon) {
    return o;
  }
  throw new CloneNotSupportedException();
}
Program: 145417
Project: 145417
Buggy source:
public NbImageIcon copy(FormProperty<?> formProperty) throws Exception {
  return iconFromResourceName(dataObject,name);
}

Fixed version (ground truth):
public NbImageIcon copy() throws Exception {
  return iconFromResourceName(dataObject,name);
}
Program: 145418
Project: 145418
Buggy source:
private void publishComponentsFacades(JavaScriptObject aTarget,HasWidgets aView){
  java.util.Iterator<Widget> wIt=aView.iterator();
  while (wIt.hasNext()) {
    Widget w=wIt.next();
    if (w instanceof HasJsName && w instanceof HasPublished) {
      aTarget.<Utils.JsObject>cast().inject(((HasJsName)w).getJsName(),((HasPublished)w).getPublished());
    }
    if (w instanceof HasWidgets)     publishComponentsFacades(aTarget,(HasWidgets)w);
  }
}

Fixed version (ground truth):
private void publishComponentsFacades(JavaScriptObject aTarget,HasWidgets aView){
  java.util.Iterator<Widget> wIt=aView.iterator();
  while (wIt.hasNext()) {
    Widget w=wIt.next();
    if (w instanceof HasJsName && w instanceof HasPublished) {
      aTarget.<Utils.JsObject>cast().inject(((HasJsName)w).getJsName(),((HasPublished)w).getPublished());
    }
    if (w instanceof HasWidgets) {
      publishComponentsFacades(aTarget,(HasWidgets)w);
    }
 else     if (w instanceof PlatypusMenuBar) {
      PlatypusMenuBar bar=(PlatypusMenuBar)w;
      publishPlatypusMenuBarFacades(aTarget,bar);
    }
  }
}
Program: 145419
Project: 145419
Buggy source:
public void remove(UIObject aChild){
  boolean removed=false;
  if (aChild instanceof MenuItem) {
    removeItem((MenuItem)aChild);
    allItems.remove(aChild);
    removed=true;
  }
 else   if (aChild instanceof PlatypusMenuItemSeparator) {
    removeSeparator((PlatypusMenuItemSeparator)aChild);
    allItems.remove(aChild);
    removed=true;
  }
 else   if (aChild instanceof PlatypusMenu) {
    removeItem(((PlatypusMenu)aChild).getParentItem());
    allItems.remove(aChild);
    removed=true;
  }
  if (removed) {
    RemoveEvent.fire(this,aChild);
  }
}

Fixed version (ground truth):
public boolean remove(UIObject aChild){
  boolean removed=false;
  if (aChild instanceof MenuItem) {
    removeItem((MenuItem)aChild);
    allItems.remove(aChild);
    removed=true;
  }
 else   if (aChild instanceof PlatypusMenuItemSeparator) {
    removeSeparator((PlatypusMenuItemSeparator)aChild);
    allItems.remove(aChild);
    removed=true;
  }
 else   if (aChild instanceof PlatypusMenu) {
    removeItem(((PlatypusMenu)aChild).getParentItem());
    allItems.remove(aChild);
    removed=true;
  }
  if (removed) {
    RemoveEvent.fire(this,aChild);
  }
  return removed;
}
Program: 145420
Project: 145420
Buggy source:
@OnError public void onError(Session websocketSession,Throwable aError){
  session.inContext(() -> {
    if (onerror != null) {
      JSObject errorEvent=ScriptUtils.makeObj();
      errorEvent.setMember("String_Node_Str",aError.getMessage());
      onerror.call(session.getPublished(),new Object[]{errorEvent});
    }
  }
);
}

Fixed version (ground truth):
@OnError public void onError(Session websocketSession,Throwable aError){
  Runnable actor=() -> {
    if (onerror != null) {
      JSObject errorEvent=ScriptUtils.makeObj();
      errorEvent.setMember("String_Node_Str",aError.getMessage());
      onerror.call(session.getPublished(),new Object[]{errorEvent});
    }
  }
;
  if (ScriptUtils.getLock() == null) {
    session.inContext(actor);
  }
 else {
    final Object lock=ScriptUtils.getLock();
synchronized (lock) {
      actor.run();
    }
  }
}
Program: 145421
Project: 145421
Buggy source:
@ScriptFunction public void close(Double opCode,String aReason) throws Exception {
  if (opCode == null) {
    opCode=Double.valueOf(CloseReason.CloseCodes.NO_STATUS_CODE.getCode());
  }
  if (aReason == null) {
    aReason="String_Node_Str";
  }
  webSocketSession.close(new CloseReason(CloseReason.CloseCodes.getCloseCode(opCode.intValue()),aReason));
}

Fixed version (ground truth):
@ScriptFunction public void close(Double opCode,String aReason) throws Exception {
  if (opCode == null) {
    opCode=Double.valueOf(CloseReason.CloseCodes.NO_STATUS_CODE.getCode());
  }
  if (aReason == null) {
    aReason="String_Node_Str";
  }
  if (webSocketSession.isOpen()) {
    webSocketSession.close(new CloseReason(CloseReason.CloseCodes.getCloseCode(opCode.intValue()),aReason));
  }
}
Program: 145422
Project: 145422
Buggy source:
@ScriptFunction public void close(Double opCode,String aReason) throws Exception {
  if (opCode == null) {
    opCode=Double.valueOf(CloseReason.CloseCodes.NO_STATUS_CODE.getCode());
  }
  if (aReason == null) {
    aReason="String_Node_Str";
  }
  session.close(new CloseReason(CloseReason.CloseCodes.getCloseCode(opCode.intValue()),aReason));
}

Fixed version (ground truth):
@ScriptFunction public void close(Double opCode,String aReason) throws Exception {
  if (opCode == null) {
    opCode=Double.valueOf(CloseReason.CloseCodes.NO_STATUS_CODE.getCode());
  }
  if (aReason == null) {
    aReason="String_Node_Str";
  }
  if (session.isOpen()) {
    session.close(new CloseReason(CloseReason.CloseCodes.getCloseCode(opCode.intValue()),aReason));
  }
}
Program: 145423
Project: 145423
Buggy source:
public void rolledback() throws Exception {
  final Set<RowsetListener> lrowsetListeners=rowsetChangeSupport.getRowsetListeners();
  rowsetChangeSupport.setRowsetListeners(null);
  try {
    originalToCurrent();
  }
  finally {
    rowsetChangeSupport.setRowsetListeners(lrowsetListeners);
  }
  rowsetChangeSupport.fireRolledbackEvent();
}

Fixed version (ground truth):
public void rolledback() throws Exception {
  final Set<RowsetListener> lrowsetListeners=rowsetChangeSupport.getRowsetListeners();
  rowsetChangeSupport.setRowsetListeners(null);
  try {
    originalToCurrent();
    if (currentRowPos > current.size() + 1) {
      currentRowPos=current.size() + 1;
    }
 else     if (currentRowPos < 0) {
      currentRowPos=0;
    }
    if (current.isEmpty()) {
      currentRowPos=0;
    }
  }
  finally {
    rowsetChangeSupport.setRowsetListeners(lrowsetListeners);
  }
  rowsetChangeSupport.fireRolledbackEvent();
}
Program: 145424
Project: 145424
Buggy source:
@Override protected void onDetach(){
  super.onDetach();
  orphan(columnsChevron);
}

Fixed version (ground truth):
@Override protected void onDetach(){
  orphan(columnsChevron);
  super.onDetach();
}
Program: 145425
Project: 145425
Buggy source:
@Override public void onFailure(String reason){
  if (reason == null)   reason="String_Node_Str";
  rowsetChangeSupport.fireNetErrorEvent(reason);
  aCallback.onFailure(reason);
}

Fixed version (ground truth):
@Override public void onFailure(String reason){
  if (reason == null)   reason="String_Node_Str";
  rowsetChangeSupport.fireNetErrorEvent(reason);
  if (aCallback != null) {
    aCallback.onFailure(reason);
  }
}
Program: 145426
Project: 145426
Buggy source:
@Override protected void doWork(Rowset aRowset) throws Exception {
  if (aRowset != null) {
    if (activeFilter != null && activeFilter.isApplied()) {
      activeFilter.deactivate();
      activeFilter=null;
    }
    if (fields == null) {
      setFields(aRowset.getFields());
    }
    List<Row> rows=aRowset.getCurrent();
    aRowset.setCurrent(new ArrayList<Row>());
    aRowset.currentToOriginal();
    setCurrent(rows);
    currentToOriginal();
    invalidateFilters();
    if (!current.isEmpty()) {
      currentRowPos=1;
    }
    rowsetChangeSupport.fireRequeriedEvent();
    aCallback.onSuccess(Rowset.this);
  }
 else {
    throw new FlowProviderFailedException(BAD_FLOW_PROVIDER_RESULT_MSG);
  }
}

Fixed version (ground truth):
@Override protected void doWork(Rowset aRowset) throws Exception {
  if (aRowset != null) {
    if (activeFilter != null && activeFilter.isApplied()) {
      activeFilter.deactivate();
      activeFilter=null;
    }
    if (fields == null) {
      setFields(aRowset.getFields());
    }
    List<Row> rows=aRowset.getCurrent();
    aRowset.setCurrent(new ArrayList<Row>());
    aRowset.currentToOriginal();
    setCurrent(rows);
    currentToOriginal();
    invalidateFilters();
    if (!current.isEmpty()) {
      currentRowPos=1;
    }
    rowsetChangeSupport.fireRequeriedEvent();
    if (aCallback != null) {
      aCallback.onSuccess(Rowset.this);
    }
  }
 else {
    throw new FlowProviderFailedException(BAD_FLOW_PROVIDER_RESULT_MSG);
  }
}
Program: 145428
Project: 145428
Buggy source:
public static String relativeUri(){
  String pageUrl=GWT.getHostPageBaseURL();
  return pageUrl.substring(0,pageUrl.length() - 1);
}

Fixed version (ground truth):
public static String relativeUri(){
  NodeList<com.google.gwt.dom.client.Element> metas=com.google.gwt.dom.client.Document.get().getHead().getElementsByTagName("String_Node_Str");
  for (int i=0; i < metas.getLength(); i++) {
    com.google.gwt.dom.client.Element meta=metas.getItem(i);
    if ("String_Node_Str".equalsIgnoreCase(meta.getAttribute("String_Node_Str"))) {
      return meta.getAttribute("String_Node_Str");
    }
  }
  String pageUrl=GWT.getHostPageBaseURL();
  pageUrl=pageUrl.substring(0,pageUrl.length() - 1);
  return pageUrl;
}
Program: 145429
Project: 145429
Buggy source:
public static JavaScriptObject jsUpload(PublishedFile aFile,String aName,final JavaScriptObject aCompleteCallback,final JavaScriptObject aProgresssCallback,final JavaScriptObject aErrorCallback){
  if (aFile != null) {
    Cancellable cancellable=requestUpload(aFile,aName,new Callback<ProgressEvent,String>(){
      protected boolean completed;
      public void onSuccess(      ProgressEvent aResult){
        try {
          if (!completed) {
            if (aProgresssCallback != null) {
              Utils.executeScriptEventVoid(aProgresssCallback,aProgresssCallback,aResult);
            }
            if (aResult.isComplete()) {
              completed=true;
              if (aCompleteCallback != null) {
                Utils.executeScriptEventVoid(aCompleteCallback,aCompleteCallback,Utils.toJs("String_Node_Str"));
              }
            }
          }
        }
 catch (        Exception ex) {
          Logger.getLogger(AppClient.class.getName()).log(Level.SEVERE,null,ex);
        }
      }
      public void onFailure(      String reason){
        if (aErrorCallback != null) {
          try {
            Utils.executeScriptEventVoid(aErrorCallback,aErrorCallback,Utils.toJs(reason));
          }
 catch (          Exception ex) {
            Logger.getLogger(AppClient.class.getName()).log(Level.SEVERE,null,ex);
          }
        }
      }
    }
);
    return Utils.publishCancellable(cancellable);
  }
 else   return null;
}

Fixed version (ground truth):
public static JavaScriptObject jsUpload(PublishedFile aFile,String aName,final JavaScriptObject aCompleteCallback,final JavaScriptObject aProgresssCallback,final JavaScriptObject aErrorCallback){
  if (aFile != null) {
    Cancellable cancellable=AppClient.getInstance().startUploadRequest(aFile,aName,new Callback<ProgressEvent,String>(){
      protected boolean completed;
      public void onSuccess(      ProgressEvent aResult){
        try {
          if (!completed) {
            if (aProgresssCallback != null) {
              Utils.executeScriptEventVoid(aProgresssCallback,aProgresssCallback,aResult);
            }
            if (aResult.isComplete()) {
              completed=true;
              if (aCompleteCallback != null) {
                Utils.executeScriptEventVoid(aCompleteCallback,aCompleteCallback,Utils.toJs("String_Node_Str"));
              }
            }
          }
        }
 catch (        Exception ex) {
          Logger.getLogger(AppClient.class.getName()).log(Level.SEVERE,null,ex);
        }
      }
      public void onFailure(      String reason){
        if (aErrorCallback != null) {
          try {
            Utils.executeScriptEventVoid(aErrorCallback,aErrorCallback,Utils.toJs(reason));
          }
 catch (          Exception ex) {
            Logger.getLogger(AppClient.class.getName()).log(Level.SEVERE,null,ex);
          }
        }
      }
    }
);
    return Utils.publishCancellable(cancellable);
  }
 else   return null;
}
Program: 145431
Project: 145431
Buggy source:
public void startDownloadRequest(String aUrlPrefix,final int aRequestType,Map<String,String> aParams,RequestBuilder.Method aMethod) throws Exception {
  final Frame frame=new Frame();
  frame.setVisible(false);
  frame.addLoadHandler(new LoadHandler(){
    @Override public void onLoad(    LoadEvent event){
      Timer timer=new Timer(){
        @Override public void run(){
          frame.removeFromParent();
        }
      }
;
      timer.schedule(2000);
    }
  }
);
  String query="String_Node_Str";
  for (  Entry<String,String> ent : aParams.entrySet()) {
    query+=param(ent.getKey(),ent.getValue()) + "String_Node_Str";
  }
  query+=param(PlatypusHttpRequestParams.TYPE,String.valueOf(aRequestType));
  frame.setUrl(apiUrl + aUrlPrefix + "String_Node_Str"+ query);
  RootPanel.get().add(frame);
}

Fixed version (ground truth):
public void startDownloadRequest(String aUrlPrefix,final int aRequestType,Map<String,String> aParams,RequestBuilder.Method aMethod) throws Exception {
  final Frame frame=new Frame();
  frame.setVisible(false);
  frame.addLoadHandler(new LoadHandler(){
    @Override public void onLoad(    LoadEvent event){
      Timer timer=new Timer(){
        @Override public void run(){
          frame.removeFromParent();
        }
      }
;
      timer.schedule(2000);
    }
  }
);
  String query="String_Node_Str";
  for (  Map.Entry<String,String> ent : aParams.entrySet()) {
    query+=param(ent.getKey(),ent.getValue()) + "String_Node_Str";
  }
  query+=param(PlatypusHttpRequestParams.TYPE,String.valueOf(aRequestType));
  frame.setUrl(apiUrl + aUrlPrefix + "String_Node_Str"+ query);
  RootPanel.get().add(frame);
}
Program: 145432
Project: 145432
Buggy source:
public String format(Object aValue) throws ParseException {
  if (numberFormat != null) {
    if (aValue instanceof Number)     return numberFormat.format((Number)aValue);
 else     return null;
  }
 else   if (dateFormat != null) {
    if (aValue instanceof Date)     return dateFormat.format((Date)aValue);
 else     return null;
  }
 else   if (maskFormat != null) {
    return maskFormat.format(aValue);
  }
 else   if (regExpFormat != null) {
    if (aValue instanceof String)     return regExpFormat.format((String)aValue);
 else     return null;
  }
 else   if (bypassFormat != null) {
    if (aValue instanceof String)     return bypassFormat.format((String)aValue);
 else     return null;
  }
 else {
    return aValue != null ? aValue.toString() : null;
  }
}

Fixed version (ground truth):
public String format(Object aValue) throws ParseException {
  if (numberFormat != null) {
    if (aValue instanceof Number)     return numberFormat.format((Number)aValue);
 else     return null;
  }
 else   if (dateFormat != null) {
    if (aValue instanceof Date)     return dateFormat.format((Date)aValue);
 else     return null;
  }
 else   if (maskFormat != null) {
    return maskFormat.format(aValue);
  }
 else   if (regExpFormat != null) {
    if (aValue instanceof String)     return regExpFormat.format((String)aValue);
 else     return null;
  }
 else   if (bypassFormat != null) {
    return aValue != null ? bypassFormat.format(String.valueOf(aValue)) : null;
  }
 else {
    return aValue != null ? aValue.toString() : null;
  }
}
Program: 145433
Project: 145433
Buggy source:
public StyledListBox(boolean isMultipleSelect){
  super(isMultipleSelect);
  addChangeHandler(new ChangeHandler(){
    @Override public void onChange(    ChangeEvent event){
      int selected=getSelectedIndex();
      if (selected == -1) {
        setValue(null,true);
      }
 else {
        setValue(associatedValues.get(selected),true);
      }
    }
  }
);
}

Fixed version (ground truth):
public StyledListBox(boolean isMultipleSelect){
  super();
  setMultipleSelect(isMultipleSelect);
  addChangeHandler(new ChangeHandler(){
    @Override public void onChange(    ChangeEvent event){
      int selected=getSelectedIndex();
      if (selected == -1) {
        setValue(null,true);
      }
 else {
        setValue(associatedValues.get(selected),true);
      }
    }
  }
);
}
Program: 145434
Project: 145434
Buggy source:
public void addItem(String aLabel,HasDirection.Direction dir,String aKey,T aAssociatedValue,String aClassName){
  super.addItem(aLabel,dir,aKey);
  associatedValues.set(getItemCount() - 1,aAssociatedValue);
  setItemStyleName(getItemCount() - 1,aClassName);
}

Fixed version (ground truth):
public void addItem(String aLabel,HasDirection.Direction dir,String aKey,T aAssociatedValue,String aClassName){
  super.addItem(aLabel != null ? aLabel : "String_Node_Str",dir,aKey);
  associatedValues.set(getItemCount() - 1,aAssociatedValue);
  setItemStyleName(getItemCount() - 1,aClassName);
}
Program: 145435
Project: 145435
Buggy source:
@Override public void insertItem(String item,Direction dir,String value,int index){
  super.insertItem(item,dir,value,index);
  if (index == -1) {
    associatedValues.add(null);
  }
 else {
    associatedValues.add(index,null);
  }
  indicies=null;
}

Fixed version (ground truth):
@Override public void insertItem(String aLabel,Direction dir,String value,int index){
  super.insertItem(aLabel != null ? aLabel : "String_Node_Str",dir,value,index);
  if (index == -1) {
    associatedValues.add(null);
  }
 else {
    associatedValues.add(index,null);
  }
  indicies=null;
}
Program: 145436
Project: 145436
Buggy source:
@Override protected Widget getMovableTarget(){
  return popup;
}

Fixed version (ground truth):
@Override protected Widget getMovableTarget(){
  return popup != null ? popup : this;
}
Program: 145437
Project: 145437
Buggy source:
public void show(){
  row=0;
  col=0;
  popup.center();
  activate();
  field.setFocus(true);
}

Fixed version (ground truth):
public void show(){
  row=0;
  col=0;
  popup.center();
  activate();
  Scheduler.get().scheduleDeferred(new ScheduledCommand(){
    @Override public void execute(){
      field.setFocus(true);
    }
  }
);
}
Program: 145438
Project: 145438
Buggy source:
@Override public void onKeyDown(KeyDownEvent event){
  if (event.getNativeKeyCode() == KeyCodes.KEY_F) {
    event.stopPropagation();
    event.preventDefault();
    ModelGrid.this.find();
  }
 else   if (event.getNativeKeyCode() == KeyCodes.KEY_F3) {
    event.stopPropagation();
    event.preventDefault();
    if (finder != null) {
      finder.findNext();
    }
  }
}

Fixed version (ground truth):
@Override public void onKeyDown(KeyDownEvent event){
  if ((event.isMetaKeyDown() || event.isControlKeyDown()) && event.getNativeKeyCode() == KeyCodes.KEY_F) {
    event.stopPropagation();
    event.preventDefault();
    ModelGrid.this.find();
  }
 else   if (event.getNativeKeyCode() == KeyCodes.KEY_F3) {
    event.stopPropagation();
    event.preventDefault();
    if (finder != null) {
      finder.findNext();
    }
  }
}
Program: 145440
Project: 145440
Buggy source:
@Template("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + LEFT_RIGHT_CELL_PADDING + "String_Node_Str"+ LEFT_RIGHT_CELL_PADDING+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str") public SafeHtml cell(String aCssRuleName,double aRowsHeight);

Fixed version (ground truth):
@Template("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + LEFT_RIGHT_CELL_PADDING + "String_Node_Str"+ LEFT_RIGHT_CELL_PADDING+ "String_Node_Str"+ "String_Node_Str") public SafeHtml cell(String aCssRuleName,double aRowsHeight);
Program: 145441
Project: 145441
Buggy source:
@Template("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str") public SafeHtml td(String aCssRuleName,double hBorderWidth,double vBorderWidth,String aLinesColor);

Fixed version (ground truth):
@Template("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str") public SafeHtml td(String aCssRuleName,double hBorderWidth,double vBorderWidth,String aLinesColor);
Program: 145442
Project: 145442
Buggy source:
@Override protected void renderCell(Context context,Row valuesRow,SafeHtmlBuilder sb){
  if (getEditor() instanceof ModelCombo) {
    try {
      ModelCombo combo=(ModelCombo)getEditor();
      if (combo.isValidBindings()) {
        Rowset valuesRowset=combo.getValueElement().entity.getRowset();
        Rowset displaysRowset=combo.getDisplayElement().entity.getRowset();
        Row displayRow=valuesRow;
        if (valuesRowset != displaysRowset) {
          combo.getValueElement().entity.scrollTo(valuesRow);
          displayRow=displaysRowset.getCurrentRow();
        }
        String label=displayRow != null ? combo.getConverter().convert(displayRow.getColumnObject(combo.getDisplayElement().getColIndex())) : "String_Node_Str";
        sb.appendEscaped(label);
      }
    }
 catch (    Exception e) {
      sb.appendEscaped(e.getMessage());
    }
  }
 else {
    sb.appendEscaped(String.valueOf(valuesRow));
  }
}

Fixed version (ground truth):
@Override protected void renderCell(Context context,Row valuesRow,SafeHtmlBuilder sb){
  if (getEditor() instanceof ModelCombo) {
    try {
      ModelCombo combo=(ModelCombo)getEditor();
      if (combo.isValidBindings()) {
        Row displayRow=valuesRow;
        String label=displayRow != null ? combo.getConverter().convert(displayRow.getColumnObject(combo.getDisplayElement().getColIndex())) : "String_Node_Str";
        sb.appendEscaped(label);
      }
    }
 catch (    Exception e) {
      sb.appendEscaped(e.getMessage());
    }
  }
 else {
    sb.appendEscaped(String.valueOf(valuesRow));
  }
}
Program: 145445
Project: 145445
Buggy source:
@Override protected void clearValue(){
  super.clearValue();
  ActionEvent.fire(this,this);
}

Fixed version (ground truth):
@Override protected void clearValue(){
  try {
    setJsValue(null,true);
    ActionEvent.fire(this,this);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 145446
Project: 145446
Buggy source:
public static PublishedFont parseFont(Element fontTag) throws Exception {
  if (fontTag != null) {
    String fontFamily=null;
    if (fontTag.hasAttribute("String_Node_Str")) {
      fontFamily=fontTag.getAttribute("String_Node_Str");
    }
    int fontSize=0;
    if (fontTag.hasAttribute("String_Node_Str")) {
      fontSize=Utils.getIntegerAttribute(fontTag,"String_Node_Str",10);
    }
    int fontStyle=0;
    if (fontTag.hasAttribute("String_Node_Str")) {
      fontStyle=Utils.getIntegerAttribute(fontTag,"String_Node_Str",0);
    }
    return PublishedFont.create(fontFamily,fontStyle,fontSize);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public static PublishedFont parseFont(Element fontTag) throws Exception {
  if (fontTag != null) {
    String fontFamily=null;
    if (fontTag.hasAttribute("String_Node_Str")) {
      fontFamily=fontTag.getAttribute("String_Node_Str");
    }
    int fontSize=Utils.getIntegerAttribute(fontTag,"String_Node_Str",10);
    int fontStyle=Utils.getIntegerAttribute(fontTag,"String_Node_Str",0);
    return PublishedFont.create(fontFamily,fontStyle,fontSize);
  }
 else {
    return null;
  }
}
Program: 145447
Project: 145447
Buggy source:
private void setIconAndAlign(final ImageParagraph component,Element aTag) throws Exception {
  if (aTag.hasAttribute("String_Node_Str")) {
    String text=aTag.getAttribute("String_Node_Str");
    boolean html=text != null && text.startsWith("String_Node_Str");
    if (html) {
      component.setHTML(text.substring("String_Node_Str".length()));
    }
 else {
      component.setText(text);
    }
  }
  if (aTag.hasAttribute("String_Node_Str"))   component.setIconTextGap(Utils.getIntegerAttribute(aTag,"String_Node_Str",4));
  if (aTag.hasAttribute("String_Node_Str"))   component.setHorizontalTextPosition(Utils.getIntegerAttribute(aTag,"String_Node_Str",PlatypusLabel.RIGHT));
  if (aTag.hasAttribute("String_Node_Str"))   component.setVerticalTextPosition(Utils.getIntegerAttribute(aTag,"String_Node_Str",PlatypusLabel.RIGHT));
  if (aTag.hasAttribute("String_Node_Str")) {
    PlatypusImageResource.load(aTag.getAttribute("String_Node_Str"),new CallbackAdapter<ImageResource,String>(){
      @Override public void onFailure(      String reason){
        Logger.getLogger(WidgetsFactory.class.getName()).log(Level.SEVERE,"String_Node_Str" + reason);
      }
      @Override protected void doWork(      ImageResource aResult) throws Exception {
        component.setImageResource(aResult);
      }
    }
);
  }
  if (aTag.hasAttribute("String_Node_Str"))   component.setVerticalAlignment(Utils.getIntegerAttribute(aTag,"String_Node_Str",0));
  if (aTag.hasAttribute("String_Node_Str"))   component.setHorizontalAlignment(Utils.getIntegerAttribute(aTag,"String_Node_Str",0));
}

Fixed version (ground truth):
private void setIconAndAlign(final ImageParagraph component,Element aTag) throws Exception {
  if (aTag.hasAttribute("String_Node_Str")) {
    String text=aTag.getAttribute("String_Node_Str");
    boolean html=text != null && text.startsWith("String_Node_Str");
    if (html) {
      component.setHTML(text.substring("String_Node_Str".length()));
    }
 else {
      component.setText(text);
    }
  }
  component.setIconTextGap(Utils.getIntegerAttribute(aTag,"String_Node_Str",4));
  component.setHorizontalTextPosition(Utils.getIntegerAttribute(aTag,"String_Node_Str",PlatypusLabel.RIGHT));
  component.setVerticalTextPosition(Utils.getIntegerAttribute(aTag,"String_Node_Str",PlatypusLabel.CENTER));
  if (aTag.hasAttribute("String_Node_Str")) {
    PlatypusImageResource.load(aTag.getAttribute("String_Node_Str"),new CallbackAdapter<ImageResource,String>(){
      @Override public void onFailure(      String reason){
        Logger.getLogger(WidgetsFactory.class.getName()).log(Level.SEVERE,"String_Node_Str" + reason);
      }
      @Override protected void doWork(      ImageResource aResult) throws Exception {
        component.setImageResource(aResult);
      }
    }
);
  }
  if (aTag.hasAttribute("String_Node_Str"))   component.setVerticalAlignment(Utils.getIntegerAttribute(aTag,"String_Node_Str",0));
  if (aTag.hasAttribute("String_Node_Str"))   component.setHorizontalAlignment(Utils.getIntegerAttribute(aTag,"String_Node_Str",0));
}
Program: 145450
Project: 145450
Buggy source:
@Override public FlowProvider createFlowProvider(String aDbId,final String aEntityId,String aSqlClause,final Fields aExpectedFields,Set<String> aReadRoles,Set<String> aWriteRoles) throws Exception {
  if (JAVASCRIPT_QUERY_CONTENTS.equals(aSqlClause)) {
    JSObject dataFeeder=ScriptUtils.createModule(aEntityId);
    if (dataFeeder != null) {
      return new PlatypusScriptedFlowProvider(ScriptedDatabasesClient.this,aExpectedFields,dataFeeder);
    }
 else {
      throw new IllegalStateException("String_Node_Str" + aEntityId + "String_Node_Str");
    }
  }
 else {
    return super.createFlowProvider(aDbId,aEntityId,aSqlClause,aExpectedFields,aReadRoles,aWriteRoles);
  }
}

Fixed version (ground truth):
@Override public FlowProvider createFlowProvider(String aDbId,final String aEntityId,String aSqlClause,final Fields aExpectedFields,Set<String> aReadRoles,Set<String> aWriteRoles) throws Exception {
  if (JAVASCRIPT_QUERY_CONTENTS.equals(aSqlClause)) {
    JSObject dataFeeder=createModule(aEntityId);
    if (dataFeeder != null) {
      return new PlatypusScriptedFlowProvider(ScriptedDatabasesClient.this,aExpectedFields,dataFeeder);
    }
 else {
      throw new IllegalStateException("String_Node_Str" + aEntityId + "String_Node_Str");
    }
  }
 else {
    return super.createFlowProvider(aDbId,aEntityId,aSqlClause,aExpectedFields,aReadRoles,aWriteRoles);
  }
}
Program: 145451
Project: 145451
Buggy source:
public static void init(){
  initEngine((  ScriptEngine aEngine) -> {
    try {
      aEngine.eval("String_Node_Str");
    }
 catch (    ScriptException ex) {
      Logger.getLogger(ScriptUtils.class.getName()).log(Level.SEVERE,null,ex);
    }
  }
);
}

Fixed version (ground truth):
public static void init(){
  if (engine == null) {
    engine=new ScriptEngineManager().getEngineByName("String_Node_Str");
    try {
      engine.eval("String_Node_Str");
    }
 catch (    ScriptException ex) {
      Logger.getLogger(ScriptUtils.class.getName()).log(Level.SEVERE,null,ex);
    }
  }
}
Program: 145452
Project: 145452
Buggy source:
public static FunctionNode extractModuleConstructor(FunctionNode jsRoot){
  final NodesContext cx=new NodesContext();
  jsRoot.accept(new BaseAnnotationsMiner(jsRoot.getSource()){
    @Override public boolean enterFunctionNode(    FunctionNode fn){
      if (scopeLevel == TOP_SCOPE_LEVEL && fn != jsRoot && !fn.isAnonymous()) {
        if (cx.result == null) {
          cx.result=fn;
        }
        cx.functions++;
      }
      return super.enterFunctionNode(fn);
    }
    @Override protected void commentedFunction(    FunctionNode fn,    String aComment){
      if (scopeLevel == TOP_CONSTRUCTORS_SCOPE_LEVEL) {
        JsDoc jsDoc=new JsDoc(aComment);
        if (jsDoc.containsModuleAnnotation()) {
          cx.result=fn;
          cx.annotatedConstructors++;
        }
      }
    }
  }
);
  if (cx.annotatedConstructors == 1) {
    return cx.result;
  }
 else   if (cx.functions == 1) {
    Logger.getLogger(PlatypusFilesSupport.class.getName()).finer("String_Node_Str");
    return cx.result;
  }
 else   if (cx.functions == 0) {
    Logger.getLogger(PlatypusFilesSupport.class.getName()).warning("String_Node_Str");
  }
 else   if (cx.annotatedConstructors > 1) {
    Logger.getLogger(PlatypusFilesSupport.class.getName()).warning("String_Node_Str");
  }
 else   if (cx.annotatedConstructors == 0 && cx.functions > 1) {
    Logger.getLogger(PlatypusFilesSupport.class.getName()).warning("String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
public static FunctionNode extractModuleConstructor(FunctionNode jsRoot){
  if (jsRoot != null) {
    final NodesContext cx=new NodesContext();
    jsRoot.accept(new BaseAnnotationsMiner(jsRoot.getSource()){
      @Override public boolean enterFunctionNode(      FunctionNode fn){
        if (scopeLevel == TOP_SCOPE_LEVEL && fn != jsRoot && !fn.isAnonymous()) {
          if (cx.result == null) {
            cx.result=fn;
          }
          cx.functions++;
        }
        return super.enterFunctionNode(fn);
      }
      @Override protected void commentedFunction(      FunctionNode fn,      String aComment){
        if (scopeLevel == TOP_CONSTRUCTORS_SCOPE_LEVEL) {
          JsDoc jsDoc=new JsDoc(aComment);
          if (jsDoc.containsModuleAnnotation()) {
            cx.result=fn;
            cx.annotatedConstructors++;
          }
        }
      }
    }
);
    if (cx.annotatedConstructors == 1) {
      return cx.result;
    }
 else     if (cx.functions == 1) {
      Logger.getLogger(PlatypusFilesSupport.class.getName()).finer("String_Node_Str");
      return cx.result;
    }
 else     if (cx.functions == 0) {
      Logger.getLogger(PlatypusFilesSupport.class.getName()).warning("String_Node_Str");
    }
 else     if (cx.annotatedConstructors > 1) {
      Logger.getLogger(PlatypusFilesSupport.class.getName()).warning("String_Node_Str");
    }
 else     if (cx.annotatedConstructors == 0 && cx.functions > 1) {
      Logger.getLogger(PlatypusFilesSupport.class.getName()).warning("String_Node_Str");
    }
  }
  return null;
}
Program: 145453
Project: 145453
Buggy source:
private String getCopyModuleContent(Project project,String aJsContent){
  FunctionNode constructorFunc=PlatypusFilesSupport.extractModuleConstructor(aJsContent);
  if (constructorFunc != null) {
    String oldName=constructorFunc.getName();
    String newName=NewApplicationElementWizardIterator.getNewValidAppElementName(project,oldName);
    StringBuilder sb=new StringBuilder(aJsContent.substring(0,constructorFunc.getStart()));
    sb.append(newName);
    sb.append(aJsContent.substring(constructorFunc.getStart() + oldName.length()));
    return sb.toString();
  }
 else {
    return aJsContent;
  }
}

Fixed version (ground truth):
private String getCopyModuleContent(Project project,String aJsContent){
  FunctionNode constructorFunc=PlatypusFilesSupport.extractModuleConstructor(aJsContent);
  if (constructorFunc != null) {
    String oldName=constructorFunc.getName();
    String newName=NewApplicationElementWizardIterator.getNewValidAppElementName(project,oldName);
    int start=Token.descPosition(constructorFunc.getIdent().getToken());
    StringBuilder sb=new StringBuilder(aJsContent.substring(0,start));
    sb.append(newName);
    sb.append(aJsContent.substring(start + oldName.length()));
    return sb.toString();
  }
 else {
    return aJsContent;
  }
}
Program: 145454
Project: 145454
Buggy source:
@Override public String translateScriptPath(String aName) throws Exception {
  ApplicationElement appElement=get(aName);
  if (appElement != null) {
    if (appElement.getType() == ClientConstants.ET_RESOURCE) {
      return basePath + File.separator + aName.replace('/',File.separatorChar);
    }
 else     if (appElement.isModule()) {
      return generateAppElementPath(aName) + File.separator + aName+ "String_Node_Str";
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String translateScriptPath(String aName) throws Exception {
  ApplicationElement appElement=get(aName);
  if (appElement != null) {
    if (appElement.getType() == ClientConstants.ET_RESOURCE) {
      return basePath + File.separator + aName.replace('/',File.separatorChar);
    }
 else     if (appElement.isModule()) {
      return generateAppElementPath(aName) + File.separator + appElement.getName()+ "String_Node_Str";
    }
  }
  return "String_Node_Str";
}
Program: 145455
Project: 145455
Buggy source:
protected static void compareValues(Change.Value v1,Change.Value v2){
  assertEquals(v1.name,v2.name);
  assertEquals(v1.type.getSqlType(),v2.type.getSqlType());
  assertEquals(v1.type.getSqlTypeName(),v2.type.getSqlTypeName());
  assertEquals(v1.type.getJavaClassName(),v2.type.getJavaClassName());
  if (v1.type.getSqlType() == Types.CLOB || v2.type.getSqlType() == Types.CLOB) {
    assertTrue(v1.value instanceof CompactClob);
    CompactClob clob1=(CompactClob)v1.value;
    assertTrue(v2.value instanceof CompactClob);
    CompactClob clob2=(CompactClob)v2.value;
    assertEquals(clob1.getData(),clob2.getData());
  }
 else   if (v1.type.getSqlType() == Types.BLOB || v2.type.getSqlType() == Types.BLOB) {
    assertTrue(v1.value instanceof CompactBlob);
    CompactBlob blob1=(CompactBlob)v1.value;
    assertTrue(v2.value instanceof CompactBlob);
    CompactBlob blob2=(CompactBlob)v2.value;
    assertArrayEquals(blob1.getData(),blob2.getData());
  }
 else   if (v1.type.getSqlType() == Types.STRUCT) {
    assertTrue(v1.value instanceof Point);
    Point pt1=(Point)v1.value;
    assertTrue(v2.value instanceof Point);
    Point pt2=(Point)v2.value;
    assertTrue((int)pt1.getX() == (int)pt2.getX());
    assertTrue((int)pt1.getY() == (int)pt2.getY());
  }
 else {
    assertEquals(v1.value,v2.value);
  }
}

Fixed version (ground truth):
protected static void compareValues(ChangeValue v1,ChangeValue v2){
  assertEquals(v1.name,v2.name);
  assertEquals(v1.type.getSqlType(),v2.type.getSqlType());
  assertEquals(v1.type.getSqlTypeName(),v2.type.getSqlTypeName());
  assertEquals(v1.type.getJavaClassName(),v2.type.getJavaClassName());
  if (v1.type.getSqlType() == Types.CLOB || v2.type.getSqlType() == Types.CLOB) {
    assertTrue(v1.value instanceof CompactClob);
    CompactClob clob1=(CompactClob)v1.value;
    assertTrue(v2.value instanceof CompactClob);
    CompactClob clob2=(CompactClob)v2.value;
    assertEquals(clob1.getData(),clob2.getData());
  }
 else   if (v1.type.getSqlType() == Types.BLOB || v2.type.getSqlType() == Types.BLOB) {
    assertTrue(v1.value instanceof CompactBlob);
    CompactBlob blob1=(CompactBlob)v1.value;
    assertTrue(v2.value instanceof CompactBlob);
    CompactBlob blob2=(CompactBlob)v2.value;
    assertArrayEquals(blob1.getData(),blob2.getData());
  }
 else   if (v1.type.getSqlType() == Types.STRUCT) {
    assertTrue(v1.value instanceof Point);
    Point pt1=(Point)v1.value;
    assertTrue(v2.value instanceof Point);
    Point pt2=(Point)v2.value;
    assertTrue((int)pt1.getX() == (int)pt2.getX());
    assertTrue((int)pt1.getY() == (int)pt2.getY());
  }
 else {
    assertEquals(v1.value,v2.value);
  }
}