nus-yam/ex-repair huggingface dataset:
Buggy code:
public class NamespaceRemoveHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = "remove-namespace" ; public static final NamespaceRemoveHandler INSTANCE = new NamespaceRemoveHandler ( ) ; public static ModelNode getRemoveNamespaceOperation ( ModelNode address , String prefix ) { } private final ParameterValidator typeValidator = new org . jboss . as . controller . operations . validation . ModelTypeValidator ( ModelType . STRING ) ; private NamespaceRemoveHandler ( ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode model = context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) ; ModelNode param = operation . get ( NAMESPACE ) ; typeValidator . validateParameter ( NAMESPACE , param ) ; ModelNode namespaces = model . get ( NAMESPACES ) ; Property toRemove = null ; ModelNode newList = new ModelNode ( ) . setEmptyList ( ) ; String prefix = param . asString ( ) ; if ( namespaces . isDefined ( ) ) { for ( Property namespace : namespaces . asPropertyList ( ) ) { if ( prefix . equals ( namespace . getName ( ) ) ) { toRemove = namespace ; } else { newList . add ( namespace . getName ( ) , namespace . getValue ( ) ) ; } } } if ( toRemove != null ) { namespaces . set ( newList ) ; } else { throw new OperationFailedException ( new ModelNode ( ) . set ( ControllerMessages . MESSAGES . namespaceNotFound ( prefix ) ) ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } @ Override public ModelNode getModelDescription ( Locale locale ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class LiteralString { @ CodeTranslate public void value ( ) throws Exception { } @ CodeTranslate public void concat ( ) throws Exception { } @ CodeTranslate public void escape ( ) throws Exception { <START_BUG> LiteralExpressionTest . result = "\n\"\\\'" ; <END_BUG> } }

Fix:
LiteralExpressionTest . result = "\n\r\t\f\b\"\\\'A" ;
Buggy code:
public class GameMechanics { private static final int POW = 3 ; private static final double RANK_UP_FACTOR = 1.1 ; private static final double LEVEL_UP_BONUS = 0.1 ; private static final int MAX_RANK = 10 ; private static final int SIZE_MULT = 10 ; private static final int EP_BLOW_UP = 100 ; public static double [ ] getFightResult ( int ownArmyStrength , int enemyArmyStrength ) { } public static int factorial ( int n ) { } public static int binomial ( int n , int k ) { } public static int getLevelForRank ( int rank ) { } public static int getRankByLevel ( int level ) { } public static int getLevelForRankUp ( int level ) { } public static int getStrengthByLevel ( int level ) { } public static int getArmyStrength ( List < DbSoldier > soldiers ) { int armyStrength = 0 ; for ( DbSoldier var : soldiers ) { armyStrength += GameMechanics . getStrengthByLevel ( var . getLevel ( ) ) ; } <START_BUG> return armyStrength ; <END_BUG> } public static int getMaxArmySize ( int playerLevel ) { } public static int getEpForPlayerLevelUp ( int playerLevel ) { } public static int getPlayerLevelForEp ( int ep ) { } public static int getEpBaseReward ( int enemyLevel ) { } public static double getPlayerLevelProgress ( int ep ) { } public static double randomMult ( ) { } public static int [ ] randomEncounter ( int ownLevel , int ownStrength ) { } }

Fix:
return Math . max ( armyStrength , 1 ) ;
Buggy code:
public class TransactionsDbAdapter extends DatabaseAdapter { private final SplitsDbAdapter mSplitsDbAdapter ; public TransactionsDbAdapter ( SQLiteDatabase db , SplitsDbAdapter splitsDbAdapter ) { } public static TransactionsDbAdapter getInstance ( ) { } public SplitsDbAdapter getSplitDbAdapter ( ) { } public long addTransaction ( Transaction transaction ) { } public long bulkAddTransactions ( List < Transaction > transactionList ) { } public Transaction getTransaction ( long rowId ) { } public Cursor fetchAllTransactionsForAccount ( String accountUID ) { } public void deleteTransactionsForAccount ( String accountUID ) { } public int deleteTransactionsWithNoSplits ( ) { } public Cursor fetchAllScheduledTransactions ( ) { } public Cursor fetchAllTransactionsForAccount ( long accountID ) { } public List < Transaction > getAllTransactionsForAccount ( String accountUID ) { } public List < Transaction > getAllTransactions ( ) { } public Cursor fetchTransactionsWithSplits ( String [ ] columns , @ Nullable String where , @ Nullable String [ ] whereArgs , @ Nullable String orderBy ) { } public Cursor fetchTransactionsWithSplitsWithTransactionAccount ( String [ ] columns , String where , String [ ] whereArgs , String orderBy ) { } public int getTotalTransactionsCount ( ) { } public int getTotalTransactionsCount ( @ Nullable String where , @ Nullable String [ ] whereArgs ) { } public Transaction buildTransactionInstance ( Cursor c ) { } public String getAccountCurrencyCode ( long accountId ) { } public Money getBalance ( String transactionUID , String accountUID ) { } public int moveTransaction ( String transactionUID , String srcAccountUID , String dstAccountUID ) { } public int getTransactionsCount ( long accountId ) { } public int getTransactionsCount ( String accountUID ) { } public long getAllTransactionsCount ( ) { } public long getTemplateTransactionsCount ( ) { } public Cursor fetchTransactionSuggestions ( String prefix , String accountUID ) { } public int updateTransaction ( ContentValues contentValues , String whereClause , String [ ] whereArgs ) { } public Transaction getTransaction ( String transactionUID ) { } public int getNumCurrencies ( String transactionUID ) { } public int deleteAllNonTemplateTransactions ( ) { <START_BUG> String where = ( DatabaseSchema . TransactionEntry . COLUMN_TEMPLATE ) + "!=0" ; <END_BUG> return mDb . delete ( mTableName , where , null ) ; } public long getTimestampOfEarliestTransaction ( AccountType type ) { } public long getTimestampOfLatestTransaction ( AccountType type ) { } private long getTimestamp ( String mod , AccountType type ) { } }

Fix:
String where = ( DatabaseSchema . TransactionEntry . COLUMN_TEMPLATE ) + "=0" ;
Buggy code:
public class AssertStatement extends Statement { public Expression assertExpression ; public Expression exceptionArgument ; int preAssertInitStateIndex = - 1 ; private FieldBinding assertionSyntheticFieldBinding ; public AssertStatement ( Expression exceptionArgument , Expression assertExpression , int startPosition ) { } public AssertStatement ( Expression assertExpression , int startPosition ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { <START_BUG> if ( ( ( bits ) & ( IsReachableMASK ) ) == 0 ) { <END_BUG> return ; } int pc = codeStream . position ; if ( ( this . assertionSyntheticFieldBinding ) != null ) { Label assertionActivationLabel = new Label ( codeStream ) ; codeStream . getstatic ( this . assertionSyntheticFieldBinding ) ; codeStream . ifne ( assertionActivationLabel ) ; Label falseLabel = new Label ( codeStream ) ; this . assertExpression . generateOptimizedBoolean ( currentScope , codeStream , ( falseLabel = new Label ( codeStream ) ) , null , true ) ; codeStream . newJavaLangAssertionError ( ) ; codeStream . dup ( ) ; if ( ( exceptionArgument ) != null ) { exceptionArgument . generateCode ( currentScope , codeStream , true ) ; codeStream . invokeJavaLangAssertionErrorConstructor ( ( ( exceptionArgument . implicitConversion ) & 15 ) ) ; } else { codeStream . invokeJavaLangAssertionErrorDefaultConstructor ( ) ; } codeStream . athrow ( ) ; falseLabel . place ( ) ; assertionActivationLabel . place ( ) ; } if ( ( preAssertInitStateIndex ) != ( - 1 ) ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , preAssertInitStateIndex ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void resolve ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public StringBuffer printStatement ( int tab , StringBuffer output ) { } }

Fix:
if ( ( ( bits ) & ( ASTNode . IsReachable ) ) == 0 ) {
Buggy code:
public class MarkupStream { private MarkupElement current ; private int currentIndex = 0 ; private final IMarkupFragment markup ; public MarkupStream ( final IMarkupFragment markup ) { } public boolean atCloseTag ( ) { } public boolean atOpenCloseTag ( ) { } public boolean atOpenCloseTag ( final String componentId ) { } public boolean atOpenTag ( ) { } public boolean atOpenTag ( final String id ) { } public boolean atTag ( ) { } public boolean equalTo ( final MarkupStream that ) { } public final boolean equalMarkup ( final MarkupStream markupStream ) { } public MarkupElement get ( ) { } public MarkupElement get ( final int index ) { } public final Class < ? extends Component > getContainerClass ( ) { } public int getCurrentIndex ( ) { } public final String getEncoding ( ) { } public IResourceStream getResource ( ) { } public ComponentTag getTag ( ) { } public final String getWicketNamespace ( ) { } public String getXmlDeclaration ( ) { } public boolean hasMore ( ) { } public final boolean isMergedMarkup ( ) { } public MarkupElement next ( ) { } public MarkupElement nextOpenTag ( ) { } public void setCurrentIndex ( final int currentIndex ) { } public final void skipComponent ( ) { } public void skipRawMarkup ( ) { } public boolean skipUntil ( final Class < ? extends MarkupElement > clazz ) { } public void skipUntil ( final String wicketTagName ) { } public void skipToMatchingCloseTag ( final ComponentTag openTag ) { } public final IMarkupFragment getMarkupFragment ( ) { } public final String getTagAttribute ( final String name , final boolean withWicketNamespace ) { } public void throwMarkupException ( final String message ) { } public String toHtmlDebugString ( ) { <START_BUG> final StringBuffer buffer = new StringBuffer ( ) ; <END_BUG> for ( int i = 0 ; i < ( markup . size ( ) ) ; i ++ ) { if ( i == ( currentIndex ) ) { buffer . append ( "<font<seq2seq4repair_space>color<seq2seq4repair_space>=<seq2seq4repair_space>\"red\">" ) ; } final MarkupElement element = markup . get ( i ) ; buffer . append ( Strings . escapeMarkup ( element . toString ( ) , true ) . toString ( ) ) ; if ( i == ( currentIndex ) ) { buffer . append ( "<//font>" ) ; } } return buffer . toString ( ) ; } @ Override public String toString ( ) { } }

Fix:
final StringBuilder buffer = new StringBuilder ( ) ;
Buggy code:
public class Map { int width ; int height ; private Tile [ ] [ ] tiles ; private TileOverlay [ ] [ ] tileOverlays ; public Map ( String filePath , MainGame mainGame ) throws IOException { } public void draw ( Graphics g , View view , Player player1 ) { int newx ; int newy ; for ( int i = ( width ) - 1 ; i >= 0 ; i -- ) { newx = ( view . getLocation ( ) . x ) + ( ( i * 64 ) + ( ( ( height ) - 1 ) * 64 ) ) ; newy = ( view . getLocation ( ) . y ) + ( ( i * 32 ) - ( ( ( height ) - 1 ) * 32 ) ) ; for ( int b = ( height ) - 1 ; b >= 0 ; b -- ) { int curTileX = i ; int curTileY = b ; Tile tile = getTile ( curTileX , curTileY ) ; TileOverlay tileOverlay = getTileOverlay ( curTileX , curTileY ) ; int tileImageIndex = tile . getImageIndex ( ) ; int tileOverlayIndex = tile . getOverlayImageIndex ( ) ; if ( tileImageIndex == MainGame . GRAB_NEAREST_TILE_INDEX ) { boolean done = false ; for ( int checkX = curTileX - 1 ; checkX <= ( curTileX + 1 ) ; checkX ++ ) { for ( int checkY = curTileY - 1 ; checkY <= ( curTileY + 1 ) ; checkY ++ ) { if ( ( ( checkX == curTileX ) || ( checkY == curTileY ) ) || done ) { continue ; } if ( ( ( ( checkX < 0 ) || ( checkX > ( ( width ) - 1 ) ) ) || ( checkY < 0 ) ) || ( checkY > ( ( height ) - 1 ) ) ) { continue ; } Tile toCheck = getTile ( checkX , checkY ) ; if ( toCheck . canBeOccupied ( ) ) { <START_BUG> tile . setImageIndex ( toCheck . getImageIndex ( ) , true ) ; <END_BUG> done = true ; } } } if ( ! done ) tile . setImageIndex ( MainGame . SAVANNAH_TILE_INDEX , true ) ; } g . drawImage ( MainGame . tileImages [ tile . getImageIndex ( ) ] , newx , newy , null ) ; if ( ( tile . getRevealed ( ) ) && ( tileOverlayIndex != ( - 1 ) ) ) { g . drawImage ( MainGame . tileImages [ tileOverlayIndex ] , newx , newy , null ) ; } g . drawImage ( MainGame . tileImages [ tileOverlay . getImageIndex ( ) ] , newx , newy , null ) ; if ( ( curTileX == ( player1 . getX ( ) ) ) && ( curTileY == ( player1 . getY ( ) ) ) ) { BufferedImage loadedimage = MainGame . tileImages [ 3 ] ; g . drawImage ( loadedimage , ( newx + 43 ) , ( newy + 12 ) , null ) ; } newx -= 64 ; newy += 32 ; } } } public Tile getTile ( int x , int y ) { } public TileOverlay getTileOverlay ( int x , int y ) { } public int getWidth ( ) { } public void setWidth ( int width ) { } public int getHeight ( ) { } public void setHeight ( int height ) { } }

Fix:
tile . setImageIndex ( toCheck . getImageIndex ( false ) , true ) ;
Buggy code:
public class XSAttributeUseImpl implements XSAttributeUse { public XSAttributeDecl fAttrDecl = null ; public short fUse = SchemaSymbols . USE_OPTIONAL ; public short fConstraintType = XSConstants . VC_NONE ; public ValidatedInfo fDefault = null ; public XSObjectList fAnnotations = null ; public void reset ( ) { } public short getType ( ) { } public String getName ( ) { } public String getNamespace ( ) { } public boolean getRequired ( ) { } public XSAttributeDeclaration getAttrDeclaration ( ) { } public short getConstraintType ( ) { } public String getConstraintValue ( ) { <START_BUG> return ( getConstraintType ( ) ) == ( XSConstants . VC_NONE ) ? null : fDefault . actualValue . toString ( ) ; <END_BUG> } public XSNamespaceItem getNamespaceItem ( ) { } public Object getActualVC ( ) { } public short getActualVCType ( ) { } public ShortList getItemValueTypes ( ) { } public XSObjectList getAnnotations ( ) { } }

Fix:
return ( getConstraintType ( ) ) == ( XSConstants . VC_NONE ) ? null : fDefault . stringValue ( ) ;
Buggy code:
public class ValueSelector extends RelativeLayout { private int minValue = Integer . MIN_VALUE ; private int maxValue = Integer . MAX_VALUE ; private boolean plusButtonIsPressed = false ; private boolean minusButtonIsPressed = false ; private final long REPEAT_INTERVAL_MS = 100L ; View rootView ; TextView valueTextView ; View minusButton ; View plusButton ; Handler handler = new Handler ( ) ; public ValueSelector ( Context context ) { } public ValueSelector ( Context context , AttributeSet attrs ) { } public ValueSelector ( Context context , AttributeSet attrs , int defStyle ) { } public int getMinValue ( ) { } public void setMinValue ( int minValue ) { } public int getMaxValue ( ) { } public void setMaxValue ( int maxValue ) { } public int getValue ( ) { } public void setValue ( int newValue ) { int value = newValue ; if ( newValue < ( minValue ) ) { <START_BUG> value = newValue ; <END_BUG> } else if ( newValue > ( maxValue ) ) { value = maxValue ; } valueTextView . setText ( String . valueOf ( value ) ) ; } private void init ( Context context ) { } private void incrementValue ( ) { } private void decrementValue ( ) { } private class AutoIncrementer implements Runnable { @ Override public void run ( ) { } } private class AutoDecrementer implements Runnable { @ Override public void run ( ) { } } }

Fix:
value = minValue ;
Buggy code:
public class Player { protected static int currentId = 1 ; protected int id ; protected String name ; protected Board board ; protected Ship [ ] ships ; public Player ( int boardSize , int destroyers , int frigates , int corvettes , int submarines ) { } public void placeShip ( Ship ship , int xPos , int yPos , Orientation orientation ) throws FieldOutOfBoardException , ShipAlreadyPlacedException , Exception { Field [ ] [ ] fields = this . board . getFields ( ) ; if ( ship . isPlaced ( ) ) throw new ShipAlreadyPlacedException ( ship ) ; if ( ! ( ( ( ( xPos >= 0 ) && ( yPos >= 0 ) ) && ( xPos < ( fields . length ) ) ) && ( yPos < ( fields . length ) ) ) ) throw new FieldOutOfBoardException ( new Field ( xPos , yPos ) ) ; if ( orientation == ( Orientation . Horizontal ) ) { if ( ! ( ( ( xPos + ( ship . getSize ( ) ) ) - 1 ) < ( fields . length ) ) ) throw new de . hsbremen . battleshipextreme . model . exception . ShipOutOfBoardException ( ship ) ; for ( int y = yPos - 1 ; y <= ( yPos + 1 ) ; y ++ ) for ( int x = xPos - 1 ; x <= ( xPos + ( ship . getSize ( ) ) ) ; x ++ ) if ( ( ( ( x >= 0 ) && ( y >= 0 ) ) && ( x < ( fields . length ) ) ) && ( y < ( fields . length ) ) ) if ( ( fields [ y ] [ x ] . getShip ( ) ) != null ) throw new de . hsbremen . battleshipextreme . model . exception . FieldOccupiedException ( fields [ y ] [ x ] ) ; for ( int x = xPos ; x < ( xPos + ( ship . getSize ( ) ) ) ; x ++ ) fields [ yPos ] [ x ] . setShip ( ship ) ; } if ( orientation == ( Orientation . Vertical ) ) { if ( ! ( ( ( yPos + ( ship . getSize ( ) ) ) - 1 ) < ( fields . length ) ) ) throw new de . hsbremen . battleshipextreme . model . exception . ShipOutOfBoardException ( ship ) ; for ( int y = yPos - 1 ; y <= ( yPos + ( ship . getSize ( ) ) ) ; y ++ ) for ( int x = xPos - 1 ; x <= ( xPos + 1 ) ; x ++ ) if ( ( ( ( x >= 0 ) && ( y >= 0 ) ) && ( x < ( fields . length ) ) ) && ( y < ( fields . length ) ) ) if ( ( fields [ y ] [ x ] . getShip ( ) ) != null ) throw new de . hsbremen . battleshipextreme . model . exception . FieldOccupiedException ( fields [ y ] [ x ] ) ; <START_BUG> for ( int y = xPos ; y < ( yPos + ( ship . getSize ( ) ) ) ; y ++ ) <END_BUG> fields [ y ] [ xPos ] . setShip ( ship ) ; } ship . setPlaced ( ) ; } public boolean hasPlacedAllShips ( ) { } public boolean shoot ( Ship ship , Player player , int xPos , int yPos , Orientation orientation ) throws Exception { } public boolean AreAllShipsReloading ( ) { } public void decreaseCurrentReloadTimeOfAllShips ( ) { } public String getName ( ) { } public void setName ( String name ) { } public int getId ( ) { } public Board getBoard ( ) { } public Ship [ ] getShips ( ) { } public static void resetCurrentId ( ) { } public String toString ( ) { } public boolean hasLost ( ) { } No newline ; at end ; of file ; }

Fix:
for ( int y = yPos ; y < ( yPos + ( ship . getSize ( ) ) ) ; y ++ )
Buggy code:
public class BasicAgent extends Agent { public BasicAgent ( int playerID , Gamestate state ) { } @ Override public Move getNextMove ( ArrayList < Move > options ) { Move chosenMove = options . get ( new Random ( ) . nextInt ( options . size ( ) ) ) ; if ( ( state . numFreeCones ( ) ) == 0 ) { float progress = 0 ; for ( int col = 2 ; col <= 12 ; col ++ ) { int tempProg = state . getTempProgress ( col ) ; if ( ( chosenMove . columns [ 0 ] ) == col ) { tempProg += 1 ; } if ( ( chosenMove . columns [ 1 ] ) == col ) { tempProg += 1 ; } <START_BUG> if ( ( ( state . getProgress ( col , playerID ) ) + tempProg ) >= ( state . getMaxProgress ( col ) ) ) { <END_BUG> chosenMove . stop = true ; break ; } progress += ( ( float ) ( tempProg ) ) // ( state . getMaxProgress ( col ) ) ; } if ( progress >= 0.4 ) { chosenMove . stop = true ; } } return chosenMove ; } }

Fix:
if ( ( tempProg > 0 ) && ( ( ( state . getProgress ( col , playerID ) ) + tempProg ) >= ( state . getMaxProgress ( col ) ) ) ) {
Buggy code:
@ Service public class UserService { private static final Logger LOGGER = LoggerFactory . getLogger ( UserService . class ) ; @ Inject private UserDao userDao ; @ Inject private CredentialDao credentialDao ; @ Inject private ProfileDataSource profileDataSource ; @ Inject private FoursquareApi foursquareApi ; @ Transactional public Credential registerUsingFoursquare ( String foursquareAuthorizationCode ) { } @ Async @ Transactional public void generateProfileUsingFoursquare ( Credential credential ) { profileDataSource . setAccessToken ( credential . getFoursquareAccessToken ( ) ) ; User user = profileDataSource . collectUserData ( ) ; user . setLikes ( profileDataSource . collectLikes ( ) ) ; user . setFriends ( profileDataSource . collectFriendsAndLikes ( ) ) ; user . setCredential ( credential ) ; <START_BUG> userDao . save ( user ) ; <END_BUG> } @ Transactional ( readOnly = true ) public User getCompactSelf ( String accessToken ) { } private String generateAccessToken ( ) { } No newline ; at end ; of file ; }

Fix:
userDao . saveOrUpdate ( user ) ;
Buggy code:
@ Controller @ RequestMapping ( "//" ) public class UserController { @ Autowired private UserService userService ; @ RequestMapping ( method = RequestMethod . GET ) public ResponseEntity < String > getMessageFromUser ( ) { } @ RequestMapping ( value = "{id}" , method = RequestMethod . GET , produces = "application//json" ) public ResponseEntity < User > getUserById ( @ PathVariable ( "id" ) Long id ) { } @ RequestMapping ( method = RequestMethod . POST , produces = "application//json" ) public ResponseEntity < User > postUser ( @ RequestBody User user ) { User postedUser = userService . postUser ( user ) ; <START_BUG> return new ResponseEntity ( postedUser , HttpStatus . OK ) ; <END_BUG> } }

Fix:
return new ResponseEntity ( postedUser , HttpStatus . CREATED ) ;
Buggy code:
public class StatusLabelProvider extends StyledCellLabelProvider { private Image imgError = null ; private Image imgWarning = null ; private Image imgInfo = null ; @ Override public void update ( ViewerCell cell ) { IStatus status = ( ( IStatus ) ( cell . getElement ( ) ) ) ; switch ( status . getSeverity ( ) ) { case IStatus . ERROR : if ( ( imgError ) == null ) imgError = AbstractUIPlugin . imageDescriptorFromPlugin ( PLUGIN_ID , "icons//error_obj.gif" ) . createImage ( ) ; cell . setImage ( imgError ) ; break ; case IStatus . WARNING : if ( ( imgWarning ) == null ) <START_BUG> imgWarning = AbstractUIPlugin . imageDescriptorFromPlugin ( PLUGIN_ID , "icons//warning.gif" ) . createImage ( ) ; <END_BUG> cell . setImage ( imgWarning ) ; break ; case IStatus . INFO : if ( ( imgInfo ) == null ) imgInfo = AbstractUIPlugin . imageDescriptorFromPlugin ( PLUGIN_ID , "icons//information.gif" ) . createImage ( ) ; cell . setImage ( imgInfo ) ; break ; } StyledString label = new StyledString ( status . getMessage ( ) ) ; cell . setText ( label . getString ( ) ) ; cell . setStyleRanges ( label . getStyleRanges ( ) ) ; } @ Override public void dispose ( ) { } }

Fix:
imgWarning = AbstractUIPlugin . imageDescriptorFromPlugin ( PLUGIN_ID , "icons//warning_obj.gif" ) . createImage ( ) ;
Buggy code:
public abstract class AbstractDataSourceRemove extends AbstractRemoveStepHandler { protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) { final ServiceRegistry registry = context . getServiceRegistry ( true ) ; final ModelNode address = operation . require ( OP_ADDR ) ; final String dsName = PathAddress . pathAddress ( address ) . getLastElement ( ) . getValue ( ) ; final String jndiName = model . get ( Constants . JNDINAME . getName ( ) ) . asString ( ) ; final ServiceName binderServiceName = ContextNames . bindInfoFor ( jndiName ) . getBinderServiceName ( ) ; final ServiceController < ? > binderController = registry . getService ( binderServiceName ) ; if ( binderController != null ) { context . removeService ( binderServiceName ) ; } final ServiceName referenceFactoryServiceName = SERVICE_NAME_BASE . append ( dsName ) ; final ServiceController < ? > referenceFactoryController = registry . getService ( referenceFactoryServiceName ) ; if ( referenceFactoryController != null ) { context . removeService ( referenceFactoryServiceName ) ; } final ServiceName dataSourceConfigServiceName = DataSourceConfigService . SERVICE_NAME_BASE . append ( dsName ) ; final ServiceName xaDataSourceConfigServiceName = XADataSourceConfigService . SERVICE_NAME_BASE . append ( dsName ) ; final List < ServiceName > serviceNames = registry . getServiceNames ( ) ; for ( ServiceName name : serviceNames ) { if ( dataSourceConfigServiceName . append ( "connetion-properties" ) . isParentOf ( name ) ) { context . removeService ( name ) ; } if ( xaDataSourceConfigServiceName . append ( "xa-datasource-properties" ) . isParentOf ( name ) ) { context . removeService ( name ) ; } } final ServiceController < ? > dataSourceConfigController = registry . getService ( dataSourceConfigServiceName ) ; if ( dataSourceConfigController != null ) { context . removeService ( dataSourceConfigServiceName ) ; } final ServiceController < ? > xaDataSourceConfigController = registry . getService ( xaDataSourceConfigServiceName ) ; if ( xaDataSourceConfigController != null ) { context . removeService ( xaDataSourceConfigServiceName ) ; } <START_BUG> final ServiceName dataSourceServiceName = AbstractDataSourceService . SERVICE_NAME_BASE . append ( dsName ) ; <END_BUG> final ServiceController < ? > dataSourceController = registry . getService ( dataSourceServiceName ) ; if ( dataSourceController != null ) { context . removeService ( dataSourceServiceName ) ; } } protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) { } protected abstract SimpleAttributeDefinition [ ] getModelProperties ( ) { } }

Fix:
final ServiceName dataSourceServiceName = AbstractDataSourceService . SERVICE_NAME_BASE . append ( jndiName ) ;
Buggy code:
public class CompilationParticipantResult implements ICompilationParticipantResult { SourceFile sourceFile ; boolean hasAnnotations ; IFile [ ] addedFiles ; IFile [ ] deletedFiles ; IProblem [ ] problems ; String [ ] dependencies ; CompilationParticipantResult ( SourceFile sourceFile ) { } public char [ ] getContents ( ) { } public IFile getFile ( ) { } public boolean hasAnnotations ( ) { } public void recordAddedGeneratedFiles ( IFile [ ] addedGeneratedFiles ) { } public void recordDeletedGeneratedFiles ( IFile [ ] deletedGeneratedFiles ) { } public void recordDependencies ( String [ ] typeNameDependencies ) { } public void recordNewProblems ( IProblem [ ] newProblems ) { int length2 = newProblems . length ; if ( length2 == 0 ) return ; int length1 = ( ( this . problems ) == null ) ? 0 : this . problems . length ; IProblem [ ] merged = new IProblem [ length1 + length2 ] ; if ( length1 > 0 ) System . arraycopy ( this . problems , 0 , merged , 0 , length1 ) ; <START_BUG> System . arraycopy ( problems , 0 , merged , length1 , length2 ) ; <END_BUG> this . problems = merged ; } void reset ( boolean detectedAnnotations ) { } public String toString ( ) { } }

Fix:
System . arraycopy ( newProblems , 0 , merged , length1 , length2 ) ;
Buggy code:
public class ValidateCert { private static Logger log = Logger . getLogger ( ValidateCert . class . getName ( ) ) ; public static void main ( String [ ] args ) throws Exception { ContextVS . getInstance ( ) . initTestEnvironment ( Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( "TestsApp.properties" ) , ".//TestDir" ) ; ResponseVS responseVS = HttpHelper . getInstance ( ) . getData ( ActorVS . getServerInfoURL ( "http:////localhost:8080//AccessControl" ) , JSON ) ; if ( ( ResponseVS . SC_OK ) != ( responseVS . getStatusCode ( ) ) ) throw new org . votingsystem . throwable . ExceptionVS ( responseVS . getMessage ( ) ) ; ActorVS actorVS = ( ( org . votingsystem . dto . ActorVSDto ) ( responseVS . getMessage ( org . votingsystem . dto . ActorVSDto . class ) ) ) . getActorVS ( ) ; if ( ! ( actorVS instanceof AccessControlVS ) ) throw new org . votingsystem . throwable . ExceptionVS ( ( "Expected<seq2seq4repair_space>access<seq2seq4repair_space>control<seq2seq4repair_space>but<seq2seq4repair_space>found<seq2seq4repair_space>" + ( actorVS . getType ( ) . toString ( ) ) ) ) ; AccessControlVS accessControlVS = ( ( AccessControlVS ) ( actorVS ) ) ; ContextVS . getInstance ( ) . setAccessControl ( ( ( AccessControlVS ) ( actorVS ) ) ) ; <START_BUG> CertValidationDto certValidationDto = CertValidationDto . validationRequest ( "7553172H" , "C8-0A-A9-AB-47-BE" ) ; <END_BUG> SignatureService superUserSignatureService = SignatureService . getUserVSSignatureService ( "07553172H" , USER ) ; UserVS fromUserVS = superUserSignatureService . getUserVS ( ) ; String messageSubject = "ValidateCert<seq2seq4repair_space>test<seq2seq4repair_space>" + ( certValidationDto . getUUID ( ) ) ; SMIMEMessage smimeMessage = superUserSignatureService . getSMIMETimeStamped ( fromUserVS . getNif ( ) , accessControlVS . getName ( ) , org . votingsystem . util . JSON . getMapper ( ) . writeValueAsString ( certValidationDto ) , messageSubject ) ; responseVS = HttpHelper . getInstance ( ) . sendData ( smimeMessage . getBytes ( ) , JSON_SIGNED , accessControlVS . getUserCSRValidationServiceURL ( ) ) ; ValidateCert . log . info ( ( ( ( "statusCode:<seq2seq4repair_space>" + ( responseVS . getStatusCode ( ) ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>message:<seq2seq4repair_space>" ) + ( responseVS . getMessage ( ) ) ) ) ; System . exit ( 0 ) ; } }

Fix:
CertValidationDto certValidationDto = CertValidationDto . validationRequest ( "7553172H" , "355136056990149" ) ;
Buggy code:
class FileLoadAction extends AbstractAction { Decoder decoder = null ; private LogUI parent ; private JFileChooser chooser = null ; public FileLoadAction ( LogUI parent , String decoder , String title ) { } public void actionPerformed ( ActionEvent e ) { if ( ( chooser ) == null ) { chooser = new JFileChooser ( ) ; } chooser . setDialogTitle ( "Load<seq2seq4repair_space>Events<seq2seq4repair_space>from<seq2seq4repair_space>XML<seq2seq4repair_space>file..." ) ; chooser . setAcceptAllFileFilterUsed ( true ) ; chooser . setFileFilter ( new FileFilter ( ) { public boolean accept ( File f ) { <START_BUG> return f . getName ( ) . toLowerCase ( ) . endsWith ( ".xml" ) ; <END_BUG> } public String getDescription ( ) { return "XML<seq2seq4repair_space>files<seq2seq4repair_space>(*.xml)" ; } } ) ; chooser . showOpenDialog ( parent ) ; File selectedFile = chooser . getSelectedFile ( ) ; if ( selectedFile != null ) { Map additionalProperties = new HashMap ( ) ; additionalProperties . put ( LOG4J_MACHINE_KEY , ( "localhost:" + ( selectedFile . getName ( ) ) ) ) ; decoder . setAdditionalProperties ( additionalProperties ) ; try { Vector events = decoder . decode ( selectedFile ) ; parent . handler . appendBatch ( events ) ; } catch ( IOException e1 ) { e1 . printStackTrace ( ) ; } } } }

Fix:
return ( f . getName ( ) . toLowerCase ( ) . endsWith ( ".xml" ) ) || ( f . isDirectory ( ) ) ;
Buggy code:
public class SignerInformationForEquifaxCanadaConverter { private SignerInformationForEquifaxCanada sdkKBACanada = null ; private com . silanis . esl . api . model . SignerInformationForEquifaxCanada apiKBACanada = null ; public SignerInformationForEquifaxCanadaConverter ( com . silanis . esl . sdk . SignerInformationForEquifaxCanada sdkKBACanada ) { } public SignerInformationForEquifaxCanadaConverter ( com . silanis . esl . api . model . SignerInformationForEquifaxCanada apiKBACanada ) { } public com . silanis . esl . api . model . SignerInformationForEquifaxCanada toAPISignerInformationForEquifaxCanada ( ) { if ( ( sdkKBACanada ) == null ) { return apiKBACanada ; } com . silanis . esl . api . model . SignerInformationForEquifaxCanada result = new com . silanis . esl . api . model . SignerInformationForEquifaxCanada ( ) ; <START_BUG> result . setFirstName ( sdkKBACanada . getFirstName ( ) ) . setLastName ( sdkKBACanada . getLastName ( ) ) . setStreetAddress ( sdkKBACanada . getStreetAddress ( ) ) . setCity ( sdkKBACanada . getCity ( ) ) . setPostalCode ( sdkKBACanada . getPostalCode ( ) ) . setProvince ( sdkKBACanada . getProvince ( ) ) . setTimeAtAddress ( sdkKBACanada . getTimeAtAddress ( ) ) . setDateOfBirth ( sdkKBACanada . getDateOfBirth ( ) ) . setDriversLicenseNumber ( sdkKBACanada . getDriversLicenseNumber ( ) ) . setSocialInsuranceNumber ( sdkKBACanada . getSocialInsuranceNumber ( ) ) . setHomePhoneNumber ( sdkKBACanada . getHomePhoneNumber ( ) ) ; <END_BUG> return result ; } public SignerInformationForEquifaxCanada toSDKSignerInformationForEquifaxCanada ( ) { } }

Fix:
result . setFirstName ( sdkKBACanada . getFirstName ( ) ) . setLastName ( sdkKBACanada . getLastName ( ) ) . setStreetAddress ( sdkKBACanada . getStreetAddress ( ) ) . setCity ( sdkKBACanada . getCity ( ) ) . setPostalCode ( sdkKBACanada . getPostalCode ( ) ) . setProvince ( sdkKBACanada . getProvince ( ) ) . setTimeAtAddress ( sdkKBACanada . getTimeAtAddress ( ) ) . setDateOfBirth ( sdkKBACanada . getDateOfBirth ( ) ) . setDriversLicenseNumber ( sdkKBACanada . getDriversLicenseNumber ( ) ) . safeSetSocialInsuranceNumber ( sdkKBACanada . getSocialInsuranceNumber ( ) ) . setHomePhoneNumber ( sdkKBACanada . getHomePhoneNumber ( ) ) ;
Buggy code:
class FileWriter extends AbstractOperator { public static final String OP_TYPE = "filewrite" ; private ContainerPicker contPicker = new ContainerPicker ( ) ; private FilePicker filePicker = new FilePicker ( ) ; private File folder ; private File [ ] listOfFiles ; private boolean hashCheck = false ; public FileWriter ( ) { } @ Override protected void init ( String id , int ratio , String division , Config config ) { } @ Override public String getOpType ( ) { } @ Override protected void operate ( int idx , int all , Session session ) { } public Sample doWrite ( InputStream in , long length , String conName , String objName , Config config , Session session ) { if ( Thread . interrupted ( ) ) throw new AbortedException ( ) ; CountingInputStream cin = new CountingInputStream ( in ) ; long start = System . currentTimeMillis ( ) ; try { session . getApi ( ) . createObject ( conName , objName , cin , length , config ) ; } catch ( StorageInterruptedException sie ) { throw new AbortedException ( ) ; } catch ( Exception e ) { <START_BUG> session . getLogger ( ) . error ( "fail<seq2seq4repair_space>to<seq2seq4repair_space>perform<seq2seq4repair_space>write<seq2seq4repair_space>operation" , e ) ; <END_BUG> return new Sample ( new Date ( ) , getId ( ) , getOpType ( ) , getSampleType ( ) , getName ( ) , false ) ; } finally { IOUtils . closeQuietly ( cin ) ; } long end = System . currentTimeMillis ( ) ; Date now = new Date ( end ) ; return new Sample ( now , getId ( ) , getOpType ( ) , getSampleType ( ) , getName ( ) , true , ( end - start ) , cin . getByteCount ( ) ) ; } }

Fix:
doLogErr ( session . getLogger ( ) , "fail<seq2seq4repair_space>to<seq2seq4repair_space>perform<seq2seq4repair_space>filewrite<seq2seq4repair_space>operation" , e ) ;
Buggy code:
public class BigramSubPathsTaggerImpl implements BigramSubPathsTagger { BigramsCache bigramsCache ; public BigramSubPathsTaggerImpl ( BigramsCache bigramsCache ) { } public BigramsCache getBigramsCache ( ) { } @ Override public void searchPossibleTagsForBigram ( TokenTagData tokenTagData1 , TokenTagData tokenTagData2 , String sequenceDirection ) { if ( TokenUtils . isTokenConstant ( tokenTagData1 ) ) { tokenTagData2 . getBigramSubPaths ( ) . put ( tokenTagData1 . getConstantTag ( ) , bigramsCache . getTheMostProbableNeighbourTags ( tokenTagData1 . getConstantTag ( ) , sequenceDirection ) ) ; } else { final Iterator it = tokenTagData1 . getBigramSubPaths ( ) . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { final Map . Entry < String , List < TagProbabilityPair > > pair = ( ( Map . Entry ) ( it . next ( ) ) ) ; final List < TagProbabilityPair > tags = pair . getValue ( ) ; for ( final TagProbabilityPair tag1 : tags ) { <START_BUG> tokenTagData2 . getBigramSubPaths ( ) . put ( tag1 . getTag ( ) , bigramsCache . getTheMostProbableNeighbourTags ( tokenTagData1 . getConstantTag ( ) , sequenceDirection ) ) ; <END_BUG> } } } } @ Override public void searchPossibleTagsForBigramPrefixedSuffixed ( TokenTagData tokenTagData1 , TokenTagData tokenTagData2 , String sequenceDirection ) { } @ Override public void searchTheMostProbableTagsForSkipgram ( TokenTagData tokenTagData1 , TokenTagData tokenTagData2 , TokenTagData tokenTagData3 ) { } @ Override public void searchTheMostProbableTagsForSkipgramPrefixedSuffixed ( TokenTagData tokenTagData1 , TokenTagData tokenTagData2 , TokenTagData tokenTagData3 ) { } private void findPathAmongTag1MorphologicalTag2AndTag3 ( String tag1 , TokenTagData tokenTagData2 , String tag3 ) { } private void findPathsBetweenTag1AndTag3 ( String tag1 , TokenTagData tokenTagData2 , String tag3 ) { } private void findPathsBetweenTag1AndMorphologicalTags ( String tag1 , TokenTagData tokenTagData2 , String sequenceDirection ) { } private void setMorphologicalTagsWithoutPathFromTag1IntoBigramSubPaths ( String tag1 , List < String > morphologicalTags , TokenTagData tokenTagData2 ) { } private void setTheMostProbableTag3BackwardPathsIntoTag2ForSkipgram ( TokenTagData tokenTagData1 , TokenTagData tokenTagData2 , TokenTagData tokenTagData3 ) { } private List < String > getMorphologicalTags ( TokenTagData tokenTagData ) { } }

Fix:
tokenTagData2 . getBigramSubPaths ( ) . put ( tag1 . getTag ( ) , bigramsCache . getTheMostProbableNeighbourTags ( tag1 . getTag ( ) , sequenceDirection ) ) ;
Buggy code:
public class UploadProgressBar extends Panel { private static final Logger log = LoggerFactory . getLogger ( UploadProgressBar . class ) ; public static final class ComponentInitializer implements IInitializer { public void init ( Application application ) { } @ Override public String toString ( ) { } } private static final ResourceReference JS = new PackageResourceReference ( UploadProgressBar . class , "progressbar.js" ) ; private static final ResourceReference CSS = new PackageResourceReference ( UploadProgressBar . class , "UploadProgressBar.css" ) ; private static final String RESOURCE_NAME = UploadProgressBar . class . getName ( ) ; private static final long serialVersionUID = 1L ; private final Form < ? > form ; public UploadProgressBar ( String id , final Form < ? > form ) { } public UploadProgressBar ( String id , final Form < ? > form , FileUploadField fileUploadField ) { } protected ResourceReference getCss ( ) { } @ Override public void renderHead ( IHeaderResponse response ) { } @ Override protected void onRemove ( ) { } private static class FormEnabler extends AbstractBehavior { private static final long serialVersionUID = 1L ; private final Component status ; private final Component bar ; private final Component uploadField ; private final UploadProgressBar pbar ; public FormEnabler ( UploadProgressBar pbar , Component status , Component bar , Component uploadField ) { } @ Override public void onComponentTag ( Component component , ComponentTag tag ) { ResourceReference ref = new SharedResourceReference ( UploadProgressBar . RESOURCE_NAME ) ; final String uploadFieldId = ( ( uploadField ) == null ) ? "" : uploadField . getMarkupId ( ) ; <START_BUG> tag . put ( "onsubmit" , ( ( ( ( ( ( ( ( ( ( "var<seq2seq4repair_space>def=new<seq2seq4repair_space>Wicket.WUPB.Def('" + ( component . getMarkupId ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( status . getMarkupId ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( bar . getMarkupId ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( component . getPage ( ) . urlFor ( ref ) ) ) + "','" ) + uploadFieldId ) + "');<seq2seq4repair_space>Wicket.WUPB.start(def);" ) ) ; <END_BUG> } public UploadProgressBar getUploadProgressBar ( ) { } } }

Fix:
tag . put ( "onsubmit" , ( ( ( ( ( ( ( ( ( ( "var<seq2seq4repair_space>def=new<seq2seq4repair_space>Wicket.WUPB.Def('" + ( component . getMarkupId ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( status . getMarkupId ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( bar . getMarkupId ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( component . getPage ( ) . urlFor ( ref , null ) ) ) + "','" ) + uploadFieldId ) + "');<seq2seq4repair_space>Wicket.WUPB.start(def);" ) ) ;
Buggy code:
public class ListViewTest extends TestCase { private static MockWebApplication application ; protected void setUp ( ) throws Exception { } private ListView createListView ( final int modelListSize ) { } public void testListView ( ) { } public void testEmptyListView ( ) throws IOException { ListView lv = createListView ( 0 ) ; assertEquals ( 0 , lv . getStartIndex ( ) ) ; assertEquals ( 0 , lv . getViewSize ( ) ) ; lv = new ListView ( "listView" , new Model ( null ) ) { protected void populateItem ( final ListItem listItem ) { } } ; assertEquals ( 0 , lv . getStartIndex ( ) ) ; assertEquals ( 0 , lv . getViewSize ( ) ) ; lv . setStartIndex ( 5 ) ; lv . setViewSize ( 10 ) ; assertEquals ( 0 , lv . getStartIndex ( ) ) ; <START_BUG> assertEquals ( 0 , lv . getViewSize ( ) ) ; <END_BUG> } }

Fix:
assertEquals ( 10 , lv . getViewSize ( ) ) ;
Buggy code:
@ ComponentType ( name = "Degree<seq2seq4repair_space>classes" , description = "Schedule<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>class" ) public class DegreeClassesComponent extends DegreeSiteComponent { @ Override public void handle ( Page page , TemplateContext componentContext , TemplateContext global ) { } private SortedMap < Integer , Set < SchoolClass > > classesByCurricularYear ( Degree degree , ExecutionSemester semester ) { } private ExecutionSemester getOtherExecutionSemester ( ExecutionSemester semester ) { ExecutionSemester next = semester . getNextExecutionPeriod ( ) ; <START_BUG> return canViewNextExecutionSemester ( next ) ? next : semester . getPreviousExecutionPeriod ( ) ; <END_BUG> } private boolean canViewNextExecutionSemester ( ExecutionSemester nextExecutionSemester ) { } private ExecutionSemester getExecutionSemester ( String [ ] requestContext ) { } }

Fix:
return ( next != null ) && ( canViewNextExecutionSemester ( next ) ) ? next : semester . getPreviousExecutionPeriod ( ) ;
Buggy code:
public final class GenericBooleanPrefDataModel extends AbstractDataModel { private final long [ ] userIDs ; private final FastByIDMap < FastIDSet > preferenceFromUsers ; private final long [ ] itemIDs ; private final FastByIDMap < FastIDSet > preferenceForItems ; private final FastByIDMap < FastByIDMap < Long > > timestamps ; public GenericBooleanPrefDataModel ( FastByIDMap < FastIDSet > userData ) { } public GenericBooleanPrefDataModel ( FastByIDMap < FastIDSet > userData , FastByIDMap < FastByIDMap < Long > > timestamps ) { } @ Deprecated public GenericBooleanPrefDataModel ( DataModel dataModel ) throws TasteException { } public static FastByIDMap < FastIDSet > toDataMap ( DataModel dataModel ) throws TasteException { } public static FastByIDMap < FastIDSet > toDataMap ( FastByIDMap < PreferenceArray > data ) { } public FastByIDMap < FastIDSet > getRawUserData ( ) { } public FastByIDMap < FastIDSet > getRawItemData ( ) { } @ Override public LongPrimitiveArrayIterator getUserIDs ( ) { } @ Override public PreferenceArray getPreferencesFromUser ( long userID ) throws NoSuchUserException { } @ Override public FastIDSet getItemIDsFromUser ( long userID ) throws TasteException { } @ Override public LongPrimitiveArrayIterator getItemIDs ( ) { } @ Override public PreferenceArray getPreferencesForItem ( long itemID ) throws NoSuchItemException { } @ Override public Float getPreferenceValue ( long userID , long itemID ) throws NoSuchUserException { } @ Override public Long getPreferenceTime ( long userID , long itemID ) throws TasteException { } @ Override public int getNumItems ( ) { } @ Override public int getNumUsers ( ) { } @ Override public int getNumUsersWithPreferenceFor ( long itemID ) { } @ Override public int getNumUsersWithPreferenceFor ( long itemID1 , long itemID2 ) { } @ Override public void removePreference ( long userID , long itemID ) { } @ Override public void setPreference ( long userID , long itemID , float value ) { } @ Override public void refresh ( Collection < Refreshable > alreadyRefreshed ) { } @ Override public boolean hasPreferenceValues ( ) { } @ Override public String toString ( ) { StringBuilder result = new StringBuilder ( 200 ) ; result . append ( "GenericBooleanPrefDataModel[users:" ) ; for ( int i = 0 ; i < ( Math . min ( 3 , userIDs . length ) ) ; i ++ ) { if ( i > 0 ) { result . append ( ',' ) ; } result . append ( userIDs [ i ] ) ; } <START_BUG> if ( ( result . length ( ) ) > 3 ) { <END_BUG> result . append ( "..." ) ; } result . append ( ']' ) ; return result . toString ( ) ; } }

Fix:
if ( ( userIDs . length ) > 3 ) {
Buggy code:
public class IssuesDao extends ApplicationDAO { public IssuesDao ( final IReleaseTagConvertor tagConvertor , final EventQueryManager queries , final AnalyzedApplication application ) { } public int countIssues ( final Release release , final String type ) { <START_BUG> String query = ( ( ( "SELECT<seq2seq4repair_space>COUNT(*)<seq2seq4repair_space>FROM<seq2seq4repair_space>issue_new<seq2seq4repair_space>WHERE<seq2seq4repair_space>issuetype.name='" + type ) + "'<seq2seq4repair_space>AND<seq2seq4repair_space>versions.name<seq2seq4repair_space>CONTAINS<seq2seq4repair_space>'" ) + ( release . geReleaseName ( ) ) ) + "'" ; <END_BUG> Iterator < IODocument > tags = this . queries . query ( query ) ; if ( tags . hasNext ( ) ) { IODocument tag = tags . next ( ) ; return tag . getField ( "COUNT" , Integer . class ) ; } return 0 ; } public int countUnknownVersionIssues ( final String type , final Date since , final Date until ) { } }

Fix:
String query = ( ( ( "SELECT<seq2seq4repair_space>COUNT(*)<seq2seq4repair_space>FROM<seq2seq4repair_space>issue_new<seq2seq4repair_space>WHERE<seq2seq4repair_space>issuetype.name='" + type ) + "'AND<seq2seq4repair_space>(status.name<seq2seq4repair_space>='Open'<seq2seq4repair_space>OR<seq2seq4repair_space>resolution.name='Fixed')<seq2seq4repair_space>AND<seq2seq4repair_space>versions.name<seq2seq4repair_space>CONTAINS<seq2seq4repair_space>'" ) + ( release . geReleaseName ( ) ) ) + "'" ;
Buggy code:
public class WebClient extends Thread { protected Config config ; protected Socket socket ; protected BufferedReader vomServer ; protected PrintWriter zumServer ; private boolean ready = false ; protected int timeout = 5000 ; protected String vomServer_text = "" ; protected Boolean Client_beenden = false ; protected InputStream is ; protected Boolean getPlayerData = true ; protected Boolean setPlayerData = false ; protected Boolean getAnimals = true ; protected Boolean getPlayer = true ; protected Boolean getAnimalsData = true ; protected int player_pos_x = 0 ; protected int player_pos_y = 0 ; protected String server_url = "" ; public WebClient ( Config config ) throws IOException { } @ Override public void run ( ) { } public int [ ] getPlayerPos ( ) { <START_BUG> while ( ( ( ( player_pos_x ) == 0 ) && ( ( player_pos_y ) == 0 ) ) || ( ( setPlayerData ) && ( ! ( ready ) ) ) ) { <END_BUG> } int [ ] player_pos_data = new int [ 2 ] ; player_pos_data [ 0 ] = 10 ; player_pos_data [ 1 ] = 10 ; return player_pos_data ; } public void setPlayerPos ( int x , int y ) { } public void getPlayerData ( ) { } public void runProtokoll ( ) throws IOException , MalformedURLException { } public final String readFile ( InputStream is ) throws IOException { } public String parseElement ( String text , String element ) { } }

Fix:
while ( ( ( ( ( player_pos_x ) == 0 ) && ( ( player_pos_y ) == 0 ) ) || ( setPlayerData ) ) && ( ! ( ready ) ) ) {
Buggy code:
public class JdrReportService implements JdrReportCollector , Service < JdrReportCollector > { public static final ServiceName SERVICE_NAME = JBOSS . append ( "jdr" , "collector" ) ; public static ServiceController < JdrReportCollector > addService ( final ServiceTarget target , final ServiceVerificationHandler verificationHandler ) { } private final InjectedValue < ServerEnvironment > serverEnvironmentValue = new InjectedValue < ServerEnvironment > ( ) ; private final InjectedValue < ModelController > modelControllerValue = new InjectedValue < ModelController > ( ) ; private ExecutorService executorService ; private ServerEnvironment serverEnvironment ; private ModelControllerClient controllerClient ; public JdrReport standaloneCollect ( String protocol , String host , String port ) throws OperationFailedException { String username = null ; String password = null ; if ( host == null ) { host = "localhost" ; } if ( port == null ) { <START_BUG> port = "9990" ; <END_BUG> } if ( protocol == null ) { protocol = "http-remoting" ; } return new JdrRunner ( protocol , username , password , host , port ) . collect ( ) ; } public JdrReport collect ( ) throws OperationFailedException { } public synchronized void start ( StartContext context ) throws StartException { } public synchronized void stop ( StopContext context ) { } public JdrReportService getValue ( ) throws IllegalArgumentException , IllegalStateException { } }

Fix:
port = "9999" ;