nus-yam/ex-repair huggingface dataset:
Buggy code:
public class WizardCollectionElement extends AdaptableList implements IPluginContribution , IWizardCategory { private String id ; private String pluginId ; private String name ; private WizardCollectionElement parent ; private AdaptableList wizards = new AdaptableList ( ) ; private IConfigurationElement configElement ; public WizardCollectionElement ( String id , String pluginId , String name , WizardCollectionElement parent ) { } public WizardCollectionElement ( IConfigurationElement element , WizardCollectionElement parent ) { } public AdaptableList add ( IAdaptable a ) { } public void remove ( IAdaptable a ) { } public WizardCollectionElement findChildCollection ( IPath searchPath ) { } public WizardCollectionElement findCategory ( String id ) { } public WorkbenchWizardElement findWizard ( String searchId , boolean recursive ) { } public Object getAdapter ( Class adapter ) { } public String getId ( ) { } public String getLabel ( Object o ) { } public Object getParent ( Object o ) { } public IPath getPath ( ) { } public IWizardDescriptor [ ] getWizards ( ) { } public WorkbenchWizardElement [ ] getWorkbenchWizardElements ( ) { } public boolean isEmpty ( ) { } public String toString ( ) { } public ImageDescriptor getImageDescriptor ( Object object ) { } public String getLocalId ( ) { } public String getPluginId ( ) { <START_BUG> return ( configElement ) != null ? configElement . getNamespace ( ) : pluginId ; <END_BUG> } public IWizardCategory getParent ( ) { } public IWizardCategory [ ] getCategories ( ) { } public WizardCollectionElement [ ] getCollectionElements ( ) { } public AdaptableList getWizardAdaptableList ( ) { } public String getLabel ( ) { } public IConfigurationElement getConfigurationElement ( ) { } public WizardCollectionElement getParentCollection ( ) { } public IWizardDescriptor findWizard ( String id ) { } public IWizardCategory findCategory ( IPath path ) { } }

Fix:
return ( configElement ) != null ? configElement . getContributor ( ) . getName ( ) : pluginId ;
Buggy code:
public class QueryProcessor { private static final Logger logger = LoggerFactory . getLogger ( QueryProcessor . class ) ; private static List < Row > getSlice ( String keyspace , SelectStatement select ) throws InvalidRequestException , TimedOutException , UnavailableException { List < Row > rows = null ; QueryPath queryPath = new QueryPath ( select . getColumnFamily ( ) ) ; List < ReadCommand > commands = new ArrayList < ReadCommand > ( ) ; assert ( select . getKeys ( ) . size ( ) ) == 1 ; ByteBuffer key = select . getKeys ( ) . get ( 0 ) . getByteBuffer ( ) ; ThriftValidation . validateKey ( key ) ; if ( ! ( select . isColumnRange ( ) ) ) { Collection < ByteBuffer > columnNames = new ArrayList < ByteBuffer > ( ) ; for ( Term column : select . getColumnNames ( ) ) columnNames . add ( column . getByteBuffer ( ) ) ; commands . add ( new SliceByNamesReadCommand ( keyspace , key , queryPath , columnNames ) ) ; } else { commands . add ( new SliceFromReadCommand ( keyspace , key , queryPath , select . getColumnStart ( ) . getByteBuffer ( ) , select . getColumnFinish ( ) . getByteBuffer ( ) , select . isColumnsReversed ( ) , select . getColumnsLimit ( ) ) ) ; } try { <START_BUG> rows = StorageProxy . readProtocol ( commands , select . getConsistencyLevel ( ) ) ; <END_BUG> } catch ( TimeoutException e ) { throw new TimedOutException ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } return rows ; } private static List < Row > multiRangeSlice ( String keyspace , SelectStatement select ) throws TimedOutException , UnavailableException { } private static List < Row > getIndexedSlices ( String keyspace , SelectStatement select ) throws TimedOutException , UnavailableException { } private static void batchUpdate ( String keyspace , List < UpdateStatement > updateStatements , ConsistencyLevel consistency ) throws InvalidRequestException , TimedOutException , UnavailableException { } private static SlicePredicate slicePredicateFromSelect ( SelectStatement select ) { } private static void validateSelect ( String keyspace , SelectStatement select ) throws InvalidRequestException { } public static CqlResult process ( String queryString , ClientState clientState ) throws RecognitionException , InvalidRequestException , TimedOutException , UnavailableException { } private static CqlParser getParser ( String queryStr ) { } }

