nus-yam/ex-repair huggingface dataset:
Buggy code:
public class MSVSSCHECKOUT extends MSVSS { private String m_LocalPath = null ; private boolean m_Recursive = false ; private String m_Version = null ; private String m_Date = null ; private String m_Label = null ; private String m_AutoResponse = null ; public void execute ( ) throws BuildException { } public void setLocalpath ( Path localPath ) { } public void getLocalpathCommand ( Commandline cmd ) { if ( ( m_LocalPath ) == null ) { return ; } else { File dir = project . resolveFile ( m_LocalPath ) ; if ( ! ( dir . exists ( ) ) ) { boolean done = dir . mkdirs ( ) ; <START_BUG> if ( done == false ) { <END_BUG> String msg = ( ( "Directory<seq2seq4repair_space>" + ( m_LocalPath ) ) + "<seq2seq4repair_space>creation<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>" ) + "succesful<seq2seq4repair_space>for<seq2seq4repair_space>an<seq2seq4repair_space>unknown<seq2seq4repair_space>reason" ; throw new BuildException ( msg , location ) ; } project . log ( ( "Created<seq2seq4repair_space>dir:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; } cmd . createArgument ( ) . setValue ( ( ( FLAG_OVERRIDE_WORKING_DIR ) + ( m_LocalPath ) ) ) ; } } public void setRecursive ( boolean recursive ) { } public void getRecursiveCommand ( Commandline cmd ) { } public void setVersion ( String version ) { } public void setDate ( String date ) { } public void setLabel ( String label ) { } public void getVersionCommand ( Commandline cmd ) { } public void setAutoresponse ( String response ) { } public void getAutoresponse ( Commandline cmd ) { } }

Fix:
if ( ! done ) {
Buggy code:
public class WireMockServer { public static final String FILES_ROOT = "__files" ; public static final int DEFAULT_PORT = 8080 ; private static final String FILES_URL_MATCH = String . format ( "//%s//*" , WireMockServer . FILES_ROOT ) ; private WireMockApp wireMockApp ; private Server jettyServer ; private final FileSource fileSource ; private final Log4jNotifier notifier ; private final int port ; public WireMockServer ( int port , FileSource fileSource ) { } public WireMockServer ( int port ) { } public WireMockServer ( ) { } public void loadMappingsUsing ( final MappingsLoader mappingsLoader ) { } public void addMockServiceRequestListener ( RequestListener listener ) { } public void setVerboseLogging ( boolean verbose ) { } public void enableRecordMappings ( FileSource mappingsFileSource , FileSource filesFileSource ) { } public void stop ( ) { } public void start ( ) { } @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) private void addMockServiceContext ( ) { Context mockServiceContext = new Context ( jettyServer , "//" ) ; Map initParams = Maps . newHashMap ( ) ; initParams . put ( "org.mortbay.jetty.servlet.Default.maxCacheSize" , "0" ) ; initParams . put ( "org.mortbay.jetty.servlet.Default.resourceBase" , fileSource . getPath ( ) ) ; initParams . put ( "org.mortbay.jetty.servlet.Default.dirAllowed" , "false" ) ; mockServiceContext . setInitParams ( initParams ) ; mockServiceContext . addServlet ( DefaultServlet . class , WireMockServer . FILES_URL_MATCH ) ; mockServiceContext . setAttribute ( MockServiceRequestHandler . class . getName ( ) , wireMockApp . getMockServiceRequestHandler ( ) ) ; mockServiceContext . setAttribute ( KEY , notifier ) ; ServletHolder servletHolder = mockServiceContext . addServlet ( HandlerDispatchingServlet . class , "//" ) ; servletHolder . setInitParameter ( HANDLER_CLASS_KEY , MockServiceRequestHandler . class . getName ( ) ) ; MimeTypes mimeTypes = new MimeTypes ( ) ; mimeTypes . addMimeMapping ( "json" , "application//json" ) ; mimeTypes . addMimeMapping ( "html" , "text//html" ) ; mimeTypes . addMimeMapping ( "xml" , "application//xml" ) ; mimeTypes . addMimeMapping ( "txt" , "text//plain" ) ; mockServiceContext . setMimeTypes ( mimeTypes ) ; mockServiceContext . setWelcomeFiles ( new String [ ] { "index.json" , "index.html" , "index.xml" , "index.txt" } ) ; mockServiceContext . addFilter ( ContentTypeSettingFilter . class , WireMockServer . FILES_URL_MATCH , FORWARD ) ; <START_BUG> mockServiceContext . addFilter ( TrailingSlashFilter . class , WireMockServer . FILES_URL_MATCH , REQUEST ) ; <END_BUG> jettyServer . addHandler ( mockServiceContext ) ; } private void addAdminContext ( ) { } }

Fix:
mockServiceContext . addFilter ( TrailingSlashFilter . class , WireMockServer . FILES_URL_MATCH , ALL ) ;
Buggy code:
public class CreateCategoryActivity extends Activity implements ColorPickerSwatch . OnColorSelectedListener { private EditText etName ; private ImageButton ibColor ; private Button bOk ; private Button bCancel ; private LetterImageView liv ; private ColorPickerDialog dialog ; private String name ; private char letter ; private int color ; private int id ; private boolean expense ; private CategoryDatabase cdb ; private DeleteCategoryDialog deleteDialog ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void initUI ( ) { } private void init ( ) { } private void fillUIValues ( ) { } private void setUpUI ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { if ( ( id ) != ( - 1 ) ) { final MenuItem delete = menu . add ( getResources ( ) . getString ( action_delete ) ) . setIcon ( getResources ( ) . getDrawable ( ic_menu_delete ) ) ; delete . setShowAsAction ( SHOW_AS_ACTION_ALWAYS ) ; delete . setOnMenuItemClickListener ( new MenuItem . OnMenuItemClickListener ( ) { @ Override public boolean onMenuItemClick ( MenuItem menuItem ) { MoneyDatabase mdb = new MoneyDatabase ( CreateCategoryActivity . this ) ; if ( mdb . CategoryHasItems ( name , expense ) ) { <START_BUG> deleteDialog = new DeleteCategoryDialog ( name , expense ) ; <END_BUG> deleteDialog . show ( getFragmentManager ( ) , "Delete" ) ; } else { cdb . deleteCategory ( name , expense ) ; Toast . makeText ( CreateCategoryActivity . this , ( ( ( name ) + "<seq2seq4repair_space>" ) + ( getResources ( ) . getString ( toast_category_deleted ) ) ) , LENGTH_SHORT ) . show ( ) ; finish ( ) ; } mdb . close ( ) ; return false ; } } ) ; } return true ; } @ Override public void onColorSelected ( int color ) { } }

Fix:
deleteDialog = DeleteCategoryDialog . newInstance ( name , expense ) ;
Buggy code:
public abstract class WicketTestCase extends TestCase { public WicketTester application ; public WicketTestCase ( String name ) { } protected void setUp ( ) throws Exception { } protected void executeTest ( final Class pageClass , final String filename ) throws Exception { } protected void executedListener ( final Class pageClass , final Component component , final String filename ) throws Exception { } protected void executedBehavior ( final Class pageClass , final AbstractAjaxBehavior behavior , final String filename ) throws Exception { assertNotNull ( behavior ) ; System . out . println ( ( ( ( ( "===<seq2seq4repair_space>" + ( pageClass . getName ( ) ) ) + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( behavior . toString ( ) ) ) + "<seq2seq4repair_space>===" ) ) ; application . setupRequestAndResponse ( ) ; WebRequestCycle cycle = application . createRequestCycle ( ) ; <START_BUG> application . getServletRequest ( ) . setRequestToRedirectString ( behavior . getCallbackUrl ( false ) . toString ( ) ) ; <END_BUG> application . processRequestCycle ( cycle ) ; String document = application . getServletResponse ( ) . getDocument ( ) ; assertTrue ( DiffUtil . validatePage ( document , pageClass , filename ) ) ; } }

Fix:
application . getServletRequest ( ) . setRequestToRedirectString ( behavior . getCallbackUrl ( false , false ) . toString ( ) ) ;
Buggy code:
public class DBUserController extends DBControl { private static DBUserController instance ; private DBUserController ( ) { } public static synchronized DBUserController getInstance ( ) { } public String getLastName ( String email ) { } public String getFirstName ( String email ) { } public Address getAddress ( String email ) { } public Date getBirthday ( String email ) { } public boolean setLastName ( String lastName , String email ) { } public boolean setFirstName ( String firstName , String email ) { } public boolean setAddress ( DBAddress address , String email ) { DataSource ds = getDataSource ( ) ; Connection c = DataSourceUtils . getConnection ( ds ) ; try { PreparedStatement ps = c . prepareStatement ( "UPDATE<seq2seq4repair_space>users<seq2seq4repair_space>SET<seq2seq4repair_space>AddressID=?<seq2seq4repair_space>WHERE<seq2seq4repair_space>Email=?" ) ; <START_BUG> ps . setInt ( 1 , address . getId ( ) ) ; <END_BUG> ps . setString ( 2 , email ) ; ps . executeUpdate ( ) ; ps . close ( ) ; c . close ( ) ; DataSourceUtils . releaseConnection ( c , ds ) ; } catch ( SQLException ex ) { LOGGER . logException ( ex , "" ) ; return false ; } finally { releaseConnection ( ds , c ) ; } return true ; } public boolean setBirthday ( Date birthday , String email ) { } public boolean verificationIDIsValid ( String verificationID ) { } public boolean verifyEmail ( String verificationID ) { } private String getEmailFromVerification ( String id ) { } public boolean addVerificationData ( String email , String verificationID ) { } public boolean userIsRegistered ( String email ) throws UserNotFoundException { } public boolean addUser ( User user , String hash ) { } @ Deprecated public boolean addUser ( User user , String userRole , String hash ) { } public boolean removeUser ( User user ) { } public boolean changeToUser ( User user , String hash ) { } }

Fix:
ps . setInt ( 1 , address . getID ( ) ) ;
Buggy code:
public class DatatypeValidatorFactoryImpl implements DatatypeValidatorFactory { private static final boolean fDebug = false ; private Hashtable fRegistry ; private Hashtable fDTDDatatypeRegistry ; private Hashtable fSchemaDatatypeRegistry ; private byte fRegistryExpanded = 0 ; private byte fSchemaValidation = 0 ; public DatatypeValidatorFactoryImpl ( ) { } public void initializeDTDRegistry ( ) { } public void expandRegistryToFullSchemaSet ( ) { } public void resetRegistry ( ) { } public DatatypeValidator createDatatypeValidator ( String typeName , DatatypeValidator base , Hashtable facets , boolean list ) { } public DatatypeValidator createDatatypeValidator ( String typeName , Vector validators ) { DatatypeValidator simpleType = null ; if ( validators != null ) { <START_BUG> simpleType = new UnionDatatypeValidator ( validators ) ; <END_BUG> } if ( simpleType != null ) { registerUserDefinedValidator ( typeName , simpleType ) ; } return simpleType ; } public DatatypeValidator getDatatypeValidator ( String type ) { } private DatatypeValidator createSchemaDatatypeValidator ( String typeName , DatatypeValidator base , Hashtable facets , boolean list ) { } private DatatypeValidator createDTDDatatypeValidator ( String typeName , DatatypeValidator base , Hashtable facets , boolean list ) { } private DatatypeValidator createSchemaValidator ( String typeName , DatatypeValidator base , Hashtable facets , boolean list ) { } private void registerUserDefinedValidator ( String typeName , DatatypeValidator simpleType ) { } private void registerSchemaValidator ( String typeName , DatatypeValidator simpleType ) { } private void registerDTDValidator ( String typeName , DatatypeValidator simpleType ) { } private static Object createDatatypeValidator ( Constructor validatorConstructor , Object [ ] arguments ) { } }

Fix:
simpleType = new UnionDatatypeValidator ( validators , null ) ;
Buggy code:
public final class Main { private final Log log = LogFactory . getLog ( Main . class ) ; public static void main ( String [ ] args ) { } private void start ( ) { } private Thread getSchedulerThread ( Injector injector ) { <START_BUG> Thread scheduler = new Thread ( injector . getInstance ( Scheduler . class ) ) ; <END_BUG> scheduler . setName ( "HdfsScheduler" ) ; scheduler . setUncaughtExceptionHandler ( getUncaughtExceptionHandler ( ) ) ; return scheduler ; } private Thread . UncaughtExceptionHandler getUncaughtExceptionHandler ( ) { } }

Fix:
Thread scheduler = new Thread ( injector . getInstance ( HdfsScheduler . class ) ) ;
Buggy code:
public class Star extends VisibleObject { private RotateTransition rotateTransition ; private RotateTransition endTransition ; private FadeTransition fadeTransition ; private boolean oscillating ; private boolean shooting ; public boolean gone = false ; public Star ( int dx , Group group ) { } public void update ( ) { setDt ( ( ( getDt ( ) ) + 6 ) ) ; <START_BUG> if ( ( getX ( ) ) < 0 ) { <END_BUG> gone ( ) ; } if ( oscillating ) { setDy ( ( 4 * ( Math . sin ( ( ( ( getDt ( ) ) * ( Math . PI ) ) // 180 ) ) ) ) ) ; } if ( shooting ) { } updateX ( ) ; updateY ( ) ; syncCoords ( ) ; } public void removeStar ( ) { } public void gone ( ) { } }

Fix:
if ( ( getX ( ) ) < ( 0 - ( getWidth ( ) ) ) ) {
Buggy code:
public class SQLJoinTableSource extends SQLTableSourceImpl { private static final long serialVersionUID = 1L ; protected SQLTableSource left ; protected SQLJoinTableSource . JoinType joinType ; protected SQLTableSource right ; protected SQLExpr condition ; public SQLJoinTableSource ( String alias ) { } public SQLJoinTableSource ( ) { } protected void accept0 ( SQLASTVisitor visitor ) { } public SQLJoinTableSource . JoinType getJoinType ( ) { } public void setJoinType ( SQLJoinTableSource . JoinType joinType ) { } public SQLTableSource getLeft ( ) { } public void setLeft ( SQLTableSource left ) { } public SQLTableSource getRight ( ) { } public void setRight ( SQLTableSource right ) { } public SQLExpr getCondition ( ) { } public void setCondition ( SQLExpr condition ) { } public void output ( StringBuffer buf ) { } @ Override public String getTablename ( ) { <START_BUG> return null ; <END_BUG> } public static enum JoinType { COMMA ( "," ) , JOIN ( "JOIN" ) , INNER_JOIN ( "INNER<seq2seq4repair_space>JOIN" ) , CROSS_JOIN ( "CROSS<seq2seq4repair_space>JOIN" ) , NATURAL_JOIN ( "NATURAL<seq2seq4repair_space>JOIN" ) , NATURAL_INNER_JOIN ( "NATURAL<seq2seq4repair_space>INNER<seq2seq4repair_space>JOIN" ) , LEFT_OUTER_JOIN ( "LEFT<seq2seq4repair_space>JOIN" ) , RIGHT_OUTER_JOIN ( "RIGHT<seq2seq4repair_space>JOIN" ) , FULL_OUTER_JOIN ( "FULL<seq2seq4repair_space>JOIN" ) , STRAIGHT_JOIN ( "STRAIGHT_JOIN" ) ; public final String name ; JoinType ( String name ) { } public static String toString ( SQLJoinTableSource . JoinType joinType ) { } } }

Fix:
return this . toString ( ) . replace ( "<seq2seq4repair_space>" , "" ) ;
Buggy code:
public class HtmlPage extends Page { private static final long serialVersionUID = 3986701406378811908L ; protected HtmlPage ( ) { } public final String getMarkupType ( ) { } protected final BookmarkablePageLink homePageLink ( final String componentName ) { <START_BUG> return new BookmarkablePageLink ( componentName , getApplicationSettings ( ) . getHomePage ( ) ) ; <END_BUG> } }

Fix:
return new BookmarkablePageLink ( componentName , getApplicationPages ( ) . getHomePage ( ) ) ;
Buggy code:
public class Rule { private static final String DOUBLE_QUOTE = "\"" ; public static final String ALL = "ALL" ; private static final String HASH_INCLUDE = "#include" ; private static final Map < NameType , Map < RuleType , Map < String , List < Rule > > > > RULES = new EnumMap < NameType , Map < RuleType , Map < String , List < Rule > > > > ( NameType . class ) ; public static List < Rule > instance ( NameType nameType , RuleType rt , Set < String > langs ) { if ( ( langs . size ( ) ) == 1 ) { return Rule . instance ( nameType , rt , langs . iterator ( ) . next ( ) ) ; } else { <START_BUG> return Rule . instance ( nameType , rt , "any" ) ; <END_BUG> } } public static List < Rule > instance ( NameType nameType , RuleType rt , String lang ) { } private static Scanner mkScanner ( NameType nameType , RuleType rt , String lang ) { } private static Scanner mkScanner ( String lang ) { } private static List < Rule > parseRules ( Scanner scanner ) { } private static String stripQuotes ( String str ) { } private final Set < String > languages ; private final Pattern lContext ; private final String logical ; private final String pattern ; private final String phoneme ; private final Pattern rContext ; public Rule ( String pattern , String lContext , String rContext , String phoneme , Set < String > languages , String logical ) { } public Set < String > getLanguages ( ) { } public Pattern getLContext ( ) { } public String getLogical ( ) { } public String getPattern ( ) { } public String getPhoneme ( ) { } public Pattern getRContext ( ) { } public boolean languageMatches ( Set < String > languageArg ) { } public boolean patternAndContextMatches ( String input , int i ) { } }

Fix:
return Rule . instance ( nameType , rt , Languages . ANY ) ;
Buggy code:
public class TestNorwegianMinimalStemFilter extends BaseTokenStreamTestCase { private Analyzer analyzer = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } ; public void testVocabulary ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { Random random = random ( ) ; <START_BUG> checkRandomData ( random , analyzer , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random , analyzer , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
final class CommandListenerWrapper implements ICommandListener { private final BindingManager bindingManager ; private final ICommandListener listener ; CommandListenerWrapper ( final org . eclipse . ui . commands . ICommandListener listener , final BindingManager bindingManager ) { } public final void commandChanged ( final CommandEvent commandEvent ) { } public final boolean equals ( final Object object ) { <START_BUG> if ( object instanceof SchemeListenerWrapper ) { <END_BUG> final CommandListenerWrapper wrapper = ( ( CommandListenerWrapper ) ( object ) ) ; return listener . equals ( wrapper . listener ) ; } if ( object instanceof org . eclipse . ui . commands . ICommandListener ) { final org . eclipse . ui . commands . ICommandListener other = ( ( org . eclipse . ui . commands . ICommandListener ) ( object ) ) ; return listener . equals ( other ) ; } return false ; } public final int hashCode ( ) { } }

Fix:
if ( object instanceof CommandListenerWrapper ) {
Buggy code:
public class WCapoResourceEditor extends WTabWidget { private static final String XML_CONTENT_TYPE = "xml" ; private static final String HEX_CONTENT_TYPE = "hex" ; private static final String SHELL_CONTENT_TYPE = "sh" ; private static final String MIMETYPE_IMAGE_PREFIX = "image//" ; private static final String APPLICATION_X_SHELLSCRIPT = "application//x-shellscript" ; private static final String EXTENTION_DELIMITER = "." ; private static final String EMPTY_STRING = "" ; private Object model = null ; private WTableView attributeTableView ; private WContainerWidget detailsContainerWidget ; private String content = null ; private String contentType = null ; private ContentFormatType contentFormatType = null ; private String mimeType = null ; private long length = 0L ; private WLink downloadLink ; private WPushButton createContentPushButton ; private WAceEditor aceEditor ; private WAceEditor formattedContentDisplay ; private WFileUpload upload ; private WContainerWidget historyContainerWidget ; private WTableView historyTableView ; private Signal modelChanged = new Signal ( ) ; private WDiffWidget diffWidget ; private String currentVersionName = "" ; public void setContent ( String content , String contentType , ContentFormatType contentFormatType , String mimeType , Long length ) { } private WAceEditor getFormattedContentDisplay ( ) { } private WAceEditor getAceEditor ( ) { } private void save ( String content ) { } public String getContent ( ) { } public void setModel ( Object model ) { } public void clearContent ( ) { } private WContainerWidget getDetailsContainerWidget ( ) { } private WContainerWidget getHistoryContainerWidget ( ) { } private void processSelectionEvent ( WAbstractItemView abstractItemView , WWidget widget ) { } private void deleteSelected ( ) { SortedSet < WModelIndex > selectedIndexes = getHistoryTableView ( ) . getSelectedIndexes ( ) ; if ( ( selectedIndexes != null ) && ( ( selectedIndexes . isEmpty ( ) ) == false ) ) { WModelIndex selectedIndex = selectedIndexes . first ( ) ; try { <START_BUG> ( ( Versionable ) ( this . model ) ) . remove ( ( ( com . delcyon . capo . resourcemanager . types . ContentMetaData ) ( selectedIndex . getInternalPointer ( ) ) ) . getResourceURI ( ) . getPath ( ) ) ; <END_BUG> refresh ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } private void restoreSelected ( ) { } private void diffSelected ( ) { } private WDiffWidget getDiffWidget ( ) { } private WTableView getHistoryTableView ( ) { } private void historyDoubleClicked ( WModelIndex index , WMouseEvent event ) { } private void makeVersionable ( ) { } private void checkinContent ( ) { } private void checkoutContent ( ) { } private void fileUploaded ( ) { } private WLink getDownloadLink ( ) { } private WWidget getCreateContentButton ( ) { } private void createContent ( ) { } private WTableView getAttributeTableView ( ) { } @ Override public void refresh ( ) { } }

Fix:
( ( Versionable ) ( this . model ) ) . remove ( ( ( com . delcyon . capo . resourcemanager . types . ContentMetaData ) ( selectedIndex . getInternalPointer ( ) ) ) . getResourceURI ( ) . getResourceURIString ( ) ) ;
Buggy code:
public class DBMessageLogWriter { static final String JDBC_DRIVER = "com.mysql.jdbc.Driver" ; static final String DB_URL = "jdbc:mysql:////localhost:3306//logs" ; static final String USER = "root" ; static final String PASS = "root" ; public void writeLogMessage ( LogMessage message ) { } public List < LogMessage > readLogMessage ( ) { Connection conn = null ; Statement stmt = null ; List < LogMessage > logMessageList = new ArrayList < LogMessage > ( ) ; try { Class . forName ( "com.mysql.jdbc.Driver" ) ; System . out . println ( "Connecting<seq2seq4repair_space>to<seq2seq4repair_space>database..." ) ; conn = DriverManager . getConnection ( DBMessageLogWriter . DB_URL , DBMessageLogWriter . USER , DBMessageLogWriter . PASS ) ; System . out . println ( "Creating<seq2seq4repair_space>statement..." ) ; stmt = conn . createStatement ( ) ; String sql ; <START_BUG> sql = "SELECT<seq2seq4repair_space>APPLICATION_NAME,<seq2seq4repair_space>KEY_STRING,<seq2seq4repair_space>MESSAGE,<seq2seq4repair_space>ADDITIONAL_INFO<seq2seq4repair_space>FROM<seq2seq4repair_space>LOG_MESSAGE<seq2seq4repair_space>ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>LOG_MESSAGE_ID<seq2seq4repair_space>LIMIT<seq2seq4repair_space>20" ; <END_BUG> ResultSet rs = stmt . executeQuery ( sql ) ; while ( rs . next ( ) ) { String appName = rs . getString ( "APPLICATION_NAME" ) ; String keyStr = rs . getString ( "KEY_STRING" ) ; String msg = rs . getString ( "MESSAGE" ) ; String addInfo = rs . getString ( "ADDITIONAL_INFO" ) ; System . out . println ( ( "DBMessageLogWriter.readLogMessage():<seq2seq4repair_space>" + appName ) ) ; System . out . println ( ( "DBMessageLogWriter.readLogMessage():<seq2seq4repair_space>" + keyStr ) ) ; System . out . println ( ( "DBMessageLogWriter.readLogMessage():<seq2seq4repair_space>" + msg ) ) ; System . out . println ( ( "DBMessageLogWriter.readLogMessage():<seq2seq4repair_space>" + addInfo ) ) ; LogMessage logMessage = new LogMessage ( ) ; logMessage . setAppName ( appName ) ; logMessage . setKey ( keyStr ) ; logMessage . setMessage ( msg ) ; logMessage . setAdditionalDetails ( addInfo ) ; logMessageList . add ( logMessage ) ; } rs . close ( ) ; stmt . close ( ) ; conn . close ( ) ; } catch ( SQLException se ) { se . printStackTrace ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { try { if ( stmt != null ) stmt . close ( ) ; } catch ( SQLException se2 ) { } try { if ( conn != null ) conn . close ( ) ; } catch ( SQLException se ) { se . printStackTrace ( ) ; } } return logMessageList ; } No newline ; at end ; of file ; }

Fix:
sql = "SELECT<seq2seq4repair_space>APPLICATION_NAME,<seq2seq4repair_space>KEY_STRING,<seq2seq4repair_space>MESSAGE,<seq2seq4repair_space>ADDITIONAL_INFO<seq2seq4repair_space>FROM<seq2seq4repair_space>LOG_MESSAGE<seq2seq4repair_space>ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>LOG_MESSAGE_ID<seq2seq4repair_space>DESC<seq2seq4repair_space>LIMIT<seq2seq4repair_space>40" ;
Buggy code:
public class Utils { public static String getNextSTToken ( StringTokenizer st ) throws IOException { } public static String getLineEnding ( ) { } public static boolean isStringEmptyOrNull ( String str ) { <START_BUG> return ( str . equals ( "" ) ) || ( str . equals ( null ) ) ; <END_BUG> } }

Fix:
return ( str . equals ( "" ) ) || ( str == null ) ;
Buggy code:
public class SQLMetadataConnectorTest { private TestDerbyConnector connector ; private MetadataStorageTablesConfig tablesConfig = MetadataStorageTablesConfig . fromBase ( "test" ) ; @ Before public void setUp ( ) throws Exception { } @ Test public void testCreateTables ( ) throws Exception { final LinkedList < String > tables = new LinkedList < String > ( ) ; final String entryType = tablesConfig . getTaskEntryType ( ) ; tables . add ( tablesConfig . getConfigTable ( ) ) ; tables . add ( tablesConfig . getSegmentsTable ( ) ) ; tables . add ( tablesConfig . getRulesTable ( ) ) ; tables . add ( tablesConfig . getLockTable ( entryType ) ) ; tables . add ( tablesConfig . getLogTable ( entryType ) ) ; tables . add ( tablesConfig . getEntryTable ( entryType ) ) ; connector . createSegmentTable ( ) ; connector . createConfigTable ( ) ; connector . createRulesTable ( ) ; connector . createTaskTables ( ) ; connector . getDBI ( ) . withHandle ( new org . skife . jdbi . v2 . tweak . HandleCallback < Void > ( ) { @ Override public Void withHandle ( org . skife . jdbi . v2 . Handle handle ) throws Exception { for ( String table : tables ) { <START_BUG> org . junit . Assert . assertTrue ( String . format ( "table<seq2seq4repair_space>$s<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>created!" , table ) , connector . tableExists ( handle , table ) ) ; <END_BUG> } return null ; } } ) ; for ( String table : tables ) { dropTable ( table ) ; } } @ Test public void testInsertOrUpdate ( ) throws Exception { } private void dropTable ( final String tableName ) { } }

Fix:
org . junit . Assert . assertTrue ( String . format ( "table<seq2seq4repair_space>%s<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>created!" , table ) , connector . tableExists ( handle , table ) ) ;
Buggy code:
public class Argument extends LocalDeclaration { public Argument ( char [ ] name , long posNom , TypeReference tr , int modifiers ) { } public void bind ( MethodScope scope , TypeBinding typeBinding , boolean used ) { if ( ( this . type ) != null ) this . type . binding = typeBinding ; int modifierFlag = this . modifiers ; if ( ( this . binding = scope . duplicateName ( this . name ) ) != null ) { scope . problemReporter ( ) . redefineArgument ( this ) ; } else { scope . addLocalVariable ( ( this . binding = new LocalVariableBinding ( this . name , typeBinding , modifierFlag , true ) ) ) ; <START_BUG> if ( isTypeUseDeprecated ( typeBinding , scope ) ) <END_BUG> scope . problemReporter ( ) . deprecatedType ( typeBinding , this . type ) ; this . binding . declaration = this ; this . binding . used = used ; } } public TypeBinding resolveForCatch ( BlockScope scope ) { } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
if ( ( typeBinding != null ) && ( isTypeUseDeprecated ( typeBinding , scope ) ) )
Buggy code:
@ Named @ ViewScoped public class ScriptBean implements Serializable { private static final long serialVersionUID = - 6537089658441990072L ; @ Inject private IScriptBusinessService scriptEjb ; private long selectedId ; private IScript editableScript ; private String questionText ; private QuestionType questionType ; private int minOption = 1 ; private int maxOption = 5 ; private String answerOption ; private SortedSet < String > answers ; private String scriptTitle ; private boolean editScriptTitle = false ; private String newTitle ; private String option ; public IScript getEditableScript ( ) { } public List < IScript > getScripts ( ) { } public List < IScriptEntry > getEntries ( ) { } public void addQuestion ( ) { } public void deleteQuestion ( IScriptEntry entry ) { } public void updateScript ( ) { } public List < QuestionType > getQuestionTypeList ( ) { } public String addScript ( ) { editableScript = scriptEjb . createNewScript ( scriptTitle ) ; clear ( ) ; <START_BUG> return "editscript.xhtml?faces-redirect=true" ; <END_BUG> } public String edit ( IScript script ) { } public String view ( IScript script ) { } public void delete ( IScript script ) { } public void addAnswer ( ) { } public void deleteAnswer ( String answer ) { } public void onRowReorder ( ReorderEvent event ) { } public List < Integer > getScaleValues ( IScriptEntry entry ) { } public void prepareEditTitle ( ) { } public void editTitle ( ) { } public void addAnswerToEntry ( IScriptEntry entry ) { } public void deleteAnswerFromEntry ( IScriptEntry entry , String answer ) { } public void updateEntry ( IScriptEntry entry ) { } public void onload ( ) { } public String getQuestionText ( ) { } public void setQuestionText ( String questionText ) { } public QuestionType getQuestionType ( ) { } public void setQuestionType ( QuestionType questionType ) { } public int getMinOption ( ) { } public void setMinOption ( int minOption ) { } public int getMaxOption ( ) { } public void setMaxOption ( int maxOption ) { } public String getAnswerOption ( ) { } public void setAnswerOption ( String answerOption ) { } public Set < String > getAnswers ( ) { } public void setAnswers ( List < String > answers ) { } public String getScriptTitle ( ) { } public void setScriptTitle ( String scriptTitle ) { } public boolean isEditScriptTitle ( ) { } public void setEditScriptTitle ( boolean editScriptTitle ) { } public String getNewTitle ( ) { } public void setNewTitle ( String newTitle ) { } private void addMessage ( Severity type , String text ) { } public String getOption ( ) { } public void setOption ( String option ) { } public long getSelectedId ( ) { } public void setSelectedId ( long selectedId ) { } private void clear ( ) { } private HttpSession getSession ( ) { } }

Fix:
return ( "editscript.xhtml?sc=" + ( editableScript . getId ( ) ) ) + "&faces-redirect=true" ;
Buggy code:
public class FineSessionFactory < L > implements SessionFactory < FineSessionCacheEntry < L > , L > { private final Cache < String , FineSessionCacheEntry < L > > sessionCache ; private final Cache < SessionAttributeCacheKey , MarshalledValue < Object , MarshallingContext > > attributeCache ; private final CacheInvoker invoker ; private final SessionContext context ; private final SessionAttributeMarshaller < Object , MarshalledValue < Object , MarshallingContext > > marshaller ; private final LocalContextFactory < L > localContextFactory ; public FineSessionFactory ( Cache < String , FineSessionCacheEntry < L > > sessionCache , Cache < SessionAttributeCacheKey , MarshalledValue < Object , MarshallingContext > > attributeCache , CacheInvoker invoker , SessionContext context , SessionAttributeMarshaller < Object , MarshalledValue < Object , MarshallingContext > > marshaller , LocalContextFactory < L > localContextFactory ) { } @ Override public Session < L > createSession ( String id , FineSessionCacheEntry < L > entry ) { } @ Override public ImmutableSession createImmutableSession ( String id , FineSessionCacheEntry < L > entry ) { } @ Override public FineSessionCacheEntry < L > findValue ( String id ) { <START_BUG> return this . invoker . invoke ( this . sessionCache , new FindOperation < String , FineSessionCacheEntry < L > > ( id ) ) ; <END_BUG> } @ Override public FineSessionCacheEntry < L > createValue ( String id ) { } @ Override public void remove ( final String id ) { } @ Override public void evict ( final String id ) { } }

Fix:
return this . invoker . invoke ( this . sessionCache , new LockingFindOperation < String , FineSessionCacheEntry < L > > ( id ) ) ;
Buggy code:
public class RunAnnotationAdapter extends SelectionAdapter { @ Override public void widgetSelected ( SelectionEvent e ) { Project p = MainWindowShell . getCurrentProject ( ) ; if ( p == null ) return ; Annotation a = p . getCurrentAnnotation ( ) ; if ( a == null ) return ; AnnotationShell as = new AnnotationShell ( a ) ; <START_BUG> annotationShell . add ( as ) ; <END_BUG> } }

Fix:
annotationShells . add ( as ) ;
Buggy code:
public class FilterControlNumber extends FilterControl { private NumberControl [ ] control ; public FilterControlNumber ( FilterPanel parent , AttributeDefinition attribute ) { } public FilterControlNumber ( FilterPanel parent , NumberFilter template ) { } @ Override protected List < Operator > getOperators ( ) { } @ Override protected void updateValueControls ( boolean initialize ) { if ( ( ( getOperator ( ) ) == ( Operator . IS_SET ) ) || ( ( getOperator ( ) ) == ( Operator . IS_NOT_SET ) ) ) { showControl ( 0 , false ) ; showControl ( 1 , false ) ; } else if ( ( getOperator ( ) ) == ( Operator . BETWEEN ) ) { showControl ( 0 , true ) ; showControl ( 1 , true ) ; } else { showControl ( 0 , true ) ; showControl ( 1 , false ) ; } if ( initialize ) { if ( ( templateFilter . getFilterValue1 ( ) ) != null ) { control [ 0 ] . setValue ( ( ( Number ) ( templateFilter . getFilterValue1 ( ) ) ) ) ; } if ( ( templateFilter . getFilterValue2 ( ) ) != null ) { <START_BUG> control [ 1 ] . setValue ( ( ( Number ) ( templateFilter . getFilterValue1 ( ) ) ) ) ; <END_BUG> } } layout ( ) ; } private void showControl ( int controlId , boolean show ) { } @ Override public IFilter getFilter ( ) { } }

Fix:
control [ 1 ] . setValue ( ( ( Number ) ( templateFilter . getFilterValue2 ( ) ) ) ) ;
Buggy code:
public class MenuItem extends Item { Menu parent ; Menu menu ; int accelerator ; public MenuItem ( Menu parent , int style ) { } public MenuItem ( Menu parent , int style , int index ) { } void addAccelerator ( ) { } public void addArmListener ( ArmListener listener ) { } public void addHelpListener ( HelpListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } protected void checkSubclass ( ) { } static int checkStyle ( int style ) { } void createHandle ( int index ) { } public int getAccelerator ( ) { } public boolean getEnabled ( ) { } public Menu getMenu ( ) { } String getNameText ( ) { } public Menu getParent ( ) { } public boolean getSelection ( ) { } void hookEvents ( ) { } int hotkeyProc ( int widget , int data , int info ) { } public boolean isEnabled ( ) { } int Pt_CB_ACTIVATE ( int widget , int info ) { } int Pt_CB_ARM ( int widget , int info ) { <START_BUG> postEvent ( Arm ) ; <END_BUG> showMenu ( ) ; return OS . Pt_CONTINUE ; } int Pt_CB_REALIZED ( int widget , int info ) { } void releaseChild ( ) { } void releaseWidget ( ) { } public void removeArmListener ( ArmListener listener ) { } public void removeHelpListener ( HelpListener listener ) { } void removeAccelerator ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void selectRadio ( ) { } public void setAccelerator ( int accelerator ) { } public void setEnabled ( boolean enabled ) { } public void setImage ( Image image ) { } public void setMenu ( Menu menu ) { } boolean setRadioSelection ( boolean value ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } void showMenu ( ) { } }

Fix:
sendEvent ( Arm ) ;
Buggy code:
public class gBestPSO extends PSOProcess { public gBestPSO ( String function ) { } @ Override public double [ ] findLocalGBest ( int particleNumber , int currentSwarmSize ) { for ( int i = 0 ; i < ( bestPositions . length ) ; i ++ ) { bestFitnesses [ i ] = evaluateFit ( bestPositions [ i ] ) ; } <START_BUG> localBestIndex = getMinPos ( bestFitnesses ) ; <END_BUG> return bestPositions [ localBestIndex ] ; } }

Fix:
localBestIndex = getMinPos ( bestFitnesses , currentSwarmSize ) ;
Buggy code:
@ Repeat ( 100 ) @ RunWith ( AlchemyTestRunner . class ) public class RequestImplTest { @ Mock private Iface applicationService ; @ Captor private ArgumentCaptor < SendMessageRequest > requestCaptor ; private BananaClient bananaClient ; private RequestImpl instance ; @ GenerateString private String message ; @ GenerateEnum private Urgency urgency ; @ GenerateString ( ALPHABETIC ) private String exceptionMessage ; private Exception ex ; @ Before public void setUp ( ) { } @ Test public void testMessage ( ) { } @ Test public void testMessageFormatting ( ) { } @ Test public void testWithUrgency ( ) { } @ Test public void testSend ( ) throws Exception { instance . send ( ) ; verify ( applicationService ) . sendMessage ( requestCaptor . capture ( ) ) ; SendMessageRequest request = requestCaptor . getValue ( ) ; assertThat ( request , notNullValue ( ) ) ; assertThat ( request . message , is ( message ) ) ; assertThat ( request . urgency , is ( urgency . toThrift ( ) ) ) ; <START_BUG> checkThat ( request . timeOfMessage ) . is ( epochNowWithinDelta ( 200L ) ) ; <END_BUG> } @ Test public void testGetMessage ( ) { } @ Test public void testGetUrgency ( ) { } No newline ; at end ; of file ; }

Fix:
checkThat ( request . timeOfMessage ) . is ( epochNowWithinDelta ( 1000L ) ) ;
Buggy code:
public class Test { public static void main ( String [ ] args ) throws IOException , ParseException { RecursiveFileLister it = new RecursiveFileLister ( "testfiles" ) ; XMLParser parser = new XMLParser ( ) ; FileLineLister puller = new FileLineLister ( ) ; ArticleIndexer indexer = new ArticleIndexer ( "lucene.index" ) ; List < Article > articles = new ArrayList < Article > ( ) ; List < String > notificationFiles = it . getFileList ( ) ; List < String > xmlFiles = new ArrayList < String > ( ) ; System . out . println ( ( "Files:<seq2seq4repair_space>" + ( notificationFiles . size ( ) ) ) ) ; for ( String file : notificationFiles ) { List < String > tmpList = new ArrayList < > ( ) ; tmpList = puller . listXMLFilesInFile ( file ) ; for ( String tmp : tmpList ) { xmlFiles . add ( tmp ) ; } } System . out . println ( ( "XML-Files:<seq2seq4repair_space>" + ( xmlFiles . size ( ) ) ) ) ; for ( String file : xmlFiles ) { Article article = parser . parse ( file ) ; articles . add ( article ) ; } try { indexer . writeArticlesToIndex ( articles ) ; } catch ( IOException e ) { System . err . println ( "Indexen<seq2seq4repair_space>fehlgeschlagen<seq2seq4repair_space>\n<seq2seq4repair_space>äh<seq2seq4repair_space>jetzt<seq2seq4repair_space>fertig\n" ) ; System . err . println ( e . getMessage ( ) ) ; } SimpleFSDirectory dir = new SimpleFSDirectory ( new File ( "lucene.index" ) ) ; DirectoryReader reader = DirectoryReader . open ( dir ) ; IndexSearcher searcher = new IndexSearcher ( reader ) ; Analyzer analyzer = new org . apache . lucene . analysis . standard . StandardAnalyzer ( Version . LUCENE_45 ) ; QueryParser queryParser = new QueryParser ( Version . LUCENE_45 , "title" , analyzer ) ; <START_BUG> Query query = queryParser . parse ( "a" ) ; <END_BUG> TopDocs td = searcher . search ( query , 10 ) ; ScoreDoc [ ] sd = td . scoreDocs ; for ( int j = 0 ; j < ( sd . length ) ; ++ j ) { Document doc = searcher . doc ( sd [ j ] . doc ) ; System . out . println ( ( ( ( ( ( doc . get ( "source" ) ) + "<seq2seq4repair_space>////<seq2seq4repair_space>" ) + ( doc . get ( "title" ) ) ) + "<seq2seq4repair_space>////<seq2seq4repair_space>" ) + ( doc . get ( "date" ) ) ) ) ; } } }

Fix:
Query query = queryParser . parse ( "d*" ) ;
Buggy code:
public class CommunicationsDAOImpl implements CommunicationsDAO { private DBHandler dbHandler ; public void setDbHandler ( DBHandler dbHandler ) { } public DBHandler getDbHandler ( ) { } public void create ( Communications communications ) { } public void update ( Communications communications ) { } public void delete ( Communications communications ) { } public Communications get ( Integer id ) { } public void deleteAllCommunications ( ) { } public int numberOfCommunications ( ) { } @ SuppressWarnings ( "unchecked" ) public List < Communications > getAllCommunications ( ) { Session session = this . dbHandler . getSessionFactory ( ) . openSession ( ) ; <START_BUG> List < Communications > communications = session . createQuery ( "FROM<seq2seq4repair_space>Communications" ) . list ( ) ; <END_BUG> session . close ( ) ; return communications ; } No newline ; at end ; of file ; }

Fix:
List < Communications > communications = session . createQuery ( "FROM<seq2seq4repair_space>Communications<seq2seq4repair_space>com<seq2seq4repair_space>ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>com.date<seq2seq4repair_space>desc" ) . list ( ) ;
Buggy code:
public abstract class Type extends ASTNode { Type ( AST ast ) { } public final boolean isPrimitiveType ( ) { } public final boolean isSimpleType ( ) { } public final boolean isArrayType ( ) { } public final boolean isParameterizedType ( ) { } public final boolean isQualifiedType ( ) { } public final boolean isWildcardType ( ) { } public final ITypeBinding resolveBinding ( ) { <START_BUG> return getAST ( ) . getBindingResolver ( ) . resolveType ( this ) ; <END_BUG> } }

Fix:
return this . ast . getBindingResolver ( ) . resolveType ( this ) ;
Buggy code:
public class RefreshTaskProcessor implements Runnable { private MongoClient client ; private MongoDatabase db ; private MongoCollection < Document > coll ; private final String user = "JavaOperator" ; private final char [ ] pwd = "gsh632260737" . toCharArray ( ) ; private final String authDB = "admin" ; private final int DBFullCount = 10000 ; private String keyWord ; private boolean isInitialized = false ; public RefreshTaskProcessor ( ) { } public RefreshTaskProcessor ( String keyWord ) { } @ Override public void run ( ) { } public void initialize ( ) { } public long getColletionCount ( ) { } public void addTask ( String keyWord ) { Document doc = new Document ( ) ; <START_BUG> doc . append ( "KeyWrod" , keyWord ) . append ( "Finished" , "False" ) ; <END_BUG> this . coll . insertOne ( doc ) ; } public void markFinished ( String keyWord ) { } public Queue < String > getUnfinishedTaskList ( ) { } public void removeAllCompletedTask ( ) { } public void releaseDBWhenFull ( ) { } public void process ( ) { } public static void main ( String [ ] args ) { } }

Fix:
doc . append ( "KeyWord" , keyWord ) . append ( "Finished" , "False" ) ;
Buggy code:
public class StringNode extends Node { public static final String STRING_FILTER = "-string" ; protected StringBuffer textBuffer ; public StringNode ( StringBuffer textBuffer , int textBegin , int textEnd ) { } public String getText ( ) { } public void setText ( String text ) { } public String toPlainTextString ( ) { } public String toHtml ( ) { } public String toString ( ) { } public void collectInto ( NodeList collectionList , String filter ) { <START_BUG> if ( filter == ( StringNode . STRING_FILTER ) ) <END_BUG> collectionList . add ( this ) ; } public void accept ( NodeVisitor visitor ) { } }

Fix:
if ( filter . equals ( StringNode . STRING_FILTER ) )
Buggy code:
public abstract class TableWithAlternatingRowStyle extends ListView { public TableWithAlternatingRowStyle ( final String componentName , final List data ) { } protected ListItem newItem ( final int index ) { Object listItem = getList ( ) . get ( index ) ; if ( ! ( listItem instanceof Serializable ) ) { throw new IllegalArgumentException ( "Table<seq2seq4repair_space>and<seq2seq4repair_space>table<seq2seq4repair_space>cell<seq2seq4repair_space>model<seq2seq4repair_space>data<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>serializable" ) ; } <START_BUG> return new ListItem ( index , this ) { <END_BUG> protected void onComponentTag ( final ComponentTag tag ) { tag . put ( "class" , ( this . isEvenIndex ( ) ? "even" : "odd" ) ) ; super . onComponentTag ( tag ) ; } } ; } }

Fix:
return new ListItem ( this , index ) {
Buggy code:
public class DropDownValueProvidersForBatchProfile { private DescribeDAO describeDAO ; private SelectDAO selectDAO ; private Map < String , Method > methodMap ; public JSONArray populateDropDownValues ( String type ) { } public DescribeDAO getDescribeDAO ( ) { } public void setDescribeDAO ( DescribeDAO describeDAO ) { } public SelectDAO getSelectDAO ( ) { } public void setSelectDAO ( SelectDAO selectDAO ) { } public JSONArray prepareAuthenticationType ( ) throws JSONException { } public JSONArray prepareBibStatus ( ) { } public JSONArray prepareReceiptStatus ( ) { } public JSONArray prepareAccessLocation ( ) { } public JSONArray prepareStatisticalSearchCode ( ) { List < StatisticalSearchRecord > statisticalSearchRecords = getDescribeDAO ( ) . fetchStatisticalSearchCodes ( ) ; JSONArray jsonArray = new JSONArray ( ) ; try { if ( CollectionUtils . isNotEmpty ( statisticalSearchRecords ) ) { for ( Iterator < StatisticalSearchRecord > iterator = statisticalSearchRecords . iterator ( ) ; iterator . hasNext ( ) ; ) { StatisticalSearchRecord statisticalSearchRecord = iterator . next ( ) ; JSONObject jsonObject = new JSONObject ( ) ; jsonObject . put ( ID , statisticalSearchRecord . getCode ( ) ) ; <START_BUG> jsonObject . put ( VALUE , statisticalSearchRecord . getName ( ) ) ; <END_BUG> jsonArray . put ( jsonObject ) ; } } } catch ( Exception e ) { e . printStackTrace ( ) ; } return jsonArray ; } public Map < String , Method > getMethodMap ( ) { } }

Fix:
jsonObject . put ( VALUE , statisticalSearchRecord . getCode ( ) ) ;
Buggy code:
@ Configuration public abstract class AbstractTransactionManagementConfiguration implements ImportAware { protected Map < String , Object > enableTx ; protected PlatformTransactionManager txManager ; public void setImportMetadata ( AnnotationMetadata importMetadata ) { } @ Autowired ( required = false ) void setConfigurers ( Collection < TransactionManagementConfigurer > configurers ) { if ( ( configurers == null ) || ( configurers . isEmpty ( ) ) ) { return ; } if ( ( configurers . size ( ) ) > 1 ) { throw new IllegalStateException ( "only<seq2seq4repair_space>one<seq2seq4repair_space>TransactionManagementConfigurer<seq2seq4repair_space>may<seq2seq4repair_space>exist" ) ; } TransactionManagementConfigurer configurer = configurers . iterator ( ) . next ( ) ; <START_BUG> this . txManager = configurer . createTransactionManager ( ) ; <END_BUG> } }

Fix:
this . txManager = configurer . annotationDrivenTransactionManager ( ) ;
Buggy code:
public class Snippet12 { public static void main ( String [ ] args ) { Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; Text text = new Text ( shell , ( ( SWT . BORDER ) | ( SWT . V_SCROLL ) ) ) ; text . setBounds ( 10 , 10 , 100 , 100 ) ; for ( int i = 0 ; i < 16 ; i ++ ) { text . append ( ( ( "Line<seq2seq4repair_space>" + i ) + "\n" ) ) ; } shell . open ( ) ; <START_BUG> text . setSelection ( 30 , 32 ) ; <END_BUG> System . out . println ( text . getCaretLocation ( ) ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
text . setSelection ( 30 , 38 ) ;
Buggy code:
public class ZoomSliderButton extends PopupButton { private static final String RESOURCE_NAME = "Zoom<seq2seq4repair_space>Reset" ; private static final String BUNDLE = "Cognitive" ; private static final Font LABEL_FONT = new Font ( "Dialog" , Font . PLAIN , 10 ) ; private static final int MINIMUM_ZOOM = 0 ; private static final int MAXIMUM_ZOOM = 500 ; private static final int SLIDER_HEIGHT = 250 ; private JSlider _slider = null ; private JLabel _currentValueLabel = null ; public ZoomSliderButton ( ) { } private void createPopupComponent ( ) { <START_BUG> _slider = new JSlider ( JSlider . VERTICAL , ZoomSliderButton . MINIMUM_ZOOM , ZoomSliderButton . MAXIMUM_ZOOM , 0 ) ; <END_BUG> _slider . setInverted ( true ) ; _slider . setMajorTickSpacing ( ( ( ZoomSliderButton . MAXIMUM_ZOOM ) // 10 ) ) ; _slider . setMinorTickSpacing ( ( ( ZoomSliderButton . MAXIMUM_ZOOM ) // 20 ) ) ; _slider . setPaintTicks ( true ) ; _slider . setPaintTrack ( true ) ; int sliderBaseWidth = _slider . getPreferredSize ( ) . width ; _slider . setPaintLabels ( true ) ; } protected void showPopup ( ) { } private void handleSliderValueChange ( ) { } private void updateCurrentValueLabel ( ) { } }

Fix:
_slider = new JSlider ( JSlider . VERTICAL , ZoomSliderButton . MINIMUM_ZOOM , ZoomSliderButton . MAXIMUM_ZOOM , ZoomSliderButton . MINIMUM_ZOOM ) ;