nus-yam/ex-repair huggingface dataset:
Buggy code:
public class QuorumResponseHandler < T > implements IAsyncCallback { protected static final Logger logger = Logger . getLogger ( QuorumResponseHandler . class ) ; protected final SimpleCondition condition = new SimpleCondition ( ) ; protected final Collection < Message > responses ; private IResponseResolver < T > responseResolver ; private final long startTime ; public QuorumResponseHandler ( int responseCount , IResponseResolver < T > responseResolver ) { } public T get ( ) throws IOException , TimeoutException , DigestMismatchException { try { <START_BUG> long timeout = ( ( System . currentTimeMillis ( ) ) - ( startTime ) ) + ( DatabaseDescriptor . getRpcTimeout ( ) ) ; <END_BUG> boolean success ; try { success = condition . await ( timeout , TimeUnit . MILLISECONDS ) ; } catch ( InterruptedException ex ) { throw new AssertionError ( ex ) ; } if ( ! success ) { StringBuilder sb = new StringBuilder ( "" ) ; for ( Message message : responses ) { sb . append ( message . getFrom ( ) ) ; } throw new TimeoutException ( ( ( ( ( "Operation<seq2seq4repair_space>timed<seq2seq4repair_space>out<seq2seq4repair_space>-<seq2seq4repair_space>received<seq2seq4repair_space>only<seq2seq4repair_space>" + ( responses . size ( ) ) ) + "<seq2seq4repair_space>responses<seq2seq4repair_space>from<seq2seq4repair_space>" ) + ( sb . toString ( ) ) ) + "<seq2seq4repair_space>." ) ) ; } } finally { for ( Message response : responses ) { MessagingService . removeRegisteredCallback ( response . getMessageId ( ) ) ; } } return responseResolver . resolve ( responses ) ; } public void response ( Message message ) { } }

Fix:
long timeout = ( DatabaseDescriptor . getRpcTimeout ( ) ) - ( ( System . currentTimeMillis ( ) ) - ( startTime ) ) ;
Buggy code:
public class BatchImageBuilder extends AbstractImageBuilder { protected BatchImageBuilder ( JavaBuilder javaBuilder ) { } public void build ( ) { } protected void addAllSourceFiles ( final ArrayList locations , final ArrayList typeNames ) throws CoreException { } protected void scrubOutputFolder ( ) throws CoreException { } protected void copyExtraResourcesBack ( ) throws CoreException { final IPath outputPath = outputFolder . getFullPath ( ) ; for ( int i = 0 , length = sourceFolders . length ; i < length ; i ++ ) { IContainer sourceFolder = sourceFolders [ i ] ; final IPath sourcePath = sourceFolder . getFullPath ( ) ; final int segmentCount = sourcePath . segmentCount ( ) ; sourceFolder . accept ( new IResourceVisitor ( ) { public boolean visit ( IResource resource ) throws CoreException { switch ( resource . getType ( ) ) { case IResource . FILE : String extension = resource . getFileExtension ( ) ; if ( JAVA_EXTENSION . equalsIgnoreCase ( extension ) ) return false ; if ( CLASS_EXTENSION . equalsIgnoreCase ( extension ) ) return false ; if ( javaBuilder . filterResource ( resource ) ) return false ; IPath partialPath = resource . getFullPath ( ) . removeFirstSegments ( segmentCount ) ; IResource copiedResource = outputFolder . getFile ( partialPath ) ; if ( copiedResource . exists ( ) ) { createErrorFor ( resource , Util . bind ( "build.duplicateResource" ) ) ; } else { resource . copy ( copiedResource . getFullPath ( ) , true , null ) ; <START_BUG> resource . setDerived ( true ) ; <END_BUG> } return false ; case IResource . FOLDER : if ( resource . getFullPath ( ) . equals ( outputPath ) ) return false ; if ( resource . getFullPath ( ) . equals ( sourcePath ) ) return true ; if ( resource . getName ( ) . equalsIgnoreCase ( "CVS" ) ) return false ; getOutputFolder ( resource . getFullPath ( ) . removeFirstSegments ( segmentCount ) ) ; } return true ; } } ) ; } } public String toString ( ) { } }

Fix:
copiedResource . setDerived ( true ) ;
Buggy code:
public class SliceQueryFilter extends QueryFilter { private static Logger logger = Logger . getLogger ( SliceQueryFilter . class ) ; public final byte [ ] start ; public final byte [ ] finish ; public final boolean reversed ; public final int count ; public SliceQueryFilter ( String key , QueryPath columnParent , byte [ ] start , byte [ ] finish , boolean reversed , int count ) { } public ColumnIterator getMemColumnIterator ( Memtable memtable , ColumnFamily cf , AbstractType comparator ) { } public ColumnIterator getSSTableColumnIterator ( SSTableReader sstable ) throws IOException { } public SuperColumn filterSuperColumn ( SuperColumn superColumn , int gcBefore ) { } @ Override public Comparator < IColumn > getColumnComparator ( AbstractType comparator ) { } public void collectReducedColumns ( IColumnContainer container , Iterator < IColumn > reducedColumns , int gcBefore ) { int liveColumns = 0 ; AbstractType comparator = container . getComparator ( ) ; while ( reducedColumns . hasNext ( ) ) { if ( liveColumns >= ( count ) ) break ; IColumn column = reducedColumns . next ( ) ; if ( SliceQueryFilter . logger . isDebugEnabled ( ) ) SliceQueryFilter . logger . debug ( ( "collecting<seq2seq4repair_space>" + ( column . getString ( comparator ) ) ) ) ; if ( ( ( ( finish . length ) > 0 ) && ( ( ! ( reversed ) ) && ( ( comparator . compare ( column . name ( ) , finish ) ) > 0 ) ) ) || ( ( reversed ) && ( ( comparator . compare ( column . name ( ) , finish ) ) < 0 ) ) ) break ; <START_BUG> if ( ( ! ( column . isMarkedForDelete ( ) ) ) && ( ( ! ( container . isMarkedForDelete ( ) ) ) || ( ( column . mostRecentLiveChangeAt ( ) ) > ( container . getMarkedForDeleteAt ( ) ) ) ) ) { <END_BUG> liveColumns ++ ; } if ( QueryFilter . isRelevant ( column , container , gcBefore ) ) container . addColumn ( column ) ; } } }

