nus-yam/ex-repair huggingface dataset:
Buggy code:
public class PlaceGroupZone implements Jsonable { private static final Color [ ] [ ] ZONE_COLORS = new Color [ ] [ ] { new Color [ ] { Color . rgb ( 225 , 50 , 50 , 0.3 ) , Color . rgb ( 225 , 50 , 50 , 0.85 ) } , new Color [ ] { Color . rgb ( 225 , 50 , 225 , 0.3 ) , Color . rgb ( 225 , 50 , 225 , 0.85 ) } , new Color [ ] { Color . rgb ( 50 , 100 , 225 , 0.3 ) , Color . rgb ( 50 , 100 , 225 , 0.85 ) } , new Color [ ] { Color . rgb ( 50 , 225 , 225 , 0.3 ) , Color . rgb ( 50 , 225 , 225 , 0.85 ) } , new Color [ ] { Color . rgb ( 50 , 225 , 50 , 0.3 ) , Color . rgb ( 50 , 225 , 50 , 0.85 ) } , new Color [ ] { Color . rgb ( 225 , 225 , 50 , 0.3 ) , Color . rgb ( 225 , 225 , 50 , 0.85 ) } , new Color [ ] { Color . rgb ( 225 , 125 , 50 , 0.3 ) , Color . rgb ( 225 , 125 , 50 , 0.85 ) } } ; private static int currentZoneColor = 0 ; public int x ; public int y ; public int w ; public int h ; public Color fillColor ; public Color strokeColor ; public PlaceGroup group ; public PlaceGroupZone ( final PlaceGroupZone zone ) { } public PlaceGroupZone ( final PlaceGroup group ) { } public PlaceGroupZone ( final int x , final int y , final int w , final int h , final PlaceGroup group ) { } public void rotate ( ) { } public boolean contains ( final int x , final int y ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } @ Override public List < String > getJsonLines ( ) { List < String > lines = new ArrayList < > ( ) ; <START_BUG> String line = ( ( ( "{<seq2seq4repair_space>\"group\":<seq2seq4repair_space>\"" + ( group . group ) ) + "\",<seq2seq4repair_space>\"chance\":<seq2seq4repair_space>" ) + ( group . chance ) ) + ",<seq2seq4repair_space>\"x\":<seq2seq4repair_space>" ; <END_BUG> if ( ( w ) != 1 ) { line += ( ( ( "[<seq2seq4repair_space>" + ( x ) ) + ",<seq2seq4repair_space>" ) + ( ( ( x ) - 1 ) + ( w ) ) ) + "<seq2seq4repair_space>],<seq2seq4repair_space>" ; } else { line += ( x ) + ",<seq2seq4repair_space>" ; } line += "<seq2seq4repair_space>\"y\":<seq2seq4repair_space>" ; if ( ( h ) != 1 ) { line += ( ( ( "[<seq2seq4repair_space>" + ( y ) ) + ",<seq2seq4repair_space>" ) + ( ( ( y ) - 1 ) + ( h ) ) ) + "<seq2seq4repair_space>]" ; } else { line += ( y ) + "" ; } line += "<seq2seq4repair_space>}" ; lines . add ( line ) ; return lines ; } }

Fix:
String line = ( ( ( ( ( "{<seq2seq4repair_space>\"" + ( group . type ) ) + "\":<seq2seq4repair_space>\"" ) + ( group . group ) ) + "\",<seq2seq4repair_space>\"chance\":<seq2seq4repair_space>" ) + ( group . chance ) ) + ",<seq2seq4repair_space>\"x\":<seq2seq4repair_space>" ;
Buggy code:
public class SynchronizationController implements VetoableGraphObjectListener { private static final Logger logger = Logger . getLogger ( SynchronizationController . class . getName ( ) ) ; private Map < Long , WebSocketMessage > messageMap = new LinkedHashMap < Long , WebSocketMessage > ( ) ; private Set < StructrWebSocket > clients = null ; private Gson gson = null ; public SynchronizationController ( Gson gson ) { } public void registerClient ( StructrWebSocket client ) { } public void unregisterClient ( StructrWebSocket client ) { } private void broadcast ( final WebSocketMessage webSocketData ) { SynchronizationController . logger . log ( Level . INFO , "Broadcasting<seq2seq4repair_space>message<seq2seq4repair_space>to<seq2seq4repair_space>{0}<seq2seq4repair_space>clients.." , clients . size ( ) ) ; webSocketData . setSessionValid ( true ) ; String message = gson . toJson ( webSocketData , WebSocketMessage . class ) ; <START_BUG> SynchronizationController . logger . log ( Level . INFO , "Sending<seq2seq4repair_space>message\n{0}" , message ) ; <END_BUG> for ( StructrWebSocket socket : clients ) { Connection socketConnection = socket . getConnection ( ) ; if ( ( socketConnection != null ) && ( socket . isAuthenticated ( ) ) ) { try { socketConnection . sendMessage ( message ) ; } catch ( Throwable t ) { SynchronizationController . logger . log ( Level . WARNING , "Error<seq2seq4repair_space>sending<seq2seq4repair_space>message<seq2seq4repair_space>to<seq2seq4repair_space>client." , t ) ; } } } } @ Override public void begin ( SecurityContext securityContext , long transactionKey ) { } @ Override public void commit ( SecurityContext securityContext , long transactionKey ) { } @ Override public void rollback ( SecurityContext securityContext , long transactionKey ) { } @ Override public void propertyModified ( SecurityContext securityContext , long transactionKey , AbstractNode entity , String key , Object oldValue , Object newValue ) { } @ Override public void relationshipCreated ( SecurityContext securityContext , long transactionKey , AbstractNode startNode , AbstractNode endNode , StructrRelationship relationship ) { } @ Override public void relationshipDeleted ( SecurityContext securityContext , long transactionKey , StructrRelationship relationship ) { } @ Override public void graphObjectCreated ( SecurityContext securityContext , long transactionKey , GraphObject graphObject ) { } @ Override public void graphObjectModified ( SecurityContext securityContext , long transactionKey , GraphObject graphObject ) { } @ Override public void graphObjectDeleted ( SecurityContext securityContext , long transactionKey , long id , Map < String , Object > properties ) { } @ Override public void wasVisited ( List < GraphObject > traversedNodes , long transactionKey , SecurityContext securityContext ) { } }