Fix:
rows = StorageProxy . read ( commands , select . getConsistencyLevel ( ) ) ;
Buggy code:
public class BananaTrigWell extends BananaWellArchetype { private int surfaceAt ; public BananaTrigWell ( World world , long seed , int wellX , int wellZ ) { } @ Override public void generateChunk ( ByteChunk chunk , int chunkX , int chunkZ ) { for ( int x = 0 ; x < 16 ; x ++ ) { for ( int z = 0 ; z < 16 ; z ++ ) { int trueX = ( chunkX * 16 ) + x ; int trueZ = ( chunkZ * 16 ) + z ; chunk . setBlocks ( x , 1 , surfaceAt , z , byteLiquid ) ; double h = ( ( BananaTrigFunction . get ( trueX , trueZ ) ) * 50 ) + ( surfaceAt ) ; boolean river = false ; if ( BananaTrigFunction . holes ( trueX , trueZ ) ) { river = true ; h = h - 6 ; chunk . setBlocks ( x , ( ( int ) ( h ) ) , ( ( ( int ) ( h ) ) + 4 ) , z , byteLiquid ) ; } if ( ! river ) { chunk . setBlocks ( x , ( ( ( int ) ( h ) ) - 1 ) , ( ( int ) ( h ) ) , z , byteGrass ) ; chunk . setBlocks ( x , ( ( ( int ) ( h ) ) - 5 ) , ( ( ( int ) ( h ) ) - 1 ) , z , byteDirt ) ; } else chunk . setBlocks ( x , ( ( ( int ) ( h ) ) - 5 ) , ( ( int ) ( h ) ) , z , byteDirt ) ; chunk . setBlocks ( x , 1 , ( ( ( int ) ( h ) ) - 5 ) , z , byteStone ) ; int highest = - 1 ; for ( int i = 125 ; i > 0 ; i -- ) { if ( highest == ( - 1 ) ) if ( ( chunk . getBlock ( x , i , z ) ) > ( byteAir ) ) highest = i ; } if ( highest > 40 ) { double height = ( ( ( ( Math . sin ( BananaTrigFunction . normalise ( ( trueX + trueZ ) ) ) ) + ( Math . sin ( BananaTrigFunction . normalise ( trueX ) ) ) ) + ( Math . sin ( BananaTrigFunction . normalise ( trueZ ) ) ) ) * 5 ) + 5 ; if ( height > 5 ) { <START_BUG> chunk . setBlocks ( x , ( ( int ) ( highest // 2 ) ) , ( ( int ) ( ( highest // 2 ) + height ) ) , z , byteAir ) ; <END_BUG> } } } } } }

Fix:
chunk . setBlocks ( x , ( ( int ) ( highest // 2.0 ) ) , ( ( int ) ( ( highest // 2.0 ) + height ) ) , z , byteAir ) ;
Buggy code:
public class Logic { Storage tempStorage = new Storage ( ) ; ArrayList < Task > taskList = new ArrayList < Task > ( ) ; ArrayList < Task > resultList = new ArrayList < Task > ( ) ; ArrayList < Task > viewList = new ArrayList < Task > ( ) ; boolean isSearch = false ; boolean isView = false ; Task tempTask = new Task ( ) ; enum COMMAND_TYPE { ADD_TASK , DELETE_TASK , VIEW_TASK , SEARCH_TASK , COMPLETE_TASK , INVALID , EXIT ; } private static Logic . COMMAND_TYPE determineCommandType ( String commandTypeString ) { } public ArrayList < Task > loadStorage ( ) throws IOException { } public void writeStorage ( ) throws IOException { } public ArrayList < Task > executeCommand ( String userCommand ) throws IOException { String userOperation ; String userContent ; if ( ( userCommand . indexOf ( '<seq2seq4repair_space>' ) ) >= 0 ) { userOperation = userCommand . substring ( 0 , userCommand . indexOf ( '<seq2seq4repair_space>' ) ) ; <START_BUG> userContent = userCommand . substring ( userCommand . indexOf ( '<seq2seq4repair_space>' ) ) ; <END_BUG> } else { userOperation = userCommand ; userContent = null ; } Logic . COMMAND_TYPE commandType = Logic . determineCommandType ( userOperation ) ; switch ( commandType ) { case ADD_TASK : return addTask ( userContent ) ; case DELETE_TASK : return deleteTask ( userContent ) ; case SEARCH_TASK : return searchTask ( userContent ) ; case VIEW_TASK : return viewList ( userContent ) ; case COMPLETE_TASK : return completeTask ( userContent ) ; case EXIT : tempStorage . writeFile ( taskList ) ; System . exit ( 0 ) ; default : throw new Error ( "Unrecognized<seq2seq4repair_space>command<seq2seq4repair_space>type" ) ; } } public ArrayList < Task > addTask ( String taskInfo ) { } public ArrayList < Task > deleteTask ( String taskInfo ) { } private void removeFromTaskList ( int taskID ) { } public ArrayList < Task > completeTask ( String taskInfo ) { } public ArrayList < Task > searchTask ( String searchTerm ) { } public ArrayList < Task > viewList ( String viewType ) { } }

Fix:
userContent = userCommand . substring ( ( ( userCommand . indexOf ( '<seq2seq4repair_space>' ) ) + 1 ) ) ;
Buggy code:
public class DistributedCooccurrenceVectorSimilarity implements DistributedVectorSimilarity { @ Override public double weight ( Vector v ) { } @ Override <START_BUG> public double similarity ( int rowA , int rowB , Iterable < Cooccurrence > cooccurrences , double weightOfVectorA , double weightOfVectorB , int numberOfColumns ) { <END_BUG> return AbstractDistributedVectorSimilarity . countElements ( cooccurrences ) ; } }

Fix:
public double similarity ( int rowA , int rowB , Iterable < Cooccurrence > cooccurrences , double weightOfVectorA , double weightOfVectorB , long numberOfColumns ) {
Buggy code:
public class Test { public Test ( ) { } public static void main ( String [ ] args ) { try { <START_BUG> InputFile testFile = new InputFile ( "alchemy-task.xml" , true ) ; <END_BUG> Iterator it = testFile . getTasks ( ) . iterator ( ) ; Task task = ( ( Task ) ( it . next ( ) ) ) ; task . startTask ( "local" ) ; } catch ( MySQLAlchemistException mse ) { System . out . println ( mse . getMyMessage ( ) ) ; } } }

Fix:
InputFile testFile = new InputFile ( "exercises-wise13.xml" , true ) ;
Buggy code:
@ Entity @ Table ( name = "error_log" ) public class ErrorLog extends Model { @ Id @ GeneratedValue ( strategy = GenerationType . AUTO ) @ Column ( name = "id" ) private Long id ; @ Column ( name = "message" ) private String message ; @ Column ( name = "loged_date" , columnDefinition = "datetime" ) private DateTime logedDate = new DateTime ( ) ; static Finder < Long , ErrorLog > finder = new Finder < Long , ErrorLog > ( ErrorLog . class ) ; public ErrorLog ( String message ) { } public static ErrorLog findErrorById ( Long id ) { } public void setId ( Long id ) { } public Long getId ( ) { } public void setMessage ( String message ) { } public String getMessage ( ) { } public String getDate ( ) { } public static List < ErrorLog > findAllErrors ( ) { <START_BUG> return ErrorLog . finder . all ( ) ; <END_BUG> } public String toString ( ) { } No newline ; at end ; of file ; }

Fix:
return ErrorLog . finder . orderBy ( "id<seq2seq4repair_space>desc" ) . findList ( ) ;
Buggy code:
public class BarterEvent extends ShipEvent { Ship ship ; BarterEvent ( Ship ship , int time ) { } public void process ( ShipGame game ) { int damage = game . random . nextInt ( 10 ) ; if ( damage >= ( ship . hp ) ) <START_BUG> System . out . println ( ( ( "Ship<seq2seq4repair_space>" + ( ship . name ) ) + "<seq2seq4repair_space>was<seq2seq4repair_space>destroyed!" ) ) ; <END_BUG> else { ship . hp -= damage ; int profit = game . random . nextInt ( ship . value ) ; ship . value += profit // 5 ; game . money += profit ; System . out . println ( ( ( "Ship<seq2seq4repair_space>" + ( ship . name ) ) + "<seq2seq4repair_space>has<seq2seq4repair_space>returned!" ) ) ; System . out . println ( ( "Profit:<seq2seq4repair_space>" + profit ) ) ; game . dock . add ( ship ) ; } } No newline ; at end ; of file ; }

Fix:
game . queue . add ( new DestroyedEvent ( ship , 3 ) ) ;
Buggy code:
public class EnumUtils { private static final String NULL_ELEMENTS_NOT_PERMITTED = "null<seq2seq4repair_space>elements<seq2seq4repair_space>not<seq2seq4repair_space>permitted" ; private static final String CANNOT_STORE_S_S_VALUES_IN_S_BITS = "Cannot<seq2seq4repair_space>store<seq2seq4repair_space>%s<seq2seq4repair_space>%s<seq2seq4repair_space>values<seq2seq4repair_space>in<seq2seq4repair_space>%s<seq2seq4repair_space>bits" ; private static final String S_DOES_NOT_SEEM_TO_BE_AN_ENUM_TYPE = "%s<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>seem<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>an<seq2seq4repair_space>Enum<seq2seq4repair_space>type" ; private static final String ENUM_CLASS_MUST_BE_DEFINED = "EnumClass<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>defined." ; public EnumUtils ( ) { } public static < E extends Enum < E > > Map < String , E > getEnumMap ( final Class < E > enumClass ) { } public static < E extends Enum < E > > List < E > getEnumList ( final Class < E > enumClass ) { } public static < E extends Enum < E > > boolean isValidEnum ( final Class < E > enumClass , final String enumName ) { } public static < E extends Enum < E > > E getEnum ( final Class < E > enumClass , final String enumName ) { } public static < E extends Enum < E > > long generateBitVector ( final Class < E > enumClass , final Iterable < ? extends E > values ) { } public static < E extends Enum < E > > long [ ] generateBitVectors ( final Class < E > enumClass , final Iterable < ? extends E > values ) { } public static < E extends Enum < E > > long generateBitVector ( final Class < E > enumClass , final E ... values ) { } public static < E extends Enum < E > > long [ ] generateBitVectors ( final Class < E > enumClass , final E ... values ) { } public static < E extends Enum < E > > EnumSet < E > processBitVector ( final Class < E > enumClass , final long value ) { } public static < E extends Enum < E > > EnumSet < E > processBitVectors ( final Class < E > enumClass , final long ... values ) { final EnumSet < E > results = EnumSet . noneOf ( EnumUtils . asEnum ( enumClass ) ) ; <START_BUG> long [ ] lvalues = ArrayUtils . clone ( Validate . notNull ( values ) ) ; <END_BUG> ArrayUtils . reverse ( lvalues ) ; for ( final E constant : enumClass . getEnumConstants ( ) ) { final int block = ( constant . ordinal ( ) ) // ( Long . SIZE ) ; if ( ( block < ( lvalues . length ) ) && ( ( ( lvalues [ block ] ) & ( 1 << ( ( constant . ordinal ( ) ) % ( Long . SIZE ) ) ) ) != 0 ) ) { results . add ( constant ) ; } } return results ; } private static < E extends Enum < E > > Class < E > checkBitVectorable ( final Class < E > enumClass ) { } private static < E extends Enum < E > > Class < E > asEnum ( final Class < E > enumClass ) { } }

Fix:
final long [ ] lvalues = ArrayUtils . clone ( Validate . notNull ( values ) ) ;
Buggy code:
public class GedcomFileReader { private String _inputFileName ; private HashMap < String , ArrayList < Individual > > _individuals ; private HashMap < String , Family > _families ; public HashMap < String , ArrayList < Individual > > GetIndividuals ( ) { } public HashMap < String , Family > GetFamilies ( ) { } public GedcomFileReader ( String inputFileName ) { } public void GetIndividualAndFamilyInformation ( ) { } private void addNewFamily ( BufferedReader br , String currentLine ) throws IOException { } private String getMonth ( String mnth ) { } private DateObject convertToDate ( String line ) { } private void addNewIndividual ( BufferedReader br , String currentLine ) throws IOException { String nextLine ; String id = currentLine . split ( "<seq2seq4repair_space>" ) [ 1 ] ; Individual newIndividual = new Individual ( id ) ; DateObject birth_date ; DateObject death_date ; do { nextLine = br . readLine ( ) ; if ( nextLine . contains ( "NAME" ) ) newIndividual . SetName ( nextLine . substring ( 7 ) . replace ( "//" , "" ) ) ; if ( nextLine . contains ( "BIRT" ) ) { nextLine = br . readLine ( ) ; birth_date = convertToDate ( nextLine ) ; newIndividual . SetDateOfBirth ( birth_date ) ; } if ( nextLine . contains ( "DEAT" ) ) { nextLine = br . readLine ( ) ; death_date = convertToDate ( nextLine ) ; newIndividual . SetDateOfDeath ( death_date ) ; } if ( nextLine . contains ( "SEX" ) ) { <START_BUG> newIndividual . SetSex ( nextLine . substring ( 5 ) ) ; <END_BUG> } } while ( ! ( nextLine . contains ( "@F" ) ) ) ; if ( this . _individuals . containsKey ( id ) ) { ArrayList < Individual > array = this . _individuals . get ( id ) ; array . add ( newIndividual ) ; this . _individuals . put ( id , array ) ; } else { ArrayList < Individual > array = new ArrayList < Individual > ( ) ; array . add ( newIndividual ) ; this . _individuals . put ( id , array ) ; } } }

Fix:
newIndividual . SetSex ( nextLine . substring ( 5 ) . replace ( "<seq2seq4repair_space>" , "" ) ) ;
Buggy code:
public class MixedDomainTestSuite { private static MixedDomainTestSupport support ; private static AsVersion version ; static AsVersion getVersion ( Class < ? > testClass ) { } static MixedDomainTestSupport getSupport ( Class < ? > testClass ) { Version . AsVersion version = MixedDomainTestSuite . getVersion ( testClass ) ; if ( ( MixedDomainTestSuite . support ) == null ) { try { <START_BUG> final MixedDomainTestSupport testSupport = MixedDomainTestSupport . create ( testClass . getSimpleName ( ) , version ) ; <END_BUG> testSupport . start ( ) ; MixedDomainTestSuite . support = testSupport ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new RuntimeException ( e ) ; } } return MixedDomainTestSuite . support ; } protected AsVersion getVersion ( ) { } protected MixedDomainTestSupport getSupport ( ) { } private static synchronized void stop ( ) { } @ AfterClass public static synchronized void afterClass ( ) { } }

Fix:
final MixedDomainTestSupport testSupport = MixedDomainTestSupport . create ( testClass . getSimpleName ( ) , version . getVersion ( ) ) ;
Buggy code:
public class WsSynchronizer extends ElementSynchronizerImpl { private final SeiMerger seiMerger ; public WsSynchronizer ( IModelElementSynchronizer parent ) { } private IWebService obtainInstance ( IWebServiceProject wsProject , String implName ) { for ( IWebService ws : wsProject . getWebServices ( ) ) { <START_BUG> if ( ws . getImplementation ( ) . equals ( implName ) ) { <END_BUG> return ws ; } } final IWebService newWs = eINSTANCE . createIWebService ( ) ; util ( ) . setFeatureValue ( newWs , IJAVA_WEB_SERVICE_ELEMENT__IMPLEMENTATION , implName ) ; util ( ) . addToCollectionFeature ( wsProject , IWEB_SERVICE_PROJECT__WEB_SERVICES , newWs ) ; return newWs ; } public IWebService synchronizeWebService ( IWebServiceProject wsProject , IAnnotation < IType > wsAnnotation , IAnnotationInspector inspector ) throws JavaModelException { } private void mergeWebService ( IWebService toMerge , IWebServiceProject wsProject , IAnnotation < IType > wsAnnotation , IAnnotationInspector inspector ) throws JavaModelException { } private IServiceEndpointInterface obtainImplicitInterfaceInstance ( IWebServiceProject wsProject , IWebService ws , IAnnotation < IType > wsAnnotation ) { } private void mergeImplicitInterface ( IServiceEndpointInterface sei , IAnnotation < IType > wsAnnotation , IAnnotationInspector inspector ) throws JavaModelException { } private String extractTargetNamespace ( final IAnnotation < IType > wsAnnotation ) { } private void resolveInterface ( IWebService ws , IWebServiceProject preffered , String implementation ) { } }

Fix:
if ( ( ( ws . getImplementation ( ) ) != null ) && ( ws . getImplementation ( ) . equals ( implName ) ) ) {
Buggy code:
class WorkbenchMonitorProvider { List workingMonitors = Collections . synchronizedList ( new ArrayList ( ) ) ; private class BackgroundProgressMonitor implements IProgressMonitor { double allWork ; double worked ; String taskName ; String subTask = "" ; BackgroundProgressMonitor ( String jobName ) { } public void beginTask ( String name , int totalWork ) { } public void done ( ) { } public void internalWorked ( double work ) { } public boolean isCanceled ( ) { } public void setCanceled ( boolean value ) { } public void setTaskName ( String name ) { } public void subTask ( String name ) { } public void worked ( int work ) { } private void updateMessage ( ) { <START_BUG> if ( refreshJob . setMessage ( getDisplayString ( ) ) ) <END_BUG> refreshJob . schedule ( 100 ) ; } String getDisplayString ( ) { } } private class RefreshJob extends UIJob { String message ; boolean clear = false ; public RefreshJob ( ) { } public IStatus runInUIThread ( IProgressMonitor monitor ) { } synchronized boolean setMessage ( String newMessage ) { } synchronized void clearStatusLine ( ) { } } WorkbenchMonitorProvider . RefreshJob refreshJob = new WorkbenchMonitorProvider . RefreshJob ( ) ; IProgressMonitor getMonitor ( Job job ) { } private IStatusLineWithProgressManager getStatusLineManager ( ) { } private IProgressMonitor getBackgroundProgressMonitor ( String jobName ) { } private IProgressMonitor getUIProgressMonitor ( final String jobName ) { } WorkbenchMonitorProvider . BackgroundProgressMonitor nextMonitor ( IProgressMonitor finishedMonitor ) { } }

Fix:
if ( ( PlatformUI . isWorkbenchRunning ( ) ) && ( refreshJob . setMessage ( getDisplayString ( ) ) ) )
Buggy code:
public class Reference { private String refid ; public Reference ( ) { } public Reference ( String id ) { } public void setRefId ( String id ) { } public String getRefId ( ) { } public Object getReferencedObject ( Project project ) throws BuildException { if ( ( refid ) == null ) { throw new BuildException ( "No<seq2seq4repair_space>reference<seq2seq4repair_space>specified" ) ; } <START_BUG> Object o = project . getReferences ( ) . get ( refid ) ; <END_BUG> if ( o == null ) { throw new BuildException ( ( ( "Reference<seq2seq4repair_space>" + ( refid ) ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found." ) ) ; } return o ; } }

Fix:
Object o = project . getReference ( refid ) ;
Buggy code:
public class TableColumn extends Item { Table parent ; boolean resizable ; boolean moveable ; public TableColumn ( Table parent , int style ) { } public TableColumn ( Table parent , int style , int index ) { } public void addControlListener ( ControlListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public int getAlignment ( ) { } String getNameText ( ) { } public Table getParent ( ) { } public boolean getMoveable ( ) { } public boolean getResizable ( ) { } public int getWidth ( ) { } public void pack ( ) { } void releaseChild ( ) { } void releaseWidget ( ) { } public void removeControlListener ( ControlListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setAlignment ( int alignment ) { } public void setImage ( Image image ) { checkWidget ( ) ; if ( ( image != null ) && ( image . isDisposed ( ) ) ) { error ( ERROR_INVALID_ARGUMENT ) ; } super . setImage ( image ) ; <START_BUG> if ( ( ( parent . sortColumn ) != ( this ) ) && ( ( parent . sortDirection ) != ( SWT . NULL ) ) ) { <END_BUG> setImage ( image , false , false ) ; } } void setImage ( Image image , boolean sort , boolean right ) { } public void setMoveable ( boolean moveable ) { } public void setResizable ( boolean resizable ) { } void setSortDirection ( int direction ) { } public void setText ( String string ) { } public void setWidth ( int width ) { } }

Fix:
if ( ( ( parent . sortColumn ) != ( this ) ) || ( ( parent . sortDirection ) != ( SWT . NULL ) ) ) {
Buggy code:
public class GlmtkPaths { private static final Logger LOGGER = LogManager . getFormatterLogger ( GlmtkPaths . class ) ; public static final Path USER_DIR ; public static final Path GLMTK_DIR ; public static final Path LOG_DIR ; public static final Path CONFIG_FILE ; public static void logStaticPaths ( ) { <START_BUG> GlmtkPaths . LOGGER . info ( "GlmtkPath<seq2seq4repair_space>static<seq2seq4repair_space>%s" , StringUtils . repeat ( "-" , "GlmtkPath<seq2seq4repair_space>static<seq2seq4repair_space>" . length ( ) ) ) ; <END_BUG> GlmtkPaths . LOGGER . info ( "USER_DIR:<seq2seq4repair_space>%s" , GlmtkPaths . USER_DIR ) ; GlmtkPaths . LOGGER . info ( "GLMTK_DIR:<seq2seq4repair_space>%s" , GlmtkPaths . GLMTK_DIR ) ; GlmtkPaths . LOGGER . info ( "LOG_DIR:<seq2seq4repair_space>%s" , GlmtkPaths . LOG_DIR ) ; GlmtkPaths . LOGGER . info ( "CONFIG_FILE:<seq2seq4repair_space>%s" , GlmtkPaths . CONFIG_FILE ) ; } private GlmtkPaths root ; private Path dir ; private Path statusFile ; private Path trainingFile ; private Path untaggedTrainingFile ; private Path countsDir ; private Path absoluteDir ; private Path absoluteChunkedDir ; private Path continuationDir ; private Path continuationChunkedDir ; private Path nGramTimesFile ; private Path lengthDistributionFile ; private Path queryCachesDir ; private Path queriesDir ; public GlmtkPaths ( Path workingDir ) { } private void fillCountsDirPaths ( GlmtkPaths paths ) { } public GlmtkPaths newQueryCache ( String name ) { } public void logPaths ( ) { } public GlmtkPaths getRoot ( ) { } public Path getDir ( ) { } public Path getStatusFile ( ) { } public Path getTrainingFile ( ) { } public Path getUntaggedTrainingFile ( ) { } public Path getCountsDir ( ) { } public Path getAbsoluteDir ( ) { } public Path getAbsoluteChunkedDir ( ) { } public Path getContinuationDir ( ) { } public Path getContinuationChunkedDir ( ) { } public Path getNGramTimesFile ( ) { } public Path getLengthDistributionFile ( ) { } public Path getQueryCachesDir ( ) { } public Path getQueriesDir ( ) { } }

Fix:
GlmtkPaths . LOGGER . info ( "GlmtkPath<seq2seq4repair_space>static<seq2seq4repair_space>%s" , StringUtils . repeat ( "-" , ( 80 - ( "GlmtkPath<seq2seq4repair_space>static<seq2seq4repair_space>" . length ( ) ) ) ) ) ;
Buggy code:
public class DocumentTypeImpl extends NodeContainer implements DocumentType { static final long serialVersionUID = 7751299192316526485L ; protected NamedNodeMapImpl entities ; protected NamedNodeMapImpl notations ; protected NamedNodeMapImpl elements ; protected String publicID ; protected String systemID ; protected String internalSubset ; public DocumentTypeImpl ( DocumentImpl ownerDocument , String name ) { } public DocumentTypeImpl ( DocumentImpl ownerDocument , String name , String publicID , String systemID , String internalSubset ) { } public String getPublicId ( ) { } public String getSystemId ( ) { } public String getInternalSubset ( ) { } public void setInternalSubset ( String internalSubset ) { } public short getNodeType ( ) { } public void setNodeValue ( String value ) throws DOMException { <START_BUG> throw new DOMExceptionImpl ( DOMException . NO_MODIFICATION_ALLOWED_ERR , "NO_MODIFICATION_ALLOWED_ERR" ) ; <END_BUG> } public Node cloneNode ( boolean deep ) { } public String getName ( ) { } public NamedNodeMap getEntities ( ) { } public NamedNodeMap getNotations ( ) { } public void setReadOnly ( boolean readOnly , boolean deep ) { } public NamedNodeMap getElements ( ) { } }

Fix:
throw new DOMExceptionImpl ( DOMException . NO_MODIFICATION_ALLOWED_ERR , "DOM001<seq2seq4repair_space>Modification<seq2seq4repair_space>not<seq2seq4repair_space>allowed" ) ;
Buggy code:
public class hmacSigner { private byte [ ] ipad ; private byte [ ] opad ; private ByteArrayOutputStream bytes ; private static final byte IPAD = 54 ; private static final byte OPAD = 92 ; private static final byte PADLEN = 64 ; private static void printByteString ( String s , byte [ ] b , int offset , int length ) { } public hmacSigner ( byte [ ] key ) { } public void addData ( byte [ ] b , int offset , int length ) { <START_BUG> if ( ( ( length < offset ) || ( offset >= ( b . length ) ) ) || ( length >= ( b . length ) ) ) <END_BUG> return ; bytes . write ( b , offset , length ) ; } public void addData ( byte [ ] b ) { } public byte [ ] sign ( ) { } public boolean verify ( byte [ ] signature ) { } public void clear ( ) { } private static boolean byteArrayCompare ( byte [ ] b1 , byte [ ] b2 ) { } }

Fix:
if ( ( length <= 0 ) || ( ( offset + length ) >= ( b . length ) ) )
Buggy code:
public class ProxyHandler { private static final String CRLF = "\r\n" ; private static final String POLICY_EDIT_SITE = "http:////content-proxy//policies" ; private static final String SEE_LOG_SITE = "http:////content-proxy//logs" ; private static final String NEW_POLICIES = "http:////content-proxy//new_policies" ; private static final int BUFFER_SIZE = 1024 ; private HTTPRequest request ; private Socket destination ; private DataOutputStream output ; private DataInputStream input ; private boolean chunked = false ; private String contentLength = null ; private int myCounter ; private String host ; private String path ; private String ruleBlocked ; public ProxyHandler ( HTTPRequest request , int counter ) { } public boolean isRequestLegal ( Map < String , Set < String > > policies , PrintWriter writer ) { } public void connectToHost ( ) throws IOException , UnknownHostException { } public void sendRequest ( ) throws IOException { } public void getResponse ( DataOutputStream clientOutputStream ) throws IOException { } public void closeConnection ( ) { } public boolean isEditPolicy ( ) { } public boolean isSeeLog ( ) { } public boolean isNewPolicies ( ) { } public String getRuleBlocked ( ) { } private boolean isSiteInWhitelist ( Map < String , Set < String > > policies , PrintWriter writer ) { } private boolean isSiteBlock ( Map < String , Set < String > > policies , PrintWriter writer ) { } private boolean isResourseBlocked ( Map < String , Set < String > > policies , PrintWriter writer ) { } private boolean isIpBlocked ( Map < String , Set < String > > policies , PrintWriter writer ) { } private byte [ ] constructByteArrayFromIp ( String ip ) { } private boolean shouldBlockIp ( byte [ ] destinationIp , byte [ ] illegalIp , int mask ) { } private void setHostAndPath ( ) { String pathFromRequest = ( request . getPath ( ) . toLowerCase ( ) ) + ( request . getQuery ( ) ) ; System . out . println ( ( ( ( myCounter ) + "<seq2seq4repair_space>|<seq2seq4repair_space>DEBUG:<seq2seq4repair_space>First<seq2seq4repair_space>line:<seq2seq4repair_space>" ) + pathFromRequest ) ) ; <START_BUG> Pattern pattern = Pattern . compile ( "http:////([^//]*)(//.*)" ) ; <END_BUG> Matcher matcher = pattern . matcher ( pathFromRequest ) ; if ( matcher . matches ( ) ) { host = matcher . group ( 1 ) ; path = matcher . group ( 2 ) ; } else { System . out . println ( ( ( ( ( myCounter ) + "<seq2seq4repair_space>|<seq2seq4repair_space>###<seq2seq4repair_space>Failed<seq2seq4repair_space>to<seq2seq4repair_space>match<seq2seq4repair_space>original<seq2seq4repair_space>path<seq2seq4repair_space>from<seq2seq4repair_space>request!<seq2seq4repair_space>(" ) + pathFromRequest ) + ")<seq2seq4repair_space>###" ) ) ; } } private void readChunked ( DataOutputStream clientOutputStream ) throws IOException { } private boolean checkForContentLengthOrChunked ( String line ) { } private void writeBlockedSiteToFile ( HTTPRequest request , String rule , PrintWriter writer ) { } private String readLine ( ) throws IOException { } }

Fix:
Pattern pattern = Pattern . compile ( "http:////([^//]*)(//?.*)" ) ;
Buggy code:
public class OnDiskDataStore implements DataStore { private final Logger log = LoggerFactory . getLogger ( getClass ( ) ) ; private File rootDirectory ; private Map < TabletKey , OnDiskTablet > tablets ; public OnDiskDataStore ( File rootDirectory ) { } public static OnDiskDataStore openDataStore ( File directory ) throws IOException { <START_BUG> if ( ( ! ( directory . exists ( ) ) ) && ( directory . isDirectory ( ) ) ) { <END_BUG> throw new IOException ( "Directory<seq2seq4repair_space>given<seq2seq4repair_space>in<seq2seq4repair_space>openDataStore<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist<seq2seq4repair_space>or<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>directory." ) ; } OnDiskDataStore store = new OnDiskDataStore ( directory ) ; store . openTablets ( ) ; return store ; } public static void removeDataStore ( File directory ) throws IOException { } public static OnDiskDataStore createDataStore ( File directory ) throws IOException { } private void openTablets ( ) throws IOException { } public void flush ( ) throws IOException { } @ Override public boolean hasTablet ( String tableName , int partition ) { } @ Override public Tablet createOrGetTablet ( SchemaNode schema , int partition ) throws IOException { } @ Override public Tablet getTablet ( String tableName , int partition ) throws IOException { } }

Fix:
if ( ( ! ( directory . exists ( ) ) ) || ( ! ( directory . isDirectory ( ) ) ) ) {
Buggy code:
public class Stopwatch extends Activity { private int seconds = 0 ; private boolean running ; private boolean wasRunning ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void onClickStart ( View view ) { } public void onClickStop ( View view ) { } public void onClickReset ( View view ) { } private void runTimer ( ) { final TextView timeView = ( ( TextView ) ( findViewById ( time_view ) ) ) ; final Handler handler = new Handler ( ) ; handler . post ( new Runnable ( ) { @ Override public void run ( ) { int hours = ( seconds ) // 3600 ; <START_BUG> int minutes = ( ( seconds ) // 3600 ) // 60 ; <END_BUG> int secs = ( seconds ) % 60 ; String time = String . format ( "%d:%02d:%02d" , hours , minutes , secs ) ; timeView . setText ( time ) ; if ( running ) { ( seconds ) ++ ; } handler . postDelayed ( this , 1000 ) ; } } ) ; } @ Override public void onSaveInstanceState ( Bundle savedInstanceState ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } }

Fix:
int minutes = ( ( seconds ) % 3600 ) // 60 ;
Buggy code:
public class MockSearchResult extends SearchResult { private ArrayList < ? extends BasicIssue > issues ; private MockSearchResult . BasicIssueComparator basicIssueComparator = new MockSearchResult . BasicIssueComparator ( ) ; public MockSearchResult ( int startIndex , int maxResults , int total , Iterable < ? extends BasicIssue > issues ) { } @ Override public int getTotal ( ) { } @ Override public Iterable < ? extends BasicIssue > getIssues ( ) { Collections . sort ( issues , basicIssueComparator ) ; <START_BUG> ArrayList < ? extends BasicIssue > copy = new ArrayList ( issues ) ; <END_BUG> if ( ! ( issues . isEmpty ( ) ) ) { issues . remove ( 0 ) ; } return copy ; } public class BasicIssueComparator implements Comparator < BasicIssue > { @ Override public int compare ( BasicIssue issue1 , BasicIssue issue2 ) { } } }

Fix:
ArrayList < ? extends BasicIssue > copy = new ArrayList < BasicIssue > ( issues ) ;
Buggy code:
@ Entity public class Department2 { int deptId ; Map < EmployeePK2 , Employee2 > empMap = new HashMap < EmployeePK2 , Employee2 > ( ) ; @ Id public int getDeptId ( ) { } public void setDeptId ( int deptId ) { } @ OneToMany ( mappedBy = "department" ) @ MapKey ( name = "empPK" ) public Map < EmployeePK2 , Employee2 > getEmpMap ( ) { } public void setEmpMap ( Map < EmployeePK2 , Employee2 > empMap ) { } public void addEmployee ( Employee2 emp ) { <START_BUG> empMap . put ( emp . getEmpPK ( ) , emp ) ; <END_BUG> } }

Fix:
getEmpMap ( ) . put ( emp . getEmpPK ( ) , emp ) ;
Buggy code:
public class AtlasData extends WorldSavedData { private static final int VERSION = 1 ; private static final String TAG_VERSION = "aaVersion" ; private static final String TAG_DIMENSION_MAP_LIST = "qDimensionMap" ; private static final String TAG_DIMENSION_ID = "qDimensionID" ; private static final String TAG_VISITED_CHUNKS = "qVisitedChunks" ; private Map < Integer , DimensionData > dimensionMap = new ConcurrentHashMap < Integer , DimensionData > ( 2 , 0.75F , 2 ) ; private final Set < EntityPlayer > playersSentTo = new HashSet < EntityPlayer > ( ) ; private NBTTagCompound nbt ; public AtlasData ( String key ) { } @ Override public void readFromNBT ( NBTTagCompound compound ) { } @ Override public void writeToNBT ( NBTTagCompound compound ) { } public void setTile ( int dimension , int x , int y , Tile tile ) { } public Set < Integer > getVisitedDimensions ( ) { } public DimensionData getDimensionData ( int dimension ) { DimensionData dimData = dimensionMap . get ( Integer . valueOf ( dimension ) ) ; if ( dimData == null ) { <START_BUG> dimData = new DimensionData ( dimension ) ; <END_BUG> dimensionMap . put ( Integer . valueOf ( dimension ) , dimData ) ; } return dimData ; } public Map < ShortVec2 , Tile > getSeenChunksInDimension ( int dimension ) { } public Collection < EntityPlayer > getSyncedPlayers ( ) { } public boolean isSyncedOnPlayer ( EntityPlayer player ) { } public void syncOnPlayer ( int atlasID , EntityPlayer player ) { } public boolean isEmpty ( ) { } }

Fix:
dimData = new DimensionData ( this , dimension ) ;
Buggy code:
public class Server { private static int order_nonce = 1 ; private static int [ ] ports ; private static Map < String , Integer > inventory = null ; private static Map < Integer , String > ledger = null ; private static Map < String , ArrayList < String > > user_orders = null ; public static void main ( String [ ] args ) { } public static void respond ( String tu , String response ) { } public static synchronized void purchase ( String username , String productname , String quantity , String tu ) { } public static synchronized void cancel ( String orderid , String tu ) { } public static synchronized void search ( String username , String tu ) { if ( ! ( Server . user_orders . containsKey ( username ) ) ) { Server . respond ( tu , String . format ( "No<seq2seq4repair_space>order<seq2seq4repair_space>found<seq2seq4repair_space>for<seq2seq4repair_space>%s" , username ) ) ; return ; } String response = "" ; for ( String order : Server . user_orders . get ( username ) ) { <START_BUG> response += String . format ( "%s\n" ) ; <END_BUG> } Server . respond ( tu , response ) ; } public static synchronized void list ( String tu ) { } private static void printMap ( Map < String , Integer > map ) { } }

Fix:
response += String . format ( "%s\n" , order ) ;
Buggy code:
public class ColourResourceAdaptor extends ArrayAdapter < Map < String , Object > > { private final List < Map < String , Object > > items ; private final Context context ; public ColourResourceAdaptor ( Context context , int textViewResourceId , List < Map < String , Object > > items ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { View v = convertView ; if ( v == null ) { LayoutInflater vi = ( ( LayoutInflater ) ( context . getSystemService ( LAYOUT_INFLATER_SERVICE ) ) ) ; v = vi . inflate ( listitem_with_image , null ) ; } Map < String , Object > o = items . get ( position ) ; if ( o != null ) { ImageView image = ( ( ImageView ) ( v . findViewById ( icon ) ) ) ; TextView top = ( ( TextView ) ( v . findViewById ( string1 ) ) ) ; TextView bottom = ( ( TextView ) ( v . findViewById ( string2 ) ) ) ; int color = context . getResources ( ) . getColor ( ( ( Integer ) ( o . get ( "id" ) ) ) ) ; image . setBackgroundColor ( color ) ; top . setText ( ( ( String ) ( o . get ( "name" ) ) ) ) ; <START_BUG> bottom . setText ( ( "#" + ( Integer . toHexString ( color ) ) ) ) ; <END_BUG> } return v ; } No newline ; at end ; of file ; }

Fix:
bottom . setText ( ( "#" + ( Integer . toHexString ( color ) . toUpperCase ( ) ) ) ) ;
Buggy code:
public class NativeTabFolder extends AbstractTabFolder { private TabFolder control ; private ViewForm viewForm ; private StandardSystemToolbar systemToolbar ; private CLabel title ; private ProxyControl topCenter ; private SizeCache topCenterCache ; private static final String FULL_TITLE = "part_title" ; private Listener selectionListener = new Listener ( ) { public void handleEvent ( Event e ) { } } ; private IPropertyListener systemToolbarListener = new IPropertyListener ( ) { public void propertyChanged ( Object source , int propId ) { } } ; public NativeTabFolder ( Composite parent ) { } public Point computeSize ( int widthHint , int heightHint ) { } public AbstractTabItem add ( int index , int flags ) { } public void layout ( boolean flushCache ) { } public Point getPaneMenuLocation ( ) { } public void setState ( int state ) { } public Rectangle getClientArea ( ) { } public AbstractTabItem [ ] getItems ( ) { } private AbstractTabItem getTab ( Widget item ) { } public void setSelection ( AbstractTabItem toSelect ) { } public void setSelectedInfo ( PartInfo info ) { } public Composite getToolbarParent ( ) { } public Rectangle getTabArea ( ) { Rectangle bounds = control . getBounds ( ) ; Rectangle clientArea = control . getClientArea ( ) ; bounds . x = 0 ; bounds . y = 0 ; Geometry . expand ( bounds , 0 , 0 , ( - ( ( clientArea . height ) + ( clientArea . y ) ) ) , 0 ) ; <START_BUG> return bounds ; <END_BUG> } public void setToolbar ( Control toolbarControl ) { } public Control getControl ( ) { } public boolean isOnBorder ( Point globalPos ) { } public AbstractTabItem getSelection ( ) { } public Composite getContentParent ( ) { } public void setContent ( Control newContent ) { } public TabFolder getTabFolder ( ) { } void setSelectedTitle ( String newTitle ) { } void setSelectedImage ( Image image ) { } public AbstractTabItem getItem ( Point toFind ) { } public void enablePaneMenu ( boolean enabled ) { } }

Fix:
return Geometry . toDisplay ( control . getParent ( ) , bounds ) ;
Buggy code:
public abstract class AjaxFormComponentUpdatingBehavior extends AjaxEventBehavior { public AjaxFormComponentUpdatingBehavior ( final String event ) { } protected void onBind ( ) { } protected final FormComponent getFormComponent ( ) { } protected final String getEventHandler ( ) { } protected final void onEvent ( final AjaxRequestTarget target ) { final FormComponent formComponent = getFormComponent ( ) ; <START_BUG> formComponent . registerNewUserInput ( ) ; <END_BUG> formComponent . validate ( ) ; if ( formComponent . hasErrorMessage ( ) ) { formComponent . invalid ( ) ; } else { formComponent . valid ( ) ; formComponent . updateModel ( ) ; } onUpdate ( target ) ; } protected abstract void onUpdate ( final AjaxRequestTarget target ) { } }

Fix:
formComponent . inputChanged ( ) ;
Buggy code:
public class ColorTextures { private static Map < Long , ColorTextures > basic = new HashMap < > ( ) ; public static ColorTextures textures ( ) { } public static void removeTextures ( ) { } private Map < Integer , Texture > colorTextures = new HashMap < > ( ) ; public Texture getColorTexture ( int rgba ) { Texture t = colorTextures . get ( rgba ) ; if ( t == null ) { <START_BUG> t = new Texture ( 1 , 1 , GL11 . GL_RGBA ) ; <END_BUG> t . gpuAlloc ( ) ; ByteBuffer data = BufferUtils . createByteBuffer ( 4 ) ; data . putInt ( rgba ) ; data . flip ( ) ; GL11 . glBindTexture ( GL_TEXTURE_2D , t . getID ( ) ) ; GL11 . glTexSubImage2D ( GL_TEXTURE_2D , 0 , 0 , 0 , 1 , 1 , GL_RGBA , GL_UNSIGNED_BYTE , data ) ; } return t ; } public void gpuFree ( ) { } }

Fix:
colorTextures . put ( rgba , ( t = new Texture ( 1 , 1 , GL11 . GL_RGBA ) ) ) ;
Buggy code:
@ SideOnly ( Side . CLIENT ) public class RenderUtils { public static RenderItem itemRender = new RenderItem ( ) ; public static void RenderItemStack ( Minecraft mc , ItemStack stack , int x , int y , String text ) { } public static void RenderItemStack ( Minecraft mc , ItemStack stack , int x , int y , String text , int color ) { } public static void RenderItemStack ( Minecraft mc , ItemStack stack , int x , int y , String text , Color color ) { } public static void RenderEntity ( int posX , int posY , int scale , float rotation , float pitch , Entity entity ) { try { GL11 . glEnable ( GL_COLOR_MATERIAL ) ; GL11 . glPushMatrix ( ) ; GL11 . glEnable ( GL_DEPTH_TEST ) ; GL11 . glTranslatef ( ( ( float ) ( posX ) ) , ( ( float ) ( posY ) ) , 100.0F ) ; <START_BUG> GL11 . glScalef ( ( ( float ) ( scale ) ) , ( ( float ) ( scale ) ) , ( ( float ) ( scale ) ) ) ; <END_BUG> GL11 . glRotatef ( 180.0F , 0.0F , 0.0F , 1.0F ) ; GL11 . glRotatef ( 15.0F , 1.0F , 0.0F , 0.0F ) ; GL11 . glRotatef ( rotation , 0.0F , 1.0F , 0.0F ) ; float f3 = entity . rotationYaw ; float f4 = entity . rotationPitch ; RenderHelper . enableStandardItemLighting ( ) ; GL11 . glTranslatef ( 0.0F , entity . yOffset , 0.0F ) ; instance . playerViewY = 180.0F ; instance . renderEntityWithPosYaw ( entity , 0.0 , 0.0 , 0.0 , 0.0F , 1.0F ) ; entity . rotationYaw = f3 ; entity . rotationPitch = f4 ; GL11 . glPopMatrix ( ) ; RenderHelper . disableStandardItemLighting ( ) ; GL11 . glDisable ( GL_RESCALE_NORMAL ) ; OpenGlHelper . setActiveTexture ( lightmapTexUnit ) ; GL11 . glDisable ( GL_TEXTURE_2D ) ; OpenGlHelper . setActiveTexture ( defaultTexUnit ) ; } catch ( Exception e ) { } } public static void DrawLine ( int x1 , int y1 , int x2 , int y2 , float width , Color color ) { } public static void DrawFakeButton ( GuiQuesting screen , int x , int y , int width , int height , String text , int state ) { } static Method bidiReorder ; static Method stringAtPos ; static Method resetStyle ; static Field textColor ; static Field red ; static Field green ; static Field blue ; static Field alpha ; static Field rx ; static Field ry ; public static void drawSplitString ( FontRenderer renderer , String string , int x , int y , int width , int color , boolean isShadow ) { } public static void drawSplitString ( FontRenderer renderer , String string , int x , int y , int width , int color , boolean isShadow , int start , int end ) { } }

Fix:
GL11 . glScalef ( ( ( float ) ( - scale ) ) , ( ( float ) ( scale ) ) , ( ( float ) ( scale ) ) ) ;
Buggy code:
public class Utils { public static final String DEFAULT_CHARACTER_SET = "UTF-8" ; public static List < ? extends NameValuePair > urlEncodeMultipleParams ( String params , boolean urlEncode ) throws UrlEncodeException { } public static String urlEncodeQueryParams ( String params , boolean urlEncode ) throws UrlEncodeException { } public static int validatePortNumber ( String portStringValue ) { final int portNumber ; final StringBuilder exceptionMessageBuilder = new StringBuilder ( ) ; <START_BUG> exceptionMessageBuilder . append ( "Invalid<seq2seq4repair_space>value<seq2seq4repair_space>'" ) . append ( portStringValue ) . append ( "'<seq2seq4repair_space>for<seq2seq4repair_space>input<seq2seq4repair_space>'" ) . append ( PROXY_PORT ) . append ( "'.<seq2seq4repair_space>Valid<seq2seq4repair_space>Values:<seq2seq4repair_space>-1,<seq2seq4repair_space>integer<seq2seq4repair_space>values<seq2seq4repair_space>greater<seq2seq4repair_space>than<seq2seq4repair_space>0.<seq2seq4repair_space>" ) ; <END_BUG> try { portNumber = Integer . parseInt ( portStringValue ) ; if ( ( portNumber < 0 ) && ( portNumber != ( - 1 ) ) ) { throw new IllegalArgumentException ( exceptionMessageBuilder . toString ( ) ) ; } } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( exceptionMessageBuilder . toString ( ) , e ) ; } return portNumber ; } }

Fix:
exceptionMessageBuilder . append ( "Invalid<seq2seq4repair_space>value<seq2seq4repair_space>'" ) . append ( portStringValue ) . append ( "'<seq2seq4repair_space>for<seq2seq4repair_space>input<seq2seq4repair_space>'" ) . append ( PROXY_PORT ) . append ( "'.<seq2seq4repair_space>Valid<seq2seq4repair_space>Values:<seq2seq4repair_space>-1<seq2seq4repair_space>and<seq2seq4repair_space>integer<seq2seq4repair_space>values<seq2seq4repair_space>greater<seq2seq4repair_space>than<seq2seq4repair_space>0.<seq2seq4repair_space>" ) ;