Fix:
if ( ( column . isLive ( ) ) && ( ( ! ( container . isMarkedForDelete ( ) ) ) || ( ( column . mostRecentLiveChangeAt ( ) ) > ( container . getMarkedForDeleteAt ( ) ) ) ) ) {
Buggy code:
public abstract class RungeKuttaIntegrator extends AbstractIntegrator { private final double [ ] c ; private final double [ ] [ ] a ; private final double [ ] b ; private final RungeKuttaStepInterpolator prototype ; private final double step ; protected RungeKuttaIntegrator ( final String name , final double [ ] c , final double [ ] [ ] a , final double [ ] b , final RungeKuttaStepInterpolator prototype , final double step ) { } @ Override public void integrate ( final ExpandableStatefulODE equations , final double t ) throws MathIllegalArgumentException , MathIllegalStateException { sanityChecks ( equations , t ) ; setEquations ( equations ) ; resetEvaluations ( ) ; final boolean forward = t > ( equations . getTime ( ) ) ; final double [ ] y0 = equations . getCompleteState ( ) ; final double [ ] y = y0 . clone ( ) ; final int stages = ( c . length ) + 1 ; final double [ ] [ ] yDotK = new double [ stages ] [ ] ; for ( int i = 0 ; i < stages ; ++ i ) { yDotK [ i ] = new double [ y0 . length ] ; } <START_BUG> final double [ ] yTmp = new double [ y0 . length ] ; <END_BUG> final double [ ] yDotTmp = new double [ y0 . length ] ; final RungeKuttaStepInterpolator interpolator = ( ( RungeKuttaStepInterpolator ) ( prototype . copy ( ) ) ) ; interpolator . reinitialize ( this , yTmp , yDotK , forward , equations . getPrimaryMapper ( ) , equations . getSecondaryMappers ( ) ) ; interpolator . storeTime ( equations . getTime ( ) ) ; stepStart = equations . getTime ( ) ; stepSize = ( forward ) ? step : - ( step ) ; for ( StepHandler handler : stepHandlers ) { handler . reset ( ) ; } setStateInitialized ( false ) ; isLastStep = false ; do { interpolator . shift ( ) ; computeDerivatives ( stepStart , y , yDotK [ 0 ] ) ; for ( int k = 1 ; k < stages ; ++ k ) { for ( int j = 0 ; j < ( y0 . length ) ; ++ j ) { double sum = ( a [ ( k - 1 ) ] [ 0 ] ) * ( yDotK [ 0 ] [ j ] ) ; for ( int l = 1 ; l < k ; ++ l ) { sum += ( a [ ( k - 1 ) ] [ l ] ) * ( yDotK [ l ] [ j ] ) ; } yTmp [ j ] = ( y [ j ] ) + ( ( stepSize ) * sum ) ; } computeDerivatives ( ( ( stepStart ) + ( ( c [ ( k - 1 ) ] ) * ( stepSize ) ) ) , yTmp , yDotK [ k ] ) ; } for ( int j = 0 ; j < ( y0 . length ) ; ++ j ) { double sum = ( b [ 0 ] ) * ( yDotK [ 0 ] [ j ] ) ; for ( int l = 1 ; l < stages ; ++ l ) { sum += ( b [ l ] ) * ( yDotK [ l ] [ j ] ) ; } yTmp [ j ] = ( y [ j ] ) + ( ( stepSize ) * sum ) ; } interpolator . storeTime ( ( ( stepStart ) + ( stepSize ) ) ) ; System . arraycopy ( yTmp , 0 , y , 0 , y0 . length ) ; System . arraycopy ( yDotK [ ( stages - 1 ) ] , 0 , yDotTmp , 0 , y0 . length ) ; stepStart = acceptStep ( interpolator , y , yDotTmp , t ) ; if ( ! ( isLastStep ) ) { interpolator . storeTime ( stepStart ) ; final double nextT = ( stepStart ) + ( stepSize ) ; final boolean nextIsLast = ( forward ) ? nextT >= t : nextT <= t ; if ( nextIsLast ) { stepSize = t - ( stepStart ) ; } } } while ( ! ( isLastStep ) ) ; equations . setTime ( stepStart ) ; equations . setCompleteState ( y ) ; stepStart = Double . NaN ; stepSize = Double . NaN ; } }

Fix:
final double [ ] yTmp = y0 . clone ( ) ;
Buggy code:
@ Version ( AsVersion . V_7_1_2_Final ) public class SimpleMixedDomain_7_1_2_Final_TestCase extends SimpleMixedDomainTest { @ BeforeClass public static void beforeClass ( ) { <START_BUG> MixedDomainTestSuite . getSupport ( SimpleMixedDomain_7_1_2_Final_TestCase . class ) ; <END_BUG> } }

Fix:
MixedDomainTestSuite . getSupport ( MixedDomain_7_1_2_Final_TestSuite . class ) ;
Buggy code:
public class ClaimManagerFragment extends Fragment { private EditText descriptionView ; private ArrayList < Tag > tagList ; private TextView startDateView ; private TextView endDateView ; private TextView destinationView ; private TextView tagView ; private String description ; private String startDateText ; private String endDateText ; private TravelItineraryList itineraryList ; private Date startDate ; private Date endDate ; private boolean incompleteFields ; private boolean invalidDates ; private boolean isEditing ; private int claimIndex ; private ClaimActivity activity ; public void setStateAsEditing ( boolean isEditing ) { } private void setFields ( ) { if ( isEditing ) { Claim editClaim = ClaimListSingleton . getClaimList ( ) . getClaimAtIndex ( claimIndex ) ; this . description = editClaim . getDescription ( ) ; this . startDate = editClaim . getStartDate ( ) ; this . endDate = editClaim . getEndDate ( ) ; this . itineraryList = editClaim . getTravelList ( ) ; this . descriptionView . setText ( this . description ) ; this . startDateView . setText ( editClaim . getStartDateAsString ( ) ) ; this . endDateView . setText ( editClaim . getEndDateAsString ( ) ) ; this . destinationView . setText ( editClaim . getTravelItineraryAsString ( ) ) ; <START_BUG> this . tagView . setText ( editClaim . getTags ( ) . toString ( ) ) ; <END_BUG> } else { this . descriptionView . setText ( "" ) ; } } public void openDateDialog ( TextView textId ) { } @ SuppressWarnings ( "deprecation" ) public void addDateData ( int year , int month , int day , TextView text ) { } public void openDestinationDialog ( ) { } public boolean createClaim ( ) throws EmptyFieldException , InvalidDateException , InvalidUserPermissionException { } public void openTagDialog ( ) { } public void updateClaim ( ) throws EmptyFieldException , InvalidDateException , InvalidUserPermissionException { } public void updateReferences ( ) { } public void addTravelItenerarItem ( TravelItinerary item ) { } public void addTagItem ( String tag ) { } public void setClaimIndex ( int index ) { } public boolean isEditing ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onStart ( ) { } }

Fix:
this . tagView . setText ( editClaim . getTagsAsString ( ) ) ;
Buggy code:
public class ChecklistBuilder { private Logger log = LoggerFactory . getLogger ( ChecklistBuilder . class ) ; private DwcaWriter writer ; private final WikipediaConfig cfg ; private Date modifiedDate ; private URL url ; public ChecklistBuilder ( WikipediaConfig cfg ) { } private File download ( ) throws IOException { } public void parse ( ) throws IOException { } private Dataset buildEml ( ) throws IOException { Dataset dataset = new Dataset ( ) ; dataset . setTitle ( ( ( cfg . getLanguage ( ) . getTitleEnglish ( ) ) + "<seq2seq4repair_space>Wikipedia<seq2seq4repair_space>-<seq2seq4repair_space>Species<seq2seq4repair_space>Pages" ) ) ; dataset . setLanguage ( ENGLISH ) ; dataset . setDataLanguage ( cfg . getLanguage ( ) ) ; <START_BUG> String description = Resources . toString ( Resources . getResource ( "" ) , Charsets . UTF_8 ) ; <END_BUG> dataset . setDescription ( description . replaceAll ( "$LANGUAGE" , cfg . getLanguage ( ) . getTitleEnglish ( ) ) . replaceAll ( "$DATE" , DateFormatUtils . ISO_DATE_FORMAT . format ( modifiedDate ) ) ) ; dataset . setPubDate ( modifiedDate ) ; dataset . setHomepage ( URI . create ( ( ( "http:////" + ( cfg . lang ) ) + ".wikipedia.org" ) ) ) ; addDeveloper ( dataset , METADATA_AUTHOR , ORIGINATOR , ADMINISTRATIVE_POINT_OF_CONTACT ) ; DataDescription d = new DataDescription ( ) ; d . setUrl ( URI . create ( url . toString ( ) ) ) ; d . setFormat ( "XML" ) ; d . setName ( "Wikipedia<seq2seq4repair_space>Article<seq2seq4repair_space>Dump" ) ; dataset . getDataDescriptions ( ) . add ( d ) ; return dataset ; } private void addDeveloper ( Dataset dataset , ContactType ... roles ) { } public static void main ( String [ ] args ) throws IOException { } }

Fix:
String description = Resources . toString ( Resources . getResource ( "description.txt" ) , Charsets . UTF_8 ) ;
Buggy code:
public class DNDExample { private int dragOperation = 0 ; private Transfer [ ] dragTypes = new Transfer [ 0 ] ; private Control dragControl ; private int dragControlType = 0 ; private DragSource dragSource ; private String dragDataText ; private String dragDataRTF ; private String dragDataHTML ; private String dragDataURL ; private String [ ] dragDataFiles ; private List fileList ; private boolean dragEnabled = false ; private int dropOperation = 0 ; private int dropFeedback = 0 ; private int dropDefaultOperation = 0 ; private Transfer [ ] dropTypes = new Transfer [ 0 ] ; private DropTarget dropTarget ; private Control dropControl ; private int dropControlType = 0 ; private Composite defaultParent ; private boolean dropEnabled = false ; private Text dragConsole ; private boolean dragEventDetail = false ; private Text dropConsole ; private boolean dropEventDetail = false ; private Image itemImage ; private static final int BUTTON_TOGGLE = 0 ; private static final int BUTTON_RADIO = 1 ; private static final int BUTTON_CHECK = 2 ; private static final int CANVAS = 3 ; private static final int LABEL = 4 ; private static final int LIST = 5 ; private static final int TABLE = 6 ; private static final int TREE = 7 ; private static final int TEXT = 8 ; private static final int STYLED_TEXT = 9 ; private static final int COMBO = 10 ; public static void main ( String [ ] args ) { } private void addDragTransfer ( Transfer transfer ) { } private void addDropTransfer ( Transfer transfer ) { } private void createDragOperations ( Composite parent ) { } private void createDragSource ( ) { } private void createDragTypes ( Composite parent ) { } private void createDragWidget ( Composite parent ) { } private void createDropOperations ( Composite parent ) { } private void createDropTarget ( ) { } private void createFeedbackTypes ( Group parent ) { } private void createDropTypes ( Composite parent ) { } private void createDropWidget ( Composite parent ) { } private Control createWidget ( int type , Composite parent , String prefix ) { } public void open ( Display display ) { } private void printEvent ( DragSourceEvent e ) { if ( ! ( dragEventDetail ) ) return ; StringBuffer sb = new StringBuffer ( ) ; sb . append ( "widget:<seq2seq4repair_space>" ) ; sb . append ( e . widget ) ; sb . append ( ",<seq2seq4repair_space>time:<seq2seq4repair_space>" ) ; sb . append ( e . time ) ; sb . append ( ",<seq2seq4repair_space>operation:<seq2seq4repair_space>" ) ; sb . append ( e . detail ) ; sb . append ( ",<seq2seq4repair_space>type:<seq2seq4repair_space>" ) ; <START_BUG> sb . append ( ( ( e . dataType ) != null ? e . dataType . type : "0" ) ) ; <END_BUG> sb . append ( ",<seq2seq4repair_space>doit:<seq2seq4repair_space>" ) ; sb . append ( e . doit ) ; sb . append ( ",<seq2seq4repair_space>data:<seq2seq4repair_space>" ) ; sb . append ( e . data ) ; sb . append ( "\n" ) ; dragConsole . append ( sb . toString ( ) ) ; } private void printEvent ( DropTargetEvent e ) { } private void removeDragTransfer ( Transfer transfer ) { } private void removeDropTransfer ( Transfer transfer ) { } }

Fix:
sb . append ( ( ( e . dataType ) != null ? e . dataType . type : '0' ) ) ;
Buggy code:
public class ReactionDataTriple extends ReactionData { public final EnumType type3 ; public final int preState3 ; public final int postState3 ; public final boolean preBonded23 ; public final boolean preBonded31 ; public final boolean postBonded23 ; public final boolean postBonded31 ; public ReactionDataTriple ( EnumType type1 , EnumType type2 , EnumType type3 , int preState1 , int preState2 , int prestate3 , int postState1 , int postState2 , int postState3 , boolean preBonded , boolean preBonded23 , boolean preBonded31 , boolean postBonded , boolean postBonded23 , boolean postBonded31 ) { } public static ReactionData fromString ( String s ) { } @ Override public String toString ( ) { <START_BUG> return String . format ( "%c%d<seq2seq4repair_space>%c<seq2seq4repair_space>%c%d<seq2seq4repair_space>%c<seq2seq4repair_space>%c%d<seq2seq4repair_space>%c<seq2seq4repair_space>to<seq2seq4repair_space>%d<seq2seq4repair_space>%c<seq2seq4repair_space>%d<seq2seq4repair_space>%c<seq2seq4repair_space>%d<seq2seq4repair_space>%c" , symbol , preState1 , ( preBonded ? '-' : '+' ) , type2 . symbol , preState2 , ( preBonded23 ? '-' : '+' ) , type3 . symbol , preState3 , ( preBonded31 ? '-' : '+' ) , postState1 , ( postBonded ? '-' : '+' ) , postState2 , ( postBonded23 ? '-' : '+' ) , postState3 , ( postBonded31 ? '-' : '+' ) ) ; <END_BUG> } @ Override public Object clone ( ) throws CloneNotSupportedException { } @ Override public int hashCode ( ) { } @ Override public boolean matches ( Atom a1 , Atom a2 , Atom a3 ) { } private boolean matchesTriple ( Atom a1 , Atom a2 , Atom a3 ) { } @ Override public void apply ( Atom a1 , Atom a2 , Atom a3 , AbstractMap map , Simulator simulator ) { } private boolean applyTriple ( Atom atom1 , Atom atom2 , Atom atom3 , AbstractMap map , Simulator simulator ) { } }

Fix:
return String . format ( "3:<seq2seq4repair_space>%c%d<seq2seq4repair_space>%c<seq2seq4repair_space>%c%d<seq2seq4repair_space>%c<seq2seq4repair_space>%c%d<seq2seq4repair_space>%c<seq2seq4repair_space>to<seq2seq4repair_space>%d<seq2seq4repair_space>%c<seq2seq4repair_space>%d<seq2seq4repair_space>%c<seq2seq4repair_space>%d<seq2seq4repair_space>%c" , symbol , preState1 , ( preBonded ? '-' : '+' ) , type2 . symbol , preState2 , ( preBonded23 ? '-' : '+' ) , type3 . symbol , preState3 , ( preBonded31 ? '-' : '+' ) , postState1 , ( postBonded ? '-' : '+' ) , postState2 , ( postBonded23 ? '-' : '+' ) , postState3 , ( postBonded31 ? '-' : '+' ) ) ;
Buggy code:
public class VersionCollector { private static final Logger logger = LoggerFactory . getLogger ( VersionCollector . class ) ; public VersionCollector ( ) { } public VersionCollectionRequest collectVersions ( Path artifactBasePath ) { } private Path getPomPath ( Path artifactBasePath , Path versionDirectoryPath ) { } public List < SnapshotVersion > collectTimestampedSnapshotVersions ( Path artifactVersionPath ) throws IOException { List < SnapshotVersion > snapshotVersions = new ArrayList < > ( ) ; ArtifactVersionDirectoryVisitor artifactVersionDirectoryVisitor = new ArtifactVersionDirectoryVisitor ( ) ; Files . walkFileTree ( artifactVersionPath , artifactVersionDirectoryVisitor ) ; for ( Path filePath : artifactVersionDirectoryVisitor . getMatchingPaths ( ) ) { Artifact artifact = ArtifactUtils . convertPathToArtifact ( filePath . toString ( ) ) ; String name = filePath . toFile ( ) . getName ( ) ; <START_BUG> SnapshotVersion snapshotVersion = MetadataHelper . createSnapshotVersion ( artifact , name ) ; <END_BUG> snapshotVersions . add ( snapshotVersion ) ; } if ( ! ( snapshotVersions . isEmpty ( ) ) ) { Collections . sort ( snapshotVersions , new SnapshotVersionComparator ( ) ) ; } return snapshotVersions ; } public Versioning generateVersioning ( List < MetadataVersion > versions ) { } public Versioning generateSnapshotVersions ( List < SnapshotVersion > snapshotVersionList ) { } private boolean artifactIsPlugin ( Model model ) { } private boolean artifactIsSnapshot ( Model model ) { } private Model getPom ( Path filePath ) throws IOException , XmlPullParserException { } }

Fix:
SnapshotVersion snapshotVersion = MetadataHelper . createSnapshotVersion ( artifact , FilenameUtils . getExtension ( name ) ) ;
Buggy code:
public class ReadResourceChildOrderingTestCase extends AbstractControllerTestBase { private String [ ] str = new String [ ] { "g" , "e" , "l" , "d" , "h" , "h" , "k" , "f" , "a" , "b" , "j" , "g" , "c" , "i" } ; ModelNode model ; public ReadResourceChildOrderingTestCase ( ) { } @ Test public void testOrdering ( ) throws Exception { } @ Override protected DescriptionProvider getRootDescriptionProvider ( ) { } @ Override protected void initModel ( Resource rootResource , ManagementResourceRegistration registration ) { registration . registerOperationHandler ( READ_RESOURCE_OPERATION , READ_RESOURCE , READ_RESOURCE_PROVIDER , true , EnumSet . of ( RUNTIME_ONLY ) ) ; registration . registerOperationHandler ( "setup" , new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { createModel ( context , model ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } } , new DescriptionProvider ( ) { @ Override public ModelNode getModelDescription ( Locale locale ) { return new ModelNode ( ) ; } } , false , PRIVATE ) ; ManagementResourceRegistration reg = registration . registerSubModel ( PathElement . pathElement ( "test" ) , new DescriptionProvider ( ) { @ Override public ModelNode getModelDescription ( Locale locale ) { ModelNode node = new ModelNode ( ) ; node . get ( DESCRIPTION ) . set ( "a<seq2seq4repair_space>test<seq2seq4repair_space>node" ) ; node . get ( ATTRIBUTES , "prop" , TYPE ) . set ( STRING ) ; node . get ( ATTRIBUTES , "prop" , DESCRIPTION ) . set ( "A<seq2seq4repair_space>test<seq2seq4repair_space>property" ) ; return node ; } } ) ; rootResource . getModel ( ) . set ( model ) ; System . out . println ( model ) ; } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class LengthConvertorTest { private final double delta = 0.001 ; @ Test public void areEqualResultsEqual ( ) { } @ Test public void areResultsWithDifferentValuesNotEqual ( ) { } @ Test public void areResultsWithDifferentOutputUnitNotEqual ( ) { } @ Test public void canConvertKMetersToMeters ( ) { <START_BUG> CLengthConvertor z = new LengthConvertor ( ) ; <END_BUG> LengthUnit . Meter ( ) ; } }

Fix:
LengthConvertor z = new LengthConvertor ( ) ;
Buggy code:
@ Path ( "//transactions-average" ) public class TransactionsAverageResource { @ GET @ Produces ( MediaType . APPLICATION_JSON ) public TransactionAverage [ ] list ( ) { List < TransactionAverage > result = new ArrayList < > ( ) ; <START_BUG> ResultSet resultSet = CassandraClient . getInstance ( ) . selectTotalAmounts ( ) ; <END_BUG> for ( Row row : resultSet ) { result . add ( new TransactionAverage ( row . getString ( "country" ) , row . getDate ( "check_timestamp" ) , row . getLong ( "transactions" ) , row . getInt ( "window_size_seconds" ) ) ) ; } return result . toArray ( new TransactionAverage [ result . size ( ) ] ) ; } }

Fix:
ResultSet resultSet = CassandraClient . getInstance ( ) . selectTransactionsCount ( ) ;
Buggy code:
public abstract class BaseCmdLineCmd extends BaseCommand { private static Logger logger = LoggerFactory . getLogger ( BaseCmdLineCmd . class ) ; public BaseCmdLineCmd ( String name ) { } @ Override public ICmdResult execute ( ) { } protected void executeCommand ( ICmdResult result , List < String > cmd , String cmdExecDir , boolean wait ) { Process p = null ; ProcessCall processCall = null ; ProcessCallOutput output = null ; List < String > cmdLine = new ArrayList < String > ( ) ; if ( SystemUtils . IS_OS_WINDOWS ) { cmdLine . add ( "cmd.exe" ) ; cmdLine . add ( "//C" ) ; } cmdLine . addAll ( cmd ) ; int retry = 0 ; Exception error = null ; while ( retry < 3 ) { try { ProcessBuilder processBuilder = new ProcessBuilder ( ) ; processBuilder . redirectErrorStream ( true ) ; processBuilder . directory ( new File ( cmdExecDir ) ) ; StringBuilder cmdToLog = new StringBuilder ( ) ; for ( String s : cmdLine ) { s = s . replaceFirst ( "https:////.*[@]" , "https:////" ) ; <START_BUG> cmdToLog . append ( s ) ; <END_BUG> } BaseCmdLineCmd . logger . info ( ( "Executing<seq2seq4repair_space>process:<seq2seq4repair_space>" + cmdToLog ) ) ; p = processBuilder . command ( cmdLine ) . start ( ) ; if ( wait ) { processCall = new ProcessCall ( p ) ; output = processCall . call ( ) ; } } catch ( Exception e ) { BaseCmdLineCmd . logger . error ( e . getMessage ( ) , e ) ; error = e ; retry ++ ; continue ; } break ; } if ( output == null ) { result . setException ( error ) ; } else if ( ( output . exitValue ) != 0 ) { result . setException ( new RuntimeException ( ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>execute<seq2seq4repair_space>command(%" + ( getClass ( ) . getName ( ) ) ) + "%),<seq2seq4repair_space>rtn<seq2seq4repair_space>value:" ) + ( output . exitValue ) ) ) ) ; } else { result . setMessage ( output . output ) ; } } protected abstract String getCmdDir ( ) { } protected abstract List < String > getCmdStrs ( ) { } protected boolean isWait ( ) { } }

Fix:
cmdToLog . append ( s ) . append ( "<seq2seq4repair_space>" ) ;
Buggy code:
public final class SingleSchema implements Schema { private static final KeywordValidatorProvider validatorProvider = KeywordValidatorProvider . getInstance ( ) ; private final SchemaFactory factory ; private final JsonNode schemaNode ; private PathProvider pathProvider = ScalarPathProvider . getInstance ( ) ; public SingleSchema ( final SchemaFactory factory , final JsonNode schemaNode ) { } @ Override public Schema getSchema ( final String path ) { } @ Override public void validate ( final ValidationState state , final Instance instance ) { final NodeType instanceType = instance . getType ( ) ; final Set < KeywordValidator > validators = SingleSchema . validatorProvider . getValidators ( schemaNode , instanceType ) ; final JsonNode node = instance . getRawInstance ( ) ; ValidationState current ; for ( final KeywordValidator validator : validators ) { current = new ValidationState ( state ) ; validator . validate ( current , node ) ; if ( ! ( current . isResolved ( ) ) ) current . getNextSchema ( ) . validate ( current , instance ) ; state . mergeWith ( current ) ; } if ( state . isFailure ( ) ) return ; if ( ! ( node . isContainerNode ( ) ) ) return ; pathProvider = ( instanceType == ( NodeType . ARRAY ) ) ? new ArrayPathProvider ( node ) : new ObjectPathProvider ( node ) ; Schema schema ; for ( final Instance child : instance ) { schema = getSchema ( child . getPathElement ( ) ) ; <START_BUG> schema . validate ( state , instance ) ; <END_BUG> } } @ Override public String toString ( ) { } }

Fix:
schema . validate ( state , child ) ;
Buggy code:
class NewDeploymentScannerAdd implements ModelAddOperationHandler , RuntimeOperationHandler { static final NewDeploymentScannerAdd INSTANCE = new NewDeploymentScannerAdd ( ) ; private NewDeploymentScannerAdd ( ) { } public Cancellable execute ( NewOperationContext context , ModelNode operation , ResultHandler resultHandler ) { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final String name = address . getLastElement ( ) . getValue ( ) ; final String path = operation . require ( PATH ) . asString ( ) ; final boolean enabled = operation . get ( SCAN_ENABLED ) . asBoolean ( true ) ; final int interval = operation . get ( SCAN_INTERVAL ) . asInt ( 5000 ) ; String relativeTo = null ; if ( operation . has ( RELATIVE_TO ) ) { relativeTo = operation . get ( RELATIVE_TO ) . asString ( ) ; } final ModelNode compensatingOperation = new ModelNode ( ) ; compensatingOperation . get ( OP ) . set ( REMOVE ) ; compensatingOperation . get ( OP_ADDR ) . set ( operation . require ( OP_ADDR ) ) ; if ( context instanceof NewRuntimeOperationContext ) { final NewRuntimeOperationContext runtimeContext = ( ( NewRuntimeOperationContext ) ( context ) ) ; final ServiceTarget serviceTarget = runtimeContext . getServiceTarget ( ) ; DeploymentScannerService . addService ( serviceTarget , name , relativeTo , path , interval , TimeUnit . MILLISECONDS , enabled ) ; } <START_BUG> final ModelNode subModel = new ModelNode ( ) ; <END_BUG> subModel . get ( PATH ) . set ( path ) ; subModel . get ( SCAN_ENABLED ) . set ( enabled ) ; subModel . get ( SCAN_INTERVAL ) . set ( interval ) ; if ( relativeTo != null ) subModel . get ( RELATIVE_TO ) . set ( relativeTo ) ; resultHandler . handleResultComplete ( compensatingOperation ) ; return Cancellable . NULL ; } }

Fix:
final ModelNode subModel = context . getSubModel ( ) ;
Buggy code:
public class CacheRemove extends AbstractRemoveStepHandler { private static final Logger log = Logger . getLogger ( CacheRemove . class . getPackage ( ) . getName ( ) ) ; static final CacheRemove INSTANCE = new CacheRemove ( ) ; protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) { final PathAddress cacheAddress = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ; final PathAddress containerAddress = cacheAddress . subAddress ( 0 , ( ( cacheAddress . size ( ) ) - 1 ) ) ; final String cacheName = cacheAddress . getLastElement ( ) . getValue ( ) ; final String containerName = containerAddress . getLastElement ( ) . getValue ( ) ; context . removeService ( EmbeddedCacheManagerService . getServiceName ( containerName ) . append ( cacheName ) ) ; <START_BUG> CacheRemove . log . debug ( ( ( ( "cache<seq2seq4repair_space>" + cacheName ) + "<seq2seq4repair_space>removed<seq2seq4repair_space>for<seq2seq4repair_space>container<seq2seq4repair_space>" ) + containerName ) ) ; <END_BUG> } protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) { } }

Fix:
CacheRemove . log . debugf ( "cache<seq2seq4repair_space>%s<seq2seq4repair_space>removed<seq2seq4repair_space>for<seq2seq4repair_space>container<seq2seq4repair_space>%s" , cacheName , containerName ) ;
Buggy code:
public class JMeterVersionTest extends JMeterTestCase { private static Map < String , String > JAR_TO_BUILD_PROP = new HashMap < String , String > ( ) ; private static final File JMETER_HOME = new File ( JMeterUtils . getJMeterHome ( ) ) ; public JMeterVersionTest ( ) { } public JMeterVersionTest ( String arg0 ) { } private final Map < String , String > versions = new HashMap < String , String > ( ) ; private final Set < String > propNames = new HashSet < String > ( ) ; private File getFileFromHome ( String relativeFile ) { } @ Override protected void setUp ( ) throws Exception { } public void testEclipse ( ) throws Exception { final BufferedReader eclipse = new BufferedReader ( new FileReader ( getFileFromHome ( "eclipse.classpath" ) ) ) ; final Pattern p = Pattern . compile ( "\\s+<classpathentry<seq2seq4repair_space>kind=\"lib\"<seq2seq4repair_space>path=\"lib//(?:api//)?(.+)-([^-]+)\\.jar\"//>" ) ; String line ; while ( ( line = eclipse . readLine ( ) ) != null ) { final Matcher m = p . matcher ( line ) ; if ( m . matches ( ) ) { String jar = m . group ( 1 ) ; String version = m . group ( 2 ) ; if ( jar . endsWith ( "-jdk15on" ) ) { jar = jar . replace ( "-jdk15on" , "" ) ; } else if ( ( jar . equals ( "commons-jexl" ) ) && ( version . startsWith ( "2" ) ) ) { jar = "commons-jexl2" ; } else { String tmp = JMeterVersionTest . JAR_TO_BUILD_PROP . get ( jar ) ; if ( tmp != null ) { jar = tmp ; } } final String expected = versions . get ( jar ) ; propNames . remove ( jar ) ; if ( expected == null ) { fail ( ( "Versions<seq2seq4repair_space>list<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>contain:<seq2seq4repair_space>" + jar ) ) ; } else { if ( ! ( version . equals ( expected ) ) ) { <START_BUG> assertEquals ( jar , expected , version ) ; <END_BUG> } } } } eclipse . close ( ) ; if ( ( propNames . size ( ) ) > 0 ) { fail ( ( "Should<seq2seq4repair_space>have<seq2seq4repair_space>no<seq2seq4repair_space>names<seq2seq4repair_space>left:<seq2seq4repair_space>" + ( Arrays . toString ( propNames . toArray ( ) ) ) ) ) ; } } public void testMaven ( ) throws Exception { } }

Fix:
assertEquals ( jar , version , expected ) ;
Buggy code:
public class NewsTabsFragment extends BaseFragment implements HasComponent < NewsTabComponent > , NewsTabView { private static final String TAG = "NewsTabsFragment" ; private NewsTabComponent component ; @ Inject NewsTabPresenter presenter ; public NewsTabsFragment ( ) { } public static NewsTabsFragment newInstance ( ) { } @ Override public void onCreate ( @ Nullable Bundle savedInstanceState ) { } @ Override protected void setupComponent ( MainComponent component ) { } @ Nullable @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } private void setupDrawer ( Activity activity , DrawerLayout drawer , Toolbar toolbar ) { } private void setupViewPager ( ViewPager viewPager ) { <START_BUG> NewsTabsFragment . Adapter adapter = new NewsTabsFragment . Adapter ( getActivity ( ) . getSupportFragmentManager ( ) ) ; <END_BUG> adapter . addFragment ( NewsPageFragment . newInstance ( ) , NEWS , "news" ) ; adapter . addFragment ( NewsPageFragment . newInstance ( ) , RECOMMENDATIONS , "recommendation" ) ; adapter . addFragment ( NewsPageFragment . newInstance ( ) , FRIENDS , "friends" ) ; adapter . addFragment ( NewsPageFragment . newInstance ( ) , COMMUNITIES , "communities" ) ; viewPager . setAdapter ( adapter ) ; } @ Override public void navigateToNewPostActivity ( ) { } @ Override public void onDestroy ( ) { } @ Override public NewsTabComponent getComponent ( ) { } static class Adapter extends FragmentPagerAdapter { private final List < Fragment > mFragments = new ArrayList < > ( ) ; private final List < String > mFragmentTitles = new ArrayList < > ( ) ; public Adapter ( FragmentManager fragmentManager ) { } public void addFragment ( Fragment fragment , NewsPageInteractor . TypeNews type , String title ) { } @ Override public Fragment getItem ( int position ) { } @ Override public int getCount ( ) { } @ Override public CharSequence getPageTitle ( int position ) { } } }

Fix:
NewsTabsFragment . Adapter adapter = new NewsTabsFragment . Adapter ( getChildFragmentManager ( ) ) ;
Buggy code:
public class HttpManagementRemoveHandler extends AbstractRemoveStepHandler { public static final HttpManagementRemoveHandler INSTANCE = new HttpManagementRemoveHandler ( ) ; private HttpManagementRemoveHandler ( ) { } @ Override protected boolean requiresRuntime ( OperationContext context ) { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { HttpManagementRemoveHandler . removeHttpManagementService ( context ) ; RemotingServices . removeConnectorServices ( context , HTTP_CONNECTOR ) ; <START_BUG> context . removeService ( UPGRADE_SERVICE_NAME . append ( "management" ) ) ; <END_BUG> } @ Override protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } static void removeHttpManagementService ( final OperationContext context ) { } }

Fix:
context . removeService ( SERVICE_NAME ) ;
Buggy code:
public class JUnitCore { private RunNotifier fNotifier ; public JUnitCore ( ) { } public static void main ( String ... args ) { } public static void runMainAndExit ( JUnitSystem system , String ... args ) { } public static Result runClasses ( Class < ? > ... classes ) { } public Result runMain ( JUnitSystem system , String ... args ) { } public String getVersion ( ) { } public Result run ( Class < ? > ... classes ) { <START_BUG> return run ( Request . classes ( "All" , classes ) ) ; <END_BUG> } public Result run ( Request request ) { } public Result run ( Test test ) { } public Result run ( Runner runner ) { } private void addFirstListener ( RunListener listener ) { } public void addListener ( RunListener listener ) { } public void removeListener ( RunListener listener ) { } }

Fix:
return run ( Request . classes ( classes ) ) ;
Buggy code:
public class RollingFileAppender extends FileAppender { Logger logger = Logger . getLogger ( RollingFileAppender . class ) ; File activeFile ; TriggeringPolicy triggeringPolicy ; RollingPolicy rollingPolicy ; public RollingFileAppender ( ) { } public void activateOptions ( ) { } public void rollover ( ) { this . closeFile ( ) ; activeFile = new File ( fileName ) ; <START_BUG> rollingPolicy . rollover ( activeFile ) ; <END_BUG> try { this . setFile ( fileName , false , bufferedIO , bufferSize ) ; } catch ( IOException e ) { LogLog . error ( ( ( "setFile(" + ( fileName ) ) + ",<seq2seq4repair_space>false)<seq2seq4repair_space>call<seq2seq4repair_space>failed." ) , e ) ; } } protected void subAppend ( LoggingEvent event ) { } public RollingPolicy getRollingPolicy ( ) { } public TriggeringPolicy getTriggeringPolicy ( ) { } public void setRollingPolicy ( RollingPolicy policy ) { } public void setTriggeringPolicy ( TriggeringPolicy policy ) { } }

Fix:
rollingPolicy . rollover ( ) ;
Buggy code:
public class TestElision extends BaseTokenStreamTestCase { public void testElision ( ) throws Exception { String test = "Plop,<seq2seq4repair_space>juste<seq2seq4repair_space>pour<seq2seq4repair_space>voir<seq2seq4repair_space>l'embrouille<seq2seq4repair_space>avec<seq2seq4repair_space>O'brian.<seq2seq4repair_space>M'enfin." ; Tokenizer tokenizer = new org . apache . lucene . analysis . standard . StandardTokenizer ( Version . LUCENE_CURRENT , new StringReader ( test ) ) ; Set articles = new HashSet ( ) ; articles . add ( "l" ) ; articles . add ( "M" ) ; <START_BUG> TokenFilter filter = new ElisionFilter ( tokenizer , articles ) ; <END_BUG> List tas = filtre ( filter ) ; assertEquals ( "embrouille" , tas . get ( 4 ) ) ; assertEquals ( "O'brian" , tas . get ( 6 ) ) ; assertEquals ( "enfin" , tas . get ( 7 ) ) ; } private List filtre ( TokenFilter filter ) throws IOException { } }

Fix:
TokenFilter filter = new ElisionFilter ( Version . LUCENE_CURRENT , tokenizer , articles ) ;
Buggy code:
public abstract class GenericTriggerExecutor { protected InternalTriggerExecutionContext tec ; protected TriggerDescriptor triggerd ; protected Activation activation ; protected LanguageConnectionContext lcc ; private boolean whenClauseRetrieved ; private boolean actionRetrieved ; private SPSDescriptor whenClause ; private SPSDescriptor action ; private ExecPreparedStatement ps ; private Activation spsActivation ; GenericTriggerExecutor ( InternalTriggerExecutionContext tec , TriggerDescriptor triggerd , Activation activation , LanguageConnectionContext lcc ) { } abstract void fireTrigger ( TriggerEvent event , CursorResultSet brs , CursorResultSet ars ) throws StandardException { } protected SPSDescriptor getWhenClause ( ) throws StandardException { } protected SPSDescriptor getAction ( ) throws StandardException { } protected void executeSPS ( SPSDescriptor sps ) throws StandardException { boolean recompile = false ; while ( true ) { if ( ( ( ps ) == null ) || recompile ) { ps = sps . getPreparedStatement ( ) ; ps = ps . getClone ( ) ; ps . setValid ( ) ; spsActivation = ps . getActivation ( lcc , false ) ; ps . setSource ( sps . getText ( ) ) ; ps . setSPSAction ( ) ; } try { <START_BUG> ResultSet rs = ps . execute ( spsActivation , false , false , false , 0L ) ; <END_BUG> if ( rs . returnsRows ( ) ) { while ( ( rs . getNextRow ( ) ) != null ) { } } rs . close ( ) ; } catch ( StandardException e ) { if ( e . getMessageId ( ) . equals ( LANG_STATEMENT_NEEDS_RECOMPILE ) ) { StatementContext sc = lcc . getStatementContext ( ) ; sc . cleanupOnError ( e ) ; recompile = true ; sps . revalidate ( lcc ) ; continue ; } lcc . popStatementContext ( lcc . getStatementContext ( ) , e ) ; spsActivation . close ( ) ; throw e ; } break ; } } protected void clearSPS ( ) throws StandardException { } }

Fix:
ResultSet rs = ps . execute ( spsActivation , false , 0L ) ;
Buggy code:
@ Stateful public class SFSB1 { @ PersistenceContext ( unitName = "hibernate3_pc" ) EntityManager em ; public void createEmployee ( String name , String address , int id ) { } public Employee getEmployeeNoTX ( int id ) { <START_BUG> return em . find ( Employee . class , id , NONE ) ; <END_BUG> } }

Fix:
return em . find ( Employee . class , id ) ;
Buggy code:
public class ProductListActivity extends UndeprecatedActionBarActivity { public static final String EXTRA_PRODUCT_ENTRY_ID = "at.florian_lentsch.expirysync.EXTRA_PRODUCT_ENTRY_ID" ; public static final String EXTRA_LOGIN_IMMEDIATELY = "at.florian_lentsch.expirysync.EXTRA_LOGIN_IMMEDIATELY" ; static final int ADD_PRODUCT_RESULT = 0 ; static final int EDIT_PRODUCT_RESULT = 1 ; static final int SCAN_BARCODE_RESULT = 2 ; static final int LOGIN_RESULT = 3 ; static final int REGISTER_RESULT = 4 ; static final int OPEN_LOGIN_RESULT_CODE = RESULT_FIRST_USER ; static final int OPEN_REGISTRATION_RESULT_CODE = ( RESULT_FIRST_USER ) + 1 ; private ProductAdapter productListAdapter ; public static Location currentLocation = null ; private SparseArray < ProductEntry > selectedEntries = new SparseArray < ProductEntry > ( ) ; private String sortBy = null ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( product_list_activity ) ; <START_BUG> PreferenceManager . setDefaultValues ( this . getApplicationContext ( ) , "main" , MODE_PRIVATE , main_preferences , false ) ; <END_BUG> NotifyChecker . setAlarm ( this ) ; iniList ( savedInstanceState ) ; final SharedPreferences sharedPref = this . getApplicationContext ( ) . getSharedPreferences ( "main" , MODE_PRIVATE ) ; boolean offlineMode = sharedPref . getBoolean ( KEY_OFFLINE_MODE , false ) ; if ( ! offlineMode ) { this . autoLogin ( sharedPref ) ; } } private void iniList ( Bundle savedInstanceState ) { } private void iniListItemSorting ( Bundle savedInstanceState ) { } private void iniListItemTapping ( ) { } private void iniListItemFiltering ( ) { } private void autoLogin ( SharedPreferences sharedPref ) { } @ Override protected void onSaveInstanceState ( Bundle outState ) { } private void setAllEntriesChecked ( boolean checked ) { } private void editEntry ( int position ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onPrepareOptionsMenu ( Menu menu ) { } private void sortList ( ) { } private void sortList ( String sortBy ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void showSortingDialog ( ) { } private void logout ( ) { } private void loadProductEntriesToList ( ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } protected void enterOfflineMode ( ) { } protected void synchronizeEntries ( ) { } private void synchronizeLocallyChangedEntries ( ) { } private void addUpdateOrDeleteProductEntryOnServer ( final ProductEntry entry , final ProductEntryCallback callback ) { } private void onSyncComplete ( ) { } private void searchRecipesForSelectedProducts ( ) { } private void deleteSelectedProducts ( ) { } public void scanBarcode ( View view ) { } protected abstract class ListItemCheckedChange { public abstract void checkedChange ( ProductEntry entry , int position , boolean isChecked ) { } } }

Fix:
PreferenceManager . setDefaultValues ( this . getApplicationContext ( ) , "main" , MODE_PRIVATE , main_preferences , true ) ;
Buggy code:
public class KMeansJob { private KMeansJob ( ) { } public static void main ( String [ ] args ) throws IOException { } public static void runJob ( String input , String clustersIn , String output , String measureClass , double convergenceDelta , int maxIterations , int numCentroids ) throws IOException { JobConf conf = new JobConf ( KMeansJob . class ) ; Path outPath = new Path ( output ) ; <START_BUG> FileSystem fs = FileSystem . get ( conf ) ; <END_BUG> if ( fs . exists ( outPath ) ) { fs . delete ( outPath , true ) ; } fs . mkdirs ( outPath ) ; KMeansDriver . runJob ( input , clustersIn , output , measureClass , convergenceDelta , maxIterations , numCentroids ) ; } }

Fix:
FileSystem fs = FileSystem . get ( outPath . toUri ( ) , conf ) ;
Buggy code:
public final class InheritanceVariantContextList { private final ImmutableList < String > names ; private final boolean isXChromosomal ; private final boolean isAutosomal ; private final List < InheritanceVariantContext > vcList ; public InheritanceVariantContextList ( List < VariantContext > vcList ) { } private boolean [ ] getChromosomalLocation ( List < VariantContext > vcList ) { } private boolean isXChromosomal ( VariantContext vc ) { <START_BUG> return vc . getContig ( ) . toLowerCase ( ) . matches ( "(^chrX$)|(^X$)|(^chr23$)|(^23$)" ) ; <END_BUG> } private boolean isAutosomal ( VariantContext vc ) { } private ImmutableList < String > getNames ( List < VariantContext > vcList ) { } public ImmutableList < String > getNames ( ) { } public boolean isXChromosomal ( ) { } public boolean isAutosomal ( ) { } public List < InheritanceVariantContext > getVcList ( ) { } public boolean namesEqual ( Pedigree pedigree ) { } @ Override public String toString ( ) { } }

Fix:
return vc . getContig ( ) . toLowerCase ( ) . matches ( "(^chrx$)|(^x$)|(^chr23$)|(^23$)" ) ;
Buggy code:
public class TextAreaModel { private String text ; private TextAreaModel . Caret caret ; private ColorCoder colorCoder ; public TextAreaModel ( String text , ColorCoder colorCoder ) { } public TextAreaModel ( ColorCoder colorCoder ) { } public TextAreaModel . Caret caret ( ) { } public TextAreaModel . State getState ( ) { } public void setState ( TextAreaModel . State state ) { } public String getText ( ) { } public String getColoredText ( ) { } public Map < Integer , Color > getColoredLines ( ) { } public void setText ( String text ) { } public void clear ( ) { } public String insert ( String characters ) { } public String deleteCharacter ( ) { } public String getSelection ( ) { } public String getCurrentLine ( ) { } private void positionCaret ( int textIndex ) { } private int getIndex ( XY < Integer > location ) { int index = getIndexForRow ( location . y ) ; index += location . x ; <START_BUG> return index ; <END_BUG> } private int getIndexForRow ( int row ) { } private int currentLineLength ( ) { } private int numberOfRows ( ) { } public class Caret { private XY < Integer > location ; private Pair < XY < Integer > , XY < Integer > > selection ; private Caret ( ) { } private Caret ( int x , int y ) { } public XY < Integer > location ( ) { } public Pair < XY < Integer > , XY < Integer > > selection ( ) { } public void setLocation ( XY < Integer > caretLocation ) { } private void setLocation ( int x , int y ) { } public void clearSelection ( ) { } public void setSelection ( XY < Integer > start , XY < Integer > end ) { } private int getX ( ) { } private void setX ( int x ) { } private int getY ( ) { } private void setY ( int y ) { } public void moveLeft ( ) { } public void moveRight ( ) { } public void moveRight ( int n ) { } public void moveUp ( ) { } public void moveDown ( ) { } public void moveToBottom ( ) { } private void changeXIfBeyondEndOfLine ( ) { } @ Override public String toString ( ) { } public boolean isAreaSelected ( ) { } } public class State { private String text ; private XY < Integer > caretLocation ; private Pair < XY < Integer > , XY < Integer > > caretSelection ; private State ( ) { } } }

Fix:
return Math . min ( index , text . length ( ) ) ;