Fix:
SynchronizationController . logger . log ( Level . INFO , "############################################################<seq2seq4repair_space>SENDING<seq2seq4repair_space>\n{0}" , message ) ;
Buggy code:
public class EmailHandler { public static void emailEvent ( String event ) { } private static String [ ] findReceiverEmails ( String email ) { String [ ] emailIds = null ; if ( email . contains ( ":" ) ) { <START_BUG> emailIds = email . split ( ":" ) ; <END_BUG> } else { emailIds = new String [ 1 ] ; emailIds [ 0 ] = email ; } return emailIds ; } }

Fix:
emailIds = email . split ( ";" ) ;
Buggy code:
public class SendLocationTests extends BaseRpcTests { public static final Float KEY_LAT_DEGREES = 42.0F ; public static final Float KEY_LON_DEGREES = 42.0F ; public static final String KEY_LOCATION_NAME = "test" ; public static final String KEY_LOCATION_DESCRIPTION = "desc" ; public static final String KEY_PHONE_NUMBER = "1234567890" ; public static final List < String > KEY_ADDRESS_LINES = Arrays . asList ( new String [ ] { "1234<seq2seq4repair_space>Test<seq2seq4repair_space>Lane" , "Ferndale" , "MI" , "56789" } ) ; private static final Image IMAGE = new Image ( ) ; private static final String VALUE = "image.jpg" ; private static final ImageType IMAGE_TYPE = ImageType . STATIC ; @ Override protected RPCMessage createMessage ( ) { } @ Override protected String getMessageType ( ) { } @ Override protected String getCommandType ( ) { } @ Override protected JSONObject getExpectedParameters ( int sdlVersion ) { } public void testLatitudeDegrees ( ) { } public void testLongitudeDegrees ( ) { <START_BUG> Float longitude = ( ( com . smartdevicelink . proxy . rpc . SendLocation ) ( msg ) ) . getLatitudeDegrees ( ) ; <END_BUG> assertEquals ( "Longitude<seq2seq4repair_space>didn't<seq2seq4repair_space>match<seq2seq4repair_space>input<seq2seq4repair_space>longitude." , SendLocationTests . KEY_LON_DEGREES , longitude ) ; } public void testLocationName ( ) { } public void testLocationDescription ( ) { } public void testPhoneNumber ( ) { } public void testAddressLines ( ) { } public void testLocationImage ( ) { } public void testNull ( ) { } public void testJsonConstructor ( ) { } }

Fix:
Float longitude = ( ( com . smartdevicelink . proxy . rpc . SendLocation ) ( msg ) ) . getLongitudeDegrees ( ) ;
Buggy code:
public class LearnStateEventServiceImpl implements LearnStateEventService { @ Override public LearnStateEvents generate ( Farmer farmer ) { } @ Override public List < LearnStateEvents > avail ( Farmer farmer ) { List < LearnStateEvents > avail = new ArrayList < LearnStateEvents > ( ) ; <START_BUG> String sqlString = "SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>learn_state_events<seq2seq4repair_space>WHERE<seq2seq4repair_space>id<seq2seq4repair_space>NOT<seq2seq4repair_space>IN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>learn_state_events.id<seq2seq4repair_space>FROM<seq2seq4repair_space>applegame.learn_state_events<seq2seq4repair_space>inner<seq2seq4repair_space>join<seq2seq4repair_space>learn_state_event_executed<seq2seq4repair_space>on<seq2seq4repair_space>learn_state_events.id=learn_state_event_executed.event_id<seq2seq4repair_space>where<seq2seq4repair_space>farmer_id=:id)" ; <END_BUG> Query query = JPA . em ( ) . createNativeQuery ( sqlString ) ; query . setParameter ( "id" , farmer . id ) ; List < Object [ ] > objRes = query . getResultList ( ) ; for ( Object [ ] obj : objRes ) { Long id = ( ( BigInteger ) ( obj [ 0 ] ) ) . longValue ( ) ; Date date = dateService . convertDateTo70 ( farmer . gameDate . date ) ; LearnStateEvents event = LearnStateEvents . find ( "id=?1<seq2seq4repair_space>and<seq2seq4repair_space>dateStart<=?2<seq2seq4repair_space>and<seq2seq4repair_space>dateEnd>=?3" , id , date , date ) . first ( ) ; if ( event != null ) { avail . add ( event ) ; } } Collections . sort ( avail , Collections . reverseOrder ( ) ) ; return avail ; } }

Fix:
String sqlString = "SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>learn_state_events<seq2seq4repair_space>WHERE<seq2seq4repair_space>id<seq2seq4repair_space>NOT<seq2seq4repair_space>IN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>learn_state_events.id<seq2seq4repair_space>FROM<seq2seq4repair_space>learn_state_events<seq2seq4repair_space>inner<seq2seq4repair_space>join<seq2seq4repair_space>learn_state_event_executed<seq2seq4repair_space>on<seq2seq4repair_space>learn_state_events.id=learn_state_event_executed.event_id<seq2seq4repair_space>where<seq2seq4repair_space>farmer_id=:id)" ;
Buggy code:
public class MenuCoordinator { Menu mainMenu ; Menu pauseMenu ; Menu loadMenu ; Menu currentMenu ; private static CoordinatorScheduler scheduler = CoordinatorScheduler . getInstance ( ) ; private static MenuCoordinator menuCoordinator = null ; public MenuCoordinator ( ) { } public Menu getCurrentMenu ( ) { } public void confirmSelection ( ) throws IOException , ParserConfigurationException , SAXException { } public void next ( ) { } public void prev ( ) { } private void startNewGame ( ) { } private void loadGame ( File saveFile ) throws IOException , ParserConfigurationException , SAXException { InputStream file = new FileInputStream ( saveFile ) ; <START_BUG> GameMap loadedMap = new GameMap ( ) ; <END_BUG> ObjectFactory objectFactory = new ObjectFactory ( file , loadedMap ) ; objectFactory . ParseFile ( ) ; ArrayList < Pair < Entity , CoordinatePair > > entities = loadedMap . getAllEntities ( ) ; Entity entity = entities . get ( 0 ) . getLeft ( ) ; GameCoordinator gameCoordinator = GameCoordinator . getInstance ( ) ; gameCoordinator . setActiveMap ( loadedMap ) ; gameCoordinator . setAvatar ( entity ) ; } public void setCurrentMenu ( Menu menu ) { } public static MenuCoordinator getInstance ( ) { } }

