nus-yam/ex-repair huggingface dataset:
Program: 145559
Project: 145559
Buggy source:
private void selectCell(int aRow,int aCol){
  if (grid.getSelectionModel() instanceof PlatypusCellSelectionModel<?>) {
    PlatypusCellSelectionModel<Row> cellsSelection=(PlatypusCellSelectionModel<Row>)grid.getSelectionModel();
    cellsSelection.selectCell(aRow,aCol,true);
  }
 else {
    grid.getSelectionModel().select(aRow,false);
  }
}

Fixed version (ground truth):
private void selectCell(int aRow,int aCol){
  if (grid.getSelectionModel() instanceof PlatypusCellSelectionModel<?>) {
    PlatypusCellSelectionModel<Row> cellsSelection=(PlatypusCellSelectionModel<Row>)grid.getSelectionModel();
    cellsSelection.deselectAll();
    cellsSelection.selectCell(aRow,aCol,true);
  }
 else {
    grid.getSelectionModel().select(aRow,false);
  }
}
Program: 145560
Project: 145560
Buggy source:
public FindWindow(Grid<Row> aGrid){
  grid=aGrid;
  initComponents();
  setHeadingText(messages.heading());
  setBorders(false);
  setResizable(false);
  setPixelSize(400,145);
}

Fixed version (ground truth):
public FindWindow(Grid<Row> aGrid){
  grid=aGrid;
  initComponents();
  setHeadingText(messages.heading());
  setBorders(false);
  setResizable(false);
  setPixelSize(400,135);
}
Program: 145561
Project: 145561
Buggy source:
public String getBody() throws IOException {
  String encoding=httpRequest.getCharacterEncoding();
  if (encoding == null || encoding.isEmpty()) {
    Logger.getLogger(HttpScriptContext.class.getName()).log(Level.WARNING,"String_Node_Str");
    encoding="String_Node_Str";
  }
  if (Charset.isSupported(encoding)) {
    try (InputStream is=httpRequest.getInputStream()){
      byte[] data=BinaryUtils.readStream(is,-1);
      return new String(data,httpRequest.getCharacterEncoding());
    }
   }
 else {
    throw new IOException(String.format("String_Node_Str",encoding));
  }
}

Fixed version (ground truth):
public String getBody() throws IOException {
  String encoding=httpRequest.getCharacterEncoding();
  if (encoding == null || encoding.isEmpty()) {
    Logger.getLogger(HttpScriptContext.class.getName()).log(Level.WARNING,"String_Node_Str");
    encoding="String_Node_Str";
  }
  if (Charset.isSupported(encoding)) {
    try (InputStream is=httpRequest.getInputStream()){
      byte[] data=BinaryUtils.readStream(is,-1);
      return new String(data,encoding);
    }
   }
 else {
    throw new IOException(String.format("String_Node_Str",encoding));
  }
}
Program: 145562
Project: 145562
Buggy source:
protected void fireEditingStopped(){
  for (  CellEditorListener l : editorListeners) {
    if (l != null) {
      l.editingStopped(new ChangeEvent(this));
    }
  }
}

Fixed version (ground truth):
protected void fireEditingStopped(){
  for (  CellEditorListener l : editorListeners.toArray(new CellEditorListener[]{})) {
    if (l != null) {
      l.editingStopped(new ChangeEvent(this));
    }
  }
}
Program: 145563
Project: 145563
Buggy source:
protected void fireEditingCancelled(){
  for (  CellEditorListener l : editorListeners) {
    if (l != null) {
      l.editingCanceled(new ChangeEvent(this));
    }
  }
}

