nus-yam/ex-repair huggingface dataset:
Program: 150478
Project: 150478
Buggy source:
public SqlTextArea(){
  setTabSize(2);
  setTabsEmulated(true);
  setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL);
  setMarkOccurrences(true);
  setAnimateBracketMatching(false);
  setAutoIndentEnabled(true);
  setCurrentLineHighlightColor(new Color(232,242,254));
  setMarkOccurrencesColor(new Color(220,220,220));
  setMatchedBracketBGColor(null);
  setMatchedBracketBorderColor(new Color(192,192,192));
  getActionMap().put("String_Node_Str",new RSyntaxTextAreaEditorKit.CopyAsRtfAction());
  Font editorFont=getFont().deriveFont(UIManager.getFont("String_Node_Str").getSize2D());
  SyntaxScheme syntaxScheme=getSyntaxScheme();
  syntaxScheme.setStyle(Token.SEPARATOR,new Style(new Color(200,0,0),null));
  syntaxScheme.setStyle(Token.RESERVED_WORD,new Style(Color.BLUE,null,editorFont));
  setFont(new Font("String_Node_Str",editorFont.getStyle(),editorFont.getSize()));
  addKeyListener(new KeyAdapter(){
    @Override public void keyPressed(    KeyEvent e){
      boolean isControlDown=e.isControlDown();
      boolean isShiftDown=e.isShiftDown();
switch (e.getKeyCode()) {
case KeyEvent.VK_P:
        if (isControlDown && isShiftDown) {
          int position=RSyntaxUtilities.getMatchingBracketPosition(SqlTextArea.this);
          if (position >= 0) {
            setCaretPosition(position + 1);
          }
        }
      break;
case KeyEvent.VK_F:
    if (isControlDown && isShiftDown) {
      formatSelection();
    }
  break;
}
}
}
);
}

Fixed version (ground truth):
public SqlTextArea(){
  setTabSize(2);
  setTabsEmulated(true);
  setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL);
  setMarkOccurrences(true);
  setAnimateBracketMatching(false);
  setAutoIndentEnabled(true);
  setCurrentLineHighlightColor(new Color(232,242,254));
  setMarkOccurrencesColor(new Color(220,220,220));
  setMatchedBracketBGColor(null);
  setMatchedBracketBorderColor(new Color(192,192,192));
  getActionMap().put("String_Node_Str",new RSyntaxTextAreaEditorKit.CopyAsRtfAction());
  Font editorFont=UIManager.getFont("String_Node_Str");
  editorFont=new Font("String_Node_Str",editorFont.getStyle(),editorFont.getSize());
  SyntaxScheme syntaxScheme=getSyntaxScheme();
  syntaxScheme.setStyle(Token.SEPARATOR,new Style(new Color(200,0,0),null));
  syntaxScheme.setStyle(Token.RESERVED_WORD,new Style(Color.BLUE,null,editorFont));
  setFont(editorFont);
  addKeyListener(new KeyAdapter(){
    @Override public void keyPressed(    KeyEvent e){
      boolean isControlDown=e.isControlDown();
      boolean isShiftDown=e.isShiftDown();
switch (e.getKeyCode()) {
case KeyEvent.VK_P:
        if (isControlDown && isShiftDown) {
          int position=RSyntaxUtilities.getMatchingBracketPosition(SqlTextArea.this);
          if (position >= 0) {
            setCaretPosition(position + 1);
          }
        }
      break;
case KeyEvent.VK_F:
    if (isControlDown && isShiftDown) {
      formatSelection();
    }
  break;
}
}
}
);
}
Program: 150479
Project: 150479
Buggy source:
/** 
 * Get the returning record in those dialects that do not support fetching arbitrary fields from JDBC's   {@link Statement#getGeneratedKeys()} method.
 */