Fix:
GameMap loadedMap = GameMap . getInstance ( ) ;
Buggy code:
public class CacheService < K , V > implements Service < Cache < K , V > > { private final CacheService . Dependencies dependencies ; private final String name ; private volatile Cache < K , V > cache ; private volatile XAResourceRecovery recovery ; private static final Logger log = Logger . getLogger ( CacheService . class . getPackage ( ) . getName ( ) ) ; public static ServiceName getServiceName ( String container , String cache ) { } public interface Dependencies { EmbeddedCacheManager getCacheContainer ( ) { } XAResourceRecoveryRegistry getRecoveryRegistry ( ) { } } public CacheService ( String name , CacheService . Dependencies dependencies ) { } @ Override public Cache < K , V > getValue ( ) { } @ Override public void start ( StartContext context ) { } @ Override public void stop ( StopContext context ) { } static class InfinispanXAResourceRecovery implements XAResourceRecovery { private final String cacheName ; private final EmbeddedCacheManager container ; InfinispanXAResourceRecovery ( String cacheName , EmbeddedCacheManager container ) { } @ Override public XAResource [ ] getXAResources ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object object ) { } @ Override public String toString ( ) { <START_BUG> return ( ( container . getCacheManagerConfiguration ( ) . globalJmxStatistics ( ) . cacheManagerName ( ) ) + "." ) + ( this . cacheName ) ; <END_BUG> } } }

Fix:
return ( ( this . container . getCacheManagerConfiguration ( ) . globalJmxStatistics ( ) . cacheManagerName ( ) ) + "." ) + ( this . cacheName ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class ArchiveTestCase { private static File cliArchiveFile ; @ ArquillianResource URL url ; @ Deployment public static Archive < ? > getDeployment ( ) { JavaArchive ja = ShrinkWrap . create ( JavaArchive . class , "dummy.jar" ) ; <START_BUG> ja . addClass ( ArchiveTestCase . class ) ; <END_BUG> return ja ; } @ BeforeClass public static void before ( ) throws Exception { } @ Test public void testDeployArchive ( ) throws Exception { } @ Test public void testUnDeployArchive ( ) throws Exception { } @ AfterClass public static void after ( ) throws Exception { } protected final String getBaseURL ( URL url ) throws MalformedURLException { } protected boolean checkUndeployed ( String spec ) { } }

Fix:
ja . addClass ( DeployTestCase . class ) ;
Buggy code:
public class OpenAttachmentCommand extends FolderCommand { MimePart part ; File tempFile ; boolean inline = false ; TempFolder tempFolder ; Object tempMessageUid ; public OpenAttachmentCommand ( DefaultCommandReference [ ] references ) { } public void updateGUI ( ) throws Exception { } public void execute ( Worker worker ) throws Exception { FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( getReferences ( ) ) ) ; Folder folder = ( ( Folder ) ( r [ 0 ] . getFolder ( ) ) ) ; Object [ ] uids = r [ 0 ] . getUids ( ) ; Integer [ ] address = r [ 0 ] . getAddress ( ) ; part = folder . getMimePart ( uids [ 0 ] , address , worker ) ; Decoder decoder ; MimeHeader header ; tempFile = null ; header = part . getHeader ( ) ; if ( part . getHeader ( ) . getContentType ( ) . equals ( "message" ) ) { tempFolder = treeModel . getTempFolder ( ) ; tempMessageUid = tempFolder . addMessage ( ( ( AbstractMessage ) ( part . getContent ( ) ) ) , worker ) ; inline = true ; } else { try { String filename = part . getHeader ( ) . getFileName ( ) ; if ( filename != null ) { tempFile = TempFileStore . createTempFile ( filename ) ; } else tempFile = TempFileStore . createTempFile ( ) ; decoder = CoderRouter . getDecoder ( header . contentTransferEncoding ) ; <START_BUG> decoder . decode ( new ByteArrayInputStream ( part . getBody ( ) . getBytes ( "US-ASCII" ) ) , new FileOutputStream ( tempFile ) ) ; <END_BUG> } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } } public void undo ( Worker worker ) throws Exception { } public void redo ( Worker worker ) throws Exception { } }