Fixed version (ground truth):
protected void fireEditingCancelled(){
  for (  CellEditorListener l : editorListeners.toArray(new CellEditorListener[]{})) {
    if (l != null) {
      l.editingCanceled(new ChangeEvent(this));
    }
  }
}
Program: 145564
Project: 145564
Buggy source:
private String transformCellValue(Object aValue,int aCol,boolean isData){
  if (aValue != null) {
    Object value=null;
    if (isData) {
      if (aValue instanceof CellData) {
        CellData cd=(CellData)aValue;
        value=cd.getData();
      }
      if (value != null) {
        return value.toString();
      }
    }
 else {
      TableColumn tc=getColumnModel().getColumn(aCol);
      TableCellRenderer renderer=tc.getCellRenderer();
      if (renderer instanceof DbCombo) {
        try {
          if (aValue instanceof CellData) {
            value=((DbCombo)renderer).achiveDisplayValue(((CellData)aValue).getData());
          }
          if (value == null) {
            value="String_Node_Str";
          }
        }
 catch (        Exception ex) {
          Logger.getLogger(DbGrid.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
        }
      }
      if (value == null && aValue instanceof CellData) {
        CellData cd=(CellData)aValue;
        value=cd.getDisplay() != null ? cd.getDisplay() : cd.getData();
      }
      if (value != null) {
        return value.toString();
      }
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private String transformCellValue(Object aValue,int aCol,boolean isData){
  if (aValue != null) {
    Object value=null;
    if (isData) {
      if (aValue instanceof CellData) {
        CellData cd=(CellData)aValue;
        value=cd.getData();
      }
 else {
        value=aValue;
      }
    }
 else {
      TableColumn tc=getColumnModel().getColumn(aCol);
      TableCellRenderer renderer=tc.getCellRenderer();
      if (renderer instanceof DbCombo) {
        try {
          value=((DbCombo)renderer).achiveDisplayValue(aValue instanceof CellData ? ((CellData)aValue).getData() : aValue);
        }
 catch (        Exception ex) {
          Logger.getLogger(DbGrid.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
        }
      }
 else {
        if (aValue instanceof CellData) {
          CellData cd=(CellData)aValue;
          value=cd.getDisplay() != null ? cd.getDisplay() : cd.getData();
        }
 else {
          value=aValue;
        }
      }
    }
    if (value != null) {
      return value.toString();
    }
  }
  return "String_Node_Str";
}
Program: 145566
Project: 145566
Buggy source:
public XMLHttpRequest2 syncRequest(String aUrlPrefix,final String aUrlQuery,String aBody,RequestBuilder.Method aMethod) throws Exception {
  String url=baseUrl + aUrlPrefix + "String_Node_Str"+ aUrlQuery;
  final XMLHttpRequest2 req=XMLHttpRequest.create().<XMLHttpRequest2>cast();
  req.open(aMethod.toString(),url,false);
  req.setRequestHeader("String_Node_Str","String_Node_Str");
  req.setRequestHeader("String_Node_Str","String_Node_Str");
  req.send(aBody);
  if (req.getStatus() == Response.SC_OK)   return req;
 else   throw new Exception(req.getStatus() + "String_Node_Str" + req.getStatusText());
}

Fixed version (ground truth):
public XMLHttpRequest2 syncRequest(String aUrl,ResponseType aResponseType,String aBody,RequestBuilder.Method aMethod) throws Exception {
  final XMLHttpRequest2 req=XMLHttpRequest.create().<XMLHttpRequest2>cast();
  req.open(aMethod.toString(),aUrl,false);
  interceptRequest(req);
  if (aResponseType != null && aResponseType != ResponseType.Default)   req.setResponseType(aResponseType);
  req.setRequestHeader("String_Node_Str","String_Node_Str");
  if (aBody != null)   req.send(aBody);
 else   req.send();
  if (req.getStatus() == Response.SC_OK)   return req;
 else   throw new Exception(req.getStatus() + "String_Node_Str" + req.getStatusText());
}
Program: 145567
Project: 145567
Buggy source:
public static void jsLoad(String aResourceName,final JavaScriptObject onSuccess,final JavaScriptObject onFailure,final boolean text) throws Exception {
  SafeUri uri=AppClient.getInstance().getResourceUri(aResourceName);
  AppClient.getInstance().startRequest(uri,text ? ResponseType.Default : ResponseType.ArrayBuffer,new Callback<XMLHttpRequest>(){
    @Override public void run(    XMLHttpRequest aResult) throws Exception {
      if (aResult.getStatus() == Response.SC_OK) {
        if (onSuccess != null)         Utils.executeScriptEventVoid(onSuccess,onSuccess,text ? Utils.toJs(aResult.getResponseText()) : aResult.<XMLHttpRequest2>cast().getResponse());
      }
 else {
        if (onFailure != null)         Utils.executeScriptEventVoid(onFailure,onFailure,Utils.toJs(aResult.getStatusText()));
      }
    }
    @Override public void cancel(){
    }
  }
,new Callback<XMLHttpRequest>(){
    @Override public void run(    XMLHttpRequest aResult) throws Exception {
      if (onFailure != null)       Utils.executeScriptEventVoid(onFailure,onFailure,Utils.toJs(aResult.getStatusText()));
    }
    @Override public void cancel(){
    }
  }
);
}

Fixed version (ground truth):
public static Object jsLoad(String aResourceName,final JavaScriptObject onSuccess,final JavaScriptObject onFailure,final boolean text) throws Exception {
  SafeUri uri=AppClient.getInstance().getResourceUri(aResourceName);
  if (onSuccess != null) {
    AppClient.getInstance().startRequest(uri,text ? ResponseType.Default : ResponseType.ArrayBuffer,new Callback<XMLHttpRequest>(){
      @Override public void run(      XMLHttpRequest aResult) throws Exception {
        if (aResult.getStatus() == Response.SC_OK) {
          if (onSuccess != null)           Utils.executeScriptEventVoid(onSuccess,onSuccess,text ? Utils.toJs(aResult.getResponseText()) : aResult.<XMLHttpRequest2>cast().getResponse());
        }
 else {
          if (onFailure != null)           Utils.executeScriptEventVoid(onFailure,onFailure,Utils.toJs(aResult.getStatusText()));
        }
      }
      @Override public void cancel(){
      }
    }
,new Callback<XMLHttpRequest>(){
      @Override public void run(      XMLHttpRequest aResult) throws Exception {
        if (onFailure != null)         Utils.executeScriptEventVoid(onFailure,onFailure,Utils.toJs(aResult.getStatusText()));
      }
      @Override public void cancel(){
      }
    }
);
  }
 else {
    XMLHttpRequest2 executed=AppClient.getInstance().syncRequest(uri.asString(),text ? ResponseType.Default : ResponseType.ArrayBuffer);
    if (executed != null) {
      if (executed.getStatus() == Response.SC_OK)       return text ? Utils.toJs(executed.getResponseText()) : executed.<XMLHttpRequest2>cast().getResponse();
 else       throw new Exception(executed.getStatusText());
    }
  }
  return null;
}
Program: 145570
Project: 145570
Buggy source:
@Override public void rowsetRequeried(RowsetRequeryEvent event){
  try {
    if (!model.isAjusting()) {
      enqueueScriptEvent(onRequeried,new ScriptSourcedEvent(sRowsetWrap));
    }
    if (!executing) {
      internalExecuteChildren(false);
      model.pumpScriptEvents();
    }
  }
 catch (  Exception ex) {
    Logger.getLogger(Entity.class.getName()).log(Level.SEVERE,null,ex);
  }
}

Fixed version (ground truth):
@Override public void rowsetRequeried(RowsetRequeryEvent event){
}
Program: 145571
Project: 145571
Buggy source:
private Parameters decodeQueryParams(String aQueryId,HttpServletRequest aRequest) throws RowsetException, IOException, UnsupportedEncodingException, Exception {
  SqlQuery query=serverCore.getDatabasesClient().getAppQuery(aQueryId);
  Parameters params=query.getParameters();
  Converter converter=serverCore.getDatabasesClient().getDbMetadataCache(query.getDbId()).getConnectionDriver().getConverter();
  for (int i=1; i <= params.getParametersCount(); i++) {
    Parameter param=params.get(i);
    String paramValue=aRequest.getParameter(param.getName());
    if (paramValue != null) {
      if ("String_Node_Str".equals(paramValue.toLowerCase()) || paramValue.isEmpty()) {
        paramValue=null;
      }
      Object convertedParamValue;
      if (param.getTypeInfo().getSqlType() == Types.DATE || param.getTypeInfo().getSqlType() == Types.TIMESTAMP || param.getTypeInfo().getSqlType() == Types.TIME) {
        SimpleDateFormat sdf=new SimpleDateFormat(RowsetJsonConstants.DATE_FORMAT);
        convertedParamValue=converter.convert2RowsetCompatible(paramValue != null ? sdf.parse(paramValue) : paramValue,param.getTypeInfo());
      }
 else {
        convertedParamValue=converter.convert2RowsetCompatible(paramValue,param.getTypeInfo());
      }
      param.setValue(convertedParamValue);
    }
  }
  return params;
}

Fixed version (ground truth):
private Parameters decodeQueryParams(String aQueryId,HttpServletRequest aRequest) throws RowsetException, IOException, UnsupportedEncodingException, Exception {
  SqlQuery query=serverCore.getDatabasesClient().getAppQuery(aQueryId);
  Parameters params=query.getParameters();
  Converter converter=serverCore.getDatabasesClient().getDbMetadataCache(query.getDbId()).getConnectionDriver().getConverter();
  for (int i=1; i <= params.getParametersCount(); i++) {
    Parameter param=params.get(i);
    String paramValue=aRequest.getParameter(param.getName());
    if (paramValue != null) {
      if ("String_Node_Str".equals(paramValue.toLowerCase()) || paramValue.isEmpty()) {
        paramValue=null;
      }
      Object convertedParamValue;
      if (param.getTypeInfo().getSqlType() == Types.DATE || param.getTypeInfo().getSqlType() == Types.TIMESTAMP || param.getTypeInfo().getSqlType() == Types.TIME) {
        convertedParamValue=converter.convert2RowsetCompatible(paramValue != null ? RowsetJsonConstants.DATE_FORMATTER.parse(paramValue) : paramValue,param.getTypeInfo());
      }
 else {
        convertedParamValue=converter.convert2RowsetCompatible(paramValue,param.getTypeInfo());
      }
      param.setValue(convertedParamValue);
    }
  }
  return params;
}
Program: 145572
Project: 145572
Buggy source:
protected Change.Value[] parseObjectProperties(Object oData) throws Exception {
  List<Change.Value> data=new ArrayList<>();
  if (oData instanceof Scriptable) {
    Scriptable sValue=(Scriptable)oData;
    Object[] valueIds=sValue.getIds();
    for (int j=0; j < valueIds.length; j++) {
      Object oValueName=valueIds[j];
      if (oValueName instanceof String) {
        String sValueName=(String)oValueName;
        Object oValueValue=sValue.get(sValueName,ScriptUtils.getScope());
        Field field=fieldsResolver.resolveField(entityId,sValueName);
        if (field != null) {
          Object convertedValueValue=converter.convert2RowsetCompatible(oValueValue,field.getTypeInfo());
          data.add(new Change.Value(sValueName,convertedValueValue,field.getTypeInfo()));
        }
 else {
          Logger.getLogger(ChangeJsonReader.class.getName()).log(Level.WARNING,String.format("String_Node_Str",entityId,sValueName));
        }
      }
 else {
        Logger.getLogger(ChangeJsonReader.class.getName()).log(Level.WARNING,"String_Node_Str");
      }
    }
  }
  return data.toArray(new Change.Value[]{});
}

Fixed version (ground truth):
protected Change.Value[] parseObjectProperties(Object oData) throws Exception {
  List<Change.Value> data=new ArrayList<>();
  if (oData instanceof Scriptable) {
    Scriptable sValue=(Scriptable)oData;
    Object[] valueIds=sValue.getIds();
    for (int j=0; j < valueIds.length; j++) {
      Object oValueName=valueIds[j];
      if (oValueName instanceof String) {
        String sValueName=(String)oValueName;
        Object oValueValue=sValue.get(sValueName,ScriptUtils.getScope());
        Field field=fieldsResolver.resolveField(entityId,sValueName);
        if (field != null) {
          if (oValueValue instanceof String && (field.getTypeInfo().getSqlType() == java.sql.Types.DATE || field.getTypeInfo().getSqlType() == java.sql.Types.TIME || field.getTypeInfo().getSqlType() == java.sql.Types.TIMESTAMP)) {
            try {
              oValueValue=RowsetJsonConstants.DATE_FORMATTER.parse((String)oValueValue);
            }
 catch (            ParseException pex) {
              if (((String)oValueValue).matches("String_Node_Str")) {
                oValueValue=Long.valueOf((String)oValueValue);
              }
 else {
                oValueValue=Double.valueOf((String)oValueValue);
              }
            }
          }
          Object convertedValueValue=converter.convert2RowsetCompatible(oValueValue,field.getTypeInfo());
          data.add(new Change.Value(sValueName,convertedValueValue,field.getTypeInfo()));
        }
 else {
          Logger.getLogger(ChangeJsonReader.class.getName()).log(Level.WARNING,String.format("String_Node_Str",entityId,sValueName));
        }
      }
 else {
        Logger.getLogger(ChangeJsonReader.class.getName()).log(Level.WARNING,"String_Node_Str");
      }
    }
  }
  return data.toArray(new Change.Value[]{});
}
Program: 145573
Project: 145573
Buggy source:
private void writeValue(StringBuilder sb,Object aValue,Field aField) throws Exception {
  String sValue="String_Node_Str";
  if (aValue != null) {
    sValue=String.valueOf(rowset.getConverter().convert2RowsetCompatible(aValue,DataTypeInfo.VARCHAR));
switch (aField.getTypeInfo().getSqlType()) {
case Types.TIME:
case Types.DATE:
case Types.TIMESTAMP:
      SimpleDateFormat sdf=new SimpleDateFormat(RowsetJsonConstants.DATE_FORMAT);
    sValue=s(sdf.format(aValue));
  break;
case Types.CHAR:
case Types.NCHAR:
case Types.VARCHAR:
case Types.NVARCHAR:
case Types.LONGVARCHAR:
case Types.LONGNVARCHAR:
case Types.CLOB:
case Types.NCLOB:
case Types.OTHER:
case Types.STRUCT:
sValue=s(sValue);
default :
break;
}
}
p(sb,aField.getName(),sValue);
}

Fixed version (ground truth):
private void writeValue(StringBuilder sb,Object aValue,Field aField) throws Exception {
  String sValue="String_Node_Str";
  if (aValue != null) {
    sValue=String.valueOf(rowset.getConverter().convert2RowsetCompatible(aValue,DataTypeInfo.VARCHAR));
switch (aField.getTypeInfo().getSqlType()) {
case Types.TIME:
case Types.DATE:
case Types.TIMESTAMP:
      sValue=s(RowsetJsonConstants.DATE_FORMATTER.format(aValue));
    break;
case Types.CHAR:
case Types.NCHAR:
case Types.VARCHAR:
case Types.NVARCHAR:
case Types.LONGVARCHAR:
case Types.LONGNVARCHAR:
case Types.CLOB:
case Types.NCLOB:
case Types.OTHER:
case Types.STRUCT:
  sValue=s(sValue);
default :
break;
}
}
p(sb,aField.getName(),sValue);
}
Program: 145574
Project: 145574
Buggy source:
private DataSource constructDataSource(DbConnectionSettings aSettings) throws Exception {
  try {
    Context initContext=new InitialContext();
    DataSource ds;
    try {
      ds=(DataSource)initContext.lookup(aSettings.getUrl());
    }
 catch (    javax.naming.NamingException ex) {
      Context envContext=(Context)initContext.lookup("String_Node_Str");
      ds=(DataSource)envContext.lookup(aSettings.getUrl());
    }
    return ds;
  }
 catch (  Exception ex) {
    return new PlatypusNativeDataSource(aSettings.getMaxConnections(),aSettings.getMaxStatements(),aSettings.getUrl(),aSettings.getInfo());
  }
}

Fixed version (ground truth):
private DataSource constructDataSource(DbConnectionSettings aSettings) throws Exception {
  try {
    Context initContext=new InitialContext();
    DataSource ds;
    try {
      ds=(DataSource)initContext.lookup(aSettings.getUrl());
    }
 catch (    javax.naming.NamingException ex) {
      Context envContext=(Context)initContext.lookup("String_Node_Str");
      ds=(DataSource)envContext.lookup(aSettings.getUrl());
    }
    return ds;
  }
 catch (  Exception ex) {
    return new PlatypusNativeDataSource(aSettings.getMaxConnections(),aSettings.getMaxStatements(),aSettings.getResourceTimeout(),aSettings.getUrl(),aSettings.getInfo());
  }
}
Program: 145575
Project: 145575
Buggy source:
public PlatypusNativeDataSource(int aMaxConnections,int aMaxStatements,String aUrl,Properties aProperties) throws Exception {
  super(aMaxConnections);
  url=aUrl;
  props=aProperties;
  maxStatements=aMaxStatements;
}

Fixed version (ground truth):
public PlatypusNativeDataSource(int aMaxConnections,int aMaxStatements,int aResourceTimeout,String aUrl,Properties aProperties) throws Exception {
  super(aMaxConnections,aResourceTimeout);
  url=aUrl;
  props=aProperties;
  maxStatements=aMaxStatements;
  resourceTimeout=aResourceTimeout;
}
Program: 145576
Project: 145576
Buggy source:
@Override protected BearDatabaseConnection createResource() throws Exception {
  return new BearDatabaseConnection(maxStatements,DriverManager.getConnection(url,props),this);
}

Fixed version (ground truth):
@Override protected BearDatabaseConnection createResource() throws Exception {
  return new BearDatabaseConnection(maxStatements,resourceTimeout,DriverManager.getConnection(url,props),this);
}
Program: 145578
Project: 145578
Buggy source:
public static Object getValue(ProtoNode node,ExecuteServerModuleMethodRequest.ArgumentType at) throws ProtoReaderException {
switch (at) {
case BIG_DECIMAL:
    return (node.getBigDecimal());
case BIG_INTEGER:
  return (node.getBigDecimal().toBigInteger());
case BOOLEAN:
return (node.getInt() != 0);
case BYTE:
return (node.getByte());
case CHARACTER:
return (node.getString().charAt(0));
case DATE:
return (node.getDate());
case DOUBLE:
return (node.getDouble());
case FLOAT:
return ((float)node.getDouble());
case INTEGER:
return (node.getInt());
case LONG:
return (node.getLong());
case SHORT:
return ((short)node.getInt());
case STRING:
return (node.getString());
default :
throw new IllegalArgumentException();
}
}

Fixed version (ground truth):
public static Object getValue(ProtoNode node,ExecuteServerModuleMethodRequest.ArgumentType at) throws ProtoReaderException {
switch (at) {
case BIG_DECIMAL:
    return (node.getBigDecimal());
case BIG_INTEGER:
  return (node.getBigDecimal().toBigInteger());
case BOOLEAN:
return (node.getInt() != 0);
case BYTE:
return (node.getByte());
case CHARACTER:
return (node.getString().charAt(0));
case DATE:
return (node.getDate());
case DOUBLE:
return (node.getDouble());
case FLOAT:
return ((float)node.getDouble());
case INTEGER:
return (node.getInt());
case LONG:
return (node.getLong());
case SHORT:
return ((short)node.getInt());
case STRING:
return (node.getString());
case OBJECT:
return ScriptUtils.parseJson(node.getString());
default :
throw new IllegalArgumentException();
}
}
Program: 145580
Project: 145580
Buggy source:
public static ArgumentType getArgumentType(Object value){
  for (  ArgumentType at : values()) {
    if (at.getClazz().isInstance(value)) {
      return at;
    }
  }
  return null;
}

Fixed version (ground truth):
public static ArgumentType getArgumentType(Object value){
  if (value instanceof Scriptable) {
    return ArgumentType.OBJECT;
  }
 else {
    for (    ArgumentType at : values()) {
      if (at.getClazz().isInstance(value)) {
        return at;
      }
    }
    return null;
  }
}
Program: 145581
Project: 145581
Buggy source:
public int apply(Connection aConnection) throws Exception {
  if (valid) {
    try (PreparedStatement stmt=aConnection.prepareStatement(clause)){
      for (int i=1; i <= parameters.size(); i++) {
        Change.Value v=parameters.get(i - 1);
        converter.convert2JdbcAndAssign(v.value,v.type,aConnection,i,stmt);
      }
      if (queriesLogger.isLoggable(Level.FINER)) {
        queriesLogger.log(Level.FINER,"String_Node_Str",new Object[]{clause,parameters.size()});
      }
      return stmt.executeUpdate();
    }
   }
 else {
    Logger.getLogger(StatementsLogEntry.class.getName()).log(Level.WARNING,"String_Node_Str");
    return 0;
  }
}

Fixed version (ground truth):
public int apply(Connection aConnection) throws Exception {
  if (valid) {
    try (PreparedStatement stmt=aConnection.prepareStatement(clause)){
      for (int i=1; i <= parameters.size(); i++) {
        Change.Value v=parameters.get(i - 1);
        converter.convert2JdbcAndAssign(v.value,v.type,aConnection,i,stmt);
      }
      if (queriesLogger.isLoggable(Level.FINE)) {
        queriesLogger.log(Level.FINE,"String_Node_Str",new Object[]{clause,parameters.size()});
      }
      return stmt.executeUpdate();
    }
   }
 else {
    Logger.getLogger(StatementsLogEntry.class.getName()).log(Level.WARNING,"String_Node_Str");
    return 0;
  }
}
Program: 145586
Project: 145586
Buggy source:
public void addCellEditorListener(CellEditorListener l){
  listenenrs.add(l);
}

Fixed version (ground truth):
@Override public void addCellEditorListener(CellEditorListener l){
  listenenrs.add(l);
}
Program: 145587
Project: 145587
Buggy source:
public void actionPerformed(ActionEvent e){
  TableColumnModel tcm=editingTable.getColumnModel();
  if (tcm instanceof ConstrainedColumnModel && tcm.getSelectionModel() instanceof ConstrainedListSelectionModel) {
    int colCount=((ConstrainedColumnModel)tcm).getDelegate().getColumnCount();
    ((ConstrainedListSelectionModel)tcm.getSelectionModel()).getDelegate().setSelectionInterval(0,colCount - 1);
  }
  if (check instanceof JRadioButton) {
    if (check.isSelected()) {
      editingTable.setRowSelectionInterval(editingRow,editingRow);
    }
 else {
      editingTable.removeRowSelectionInterval(editingRow,editingRow);
    }
  }
 else {
    if (check.isSelected()) {
      editingTable.addRowSelectionInterval(editingRow,editingRow);
    }
 else {
      editingTable.removeRowSelectionInterval(editingRow,editingRow);
    }
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  invokeRowHeaderAction();
}
Program: 145588
Project: 145588
Buggy source:
public Object getCellEditorValue(){
  return null;
}

Fixed version (ground truth):
@Override public Object getCellEditorValue(){
  return null;
}
Program: 145589
Project: 145589
Buggy source:
public boolean isCellEditable(EventObject anEvent){
  if (anEvent instanceof MouseEvent) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isCellEditable(EventObject anEvent){
  if (anEvent instanceof MouseEvent) {
    return true;
  }
  return false;
}
Program: 145590
Project: 145590
Buggy source:
public void cancelCellEditing(){
  ChangeEvent event=new ChangeEvent(this);
  for (  CellEditorListener l : listenenrs.toArray(new CellEditorListener[0])) {
    l.editingCanceled(event);
  }
}

Fixed version (ground truth):
@Override public void cancelCellEditing(){
  ChangeEvent event=new ChangeEvent(this);
  for (  CellEditorListener l : listenenrs.toArray(new CellEditorListener[0])) {
    l.editingCanceled(event);
  }
}
Program: 145591
Project: 145591
Buggy source:
public boolean shouldSelectCell(EventObject anEvent){
  return false;
}

Fixed version (ground truth):
@Override public boolean shouldSelectCell(EventObject anEvent){
  invokeRowHeaderAction();
  return false;
}
Program: 145592
Project: 145592
Buggy source:
public void removeCellEditorListener(CellEditorListener l){
  listenenrs.remove(l);
}

Fixed version (ground truth):
@Override public void removeCellEditorListener(CellEditorListener l){
  listenenrs.remove(l);
}
Program: 145593
Project: 145593
Buggy source:
public Component getTableCellEditorComponent(JTable table,Object value,boolean isSelected,int rowIndex,int column){
  try {
    editingTable=table;
    editingRow=rowIndex;
    if (check != null) {
      check.setSelected(table.isRowSelected(editingRow));
    }
    int modelRow=table.convertRowIndexToModel(rowIndex);
    DbGrid grid=DbControlsUtils.getFirstDbGrid(table);
    Row row=grid.index2Row(modelRow);
    if (row != null) {
      if (grid.isCurrentRow(row)) {
        indicator.setIcon(RowHeaderCellRenderer.currentIcon);
      }
 else {
        indicator.setIcon(null);
      }
      if (row.isInserted()) {
        rowDescriptor.setIcon(RowHeaderCellRenderer.insertingIcon);
      }
 else       if (row.isUpdated()) {
        rowDescriptor.setIcon(RowHeaderCellRenderer.editingIcon);
      }
 else {
        rowDescriptor.setIcon(null);
      }
    }
 else {
      indicator.setIcon(null);
      rowDescriptor.setIcon(null);
    }
    return this;
  }
 catch (  RowsetException ex) {
    Logger.getLogger(RowHeaderCellEditor.class.getName()).log(Level.SEVERE,null,ex);
    return this;
  }
}

Fixed version (ground truth):
@Override public Component getTableCellEditorComponent(JTable table,Object value,boolean isSelected,int rowIndex,int column){
  try {
    editingTable=table;
    editingRow=rowIndex;
    if (check != null) {
      check.setSelected(table.isRowSelected(editingRow));
    }
    int modelRow=table.convertRowIndexToModel(rowIndex);
    DbGrid grid=DbControlsUtils.getFirstDbGrid(table);
    Row row=grid.index2Row(modelRow);
    if (row != null) {
      if (grid.isCurrentRow(row)) {
        indicator.setIcon(RowHeaderCellRenderer.currentIcon);
      }
 else {
        indicator.setIcon(null);
      }
      if (row.isInserted()) {
        rowDescriptor.setIcon(RowHeaderCellRenderer.insertingIcon);
      }
 else       if (row.isUpdated()) {
        rowDescriptor.setIcon(RowHeaderCellRenderer.editingIcon);
      }
 else {
        rowDescriptor.setIcon(null);
      }
    }
 else {
      indicator.setIcon(null);
      rowDescriptor.setIcon(null);
    }
    return this;
  }
 catch (  RowsetException ex) {
    Logger.getLogger(RowHeaderCellEditor.class.getName()).log(Level.SEVERE,null,ex);
    return this;
  }
}
Program: 145594
Project: 145594
Buggy source:
public boolean stopCellEditing(){
  ChangeEvent event=new ChangeEvent(this);
  for (  CellEditorListener l : listenenrs.toArray(new CellEditorListener[0])) {
    l.editingStopped(event);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean stopCellEditing(){
  ChangeEvent event=new ChangeEvent(this);
  for (  CellEditorListener l : listenenrs.toArray(new CellEditorListener[0])) {
    l.editingStopped(event);
  }
  return true;
}
Program: 145595
Project: 145595
Buggy source:
@Override public FlowProvider createFlowProvider(String string,String string1,String string2,String string3,Set<String> set,Set<String> set1) throws Exception {
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public FlowProvider createFlowProvider(String string,String string1,String string2,String string3,Fields fields,Set<String> set,Set<String> set1) throws Exception {
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 145596
Project: 145596
Buggy source:
@ScriptFunction(jsDocText="String_Node_Str") public Color getForeground(){
  return delegate.getForeground();
}

Fixed version (ground truth):
@ScriptFunction(jsDocText="String_Node_Str") public Color getForeground(){
  return new ScriptColor(delegate.getForeground());
}
Program: 145597
Project: 145597
Buggy source:
@ScriptFunction(jsDocText="String_Node_Str") public Color getBackground(){
  return delegate.getBackground();
}

Fixed version (ground truth):
@ScriptFunction(jsDocText="String_Node_Str") public ScriptColor getBackground(){
  return new ScriptColor(delegate.getBackground());
}
Program: 145598
Project: 145598
Buggy source:
public ScriptColor(int r,int g,int b,int a){
  super(r,g,b,a);
}

Fixed version (ground truth):
public ScriptColor(String aEncoded){
  this(Color.decode(aEncoded));
}
Program: 145599
Project: 145599
Buggy source:
@Override public void execute(){
  if (btn.getParent() instanceof ResizeContainer) {
    ResizeContainer c=(ResizeContainer)btn.getParent();
    Size s=XElement.as(c.getElement().getParentElement()).getSize(true);
    c.setPixelSize(s.getWidth() + 1,s.getHeight());
    c.setPixelSize(s.getWidth() - 1,s.getHeight());
  }
 else   if (btn.getParent() instanceof HasLayout) {
    ((HasLayout)btn.getParent()).forceLayout();
  }
}

Fixed version (ground truth):
@Override public void execute(){
  if (btn.isAttached()) {
    if (btn.getParent() instanceof ResizeContainer) {
      ResizeContainer c=(ResizeContainer)btn.getParent();
      Size s=XElement.as(c.getElement()).getSize(false);
      c.setPixelSize(s.getWidth() - 1,s.getHeight());
      c.setPixelSize(s.getWidth() + 1,s.getHeight());
    }
 else     if (btn.getParent() instanceof RequiresResize) {
      ((RequiresResize)btn.getParent()).onResize();
    }
  }
}
Program: 145603
Project: 145603
Buggy source:
public GxtEventsExecutor(JavaScriptObject aEventThis){
  super();
  eventThis=aEventThis;
}

Fixed version (ground truth):
public GxtEventsExecutor(Component aComponent,JavaScriptObject aEventThis){
  super();
  component=aComponent;
  eventThis=aEventThis;
}
Program: 145604
Project: 145604
Buggy source:
public void cancelBlur(){
  blurring=null;
}

Fixed version (ground truth):
protected void cancelBlur(){
  blurring=null;
}
Program: 145605
Project: 145605
Buggy source:
public PlatypusAdapterField(Field<T> aTarget){
  super(new HorizontalLayoutContainer());
  setPixelSize(150,23);
  target=aTarget;
  target.setTabIndex(1);
  complex=(HorizontalLayoutContainer)getWidget();
  complex.add(target,new HorizontalLayoutData(1,1));
  reRegisterFocusManager();
}

Fixed version (ground truth):
public PlatypusAdapterField(Field<T> aTarget){
  super(new HorizontalLayoutContainer());
  setPixelSize(150,23);
  target=aTarget;
  target.setTabIndex(1);
  complex=(HorizontalLayoutContainer)getWidget();
  complex.add(target,new HorizontalLayoutData(1,1));
  reregisterFocusBlur();
}
Program: 145606
Project: 145606
Buggy source:
@Override public void execute(){
  if (blurring == event)   PlatypusAdapterField.this.fireEvent(event);
}

Fixed version (ground truth):
@Override public void execute(){
  if (event == blurring) {
    PlatypusAdapterField.this.fireEvent(event);
    cancelBlur();
  }
}
Program: 145607
Project: 145607
Buggy source:
@Override public void onFocus(FocusEvent event){
  cancelBlur();
}

Fixed version (ground truth):
@Override public void onFocus(final FocusEvent event){
  if (blurring == null) {
    PlatypusAdapterField.this.fireEvent(event);
  }
 else   cancelBlur();
}
Program: 145608
Project: 145608
Buggy source:
@Override public void onBlur(final BlurEvent event){
  blurring=event;
  Scheduler.get().scheduleDeferred(new ScheduledCommand(){
    @Override public void execute(){
      if (blurring == event)       PlatypusAdapterField.this.fireEvent(event);
    }
  }
);
}

Fixed version (ground truth):
@Override public void onBlur(final BlurEvent event){
  blurring=event;
  Scheduler.get().scheduleDeferred(new ScheduledCommand(){
    @Override public void execute(){
      if (event == blurring) {
        PlatypusAdapterField.this.fireEvent(event);
        cancelBlur();
      }
    }
  }
);
}
Program: 145609
Project: 145609
Buggy source:
public void setOnSelect(JavaScriptObject aSelectFunction){
  if (selectFunction != aSelectFunction) {
    selectFunction=aSelectFunction;
    if (selectFunction != null && getPublishedField() != null) {
      selectButton=new TextButton("String_Node_Str");
      selectButton.setEnabled(editable);
      selectButton.setTabIndex(2);
      complex.add(selectButton,new HorizontalLayoutData(-1,1));
      selectHandlerRegistration=selectButton.addSelectHandler(new SelectHandler(){
        @Override public void onSelect(        SelectEvent event){
          Runnable onSelect=ControlsUtils.createScriptSelector(getEventsThis(),selectFunction,getPublishedField());
          onSelect.run();
          target.focus();
        }
      }
);
    }
 else {
      if (selectButton != null) {
        selectHandlerRegistration.removeHandler();
        selectHandlerRegistration=null;
        selectButton.removeFromParent();
        selectButton=null;
      }
    }
    reRegisterFocusManager();
  }
}

Fixed version (ground truth):
public void setOnSelect(JavaScriptObject aSelectFunction){
  if (selectFunction != aSelectFunction) {
    selectFunction=aSelectFunction;
    if (selectFunction != null && getPublishedField() != null) {
      selectButton=new TextButton("String_Node_Str");
      selectButton.setEnabled(editable);
      selectButton.setTabIndex(2);
      complex.add(selectButton,new HorizontalLayoutData(-1,1));
      selectHandlerRegistration=selectButton.addSelectHandler(new SelectEvent.SelectHandler(){
        @Override public void onSelect(        SelectEvent event){
          Runnable onSelect=ControlsUtils.createScriptSelector(getEventsThis(),selectFunction,getPublishedField());
          onSelect.run();
          target.focus();
        }
      }
);
    }
 else {
      if (selectButton != null) {
        selectHandlerRegistration.removeHandler();
        selectHandlerRegistration=null;
        selectButton.removeFromParent();
        selectButton=null;
      }
    }
    reregisterFocusBlur();
  }
}
Program: 145610
Project: 145610
Buggy source:
public PlatypusHtmlEditor(){
  super();
}

Fixed version (ground truth):
public PlatypusHtmlEditor(){
  super();
  reregisterFocusBlur();
}
Program: 145611
Project: 145611
Buggy source:
protected boolean isValidName(String name){
  try {
    entity.getModel().getParameters().invalidateFieldsHash();
    return !name.isEmpty() && entity.getModel().getParameters().get(name) == null && entity.getModel().getEntityByName(name) == null && ScriptUtils.isValidJsIdentifier(name);
  }
 catch (  Exception ex) {
    ErrorManager.getDefault().notify(ex);
  }
  return false;
}

Fixed version (ground truth):
protected boolean isValidName(String name){
  try {
    entity.getModel().getParameters().invalidateFieldsHash();
    return !name.isEmpty() && entity.getModel().getParameters().get(name) == null && (entity.getModel().getEntityByName(name) == null || getName().equalsIgnoreCase(name)) && ScriptUtils.isValidJsIdentifier(name);
  }
 catch (  Exception ex) {
    ErrorManager.getDefault().notify(ex);
  }
  return false;
}
Program: 145613
Project: 145613
Buggy source:
public static boolean isValidName(Model model,String name){
  try {
    model.getParameters().invalidateFieldsHash();
    return !name.isEmpty() && model.getParameters().get(name) == null && model.getEntityByName(name) == null && ScriptUtils.isValidJsIdentifier(name);
  }
 catch (  Exception ex) {
    ErrorManager.getDefault().notify(ex);
  }
  return false;
}

Fixed version (ground truth):
public boolean isValidName(Model model,String name){
  try {
    model.getParameters().invalidateFieldsHash();
    return !name.isEmpty() && (model.getParameters().get(name) == null || getName().equalsIgnoreCase(name)) && model.getEntityByName(name) == null && ScriptUtils.isValidJsIdentifier(name);
  }
 catch (  Exception ex) {
    ErrorManager.getDefault().notify(ex);
  }
  return false;
}
Program: 145614
Project: 145614
Buggy source:
public boolean deleteRow() throws Exception {
  return delete();
}

Fixed version (ground truth):
@ScriptFunction(jsDocText="String_Node_Str") public boolean deleteRow() throws Exception {
  return delete();
}
Program: 145615
Project: 145615
Buggy source:
@ScriptFunction(jsDocText="String_Node_Str") public boolean delete() throws Exception {
  Rowset rowset=getRowset();
  int oldCount=rowset.size();
  if (oldCount > 0) {
    rowset.delete();
  }
  return oldCount != rowset.size();
}

Fixed version (ground truth):
public boolean delete() throws Exception {
  Rowset rowset=getRowset();
  int oldCount=rowset.size();
  if (oldCount > 0) {
    rowset.delete();
  }
  return oldCount != rowset.size();
}
Program: 145616
Project: 145616
Buggy source:
@Override public Dimension getPreferredSize(){
  Dimension size=super.getPreferredSize();
  if (!isPreferredSizeSet()) {
    for (    Component c : getComponents()) {
      Rectangle b=c.getBounds();
      if (b.x + b.width > size.width) {
        size.width=b.x + b.width;
      }
      if (b.y + b.height > size.height) {
        size.height=b.y + b.height;
      }
    }
    size.width+=EntityView.INSET_ZONE;
    size.height+=EntityView.INSET_ZONE;
  }
  return size;
}

Fixed version (ground truth):
@Override public Dimension getPreferredSize(){
  Dimension size=super.getPreferredSize();
  if (!isPreferredSizeSet()) {
    for (    Component c : getComponents()) {
      Rectangle b=c.getBounds();
      if (b.x + b.width > size.width) {
        size.width=b.x + b.width;
      }
      if (b.y + b.height > size.height) {
        size.height=b.y + b.height;
      }
    }
    size.width+=EntityView.INSET_ZONE * 3;
    size.height+=EntityView.INSET_ZONE * 3;
  }
  return size;
}
Program: 145617
Project: 145617
Buggy source:
protected Filtered filter(ApplicationElement aAppElement) throws Exception {
}

Fixed version (ground truth):
/** 
 * Performs some mutations of a xml content dom. Adds dependencies. Stripes put <source/>tag and so on.
 * @param aAppElement Appelement, whoose content dom to mutated.
 * @return
 * @throws Exception 
 */
protected Filtered filter(ApplicationElement aAppElement) throws Exception {
}
Program: 145618
Project: 145618
Buggy source:
@Override public void init(ServletConfig config) throws ServletException {
  try {
    super.init(config);
    ServerConfig scp=ServerConfig.parse(config);
    Handler consoleHandler=new ConsoleHandler();
    consoleHandler.setFormatter(new PlatypusFormatter());
    Logger logger=Logger.getLogger(Client.APPLICATION_LOGGER_NAME);
    logger.addHandler(consoleHandler);
    logger.setUseParentHandlers(false);
    DatabasesClient serverCoreDbClient=new DatabasesClient(scp.getDbSettings(),true);
    ScriptRunner.PlatypusScriptedResource.init(serverCoreDbClient.getAppCache());
    serverCore=new PlatypusServerCore(serverCoreDbClient,scp.getTasks(),scp.getAppElementId());
    serverCoreDbClient.setContextHost(serverCore);
    serverCoreDbClient.setPrincipalHost(serverCore);
    if (System.getProperty(ScriptRunner.DEBUG_PROPERTY) != null) {
      Debugger debugger;
      debugger=Debugger.initialize(false);
      unRegisterMBean(DebuggerMBean.DEBUGGER_MBEAN_NAME);
      registerMBean(DebuggerMBean.DEBUGGER_MBEAN_NAME,debugger);
      unRegisterMBean(Breakpoints.BREAKPOINTS_MBEAN_NAME);
      registerMBean(Breakpoints.BREAKPOINTS_MBEAN_NAME,Breakpoints.getInstance());
      unRegisterMBean(Settings.SETTINGS_MBEAN_NAME);
      registerMBean(Settings.SETTINGS_MBEAN_NAME,new Settings(serverCoreDbClient));
    }
    serverCore.startBackgroundTasks();
  }
 catch (  Exception ex) {
    throw new ServletException(ex);
  }
}

Fixed version (ground truth):
@Override public void init(ServletConfig config) throws ServletException {
  try {
    super.init(config);
    ServerConfig scp=ServerConfig.parse(config);
    Handler consoleHandler=new ConsoleHandler();
    consoleHandler.setFormatter(new PlatypusFormatter());
    Logger logger=Logger.getLogger(Client.APPLICATION_LOGGER_NAME);
    logger.addHandler(consoleHandler);
    logger.setUseParentHandlers(false);
    DatabasesClient serverCoreDbClient=new DatabasesClient(scp.getDbSettings(),true);
    ScriptRunner.PlatypusScriptedResource.init(serverCoreDbClient.getAppCache());
    serverCore=new PlatypusServerCore(serverCoreDbClient,scp.getTasks(),scp.getAppElementId());
    serverCoreDbClient.setContextHost(serverCore);
    serverCoreDbClient.setPrincipalHost(serverCore);
    ScriptUtils.getScope().defineProperty(ServerScriptRunner.MODULES_SCRIPT_NAME,serverCore.getScriptsCache(),ScriptableObject.READONLY);
    if (System.getProperty(ScriptRunner.DEBUG_PROPERTY) != null) {
      Debugger debugger;
      debugger=Debugger.initialize(false);
      unRegisterMBean(DebuggerMBean.DEBUGGER_MBEAN_NAME);
      registerMBean(DebuggerMBean.DEBUGGER_MBEAN_NAME,debugger);
      unRegisterMBean(Breakpoints.BREAKPOINTS_MBEAN_NAME);
      registerMBean(Breakpoints.BREAKPOINTS_MBEAN_NAME,Breakpoints.getInstance());
      unRegisterMBean(Settings.SETTINGS_MBEAN_NAME);
      registerMBean(Settings.SETTINGS_MBEAN_NAME,new Settings(serverCoreDbClient));
    }
    serverCore.startBackgroundTasks();
  }
 catch (  Exception ex) {
    throw new ServletException(ex);
  }
}
Program: 145620
Project: 145620
Buggy source:
@Override protected void definePropertiesAndMethods(){
  super.definePropertiesAndMethods();
  defineProperty(MODULES_SCRIPT_NAME,serverCore.getScriptsCache(),ScriptableObject.READONLY);
  defineFunctionProperties(new String[]{"String_Node_Str","String_Node_Str"},ServerScriptRunner.class,EMPTY);
}

Fixed version (ground truth):
@Override protected void definePropertiesAndMethods(){
  super.definePropertiesAndMethods();
  defineFunctionProperties(new String[]{"String_Node_Str","String_Node_Str"},ServerScriptRunner.class,EMPTY);
}
Program: 145621
Project: 145621
Buggy source:
public static int getWidgetHeight(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetHeight();
}

Fixed version (ground truth):
public static int getWidgetHeight(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof SimpleContainer && aWidget.getParent().getParent() instanceof FieldSet) {
    aWidget=aWidget.getParent().getParent();
  }
  if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetHeight();
}
Program: 145622
Project: 145622
Buggy source:
public static int getWidgetWidth(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetWidth();
}

Fixed version (ground truth):
public static int getWidgetWidth(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof SimpleContainer && aWidget.getParent().getParent() instanceof FieldSet) {
    aWidget=aWidget.getParent().getParent();
  }
  if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetWidth();
}
Program: 145623
Project: 145623
Buggy source:
public static int getWidgetTop(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetTop();
}

Fixed version (ground truth):
public static int getWidgetTop(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof SimpleContainer && aWidget.getParent().getParent() instanceof FieldSet) {
    aWidget=aWidget.getParent().getParent();
  }
  if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetTop();
}
Program: 145624
Project: 145624
Buggy source:
public static int getWidgetLeft(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetLeft();
}

Fixed version (ground truth):
public static int getWidgetLeft(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof SimpleContainer && aWidget.getParent().getParent() instanceof FieldSet) {
    aWidget=aWidget.getParent().getParent();
  }
  if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetLeft();
}
Program: 145625
Project: 145625
Buggy source:
@Override public void onMouseMove(MouseMoveEvent event){
  event.stopPropagation();
  if (mouseState == MOUSE.NULL || mouseState == MOUSE.MOVED) {
    mouseState=MOUSE.MOVED;
    executeEvent(eventThis,mouseMoved,null);
  }
 else   if (mouseState == MOUSE.PRESSED || mouseState == MOUSE.DRAGGED) {
    mouseState=MOUSE.DRAGGED;
    executeEvent(eventThis,mouseDragged,JSEvents.publishMouseMoveEvent(event));
  }
}

Fixed version (ground truth):
@Override public void onMouseMove(MouseMoveEvent event){
  if (mouseMoved != null || mouseDragged != null) {
    event.stopPropagation();
    if (mouseState == MOUSE.NULL || mouseState == MOUSE.MOVED) {
      mouseState=MOUSE.MOVED;
      executeEvent(eventThis,mouseMoved,null);
    }
 else     if (mouseState == MOUSE.PRESSED || mouseState == MOUSE.DRAGGED) {
      mouseState=MOUSE.DRAGGED;
      executeEvent(eventThis,mouseDragged,JSEvents.publishMouseMoveEvent(event));
    }
  }
}