@SuppressWarnings("String_Node_Str") private final void selectReturning(Configuration configuration,Object... values){
  if (values != null && values.length > 0) {
    if (into.getIdentity() != null) {
      Field<Number> field=(Field<Number>)into.getIdentity().getField();
      Number[] ids=new Number[values.length];
      for (int i=0; i < values.length; i++) {
        ids[i]=field.getDataType().convert(values[i]);
      }
      if (returning.size() == 1 && returning.get(0).equals(field)) {
        for (        Number id : ids) {
          R typed=Utils.newRecord(into,configuration);
          ((AbstractRecord)typed).setValue(field,new Value<Number>(id));
          getReturnedRecords().add(typed);
        }
      }
 else {
        returned=create(configuration).select(returning).from(into).where(field.in(ids)).fetchInto(into);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Get the returning record in those dialects that do not support fetching arbitrary fields from JDBC's   {@link Statement#getGeneratedKeys()} method.
 */
@SuppressWarnings("String_Node_Str") private final void selectReturning(Configuration configuration,Object... values){
  if (values != null && values.length > 0) {
    if (into.getIdentity() != null) {
      Field<Number> field=(Field<Number>)into.getIdentity().getField();
      Number[] ids=new Number[values.length];
      for (int i=0; i < values.length; i++) {
        ids[i]=field.getDataType().convert(values[i]);
      }
      if (returning.size() == 1 && returning.get(0).equals(field)) {
        for (        Number id : ids) {
          R typed=Utils.newRecord(into,configuration);
          ((AbstractRecord)typed).setValue(field,new Value<Number>(id));
          getReturnedRecords().add(typed);
        }
      }
 else {
        returned=create(configuration).select(returning).from(into).where(field.in(ids)).fetchInto(into);
      }
    }
 else {
      final Field<Object> idField=field(null);
      final ResultImpl<R> result=new ResultImpl<R>(configuration,idField);
      for (      final Object value : values) {
        final Record record=Utils.newRecord(RecordImpl.class,new Field[]{idField});
        record.setValue(idField,value);
        result.addRecord((R)record);
      }
      returned=result;
    }
  }
}
Program: 150481
Project: 150481
Buggy source:
@Override public SQLDialect getSQLDialect(){
  return ctx.getDialect();
}

Fixed version (ground truth):
@Override public SQLDialect getSQLDialect(){
  return ctx.configuration().getDialect();
}
Program: 150482
Project: 150482
Buggy source:
@Override public LocalStatementExecutor createBreakpointHitStatementExecutor(long threadID){
  final ExecuteContext ctx;
synchronized (threadIDToExecuteContextMap) {
    ctx=threadIDToExecuteContextMap.get(threadID);
    if (ctx == null) {
      return null;
    }
  }
  return new LocalStatementExecutor(new QueryExecutorContext(){
    @Override public boolean isReadOnly(){
      return false;
    }
    @Override public Connection getConnection(){
      return ctx.connection();
    }
    @Override public void releaseConnection(    Connection connection){
    }
    @Override public SQLDialect getSQLDialect(){
      return ctx.getDialect();
    }
    @Override public String[] getTableNames(){
      return LocalDebugger.this.getTableNames();
    }
    @Override public String[] getTableColumnNames(){
      return LocalDebugger.this.getTableColumnNames();
    }
  }
);
}

Fixed version (ground truth):
@Override public LocalStatementExecutor createBreakpointHitStatementExecutor(long threadID){
  final ExecuteContext ctx;
synchronized (threadIDToExecuteContextMap) {
    ctx=threadIDToExecuteContextMap.get(threadID);
    if (ctx == null) {
      return null;
    }
  }
  return new LocalStatementExecutor(new QueryExecutorContext(){
    @Override public boolean isReadOnly(){
      return false;
    }
    @Override public Connection getConnection(){
      return ctx.connection();
    }
    @Override public void releaseConnection(    Connection connection){
    }
    @Override public SQLDialect getSQLDialect(){
      return ctx.configuration().getDialect();
    }
    @Override public String[] getTableNames(){
      return LocalDebugger.this.getTableNames();
    }
    @Override public String[] getTableColumnNames(){
      return LocalDebugger.this.getTableColumnNames();
    }
  }
);
}
Program: 150483
Project: 150483
Buggy source:
/** 
 * Specify a set of field names whose values should be interned. <p> See   {@link Result#intern(int)} for more details.
 * @param fields The field names whose values should be interned
 * @return The same result
 * @see Result#intern(Field)
 * @see String#intern()
 */
Result<R> intern(String... fieldNames);

Fixed version (ground truth):
/** 
 * Specify a set of field names whose values should be interned. <p> See   {@link Result#intern(int)} for more details.
 * @param fieldNames The field names whose values should be interned
 * @return The same result
 * @see Result#intern(Field)
 * @see String#intern()
 */
Result<R> intern(String... fieldNames);
Program: 150484
Project: 150484
Buggy source:
/** 
 * Specify a set of field names whose values should be interned. <p> Unlike   {@link Result}'s <code>intern()</code> methods, this already interns values right after fetching them from a JDBC result set. See  {@link Result#intern(int)} for more details.
 * @param fields The field names whose values should be interned
 * @return The same result query
 * @see Result#intern(String)
 * @see String#intern()
 */
ResultQuery<R> intern(String... fieldNames);

Fixed version (ground truth):
/** 
 * Specify a set of field names whose values should be interned. <p> Unlike   {@link Result}'s <code>intern()</code> methods, this already interns values right after fetching them from a JDBC result set. See  {@link Result#intern(int)} for more details.
 * @param fieldNames The field names whose values should be interned
 * @return The same result query
 * @see Result#intern(String)
 * @see String#intern()
 */
ResultQuery<R> intern(String... fieldNames);
Program: 150485
Project: 150485
Buggy source:
/** 
 * <p>Returns padding using the specified delimiter repeated to a given length.</p> <pre> StringUtils.padding(0, 'e')  = "" StringUtils.padding(3, 'e')  = "eee" StringUtils.padding(-2, 'e') = IndexOutOfBoundsException </pre> <p>Note: this method doesn't not support padding with <a href="http://www.unicode.org/glossary/#supplementary_character">Unicode Supplementary Characters</a> as they require a pair of <code>char</code>s to be represented. If you are needing to support full I18N of your applications consider using   {@link #repeat(String,int)} instead.</p>
 * @param repeat  number of times to repeat delim
 * @param padChar  character to repeat
 * @return String with repeated character
 * @throws IndexOutOfBoundsException if <code>repeat &lt; 0</code>
 * @see #repeat(String,int)
 */
private static String padding(int repeat,char padChar) throws IndexOutOfBoundsException {
  if (repeat < 0) {
    throw new IndexOutOfBoundsException("String_Node_Str" + repeat);
  }
  final char[] buf=new char[repeat];
  for (int i=0; i < buf.length; i++) {
    buf[i]=padChar;
  }
  return new String(buf);
}

Fixed version (ground truth):
/** 
 * <p>Returns padding using the specified delimiter repeated to a given length.</p> <pre> StringUtils.padding(0, 'e')  = "" StringUtils.padding(3, 'e')  = "eee" StringUtils.padding(-2, 'e') = IndexOutOfBoundsException </pre> <p>Note: this method doesn't not support padding with <a href="http://www.unicode.org/glossary/#supplementary_character">Unicode Supplementary Characters</a> as they require a pair of <code>char</code>s to be represented. If you are needing to support full I18N of your applications consider using   {@link #repeat(String,int)} instead.</p>
 * @param repeat  number of times to repeat delim
 * @param padChar  character to repeat
 * @return String with repeated character
 * @throws IndexOutOfBoundsException if <code>repeat &lt; 0</code>
 */
private static String padding(int repeat,char padChar) throws IndexOutOfBoundsException {
  if (repeat < 0) {
    throw new IndexOutOfBoundsException("String_Node_Str" + repeat);
  }
  final char[] buf=new char[repeat];
  for (int i=0; i < buf.length; i++) {
    buf[i]=padChar;
  }
  return new String(buf);
}
Program: 150486
Project: 150486
Buggy source:
private final void init(){
  try {
    Result<Record> columns=executor.fetch(meta().getColumns(null,getSchema().getName(),getName(),"String_Node_Str"));
    for (    Record column : columns) {
      String columnName=column.getValue("String_Node_Str",String.class);
      String typeName=column.getValue("String_Node_Str",String.class);
      int precision=column.getValue("String_Node_Str",int.class);
      int scale=column.getValue("String_Node_Str",int.class);
      DataType<?> type=null;
      try {
        type=DefaultDataType.getDataType(executor.getDialect(),typeName,precision,scale);
        if (type.hasPrecision()) {
          type=type.precision(precision);
        }
        if (type.hasScale()) {
          type=type.scale(scale);
        }
        if (type.hasLength()) {
          type=type.length(precision);
        }
      }
 catch (      SQLDialectNotSupportedException e) {
        type=SQLDataType.OTHER;
      }
      createField(columnName,type,this);
    }
  }
 catch (  SQLException e) {
    throw new DataAccessException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private final void init(){
  try {
    String searchName=executor.getDialect() == ORACLE ? getName().replace("String_Node_Str","String_Node_Str") : getName();
    Result<Record> columns=executor.fetch(meta().getColumns(null,getSchema().getName(),searchName,"String_Node_Str"));
    for (    Record column : columns) {
      String columnName=column.getValue("String_Node_Str",String.class);
      String typeName=column.getValue("String_Node_Str",String.class);
      int precision=column.getValue("String_Node_Str",int.class);
      int scale=column.getValue("String_Node_Str",int.class);
      DataType<?> type=null;
      try {
        type=DefaultDataType.getDataType(executor.getDialect(),typeName,precision,scale);
        if (type.hasPrecision()) {
          type=type.precision(precision);
        }
        if (type.hasScale()) {
          type=type.scale(scale);
        }
        if (type.hasLength()) {
          type=type.length(precision);
        }
      }
 catch (      SQLDialectNotSupportedException e) {
        type=SQLDataType.OTHER;
      }
      createField(columnName,type,this);
    }
  }
 catch (  SQLException e) {
    throw new DataAccessException("String_Node_Str",e);
  }
}
Program: 150488
Project: 150488
Buggy source:
public static <T>DataType<T> getDataType(SQLDialect dialect,Class<T> type){
switch (dialect) {
case ASE:
    return ASEDataType.getDataType(type);
case CUBRID:
  return CUBRIDDataType.getDataType(type);
case DB2:
return DB2DataType.getDataType(type);
case DERBY:
return DerbyDataType.getDataType(type);
case H2:
return H2DataType.getDataType(type);
case HSQLDB:
return HSQLDBDataType.getDataType(type);
case INGRES:
return IngresDataType.getDataType(type);
case MYSQL:
return MySQLDataType.getDataType(type);
case ORACLE:
return OracleDataType.getDataType(type);
case POSTGRES:
return PostgresDataType.getDataType(type);
case SQLITE:
return SQLiteDataType.getDataType(type);
case SQLSERVER:
return SQLServerDataType.getDataType(type);
case SYBASE:
return SybaseDataType.getDataType(type);
default :
return SQLDataType.getDataType(null,type);
}
}

Fixed version (ground truth):
public static <T>DataType<T> getDataType(SQLDialect dialect,Class<T> type){
switch (dialect) {
case ASE:
    return ASEDataType.getDataType(type);
case CUBRID:
  return CUBRIDDataType.getDataType(type);
case DB2:
return DB2DataType.getDataType(type);
case DERBY:
return DerbyDataType.getDataType(type);
case FIREBIRD:
return FirebirdDataType.getDataType(type);
case H2:
return H2DataType.getDataType(type);
case HSQLDB:
return HSQLDBDataType.getDataType(type);
case INGRES:
return IngresDataType.getDataType(type);
case MYSQL:
return MySQLDataType.getDataType(type);
case ORACLE:
return OracleDataType.getDataType(type);
case POSTGRES:
return PostgresDataType.getDataType(type);
case SQLITE:
return SQLiteDataType.getDataType(type);
case SQLSERVER:
return SQLServerDataType.getDataType(type);
case SYBASE:
return SybaseDataType.getDataType(type);
default :
return SQLDataType.getDataType(null,type);
}
}
Program: 150489
Project: 150489
Buggy source:
static String postgresArrayString(Object[] value){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  String separator="String_Node_Str";
  for (  Object o : value) {
    sb.append(separator);
    if (o == null) {
      sb.append(o);
    }
 else {
      sb.append("String_Node_Str");
      sb.append(o.toString().replaceAll("String_Node_Str","String_Node_Str"));
      sb.append("String_Node_Str");
    }
    separator="String_Node_Str";
  }
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
static String postgresArrayString(Object[] value){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  String separator="String_Node_Str";
  for (  Object o : value) {
    sb.append(separator);
    if (o == null) {
      sb.append(o);
    }
 else {
      sb.append("String_Node_Str");
      sb.append(o.toString().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str"));
      sb.append("String_Node_Str");
    }
    separator="String_Node_Str";
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 150490
Project: 150490
Buggy source:
public void evaluateInternal(final String sql){
  southPanel.removeAll();
  southPanel.revalidate();
  southPanel.repaint();
  SwingUtilities.invokeLater(new Runnable(){
    @Override public void run(){
      final int maxDisplayedRowCount=((Number)displayedRowCountField.getValue()).intValue();
      Thread evaluationThread=new Thread("String_Node_Str"){
        @Override public void run(){
          evaluate_unrestricted_nothread(sql,maxDisplayedRowCount);
        }
      }
;
      evaluationThread.start();
    }
  }
);
}

Fixed version (ground truth):
public void evaluateInternal(final String sql){
  southPanel.removeAll();
  southPanel.revalidate();
  southPanel.repaint();
  SwingUtilities.invokeLater(new Runnable(){
    @Override public void run(){
      final int maxDisplayedRowCount=((Number)displayedRowCountField.getValue()).intValue();
      final boolean isUpdatable=isUsingMaxRowCount;
      Thread evaluationThread=new Thread("String_Node_Str"){
        @Override public void run(){
          evaluate_unrestricted_nothread(sql,maxDisplayedRowCount,isUpdatable);
        }
      }
;
      evaluationThread.start();
    }
  }
);
}
Program: 150492
Project: 150492
Buggy source:
@Override public void keyPressed(KeyEvent e){
switch (e.getKeyCode()) {
case KeyEvent.VK_PAGE_UP:
case KeyEvent.VK_PAGE_DOWN:
case KeyEvent.VK_UP:
case KeyEvent.VK_DOWN:
case KeyEvent.VK_HOME:
case KeyEvent.VK_END:
case KeyEvent.VK_ESCAPE:
    return;
case KeyEvent.VK_ENTER:
  editorTextArea.replaceRange(((CompletionCandidate)jList.getSelectedValue()).toString(),getWordStart(),editorTextArea.getCaretPosition());
w.setVisible(false);
return;
}
editorTextArea.dispatchEvent(new KeyEvent(editorTextArea,e.getID(),e.getWhen(),e.getModifiers(),e.getKeyCode(),e.getKeyChar(),e.getKeyLocation()));
if (e.getKeyChar() != KeyEvent.CHAR_UNDEFINED || e.getKeyCode() == KeyEvent.VK_LEFT || e.getKeyCode() == KeyEvent.VK_RIGHT) {
adjustListContent();
}
}

Fixed version (ground truth):
@Override public void keyPressed(KeyEvent e){
switch (e.getKeyCode()) {
case KeyEvent.VK_PAGE_UP:
case KeyEvent.VK_PAGE_DOWN:
case KeyEvent.VK_UP:
case KeyEvent.VK_DOWN:
case KeyEvent.VK_HOME:
case KeyEvent.VK_END:
    return;
case KeyEvent.VK_ESCAPE:
  w.setVisible(false);
return;
case KeyEvent.VK_ENTER:
editorTextArea.replaceRange(((CompletionCandidate)jList.getSelectedValue()).toString(),getWordStart(),editorTextArea.getCaretPosition());
w.setVisible(false);
return;
}
editorTextArea.dispatchEvent(new KeyEvent(editorTextArea,e.getID(),e.getWhen(),e.getModifiers(),e.getKeyCode(),e.getKeyChar(),e.getKeyLocation()));
if (e.getKeyChar() != KeyEvent.CHAR_UNDEFINED || e.getKeyCode() == KeyEvent.VK_LEFT || e.getKeyCode() == KeyEvent.VK_RIGHT) {
adjustListContent();
}
}
Program: 150494
Project: 150494
Buggy source:
public QueryExecution execute(String sql,int maxRSRowsParsing,int retainParsedRSDataRowCountThreshold);

Fixed version (ground truth):
public QueryExecution execute(String sql,int maxRSRowsParsing,int retainParsedRSDataRowCountThreshold,boolean isUpdatable);
Program: 150495
Project: 150495
Buggy source:
@Override public QueryExecution execute(String sql,int maxRSRowsParsing,int retainParsedRSDataRowCountThreshold){
  return debugger.getCommunicationInterface().syncSend(new CMS_doStatementExecutorExecution(id,sql,maxRSRowsParsing,retainParsedRSDataRowCountThreshold));
}

Fixed version (ground truth):
@Override public QueryExecution execute(String sql,int maxRSRowsParsing,int retainParsedRSDataRowCountThreshold,boolean isUpdatable){
  return debugger.getCommunicationInterface().syncSend(new CMS_doStatementExecutorExecution(id,sql,maxRSRowsParsing,retainParsedRSDataRowCountThreshold,isUpdatable));
}
Program: 150497
Project: 150497
Buggy source:
CMS_doStatementExecutorExecution(int id,String sql,int maxRSRowsParsing,int retainParsedRSDataRowCountThreshold){
  this.id=id;
  this.sql=sql;
  this.maxRSRowsParsing=maxRSRowsParsing;
  this.retainParsedRSDataRowCountThreshold=retainParsedRSDataRowCountThreshold;
}

Fixed version (ground truth):
CMS_doStatementExecutorExecution(int id,String sql,int maxRSRowsParsing,int retainParsedRSDataRowCountThreshold,boolean isUpdatable){
  this.id=id;
  this.sql=sql;
  this.maxRSRowsParsing=maxRSRowsParsing;
  this.retainParsedRSDataRowCountThreshold=retainParsedRSDataRowCountThreshold;
  this.isUpdatable=isUpdatable;
}
Program: 150498
Project: 150498
Buggy source:
/** 
 * Convert this record into an array of a given component type.
 */
@SuppressWarnings("String_Node_Str") private final <T>T intoArray(Object[] result,Class<?> componentType){
  int size=getFields().size();
  if (size > result.length) {
    result=(Object[])Array.newInstance(componentType,size);
  }
  for (int i=0; i < size; i++) {
    result[i]=Convert.convert(getValue(i),componentType);
  }
  return (T)result;
}

Fixed version (ground truth):
/** 
 * Convert this record into an array of a given component type.
 */
private final Object[] intoArray(Object[] result,Class<?> componentType){
  int size=getFields().size();
  if (size > result.length) {
    result=(Object[])Array.newInstance(componentType,size);
  }
  for (int i=0; i < size; i++) {
    result[i]=Convert.convert(getValue(i),componentType);
  }
  return result;
}
Program: 150499
Project: 150499
Buggy source:
@Override public final Object getObject(String columnLabel,Map<String,Class<?>> map) throws SQLException {
  return ctx.resultSet().getObject(columnLabel,map);
}

Fixed version (ground truth):
@Override public <T>T getObject(String columnLabel,Class<T> type) throws SQLException {
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 150500
Project: 150500
Buggy source:
@Test public void testPlainSQLWithQueryParts() throws Exception {
  String sql="String_Node_Str";
  QueryPart[] parts={val(1),name(TAuthor_ID().getName()),name(TAuthor().getName()),name(TAuthor_ID().getName()),inline(1)};
  Record author=create().select(val(1),TAuthor_ID()).from(TAuthor()).where(TAuthor_ID().equal(1)).fetchOne();
  Record record=create().fetchOne(sql,parts);
  Result<Record> result=create().fetch(sql,parts);
  Cursor<Record> cursor=create().fetchLazy(sql,parts);
  List<Result<Record>> many=create().fetchMany(sql,parts);
  assertEquals(author,record);
  assertEquals(author,result.get(0));
  assertEquals(author,cursor.fetchOne());
  assertEquals(author,many.get(0).get(0));
}

Fixed version (ground truth):
@Test public void testPlainSQLWithQueryParts() throws Exception {
  String sql="String_Node_Str";
  QueryPart[] parts={val("String_Node_Str"),name(TAuthor_LAST_NAME().getName()),name(TAuthor().getName()),name(TAuthor_ID().getName()),inline(1)};
  Record author=create().select(val("String_Node_Str"),TAuthor_LAST_NAME()).from(TAuthor()).where(TAuthor_ID().equal(1)).fetchOne();
  Record record=create().fetchOne(sql,parts);
  Result<Record> result=create().fetch(sql,parts);
  Cursor<Record> cursor=create().fetchLazy(sql,parts);
  assertEquals(author,record);
  assertEquals(author,result.get(0));
  assertEquals(author,cursor.fetchOne());
}
Program: 150502
Project: 150502
Buggy source:
public StatementProcessor getStatementProcessor(){
  return new StatementProcessor((StatementProcessor.ProcessorExecutionType)processorTypeComboBox.getSelectedItem(),processorTextField.getText());
}

Fixed version (ground truth):
public StatementProcessor getStatementProcessor(){
  StatementProcessor.ProcessorExecutionType type=(StatementProcessor.ProcessorExecutionType)processorTypeComboBox.getSelectedItem();
  return new StatementProcessor(type,type == StatementProcessor.ProcessorExecutionType.STATIC ? processorStaticSQLTextArea.getText() : processorTextField.getText());
}
Program: 150503
Project: 150503
Buggy source:
public final Connection getConnection(){
  if (!connectionInitialised) {
    connectionInitialised=true;
    connection=getConnection0(null,null);
    boolean runConsoleInProcess=false;
    if (runConsoleInProcess) {
      try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        Debugger debugger=new ClientDebugger("String_Node_Str",DEBUGGER_PORT);
        Console console=new Console(debugger,true);
        console.setLoggingActive(true);
        console.setVisible(true);
      }
 catch (      Exception ignore) {
      }
    }
  }
  return connection;
}

Fixed version (ground truth):
public final Connection getConnection(){
  if (!connectionInitialised) {
    connectionInitialised=true;
    connection=getConnection0(null,null);
    boolean runConsoleInProcess=false;
    if (runConsoleInProcess) {
      try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        Debugger debugger=new ClientDebugger("String_Node_Str",DEBUGGER_PORT);
        Console console=new Console(debugger,true,true);
        console.setLoggingActive(true);
        console.setVisible(true);
      }
 catch (      Exception ignore) {
      }
    }
  }
  return connection;
}
Program: 150504
Project: 150504
Buggy source:
public Object syncSend(Message message){
  Thread thread=Thread.currentThread();
  long threadID=thread.getId();
  ThreadInfo threadInfo=new ThreadInfo();
  boolean isAdded;
synchronized (idToThreadInfo) {
    isAdded=idToThreadInfo.put(threadID,threadInfo) != null;
  }
  CM_asyncExec asyncExec=new CM_asyncExec();
  asyncExec.setArgs(threadID,message);
  asyncSend(asyncExec);
  CommandResultMessage commandResultMessage=null;
synchronized (threadInfo) {
    while (commandResultMessage == null) {
      while (!threadInfo.isValuePresent()) {
        try {
          threadInfo.wait();
        }
 catch (        Exception e) {
        }
        if (!isAlive()) {
          idToThreadInfo.remove(threadID);
          printFailedInvocation(message);
          return null;
        }
      }
      Message value=threadInfo.getMessage();
      if (value instanceof CommandResultMessage) {
        commandResultMessage=(CommandResultMessage)value;
      }
 else {
        commandResultMessage=runMessage(value);
      }
    }
  }
  if (isAdded) {
synchronized (idToThreadInfo) {
      idToThreadInfo.remove(threadID);
    }
  }
  return processCommandResult(commandResultMessage);
}

Fixed version (ground truth):
public Object syncSend(Message message){
  Thread thread=Thread.currentThread();
  long threadID=thread.getId();
  ThreadInfo threadInfo=new ThreadInfo();
  boolean isAdded;
synchronized (idToThreadInfo) {
    isAdded=idToThreadInfo.put(threadID,threadInfo) == null;
  }
  CM_asyncExec asyncExec=new CM_asyncExec();
  asyncExec.setArgs(threadID,message);
  asyncSend(asyncExec);
  CommandResultMessage commandResultMessage=null;
synchronized (threadInfo) {
    while (commandResultMessage == null) {
      while (!threadInfo.isValuePresent()) {
        try {
          threadInfo.wait();
        }
 catch (        Exception e) {
        }
        if (!isAlive()) {
          idToThreadInfo.remove(threadID);
          printFailedInvocation(message);
          return null;
        }
      }
      Message value=threadInfo.getMessage();
      if (value instanceof CommandResultMessage) {
        commandResultMessage=(CommandResultMessage)value;
      }
 else {
        commandResultMessage=runMessage(value);
      }
    }
  }
  if (isAdded) {
synchronized (idToThreadInfo) {
      idToThreadInfo.remove(threadID);
    }
  }
  return processCommandResult(commandResultMessage);
}
Program: 150506
Project: 150506
Buggy source:
@Test public void testRelationalDivision(){
  int id=create().select().from(TBookToBookStore().divideBy(TBookStore()).on(TBookToBookStore_BOOK_STORE_NAME().equal(TBookStore_NAME())).returning(TBookToBookStore_BOOK_ID())).fetchOne(0,Integer.class);
  assertEquals(3,id);
  Table<?> notAllBookStores=create().select().from(TBookStore()).where(TBookStore_NAME().notEqual("String_Node_Str")).asTable("String_Node_Str");
  Result<?> result=create().select().from(TBookToBookStore().divideBy(notAllBookStores).on(TBookToBookStore_BOOK_STORE_NAME().equal(notAllBookStores.getField(TBookStore_NAME()))).returning(TBookToBookStore_BOOK_ID(),field("String_Node_Str").as("String_Node_Str"))).orderBy(1).fetch();
  assertEquals(asList((Object)1,"String_Node_Str"),asList(result.get(0).intoArray()));
  assertEquals(asList((Object)3,"String_Node_Str"),asList(result.get(1).intoArray()));
}

Fixed version (ground truth):
@Test public void testRelationalDivision() throws Exception {
  int id=create().select().from(TBookToBookStore().divideBy(TBookStore()).on(TBookToBookStore_BOOK_STORE_NAME().equal(TBookStore_NAME())).returning(TBookToBookStore_BOOK_ID())).fetchOne(0,Integer.class);
  assertEquals(3,id);
  Table<?> notAllBookStores=create().select().from(TBookStore()).where(TBookStore_NAME().notEqual("String_Node_Str")).asTable("String_Node_Str");
  Result<?> result=create().select().from(TBookToBookStore().divideBy(notAllBookStores).on(TBookToBookStore_BOOK_STORE_NAME().equal(notAllBookStores.getField(TBookStore_NAME()))).returning(TBookToBookStore_BOOK_ID(),field("String_Node_Str").as("String_Node_Str"))).orderBy(1).fetch();
  assertEquals(asList((Object)1,"String_Node_Str"),asList(result.get(0).intoArray()));
  assertEquals(asList((Object)3,"String_Node_Str"),asList(result.get(1).intoArray()));
}
Program: 150510
Project: 150510
Buggy source:
@Test public void testInverseAndNestedJoin() throws Exception {
  if (getDialect() == SQLITE) {
    log.info("String_Node_Str","String_Node_Str");
    return;
  }
  Result<Record> result1=create().select(TAuthor_ID(),TBook_ID(),TBookStore_NAME()).from(TAuthor().join(TBook()).on(TAuthor_ID().equal(TBook_AUTHOR_ID()))).join(TBookToBookStore().join(TBookStore()).on(TBookToBookStore_BOOK_STORE_NAME().equal(TBookStore_NAME()))).on(TBook_ID().equal(TBookToBookStore_BOOK_ID())).orderBy(TBook_ID(),TBookStore_NAME()).fetch();
  assertEquals(6,result1.size());
  assertEquals(asList(1,1,1,2,2,2),result1.getValues(0));
  assertEquals(asList(1,1,2,3,3,3),result1.getValues(1));
  assertEquals(asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),result1.getValues(2));
  Result<Record> result2=create().select(TAuthor_ID(),TBook_ID(),TBookStore_NAME()).from(TAuthor().join(TBook()).on(TAuthor_ID().equal(TBook_AUTHOR_ID())),TBookToBookStore().join(TBookStore()).on(TBookToBookStore_BOOK_STORE_NAME().equal(TBookStore_NAME()))).where(TBook_ID().equal(TBookToBookStore_BOOK_ID())).orderBy(TBook_ID(),TBookStore_NAME()).fetch();
  assertEquals(6,result2.size());
  assertEquals(asList(1,1,1,2,2,2),result2.getValues(0));
  assertEquals(asList(1,1,2,3,3,3),result2.getValues(1));
  assertEquals(asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),result2.getValues(2));
  assertEquals(result1,result2);
}

Fixed version (ground truth):
@Test public void testInverseAndNestedJoin() throws Exception {
  if (getDialect() == SQLITE || getDialect() == CUBRID) {
    log.info("String_Node_Str","String_Node_Str");
    return;
  }
  Result<Record> result1=create().select(TAuthor_ID(),TBook_ID(),TBookStore_NAME()).from(TAuthor().join(TBook()).on(TAuthor_ID().equal(TBook_AUTHOR_ID()))).join(TBookToBookStore().join(TBookStore()).on(TBookToBookStore_BOOK_STORE_NAME().equal(TBookStore_NAME()))).on(TBook_ID().equal(TBookToBookStore_BOOK_ID())).orderBy(TBook_ID(),TBookStore_NAME()).fetch();
  assertEquals(6,result1.size());
  assertEquals(asList(1,1,1,2,2,2),result1.getValues(0));
  assertEquals(asList(1,1,2,3,3,3),result1.getValues(1));
  assertEquals(asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),result1.getValues(2));
  Result<Record> result2=create().select(TAuthor_ID(),TBook_ID(),TBookStore_NAME()).from(TAuthor().join(TBook()).on(TAuthor_ID().equal(TBook_AUTHOR_ID())),TBookToBookStore().join(TBookStore()).on(TBookToBookStore_BOOK_STORE_NAME().equal(TBookStore_NAME()))).where(TBook_ID().equal(TBookToBookStore_BOOK_ID())).orderBy(TBook_ID(),TBookStore_NAME()).fetch();
  assertEquals(6,result2.size());
  assertEquals(asList(1,1,1,2,2,2),result2.getValues(0));
  assertEquals(asList(1,1,2,3,3,3),result2.getValues(1));
  assertEquals(asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),result2.getValues(2));
  assertEquals(result1,result2);
}
Program: 150512
Project: 150512
Buggy source:
@Override protected final void prepare(ExecuteContext ctx) throws SQLException {
  Connection connection=ctx.getConnection();
  if (ctx.getDialect() == SQLDialect.ASE) {
    ctx.statement(connection.prepareStatement(ctx.sql(),Statement.RETURN_GENERATED_KEYS));
    return;
  }
 else   if (returning.isEmpty()) {
    super.prepare(ctx);
    return;
  }
 else {
switch (ctx.getDialect()) {
case POSTGRES:
case SQLITE:
case SYBASE:
      super.prepare(ctx);
    return;
case ASE:
case CUBRID:
case DERBY:
case H2:
case INGRES:
case MYSQL:
case SQLSERVER:
  ctx.statement(connection.prepareStatement(ctx.sql(),Statement.RETURN_GENERATED_KEYS));
return;
default :
{
List<String> names=new ArrayList<String>();
for (Field<?> field : returning) {
  names.add(field.getName());
}
ctx.statement(connection.prepareStatement(ctx.sql(),names.toArray(new String[names.size()])));
return;
}
}
}
}

Fixed version (ground truth):
@Override protected final void prepare(ExecuteContext ctx) throws SQLException {
  Connection connection=ctx.getConnection();
  if (ctx.getDialect() == SQLDialect.ASE) {
    ctx.statement(connection.prepareStatement(ctx.sql(),Statement.RETURN_GENERATED_KEYS));
    return;
  }
 else   if (returning.isEmpty()) {
    super.prepare(ctx);
    return;
  }
 else {
switch (ctx.getDialect()) {
case POSTGRES:
case SQLITE:
case CUBRID:
case SYBASE:
      super.prepare(ctx);
    return;
case ASE:
case DERBY:
case H2:
case INGRES:
case MYSQL:
case SQLSERVER:
  ctx.statement(connection.prepareStatement(ctx.sql(),Statement.RETURN_GENERATED_KEYS));
return;
default :
{
List<String> names=new ArrayList<String>();
for (Field<?> field : returning) {
  names.add(field.getName());
}
ctx.statement(connection.prepareStatement(ctx.sql(),names.toArray(new String[names.size()])));
return;
}
}
}
}
Program: 150514
Project: 150514
Buggy source:
@Override final Field<T> getFunction0(Configuration configuration){
switch (configuration.getDialect()) {
case ASE:
    return function("String_Node_Str",getDataType(),literal("String_Node_Str"),val(value),field);
case DB2:
case HSQLDB:
  return field.add(field("String_Node_Str",BigDecimal.class,value));
case DERBY:
return new FnPrefixFunction<T>("String_Node_Str",getDataType(),field("String_Node_Str"),val(value.intValue()),field);
case INGRES:
return field.add(field("String_Node_Str" + value + "String_Node_Str",BigDecimal.class));
case MYSQL:
return function("String_Node_Str",getDataType(),field("String_Node_Str"),val(value),field);
case POSTGRES:
return field.add(field("String_Node_Str" + value + "String_Node_Str",BigDecimal.class));
case SQLITE:
return function("String_Node_Str",getDataType(),field,val("String_Node_Str" + value + "String_Node_Str"));
default :
return field.add(val(value));
}
}

Fixed version (ground truth):
@Override final Field<T> getFunction0(Configuration configuration){
switch (configuration.getDialect()) {
case ASE:
    return function("String_Node_Str",getDataType(),literal("String_Node_Str"),val(value),field);
case CUBRID:
  return function("String_Node_Str",getDataType(),field,val(value));
case DB2:
case HSQLDB:
return field.add(field("String_Node_Str",BigDecimal.class,value));
case DERBY:
return new FnPrefixFunction<T>("String_Node_Str",getDataType(),field("String_Node_Str"),val(value.intValue()),field);
case INGRES:
return field.add(field("String_Node_Str" + value + "String_Node_Str",BigDecimal.class));
case MYSQL:
return function("String_Node_Str",getDataType(),field("String_Node_Str"),val(value),field);
case POSTGRES:
return field.add(field("String_Node_Str" + value + "String_Node_Str",BigDecimal.class));
case SQLITE:
return function("String_Node_Str",getDataType(),field,val("String_Node_Str" + value + "String_Node_Str"));
default :
return field.add(val(value));
}
}
Program: 150515
Project: 150515
Buggy source:
@Override final Field<T> getFunction0(Configuration configuration){
switch (configuration.getDialect()) {
case ASE:
    return function("String_Node_Str",getDataType(),literal("String_Node_Str"),val(-value.intValue()),field);
case DB2:
case HSQLDB:
  return field.sub(field("String_Node_Str",BigDecimal.class,value));
case DERBY:
return new FnPrefixFunction<T>("String_Node_Str",getDataType(),field("String_Node_Str"),val(-value.intValue()),field);
case INGRES:
return field.sub(field("String_Node_Str" + value + "String_Node_Str",BigDecimal.class));
case MYSQL:
return function("String_Node_Str",getDataType(),field("String_Node_Str"),val(-value.intValue()),field);
case POSTGRES:
return field.sub(field("String_Node_Str" + value + "String_Node_Str",BigDecimal.class));
case SQLITE:
return function("String_Node_Str",getDataType(),field,val("String_Node_Str" + value + "String_Node_Str"));
default :
return field.sub(val(value));
}
}

Fixed version (ground truth):
@Override final Field<T> getFunction0(Configuration configuration){
switch (configuration.getDialect()) {
case ASE:
    return function("String_Node_Str",getDataType(),literal("String_Node_Str"),val(-value.intValue()),field);
case CUBRID:
  return function("String_Node_Str",getDataType(),field,val(value));
case DB2:
case HSQLDB:
return field.sub(field("String_Node_Str",BigDecimal.class,value));
case DERBY:
return new FnPrefixFunction<T>("String_Node_Str",getDataType(),field("String_Node_Str"),val(-value.intValue()),field);
case INGRES:
return field.sub(field("String_Node_Str" + value + "String_Node_Str",BigDecimal.class));
case MYSQL:
return function("String_Node_Str",getDataType(),field("String_Node_Str"),val(-value.intValue()),field);
case POSTGRES:
return field.sub(field("String_Node_Str" + value + "String_Node_Str",BigDecimal.class));
case SQLITE:
return function("String_Node_Str",getDataType(),field,val("String_Node_Str" + value + "String_Node_Str"));
default :
return field.sub(val(value));
}
}
Program: 150516
Project: 150516
Buggy source:
protected TableField<D,Byte> TDirectory_IS_DIRECTORY(){
  return delegate.TDirectory_IS_DIRECTORY();
}

Fixed version (ground truth):
protected TableField<D,Integer> TDirectory_IS_DIRECTORY(){
  return delegate.TDirectory_IS_DIRECTORY();
}
Program: 150517
Project: 150517
Buggy source:
@Test public void testConnectByDirectory() throws Exception {
switch (getDialect()) {
case ASE:
case DB2:
case DERBY:
case H2:
case HSQLDB:
case INGRES:
case MYSQL:
case POSTGRES:
case SQLITE:
case SQLSERVER:
case SYBASE:
    log.info("String_Node_Str","String_Node_Str");
  return;
}
List<?> paths=create().select(substring(sysConnectByPath(TDirectory_NAME(),"String_Node_Str"),2)).from(TDirectory()).where(trueCondition()).and(trueCondition()).connectBy(prior(TDirectory_ID()).equal(TDirectory_PARENT_ID())).startWith(TDirectory_PARENT_ID().isNull()).orderBy(one()).fetch(0);
assertEquals(26,paths.size());
assertEquals(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),paths);
}

Fixed version (ground truth):
@Test public void testConnectByDirectory() throws Exception {
switch (getDialect()) {
case ASE:
case DB2:
case DERBY:
case H2:
case HSQLDB:
case INGRES:
case MYSQL:
case POSTGRES:
case SQLITE:
case SQLSERVER:
case SYBASE:
    log.info("String_Node_Str","String_Node_Str");
  return;
}
List<?> paths=create().select(substring(sysConnectByPath(lower(TDirectory_NAME()),"String_Node_Str"),2).as("String_Node_Str")).from(TDirectory()).where(trueCondition()).and(trueCondition()).connectBy(prior(TDirectory_ID()).equal(TDirectory_PARENT_ID())).startWith(TDirectory_PARENT_ID().isNull()).orderBy(1).fetch(0);
assertEquals(25,paths.size());
assertEquals(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),paths);
}
Program: 150521
Project: 150521
Buggy source:
@Test public void testFetchLater() throws Exception {
  Future<Result<B>> later;
  Result<B> result;
  int activeCount=Thread.activeCount();
  later=create().selectFrom(TBook()).orderBy(TBook_ID()).fetchLater();
  assertFalse(later.isDone());
  assertFalse(later.isCancelled());
  assertEquals(activeCount + 1,Thread.activeCount());
  result=later.get();
  Thread.sleep(500);
  assertEquals(activeCount,Thread.activeCount());
  result=later.get();
  result=later.get(1000,TimeUnit.MILLISECONDS);
  assertEquals(4,result.size());
  assertEquals(BOOK_IDS,result.getValues(TBook_ID()));
  later=create().selectFrom(TBook()).orderBy(TBook_ID()).fetchLater();
  later=create().selectFrom(TBook()).orderBy(TBook_ID()).fetchLater();
  later=create().selectFrom(TBook()).orderBy(TBook_ID()).fetchLater();
  later=create().selectFrom(TBook()).orderBy(TBook_ID()).fetchLater();
  assertEquals(activeCount + 4,Thread.activeCount());
  later=null;
  System.gc();
  System.gc();
  Thread.sleep(500);
  assertEquals(activeCount,Thread.activeCount());
}

Fixed version (ground truth):
@Test public void testFetchLater() throws Exception {
  Future<Result<B>> later;
  Result<B> result;
  int activeCount=Thread.activeCount();
  later=create().selectFrom(TBook()).orderBy(TBook_ID()).fetchLater();
  assertFalse(later.isDone());
  assertFalse(later.isCancelled());
  assertEquals(activeCount + 1,Thread.activeCount());
  result=later.get();
  Thread.sleep(500);
  assertEquals(activeCount,Thread.activeCount());
  result=later.get();
  result=later.get(1000,TimeUnit.MILLISECONDS);
  assertEquals(4,result.size());
  assertEquals(BOOK_IDS,result.getValues(TBook_ID()));
  later=create().selectFrom(TBook()).orderBy(TBook_ID()).fetchLater();
  later=create().selectFrom(TBook()).orderBy(TBook_ID()).fetchLater();
  later=create().selectFrom(TBook()).orderBy(TBook_ID()).fetchLater();
  assertEquals(activeCount + 3,Thread.activeCount());
  later=null;
  System.gc();
  System.gc();
  Thread.sleep(500);
  assertEquals(activeCount,Thread.activeCount());
}
Program: 150522
Project: 150522
Buggy source:
@Test public void testSystemFunctions() throws Exception {
  if (getDialect() == SQLDialect.SQLITE) {
    log.info("String_Node_Str","String_Node_Str");
    return;
  }
  Field<?> user=trim(lower(currentUser()));
  Record record=create().select(user).fetchOne();
  assertTrue(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").contains(record.getValue(user)));
}

Fixed version (ground truth):
@Test public void testSystemFunctions() throws Exception {
  if (getDialect() == SQLDialect.SQLITE) {
    log.info("String_Node_Str","String_Node_Str");
    return;
  }
  Field<?> user=trim(lower(currentUser()));
  Record record=create().select(user).fetchOne();
  assertTrue(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").contains(record.getValue(user)));
}
Program: 150524
Project: 150524
Buggy source:
@Override protected TableField<T_639NumbersTableRecord,Byte> T639_BYTE(){
  return T_639NumbersTable.BYTE;
}

Fixed version (ground truth):
@Override protected TableField<T_639NumbersTableRecord,Byte> T639_BYTE(){
  return null;
}
Program: 150525
Project: 150525
Buggy source:
private static Time getTime(SQLDialect dialect,ResultSet rs,int index) throws SQLException {
  if (dialect == SQLDialect.SQLITE) {
    String time=rs.getString(index);
    if (time != null) {
      return new Time(parse("String_Node_Str",time));
    }
    return null;
  }
 else {
    return rs.getTime(index);
  }
}

Fixed version (ground truth):
private static Time getTime(SQLDialect dialect,ResultSet rs,int index) throws SQLException {
  if (dialect == SQLDialect.SQLITE) {
    String time=rs.getString(index);
    if (time != null) {
      return new Time(parse("String_Node_Str",time));
    }
    return null;
  }
 else   if (dialect == CUBRID) {
    Time time=rs.getTime(index);
    if (time != null) {
      Calendar cal=Calendar.getInstance();
      cal.setTimeInMillis(time.getTime());
      cal.set(Calendar.MILLISECOND,0);
      time=new Time(cal.getTimeInMillis());
    }
    return time;
  }
 else {
    return rs.getTime(index);
  }
}
Program: 150526
Project: 150526
Buggy source:
private static Date getDate(SQLDialect dialect,ResultSet rs,int index) throws SQLException {
  if (dialect == SQLDialect.SQLITE) {
    String date=rs.getString(index);
    if (date != null) {
      return new Date(parse("String_Node_Str",date));
    }
    return null;
  }
 else   if (dialect == CUBRID) {
    Date date=rs.getDate(index);
    if (date != null) {
      date=new Date((rs.getDate(index).getTime() / 1000) * 1000);
    }
    return date;
  }
 else {
    return rs.getDate(index);
  }
}

Fixed version (ground truth):
private static Date getDate(SQLDialect dialect,ResultSet rs,int index) throws SQLException {
  if (dialect == SQLDialect.SQLITE) {
    String date=rs.getString(index);
    if (date != null) {
      return new Date(parse("String_Node_Str",date));
    }
    return null;
  }
 else   if (dialect == CUBRID) {
    Date date=rs.getDate(index);
    if (date != null) {
      Calendar cal=Calendar.getInstance();
      cal.setTimeInMillis(date.getTime());
      cal.set(Calendar.MILLISECOND,0);
      date=new Date(cal.getTimeInMillis());
    }
    return date;
  }
 else {
    return rs.getDate(index);
  }
}
Program: 150527
Project: 150527
Buggy source:
@Override public void stateChanged(ChangeEvent e){
  if (!isAdjusting && editorTabbedPane.getSelectedIndex() == editorTabbedPane.getTabCount() - 1) {
    addSQLEditorPane(databaseDescriptor);
  }
}

Fixed version (ground truth):
@Override public void stateChanged(ChangeEvent e){
  int selectedIndex=editorTabbedPane.getSelectedIndex();
  Component tabComponent2=editorTabbedPane.getTabComponentAt(selectedIndex);
  closeLabel.setVisible(tabComponent2 == tabComponent && editorTabbedPane.getTabCount() > 2);
}
Program: 150529
Project: 150529
Buggy source:
@Override public void run(){
  startButton.setVisible(true);
  stopButton.setVisible(false);
}

Fixed version (ground truth):
@Override public void run(){
  startButton.setVisible(true);
  stopButton.setVisible(false);
  stopButton.setToolTipText(null);
}