Fix:
decoder . decode ( new ByteArrayInputStream ( part . getBody ( ) . getBytes ( "ISO_8859_1" ) ) , new FileOutputStream ( tempFile ) ) ;
Buggy code:
public class CaseStatement extends Statement { public Expression constantExpression ; public CaseLabel targetLabel ; boolean isEnumConstant ; public CaseStatement ( Expression constantExpression , int sourceEnd , int sourceStart ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public StringBuffer printStatement ( int tab , StringBuffer output ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void resolve ( BlockScope scope ) { } public Constant resolveCase ( BlockScope scope , TypeBinding switchExpressionType , SwitchStatement switchStatement ) { scope . switchCase = this ; if ( ( constantExpression ) == null ) { if ( ( switchStatement . defaultCase ) != null ) scope . problemReporter ( ) . duplicateDefaultCase ( this ) ; switchStatement . defaultCase = this ; return NotAConstant ; } switchStatement . cases [ ( ( switchStatement . caseCount ) ++ ) ] = this ; if ( ( switchExpressionType . isEnum ( ) ) && ( ( constantExpression ) instanceof SingleNameReference ) ) { ( ( SingleNameReference ) ( constantExpression ) ) . setActualReceiverType ( ( ( ReferenceBinding ) ( switchExpressionType ) ) ) ; } TypeBinding caseType = constantExpression . resolveType ( scope ) ; if ( ( caseType == null ) || ( switchExpressionType == null ) ) return NotAConstant ; if ( ( constantExpression . isConstantValueOfTypeAssignableToType ( caseType , switchExpressionType ) ) || ( caseType . isCompatibleWith ( switchExpressionType ) ) ) { if ( caseType . isEnum ( ) ) { this . isEnumConstant = true ; if ( ( ( constantExpression ) instanceof NameReference ) && ( ( ( constantExpression . bits ) & ( ASTNode . RestrictiveFlagMASK ) ) == ( Binding . FIELD ) ) ) { NameReference reference = ( ( NameReference ) ( constantExpression ) ) ; FieldBinding field = reference . fieldBinding ( ) ; if ( ( ( field . modifiers ) & ( AccEnum ) ) == 0 ) { scope . problemReporter ( ) . enumSwitchCannotTargetField ( reference , field ) ; } else if ( reference instanceof QualifiedNameReference ) { scope . problemReporter ( ) . cannotUseQualifiedEnumConstantInCaseLabel ( reference , field ) ; } <START_BUG> return Constant . fromValue ( field . id ) ; <END_BUG> } } else { return constantExpression . constant ; } } else if ( scope . isBoxingCompatibleWith ( switchExpressionType , caseType ) ) { constantExpression . computeConversion ( scope , caseType , switchExpressionType ) ; return constantExpression . constant ; } scope . problemReporter ( ) . typeMismatchError ( caseType , switchExpressionType , constantExpression ) ; return NotAConstant ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
return Constant . fromValue ( field . original ( ) . id ) ;
Buggy code:
public class GameStateHandler { private ServerUI ui ; private Vector < ConnectionHandler > IDList ; private boolean isActive = false ; public static void main ( String [ ] args ) { } public GameStateHandler ( ) { } public void handlePoint ( ConnectionHandler c , int x , int y , boolean pulling ) { } public void handleText ( ConnectionHandler c , String msg ) { for ( int i = 0 ; i < ( IDList . size ( ) ) ; i ++ ) { <START_BUG> IDList . elementAt ( i ) . p . writeMessage ( ( ( ( "text" + ( c . name ) ) + ";" ) + msg ) ) ; <END_BUG> } } public void handleColorChange ( ConnectionHandler c , int rgb ) { } public void handleSizeChange ( ConnectionHandler c , int size ) { } public void handleNameChange ( ConnectionHandler c , String newName ) { } public void addToList ( ConnectionHandler c ) { } public void toLog ( String input ) { } public void newPlayerConnected ( String name , String ip ) { } }

Fix:
IDList . elementAt ( i ) . p . writeMessage ( ( ( ( "text" + ( c . name ) ) + ":<seq2seq4repair_space>" ) + msg ) ) ;
Buggy code:
public class InfinispanSSOManagerFactoryBuilder implements SSOManagerFactoryBuilder { public static final String DEFAULT_CACHE_CONTAINER = "web" ; @ Override <START_BUG> public < I , D > ServiceBuilder < SSOManagerFactory < I , D > > build ( ServiceTarget target , ServiceName name , String host ) { <END_BUG> String containerName = InfinispanSSOManagerFactoryBuilder . DEFAULT_CACHE_CONTAINER ; ServiceName containerServiceName = EmbeddedCacheManagerService . getServiceName ( containerName ) ; String templateCacheName = CacheContainer . DEFAULT_CACHE_ALIAS ; String cacheName = host ; ServiceName cacheConfigurationServiceName = CacheConfigurationService . getServiceName ( containerName , cacheName ) ; ServiceName cacheServiceName = CacheService . getServiceName ( containerName , cacheName ) ; SSOCacheConfigurationService . build ( target , containerName , cacheName , templateCacheName ) . setInitialMode ( ON_DEMAND ) . install ( ) ; final InjectedValue < EmbeddedCacheManager > cacheContainer = new InjectedValue ( ) ; CacheService . Dependencies dependencies = new CacheService . Dependencies ( ) { @ Override public EmbeddedCacheManager getCacheContainer ( ) { return cacheContainer . getValue ( ) ; } @ Override public XAResourceRecoveryRegistry getRecoveryRegistry ( ) { return null ; } } ; AsynchronousService . addService ( target , cacheServiceName , new CacheService ( cacheName , dependencies ) ) . addDependency ( cacheConfigurationServiceName ) . addDependency ( containerServiceName , EmbeddedCacheManager . class , cacheContainer ) . setInitialMode ( ON_DEMAND ) . install ( ) ; return InfinispanSSOManagerFactory . build ( target , name , containerName , cacheName ) ; } }

Fix:
public < A , D > ServiceBuilder < SSOManagerFactory < A , D > > build ( ServiceTarget target , ServiceName name , String host ) {
Buggy code:
public class Gremlin { private static double damageProbability = 0 ; public static byte [ ] corruptPacket ( DatagramPacket packet ) { } public static double getDamageProbability ( ) { } public static void setDamageProbability ( double newProbability ) { } private static byte [ ] corruptBytes ( byte [ ] data ) { double timesProbability = Math . random ( ) ; int timesToDamage ; if ( timesProbability <= 0.5 ) { timesToDamage = 1 ; } else if ( ( timesProbability > 0.5 ) && ( timesProbability <= 0.8 ) ) { timesToDamage = 2 ; } else { timesToDamage = 3 ; } System . out . println ( ( ( "Packet<seq2seq4repair_space>damaged<seq2seq4repair_space>" + timesToDamage ) + "<seq2seq4repair_space>time(s)" ) ) ; Random random = new Random ( ) ; int randomIndex ; int [ ] prevIndexes = new int [ ] { - 1 , - 1 , - 1 } ; for ( int i = 0 ; i <= ( timesToDamage - 1 ) ; i ++ ) { do { <START_BUG> randomIndex = random . nextInt ( 256 ) ; <END_BUG> } while ( ( ( randomIndex == ( prevIndexes [ 0 ] ) ) || ( randomIndex == ( prevIndexes [ 1 ] ) ) ) || ( randomIndex == ( prevIndexes [ 2 ] ) ) ) ; prevIndexes [ i ] = randomIndex ; data [ randomIndex ] = Gremlin . generateRandomByte ( ) ; } return data ; } private static byte generateRandomByte ( ) { } }

Fix:
randomIndex = random . nextInt ( data . length ) ;
Buggy code:
class RemoteOutboundConnectionRemoveHandler extends AbstractRemoveStepHandler { static final RemoteOutboundConnectionRemoveHandler INSTANCE = new RemoteOutboundConnectionRemoveHandler ( ) ; private RemoteOutboundConnectionRemoveHandler ( ) { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void recoverServices ( final OperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { <START_BUG> RemoteOutboundConnectionAdd . INSTANCE . installRuntimeService ( context , model , null ) ; <END_BUG> } }

Fix:
RemoteOutboundConnectionAdd . INSTANCE . installRuntimeService ( context , operation , model , null ) ;
Buggy code:
public class Timer { private static Boolean running = false ; private static int minuteTimer = 0 ; public static void startTimer ( ) { if ( Timer . running ) return ; Timer . running = true ; Bukkit . getServer ( ) . getScheduler ( ) . scheduleSyncRepeatingTask ( plugin , new Runnable ( ) { @ Override public void run ( ) { Timer . cooldownLoop ( ) ; Timer . deathLoop ( ) ; Timer . tpCooldown ( ) ; Timer . minionTimer ( ) ; ( Timer . minuteTimer ) ++ ; <START_BUG> if ( ( Timer . minuteTimer ) > 1200 ) { <END_BUG> Timer . minuteTimer = 0 ; Bukkit . getServer ( ) . getScheduler ( ) . scheduleSyncDelayedTask ( plugin , new Runnable ( ) { @ Override public void run ( ) { Shop . timer ( ) ; Points . updateSigns ( Points . highScore ( ) ) ; } } , 1L ) ; } } } , 0 , 20L ) ; } private static void cooldownLoop ( ) { } private static void deathLoop ( ) { } private static void tpCooldown ( ) { } private static void minionTimer ( ) { } No newline ; at end ; of file ; }

Fix:
if ( ( Timer . minuteTimer ) > 2400 ) {
Buggy code:
public class TypeDeclarationPattern extends SearchPattern { protected char [ ] simpleName ; protected char [ ] pkg ; protected char [ ] [ ] enclosingTypeNames ; protected char classOrInterface ; private char [ ] decodedPackage ; private char [ ] [ ] decodedEnclosingTypeNames ; protected char [ ] decodedSimpleName ; protected char decodedClassOrInterface ; public static char [ ] createClassDeclaration ( char [ ] packageName , char [ ] [ ] enclosingTypeNames , char [ ] typeName ) { } public static char [ ] createInterfaceDeclaration ( char [ ] packageName , char [ ] [ ] enclosingTypeNames , char [ ] typeName ) { } protected static char [ ] createTypeDeclaration ( char [ ] packageName , char [ ] [ ] enclosingTypeNames , char [ ] typeName , boolean isClass ) { } public TypeDeclarationPattern ( int matchMode , boolean isCaseSensitive ) { } public TypeDeclarationPattern ( char [ ] pkg , char [ ] [ ] enclosingTypeNames , char [ ] simpleName , char classOrInterface , int matchMode , boolean isCaseSensitive ) { } protected void decodeIndexEntry ( IEntryResult entryResult ) { } <START_BUG> public void feedIndexRequestor ( IIndexSearchRequestor requestor , int detailLevel , int [ ] references , IndexInput input , IJavaSearchScope scope ) throws IOException { <END_BUG> boolean isClass = ( decodedClassOrInterface ) == ( CLASS_SUFFIX ) ; for ( int i = 0 , max = references . length ; i < max ; i ++ ) { IndexedFile file = input . getIndexedFile ( references [ i ] ) ; if ( file != null ) { String path = IndexedFile . convertPath ( file . getPath ( ) ) ; if ( scope . encloses ( path ) ) { if ( isClass ) requestor . acceptClassDeclaration ( path , decodedSimpleName , decodedEnclosingTypeNames , decodedPackage ) ; else requestor . acceptInterfaceDeclaration ( path , decodedSimpleName , decodedEnclosingTypeNames , decodedPackage ) ; } } } } protected char [ ] indexEntryPrefix ( ) { } protected boolean matchIndexEntry ( ) { } public String toString ( ) { } }

Fix:
public void feedIndexRequestor ( IIndexSearchRequestor requestor , int [ ] references , IndexInput input , IJavaSearchScope scope ) throws IOException {
Buggy code:
public class SenseiPluginRegistry { public static final String FACET_CONF_PREFIX = "sensei.custom.facets" ; private Map < String , PluginHolder > pluginsByPrefix = new LinkedHashMap < String , PluginHolder > ( ) ; private Map < String , PluginHolder > pluginsByNames = new LinkedHashMap < String , PluginHolder > ( ) ; private List < PluginHolder > plugins = new ArrayList < PluginHolder > ( ) ; private Configuration configuration ; private static Map < Configuration , SenseiPluginRegistry > cachedRegistries = new IdentityHashMap < Configuration , SenseiPluginRegistry > ( ) ; private SenseiPluginRegistry ( ) { } public static synchronized SenseiPluginRegistry get ( Configuration conf ) { } public static synchronized SenseiPluginRegistry build ( Configuration conf ) { if ( SenseiPluginRegistry . cachedRegistries . containsKey ( conf ) ) { return SenseiPluginRegistry . cachedRegistries . get ( conf ) ; } SenseiPluginRegistry ret = new SenseiPluginRegistry ( ) ; ret . configuration = conf ; Iterator keysIterator = conf . getKeys ( ) ; while ( keysIterator . hasNext ( ) ) { String key = ( ( String ) ( keysIterator . next ( ) ) ) ; if ( key . endsWith ( ".class" ) ) { String prefix = key . substring ( 0 , key . indexOf ( ".class" ) ) ; String pluginName = prefix ; if ( prefix . contains ( "." ) ) { pluginName = prefix . substring ( ( ( prefix . lastIndexOf ( "." ) ) + 1 ) ) ; } String pluginCLass = conf . getString ( key ) ; ret . plugins . add ( new PluginHolder ( ret , pluginCLass , pluginName , prefix ) ) ; } } for ( PluginHolder pluginHolder : ret . plugins ) { ret . pluginsByPrefix . put ( pluginHolder . fullPrefix , pluginHolder ) ; ret . pluginsByNames . put ( pluginHolder . pluginName , pluginHolder ) ; Iterator propertyIterator = conf . getKeys ( pluginHolder . fullPrefix ) ; while ( propertyIterator . hasNext ( ) ) { String propertyName = ( ( String ) ( propertyIterator . next ( ) ) ) ; if ( propertyName . endsWith ( ".class" ) ) { continue ; } String property = propertyName ; if ( propertyName . contains ( pluginHolder . fullPrefix ) ) { property = propertyName . substring ( ( ( pluginHolder . fullPrefix . length ( ) ) + 1 ) ) ; } <START_BUG> pluginHolder . properties . put ( property , conf . getString ( propertyName ) ) ; <END_BUG> } } SenseiPluginRegistry . cachedRegistries . put ( conf , ret ) ; return ret ; } public < T > T getBeanByName ( String name , Class < T > type ) { } public < T > List < T > getBeansByType ( Class < T > type ) { } public List < ? > getBeansByPrefix ( String prefix ) { } public FacetHandler < ? > getFacet ( String name ) { } public < T > T getBeanByFullPrefix ( String fullPrefix , Class < T > type ) { } public < T > List < T > resolveBeansByListKey ( String paramKey , Class < T > returnedClass ) { } public synchronized void start ( ) { } public synchronized void stop ( ) { } public Configuration getConfiguration ( ) { } }

Fix:
pluginHolder . properties . put ( property , conf . getProperty ( propertyName ) . toString ( ) ) ;
Buggy code:
public class MonitorHBaseLog { private static final Log LOG = LogFactory . getLog ( MonitorHBaseLog . class ) ; public static String execCmd ( ) { } public static boolean execResetCmd ( ) { Utils util = new Utils ( ) ; String username = util . getString ( "host.username" ) ; String passwd = util . getString ( "host.passwd" ) ; String cmd = util . getString ( "hbase.exec.reset.cmd" ) ; List < Object > hosts = util . getList ( "hbase.monitor.servers.ip" ) ; if ( ( ( ( StringUtils . isEmpty ( username ) ) || ( StringUtils . isEmpty ( passwd ) ) ) || ( StringUtils . isEmpty ( cmd ) ) ) || ( ( hosts . size ( ) ) == 0 ) ) { MonitorHBaseLog . LOG . error ( "host.username<seq2seq4repair_space>and<seq2seq4repair_space>host.passwd<seq2seq4repair_space>and<seq2seq4repair_space>hbase.exec.reset.cmd<seq2seq4repair_space>and<seq2seq4repair_space>monitor.servers.ip<seq2seq4repair_space>is<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>not<seq2seq4repair_space>null" ) ; return false ; } for ( Object obj : hosts ) { String ipAddress = ( ( String ) ( obj ) ) ; JsshTools ssh = new JsshTools ( ) ; int count = 0 ; int ret = - 1 ; while ( ret != 0 ) { ret = ssh . execute ( cmd , username , passwd , ipAddress ) ; count ++ ; if ( count == 5 ) { <START_BUG> break ; <END_BUG> } if ( ret != 0 ) { MonitorHBaseLog . LOG . info ( ( "cmd<seq2seq4repair_space>exec<seq2seq4repair_space>status<seq2seq4repair_space>failure<seq2seq4repair_space>retry<seq2seq4repair_space>count:" + count ) ) ; try { Thread . sleep ( 500 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } } MonitorHBaseLog . LOG . info ( ( ( ( ( ( "cmd<seq2seq4repair_space>:" + cmd ) + "<seq2seq4repair_space>host<seq2seq4repair_space>:" ) + ipAddress ) + "<seq2seq4repair_space>status<seq2seq4repair_space>:" ) + "success" ) ) ; } return true ; } }

Fix:
return false ;
Buggy code:
public class AutoLabelResolver implements IComponentResolver { private static final long serialVersionUID = 1L ; private static Logger logger = LoggerFactory . getLogger ( AutoLabelResolver . class ) ; static final String WICKET_FOR = "wicket:for" ; public Component resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { } protected Component findRelatedComponent ( MarkupContainer container , final String id ) { } protected static class AutoLabel extends WebMarkupContainer { private static final long serialVersionUID = 1L ; private final Component component ; public AutoLabel ( String id , Component fc ) { } @ Override protected void onComponentTag ( ComponentTag tag ) { } @ Override public void onComponentTagBody ( MarkupStream markupStream , ComponentTag openTag ) { } protected int [ ] findLabelTextRange ( AppendingStringBuffer markup ) { } protected AppendingStringBuffer readBodyMarkup ( MarkupStream markupStream ) { } protected String getLabelText ( ) { } protected final boolean isTextSpan ( XmlTag tag ) { if ( ! ( tag . isOpen ( ) ) ) return false ; if ( ( ! ( "span" . equalsIgnoreCase ( tag . getName ( ) ) ) ) || ( ( tag . getNamespace ( ) ) != null ) ) return false ; String classNames = tag . getAttributes ( ) . getString ( "class" ) ; if ( Strings . isEmpty ( classNames ) ) return false ; boolean textClassFound = false ; for ( String className : classNames . split ( "<seq2seq4repair_space>" ) ) { <START_BUG> if ( "text" . equals ( className ) ) { <END_BUG> textClassFound = true ; break ; } } if ( ! textClassFound ) return false ; return true ; } } }

Fix:
if ( "label-text" . equals ( className ) ) {
Buggy code:
public class SystemController extends TimerTask implements GpioPinListenerDigital { private TrueSensor trueSensor ; private FalseSensor falseSensor ; private QuestionHandler questionHandler ; private int trueCount ; private int falseCount ; private String currentQuestion ; public static void main ( String [ ] args ) { } public void run ( ) { } public SystemController ( ) { } public void handleGpioPinDigitalStateChangeEvent ( GpioPinDigitalStateChangeEvent event ) { <START_BUG> System . out . println ( ( ( ( "<seq2seq4repair_space>--><seq2seq4repair_space>GPIO<seq2seq4repair_space>PIN<seq2seq4repair_space>STATE<seq2seq4repair_space>CHANGE:<seq2seq4repair_space>" + ( event . getPin ( ) . getAddress ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( event . getState ( ) ) ) ) ; <END_BUG> } }

Fix:
System . out . println ( ( ( ( "<seq2seq4repair_space>--><seq2seq4repair_space>GPIO<seq2seq4repair_space>PIN<seq2seq4repair_space>STATE<seq2seq4repair_space>CHANGE:<seq2seq4repair_space>" + ( event . getPin ( ) . getPin ( ) . getAddress ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( event . getState ( ) ) ) ) ;
Buggy code:
public class EntityOldFire extends EntityThrowable { private static final ResourceLocation resourceLocation = new ResourceLocation ( Reference . MODID , "textures//entities//fire.png" ) ; public EntityLivingBase shootingEntity ; public EntityOldFire ( World world ) { } public EntityOldFire ( World world , EntityLivingBase entity ) { } public EntityOldFire ( World world , double x , double y , double z ) { } @ Override protected float getGravityVelocity ( ) { } @ Override public void onUpdate ( ) { if ( ( shootingEntity ) == null ) { return ; } int rotation = 0 ; if ( ! ( worldObj . isRemote ) ) { <START_BUG> PacketDispatcher . sendToAllAround ( new SpawnFireParticles ( this ) , ( ( EntityPlayer ) ( shootingEntity ) ) , 64.0 ) ; <END_BUG> } this . worldObj . spawnParticle ( FLAME , this . posX , this . posY , this . posZ , 0.0 , 0.0 , 0.0 ) ; this . worldObj . spawnParticle ( FLAME , this . posX , this . posY , this . posZ , 0.0 , 0.0 , 0.0 ) ; this . rotationYaw = ( rotation + 1 ) % 360 ; if ( ( ticksExisted ) > 60 ) { setDead ( ) ; } super . onUpdate ( ) ; } @ Override protected void onImpact ( MovingObjectPosition movingObject ) { } }

Fix:
PacketDispatcher . sendToAllAround ( new SpawnFireParticles ( this , 0 ) , ( ( EntityPlayer ) ( shootingEntity ) ) , 64.0 ) ;
Buggy code:
public interface TestTypesInterface extends ActiveRecord { @ Attribute ( type = Types . CHAR , typeName = TypeMappings . UUID_TYPE_NAME , name = "uuid" ) public default UUID getUUID ( ) { } public default void setUUID ( UUID id ) { } @ Attribute ( type = Types . VARCHAR , typeName = TypeMappings . URL_TYPE_NAME , name = "url" ) public default URL getURL ( ) throws MalformedURLException { } public default void setURL ( URL url ) { } public default URI getURI ( ) { } public default void setURI ( URI uri ) { } @ Attribute ( type = Types . VARCHAR , typeName = TypeMappings . PATH_TYPE_NAME , name = "path" ) public default Path getPath ( ) { } public default void setPath ( Path path ) { } @ Attribute ( type = Types . VARCHAR , typeName = TypeMappings . ENUM_TYPE_NAME , name = "enum" ) public default RoundingMode getEnum ( ) { } public default void setEnum ( RoundingMode mode ) { } @ Attribute ( type = Types . INTEGER , name = "enum_ordinal" ) public default RoundingMode getEnumOrdinal ( ) { } public default void setEnumOrdinal ( RoundingMode mode ) { } @ Attribute ( type = Types . VARCHAR , typeName = "VARCHAR(100)" , name = "db_mappable" ) public default TestTypesInterface . TestDBMappableImpl getDBMappable ( ) { } public default void setDBMappable ( TestTypesInterface . TestDBMappableImpl obj ) { } <START_BUG> @ Attribute ( name = "xml" , type = Types . VARCHAR , typeName = "VARCHAR(1)" ) <END_BUG> public default InputStream readXML ( ) throws SQLException { return TypeMappings . readXML ( this , "xml" ) ; } public default void writeXML ( String xml ) throws SQLException { } static class TestDBMappableImpl implements DBMappable { String testString ; int testInteger ; public TestDBMappableImpl ( ) { } @ Override public void readFromDBValue ( Object dbValue ) { } @ Override public Object toDBValue ( ) { } } }

Fix:
@ Attribute ( name = "xml" , type = Types . SQLXML )
Buggy code:
public class SharedObjectContainerFactory implements ISharedObjectContainerFactory { protected static ISharedObjectContainerFactory instance = null ; protected SharedObjectContainerFactory ( ) { } public static ISharedObjectContainerFactory getDefault ( ) { } private static void trace ( String msg ) { } public ISharedObjectContainer createSharedObjectContainer ( ContainerTypeDescription desc , String [ ] argTypes , Object [ ] args ) throws ContainerCreateException { SharedObjectContainerFactory . trace ( ( ( ( ( ( ( "createSharedObjectContainer(" + desc ) + "," ) + ( Trace . getArgumentsString ( argTypes ) ) ) + "," ) + ( Trace . getArgumentsString ( args ) ) ) + ")" ) ) ; if ( desc == null ) throw new ContainerCreateException ( "ContainerTypeDescription<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; <START_BUG> IContainer newContainer = ContainerFactory . getDefault ( ) . createContainer ( desc , argTypes , args ) ; <END_BUG> ISharedObjectContainer soContainer = ( ( ISharedObjectContainer ) ( newContainer . getAdapter ( ISharedObjectContainer . class ) ) ) ; if ( soContainer == null ) { newContainer . dispose ( ) ; throw new ContainerCreateException ( "new<seq2seq4repair_space>container<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>shared<seq2seq4repair_space>object<seq2seq4repair_space>container" ) ; } return soContainer ; } public ISharedObjectContainer createSharedObjectContainer ( String descriptionName ) throws ContainerCreateException { } public ISharedObjectContainer createSharedObjectContainer ( String descriptionName , Object [ ] args ) throws ContainerCreateException { } public ISharedObjectContainer createSharedObjectContainer ( String descriptionName , String [ ] argsTypes , Object [ ] args ) throws ContainerCreateException { } }

Fix:
IContainer newContainer = ContainerFactory . getDefault ( ) . createContainer ( desc , args ) ;
Buggy code:
public class JaxrsDependencyProcessor implements DeploymentUnitProcessor { public static ModuleIdentifier RESTEASY_JAXRS = ModuleIdentifier . create ( "org.jboss.resteasy.resteasy-jaxrs" ) ; public static ModuleIdentifier JAXRS_API = ModuleIdentifier . create ( "javax.ws.rs.api" ) ; public static ModuleIdentifier ASYNC_HTTP_SERVLET_30 = ModuleIdentifier . create ( "org.jboss.resteasy.async-http-servlet-30" ) ; public static ModuleIdentifier RESTEASY_CDI = ModuleIdentifier . create ( "org.jboss.resteasy.resteasy-cdi" ) ; public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; if ( ! ( JaxrsDeploymentMarker . isJaxrsDeployment ( deploymentUnit ) ) ) { return ; } final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; addDepdenency ( moduleSpecification , moduleLoader , JaxrsDependencyProcessor . RESTEASY_JAXRS ) ; addDepdenency ( moduleSpecification , moduleLoader , JaxrsDependencyProcessor . JAXRS_API ) ; addDepdenency ( moduleSpecification , moduleLoader , JaxrsDependencyProcessor . ASYNC_HTTP_SERVLET_30 ) ; <START_BUG> if ( WeldDeploymentMarker . isWeldDeployment ( deploymentUnit ) ) { <END_BUG> addDepdenency ( moduleSpecification , moduleLoader , JaxrsDependencyProcessor . RESTEASY_CDI ) ; } } private void addDepdenency ( ModuleSpecification moduleSpecification , ModuleLoader moduleLoader , ModuleIdentifier moduleIdentifier ) { } @ Override public void undeploy ( DeploymentUnit context ) { } }

Fix:
if ( WeldDeploymentMarker . isPartOfWeldDeployment ( deploymentUnit ) ) {
Buggy code:
public class GET extends AbstractQuery implements Shift { public static final GET _ = new GET ( ) ; private static boolean debug = true ; private GET ( ) { } protected GET ( String ... name ) { } public OnQuestion onCalcQuestion ( ) { } private OnQuestion question = new OnQuestion ( ) { @ Override public void onMessage ( final PFlow pf ) { } private void evalGet ( final PFlow pf , final Relationship op , final Node node , final Set < Node > thes , final Set < Relationship > visitedREFs ) { } } ; public boolean get ( PFlow pf , QCAVector vector , final Set < Node > thes , Set < Relationship > visitedREFs ) { } private boolean check ( final PFlow pf , final QCAVector v , final Relationship toCheck , final Set < Node > thes , Set < Relationship > visitedREFs ) { } public boolean get ( final PFlow pf , final Set < QCAVector > REFs , final Set < Node > thes , Set < Relationship > visitedREFs ) { } private void getOutgoingReferences ( PFlow pf , QCAVector vector , Relationship rr , Node node , Set < QCAVector > newREFs , Set < Relationship > visitedREFs ) { QCAVector prev = null ; IndexHits < Relationship > it = Order . context ( node ) ; try { for ( Relationship r : it ) { prev = vector . question ( r , prev ) ; Statement st = Statements . relationshipType ( r ) ; if ( st instanceof AN ) { for ( QCAVector v : AN . getREFs ( pf , prev ) ) { <START_BUG> Relationship t = v . getAnswer ( ) ; <END_BUG> prev . addAnswer ( v ) ; if ( ( visitedREFs != null ) && ( ! ( visitedREFs . contains ( t ) ) ) ) { newREFs . add ( v ) ; } } } else if ( st instanceof Reference ) { if ( ! ( pf . isInStack ( r ) ) ) { try { PipedInput < QCAVector > in = Evaluator . _ . execute ( prev ) ; for ( QCAVector v : in ) { prev . addAnswer ( v ) ; if ( ( visitedREFs != null ) && ( ! ( visitedREFs . contains ( v . getAnswer ( ) ) ) ) ) newREFs . add ( v ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } } } } } catch ( Exception e ) { pf . sendException ( e ) ; } finally { it . close ( ) ; } } private boolean searchForHAVE ( final PFlow pf , final Relationship ref , final QCAVector v , final Set < Node > thes ) { } private boolean relaxReference ( PFlow pf , QCAVector vector , Relationship op ) { } private static TraversalDescription prepared = Traversal . description ( ) . depthFirst ( ) . uniqueness ( RELATIONSHIP_PATH ) . relationships ( ANY . _ , OUTGOING ) . relationships ( AN . _ , OUTGOING ) . relationships ( REF . _ , OUTGOING ) . relationships ( SHALL . _ , OUTGOING ) ; private boolean getByHave ( final PFlow pf , QCAVector vector , Relationship op , final Node context , final Set < Node > thes ) { } }

Fix:
Relationship t = v . getClosest ( ) ;
Buggy code:
class CSVLexer3 extends Lexer { private final char escape ; public CSVLexer3 ( final CSVFormat format , final ExtendedBufferedReader in ) { } private static enum CharType { DELIM , ESCAPE , ENCAP , EOL , COMMENT_START , WHITESPACE , OTHER , EOFCHAR ; } private CSVLexer3 . CharType classify ( final int intch ) { if ( isDelimiter ( intch ) ) { return CSVLexer3 . CharType . DELIM ; } if ( isCommentStart ( intch ) ) { return CSVLexer3 . CharType . COMMENT_START ; } <START_BUG> if ( isEncapsulator ( intch ) ) { <END_BUG> return CSVLexer3 . CharType . ENCAP ; } if ( isEscape ( intch ) ) { return CSVLexer3 . CharType . ESCAPE ; } if ( ( intch == '\r' ) || ( intch == '\n' ) ) { return CSVLexer3 . CharType . EOL ; } if ( isWhitespace ( intch ) ) { return CSVLexer3 . CharType . WHITESPACE ; } if ( intch == ( Constants . END_OF_STREAM ) ) { return CSVLexer3 . CharType . EOFCHAR ; } return CSVLexer3 . CharType . OTHER ; } private static enum State { BEGIN , PLAIN , INQUOTE , QUOTEQUOTE , ESCAPE_PLAIN , ESCAPE_QUOTE ; } @ Override Token nextToken ( final Token tkn ) throws IOException { } }

Fix:
if ( isQuoteChar ( intch ) ) {
Buggy code:
public final class ObjectByte { public static final byte [ ] toByteArray ( Serializable obj ) { if ( obj == null ) return null ; byte [ ] bytes = null ; ByteArrayOutputStream bos = null ; ObjectOutputStream oos = null ; try { bos = new ByteArrayOutputStream ( ) ; oos = new ObjectOutputStream ( bos ) ; <START_BUG> oos . writeObject ( obj ) ; <END_BUG> oos . flush ( ) ; bytes = bos . toByteArray ( ) ; } catch ( IOException ex ) { ex . printStackTrace ( ) ; } finally { try { if ( oos != null ) oos . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { if ( bos != null ) bos . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return bytes ; } public static final Object toObject ( byte [ ] bytes ) { } }

Fix:
oos . writeObject ( "Today" ) ;
Buggy code:
@ RunWith ( SpringJUnit4ClassRunner . class ) @ DirtiesContext ( classMode = ClassMode . AFTER_EACH_TEST_METHOD ) public abstract class AbstractTransactionalAnnotatedConfigClassTests { protected static final String JANE = "jane" ; protected static final String SUE = "sue" ; protected static final String YODA = "yoda" ; protected DataSource dataSourceFromTxManager ; protected DataSource dataSourceViaInjection ; protected JdbcTemplate jdbcTemplate ; @ Autowired private Employee employee ; @ Autowired public void setTransactionManager ( DataSourceTransactionManager transactionManager ) { } @ Autowired public void setDataSource ( DataSource dataSource ) { } private int countRowsInTable ( String tableName ) { <START_BUG> return jdbcTemplate . queryForInt ( ( "SELECT<seq2seq4repair_space>COUNT(0)<seq2seq4repair_space>FROM<seq2seq4repair_space>" + tableName ) ) ; <END_BUG> } private int createPerson ( String name ) { } protected int deletePerson ( String name ) { } protected void assertNumRowsInPersonTable ( int expectedNumRows , String testState ) { } protected void assertAddPerson ( final String name ) { } @ Test public void autowiringFromConfigClass ( ) { } @ BeforeTransaction public void beforeTransaction ( ) { } @ Before public void setUp ( ) throws Exception { } @ Test @ Transactional public void modifyTestDataWithinTransaction ( ) { } @ After public void tearDown ( ) throws Exception { } @ AfterTransaction public void afterTransaction ( ) { } }

Fix:
return jdbcTemplate . queryForObject ( ( "SELECT<seq2seq4repair_space>COUNT(0)<seq2seq4repair_space>FROM<seq2seq4repair_space>" + tableName ) , Integer . class ) ;