nus-yam/ex-repair huggingface dataset:
Buggy code:
@ Path ( "//" ) public class PaymentResource { @ PUT @ Consumes ( { MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) @ Produces ( { MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) @ Path ( "//order" ) public GenericResponse buyProduct ( OrderRequest orderRequest , @ HeaderParam ( "email" ) String email , @ HeaderParam ( "password" ) String password ) { System . out . println ( "PUT<seq2seq4repair_space>METHOD<seq2seq4repair_space>Request<seq2seq4repair_space>for<seq2seq4repair_space>placing<seq2seq4repair_space>an<seq2seq4repair_space>order............." ) ; boolean isUserAuthentic = false ; isUserAuthentic = LSMAuthenticator . authenticateUser ( email , password ) ; if ( isUserAuthentic ) { GenericResponse genericResponse = new GenericResponse ( ) ; int orderID = 0 ; PaymentActivity paymentActivity = new PaymentActivity ( ) ; orderID = paymentActivity . buyProduct ( orderRequest ) ; if ( 0 != orderID ) { genericResponse . setMessage ( "Order<seq2seq4repair_space>is<seq2seq4repair_space>created" ) ; genericResponse . setSuccess ( true ) ; genericResponse . setGenericReturnValue ( ( orderID + "" ) ) ; Link get = new Link ( "Get<seq2seq4repair_space>Order<seq2seq4repair_space>Detail" , ( ( ( Constant . LSM_COMMON_URL ) + "//order//" ) + orderID ) , "application//xml" ) ; Link cancel = new Link ( "Cancel<seq2seq4repair_space>Order" , ( ( ( Constant . LSM_COMMON_URL ) + "//order//" ) + orderID ) , "application//xml" ) ; Link ship = new Link ( "Ship<seq2seq4repair_space>Order" , ( ( Constant . LSM_COMMON_URL ) + "//order//ship" ) , "application//xml" ) ; <START_BUG> genericResponse . setLinks ( get , cancel , ship ) ; <END_BUG> } else { genericResponse . setMessage ( "Order<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>created" ) ; genericResponse . setSuccess ( false ) ; } return genericResponse ; } else { throw new com . online . lakeshoremarket . exception . GenericLSMException ( "User<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>authorized" , Status . UNAUTHORIZED ) ; } } }

Fix:
genericResponse . setLinks ( get , ship , cancel ) ;
Buggy code:
public class FlashAttributeResultMatchers { protected FlashAttributeResultMatchers ( ) { } public < T > ResultMatcher attribute ( final String name , final Matcher < T > matcher ) { } public < T > ResultMatcher attribute ( final String name , final Object value ) { return new ResultMatcher ( ) { @ SuppressWarnings ( "unchecked" ) public void match ( MvcResult result ) throws Exception { <START_BUG> assertEquals ( "Flash<seq2seq4repair_space>attribute" , value , result . getFlashMap ( ) . get ( name ) ) ; <END_BUG> } } ; } public < T > ResultMatcher attributeExists ( final String ... names ) { } public < T > ResultMatcher attributeCount ( final int count ) { } }

Fix:
assertEquals ( "Flash<seq2seq4repair_space>attribute" , value , ( ( T ) ( result . getFlashMap ( ) . get ( name ) ) ) ) ;
Buggy code:
public class AddCountersSourceEffect extends OneShotEffect { private Counter counter ; private boolean informPlayers ; private DynamicValue amount ; private boolean putOnCard ; public AddCountersSourceEffect ( Counter counter ) { } public AddCountersSourceEffect ( Counter counter , boolean informPlayers ) { } public AddCountersSourceEffect ( Counter counter , DynamicValue amount , boolean informPlayers ) { } public AddCountersSourceEffect ( Counter counter , DynamicValue amount , boolean informPlayers , boolean putOnCard ) { } public AddCountersSourceEffect ( final AddCountersSourceEffect effect ) { } @ Override public boolean apply ( Game game , Ability source ) { Player controller = game . getPlayer ( source . getControllerId ( ) ) ; if ( controller != null ) { if ( putOnCard ) { Card card = game . getCard ( source . getSourceId ( ) ) ; if ( card != null ) { if ( ( counter ) != null ) { Counter newCounter = counter . copy ( ) ; int countersToAdd = amount . calculate ( game , source , this ) ; if ( ( countersToAdd > 0 ) && ( ( newCounter . getCount ( ) ) == 1 ) ) { countersToAdd -- ; } newCounter . add ( countersToAdd ) ; card . addCounters ( newCounter , game ) ; if ( informPlayers ) { Player player = game . getPlayer ( source . getControllerId ( ) ) ; if ( player != null ) { game . informPlayers ( new StringBuilder ( player . getName ( ) ) . append ( "<seq2seq4repair_space>puts<seq2seq4repair_space>" ) . append ( newCounter . getCount ( ) ) . append ( "<seq2seq4repair_space>" ) . append ( newCounter . getName ( ) . toLowerCase ( ) ) . append ( "<seq2seq4repair_space>counter<seq2seq4repair_space>on<seq2seq4repair_space>" ) . append ( card . getLogName ( ) ) . toString ( ) ) ; } } } return true ; } } else { Permanent permanent = game . getPermanent ( source . getSourceId ( ) ) ; if ( permanent != null ) { if ( ( counter ) != null ) { Counter newCounter = counter . copy ( ) ; int countersToAdd = amount . calculate ( game , source , this ) ; <START_BUG> if ( countersToAdd > 0 ) { <END_BUG> if ( ( countersToAdd > 0 ) && ( ( newCounter . getCount ( ) ) == 1 ) ) { countersToAdd -- ; } newCounter . add ( countersToAdd ) ; int before = permanent . getCounters ( ) . getCount ( newCounter . getName ( ) ) ; permanent . addCounters ( newCounter , game ) ; int amountAdded = ( permanent . getCounters ( ) . getCount ( newCounter . getName ( ) ) ) - before ; if ( informPlayers ) { Player player = game . getPlayer ( source . getControllerId ( ) ) ; if ( player != null ) { game . informPlayers ( ( ( ( ( ( ( ( player . getName ( ) ) + "<seq2seq4repair_space>puts<seq2seq4repair_space>" ) + amountAdded ) + "<seq2seq4repair_space>" ) + ( newCounter . getName ( ) . toLowerCase ( ) ) ) + "<seq2seq4repair_space>counter<seq2seq4repair_space>on<seq2seq4repair_space>" ) + ( permanent . getLogName ( ) ) ) ) ; } } } } } } return true ; } return false ; } private void setText ( ) { } @ Override public AddCountersSourceEffect copy ( ) { } }

Fix:
if ( ( ( amount ) instanceof StaticValue ) || ( countersToAdd > 0 ) ) {
Buggy code:
public class ClientConnection { private static Logger logger = Logger . getLogger ( ClientMain . class ) ; private static final int TIMEOUT = 5 ; private SSLSocket socket ; private BufferedOutputStream out ; private BufferedInputStream in ; public ClientConnection ( ) { } public ClientConnection ( InetAddress address , int port ) throws IOException { } public Socket getSocket ( ) { } public BufferedOutputStream getOut ( ) { } public BufferedInputStream getIn ( ) { } private void createConnection ( InetAddress address , int port ) throws IOException { } public void closeConnection ( ) throws IOException { } public void sendMessage ( String message ) throws IOException { } public String waitForResponse ( ) throws IOException { } public String waitForMailResponse ( ) throws MalFormedMessageException , IOException { <START_BUG> BufferedReader reader = new BufferedReader ( new InputStreamReader ( in , "UTF-8" ) ) ; <END_BUG> StringBuilder response = new StringBuilder ( ) ; response . append ( reader . readLine ( ) ) ; MailMessage mailMess = new MailMessage ( response . toString ( ) ) ; char [ ] buf = new char [ mailMess . getSize ( ) ] ; reader . read ( buf , 0 , mailMess . getSize ( ) ) ; response . append ( buf ) ; ClientConnection . logger . info ( ( "Server<seq2seq4repair_space>:<seq2seq4repair_space>" + ( response . toString ( ) ) ) ) ; return response . toString ( ) ; } }

Fix:
BufferedReader reader = new BufferedReader ( new InputStreamReader ( in , "UTF8" ) ) ;
Buggy code:
public class AdviceDeclaration extends AjMethodDeclaration { public PointcutDesignator pointcutDesignator ; int baseArgumentCount ; public Argument extraArgument ; public AdviceKind kind ; private int extraArgumentFlags = 0 ; public MethodBinding proceedMethodBinding ; public List proceedCalls = new ArrayList ( 2 ) ; private boolean proceedInInners ; private ResolvedMember [ ] proceedCallSignatures ; private boolean [ ] formalsUnchangedToProceed ; private UnresolvedType [ ] declaredExceptions ; public AdviceDeclaration ( CompilationResult result , AdviceKind kind ) { } protected int generateInfoAttributes ( ClassFile classFile ) { } private AjAttribute makeAttribute ( ) { } public void resolveStatements ( ) { } public int getDeclaredParameterCount ( ) { } private void generateProceedMethod ( ClassScope classScope , ClassFile classFile ) { } public void generateCode ( ClassScope classScope , ClassFile classFile ) { } private void determineExtraArgumentFlags ( ) { } private static TypeBinding [ ] resize ( int newSize , TypeBinding [ ] bindings ) { } public void addAtAspectJAnnotations ( ) { Annotation adviceAnnotation = null ; String pointcutExpression = pointcutDesignator . getPointcut ( ) . toString ( ) ; String extraArgumentName = "" ; if ( ( extraArgument ) != null ) { extraArgumentName = new String ( extraArgument . name ) ; } if ( ( kind ) == ( AdviceKind . Before ) ) { adviceAnnotation = AtAspectJAnnotationFactory . createBeforeAnnotation ( pointcutExpression , declarationSourceStart ) ; } else if ( ( kind ) == ( AdviceKind . After ) ) { adviceAnnotation = AtAspectJAnnotationFactory . createAfterAnnotation ( pointcutExpression , declarationSourceStart ) ; } else if ( ( kind ) == ( AdviceKind . AfterReturning ) ) { adviceAnnotation = AtAspectJAnnotationFactory . createAfterReturningAnnotation ( pointcutExpression , extraArgumentName , declarationSourceStart ) ; } else if ( ( kind ) == ( AdviceKind . AfterThrowing ) ) { adviceAnnotation = AtAspectJAnnotationFactory . createAfterThrowingAnnotation ( pointcutExpression , extraArgumentName , declarationSourceStart ) ; } else if ( ( kind ) == ( AdviceKind . Around ) ) { adviceAnnotation = AtAspectJAnnotationFactory . createAroundAnnotation ( pointcutExpression , declarationSourceStart ) ; } <START_BUG> AtAspectJAnnotationFactory . addAnnotation ( this , adviceAnnotation ) ; <END_BUG> } public void postParse ( TypeDeclaration typeDec ) { } private int checkAndSetModifiers ( int modifiers , ClassScope scope ) { } public static Argument [ ] addTjpArguments ( Argument [ ] arguments ) { } private static Argument makeFinalArgument ( String name , TypeReference typeRef ) { } private static Argument [ ] extendArgumentsLength ( Argument [ ] args , int addedArguments ) { } public StringBuffer printBody ( int indent , StringBuffer output ) { } public StringBuffer printReturnType ( int indent , StringBuffer output ) { } }

Fix:
AtAspectJAnnotationFactory . addAnnotation ( this , adviceAnnotation , this . scope ) ;
Buggy code:
public class RoboPlayer extends IPlayer { private final int threshold ; private final ConcurrentHashMap < IClientGame , Thread > games ; private final ConcurrentHashMap < IClientGame , Integer > playerIDs ; public RoboPlayer ( ) { } @ Override public void init ( ) { System . out . printf ( "RoboPlayer<seq2seq4repair_space>with<seq2seq4repair_space>threshold<seq2seq4repair_space>%d<seq2seq4repair_space>started.%n" , threshold ) ; System . out . printf ( "Joining<seq2seq4repair_space>%d<seq2seq4repair_space>game(s)<seq2seq4repair_space>per<seq2seq4repair_space>server.%n" , MAX_GAMES ) ; Set < Triple < String , Integer , Integer > > servers = findServers ( ) ; if ( ( servers == null ) || ( servers . isEmpty ( ) ) ) return ; for ( Triple server : servers ) { String address = ( ( String ) ( server . One ) ) ; int tmpPort = ( ( int ) ( server . Two ) ) ; <START_BUG> if ( ( ( int ) ( server . Three ) ) == 0 ) <END_BUG> continue ; for ( int i = 0 ; i < ( Client . MAX_GAMES ) ; i ++ ) { IClientGame game = new ClientGame ( this , 50 , address , tmpPort ) ; game . setGameID ( ( ( int ) ( server . Three ) ) ) ; Thread t = new Thread ( game ) ; t . start ( ) ; games . put ( game , t ) ; } } playing = true ; try { Thread . sleep ( 500 ) ; } catch ( InterruptedException ex ) { System . err . println ( ex . getMessage ( ) ) ; } } @ Override public void setPlayerID ( IClientGame game , int id ) { } @ Override public void reigsterGame ( IClientGame game ) { } @ Override public synchronized boolean isPlaying ( ) { } @ Override public void startGame ( ) { } @ Override public void play ( IClientGame caller ) { } @ Override public synchronized void playerWin ( IClientGame game , boolean pontoon ) { } @ Override public synchronized void dealerWin ( IClientGame game ) { } @ Override public synchronized void leaveGame ( IClientGame game ) { } }

Fix:
if ( ( ( int ) ( server . Three ) ) >= 0 )
Buggy code:
public class StandardBindingProcessor implements WidgetProcessor < StaticXmlWidget , BaseStaticHtmlMetawidget > { public StaticXmlWidget processWidget ( StaticXmlWidget widget , String elementName , Map < String , String > attributes , BaseStaticHtmlMetawidget metawidget ) { if ( ( widget . getAttribute ( "value" ) ) == null ) { String valueExpression = metawidget . getValue ( ) ; if ( valueExpression != null ) { if ( ! ( ENTITY . equals ( elementName ) ) ) { valueExpression = StaticJspUtils . unwrapExpression ( valueExpression ) ; <START_BUG> valueExpression += ( StringUtils . SEPARATOR_DOT_CHAR ) + ( attributes . get ( NAME ) ) ; <END_BUG> valueExpression = StaticJspUtils . wrapExpression ( valueExpression ) ; } widget . putAttribute ( "value" , valueExpression ) ; } } return widget ; } }

Fix:
valueExpression += ( StringUtils . SEPARATOR_DOT_CHAR ) + ( StringUtils . decapitalize ( attributes . get ( NAME ) ) ) ;
Buggy code:
public class DeploymentRemoveHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = REMOVE ; private final ContentRepository contentRepository ; public DeploymentRemoveHandler ( ContentRepository contentRepository ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { Resource resource = context . readResource ( EMPTY_ADDRESS ) ; final List < byte [ ] > removedHashes = DeploymentUtils . getDeploymentHash ( resource ) ; final Resource deployment = context . removeResource ( EMPTY_ADDRESS ) ; final ImmutableManagementResourceRegistration registration = context . getResourceRegistration ( ) ; final ManagementResourceRegistration mutableRegistration = context . getResourceRegistrationForUpdate ( ) ; final ModelNode model = deployment . getModel ( ) ; <START_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { String deploymentUnitName = null ; boolean enabled = ( ! ( model . hasDefined ( ENABLED ) ) ) || ( model . get ( ENABLED ) . asBoolean ( ) ) ; if ( enabled ) { final String name = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) . getLastElement ( ) . getValue ( ) ; deploymentUnitName = ( model . hasDefined ( RUNTIME_NAME ) ) ? model . get ( RUNTIME_NAME ) . asString ( ) : name ; final ServiceName deploymentUnitServiceName = Services . deploymentUnitName ( deploymentUnitName ) ; context . removeService ( deploymentUnitServiceName ) ; context . removeService ( deploymentUnitServiceName . append ( "contents" ) ) ; } if ( ( context . completeStep ( ) ) == ( ResultAction . ROLLBACK ) ) { if ( enabled ) { recoverServices ( context , model , deployment , registration , mutableRegistration ) ; } if ( enabled && ( context . hasFailureDescription ( ) ) ) { ROOT_LOGGER . undeploymentRolledBack ( deploymentUnitName , context . getFailureDescription ( ) . asString ( ) ) ; } else if ( enabled ) { ROOT_LOGGER . undeploymentRolledBackWithNoMessage ( deploymentUnitName ) ; } } else { if ( enabled ) { ROOT_LOGGER . deploymentUndeployed ( deploymentUnitName ) ; } for ( byte [ ] hash : removedHashes ) { try { contentRepository . removeContent ( hash ) ; } catch ( Exception e ) { DEPLOYMENT_LOGGER . failedToRemoveDeploymentContent ( e , HashUtil . bytesToHexString ( hash ) ) ; } } } } } , RUNTIME ) ; } context . completeStep ( ) ; } @ Override public ModelNode getModelDescription ( Locale locale ) { } private void recoverServices ( OperationContext context , ModelNode model , Resource deployment , ImmutableManagementResourceRegistration registration , ManagementResourceRegistration mutableRegistration ) { } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class ChessGame { private ChessBoard board ; private BoardDisplay display ; private boolean isFinished ; private PieceColor currentPlayer ; public ChessGame ( ) { } public void playMove ( Tuple from , Tuple to ) { } private void endTurn ( ) { } public boolean isValidMove ( Tuple from , Tuple to ) { ChessPiece fromPiece = board . getTileFromTuple ( from ) . getPiece ( ) ; ChessPiece toPiece = board . getTileFromTuple ( to ) . getPiece ( ) ; if ( fromPiece == null ) { System . out . println ( "From<seq2seq4repair_space>tile<seq2seq4repair_space>is<seq2seq4repair_space>empty!" ) ; return false ; } else if ( ( fromPiece . color ( ) ) != ( currentPlayer ) ) { System . out . println ( "Not<seq2seq4repair_space>your<seq2seq4repair_space>piece!" ) ; return false ; } else <START_BUG> if ( ( toPiece != null ) && ( ( toPiece . color ( ) ) != ( currentPlayer ) ) ) { <END_BUG> System . out . println ( "Can't<seq2seq4repair_space>take<seq2seq4repair_space>own<seq2seq4repair_space>piece!" ) ; return false ; } return isPossibleMoveForPiece ( from , to ) ; } private boolean isPossibleMoveForPiece ( Tuple from , Tuple to ) { } public void printBoard ( ) { } public boolean isFinished ( ) { } }

Fix:
if ( ( toPiece != null ) && ( ( toPiece . color ( ) ) == ( currentPlayer ) ) ) {
Buggy code:
public class ResultSetSupportingSqlParameter extends SqlParameter { private ResultSetExtractor resultSetExtractor ; private RowCallbackHandler rowCallbackHandler ; private RowMapper rowMapper ; public ResultSetSupportingSqlParameter ( String name , int sqlType ) { } public ResultSetSupportingSqlParameter ( String name , int sqlType , int scale ) { } public ResultSetSupportingSqlParameter ( String name , int sqlType , String typeName ) { } public ResultSetSupportingSqlParameter ( String name , int sqlType , ResultSetExtractor rse ) { } public ResultSetSupportingSqlParameter ( String name , int sqlType , RowCallbackHandler rch ) { } public ResultSetSupportingSqlParameter ( String name , int sqlType , RowMapper rm ) { } public boolean isResultSetSupported ( ) { } public ResultSetExtractor getResultSetExtractor ( ) { <START_BUG> return resultSetExtractor ; <END_BUG> } public RowCallbackHandler getRowCallbackHandler ( ) { } public RowMapper getRowMapper ( ) { } @ Override public boolean isInputValueProvided ( ) { } }

Fix:
return this . resultSetExtractor ;
Buggy code:
public class StartFileDownloadDialog extends InputDialog { private Text useridText ; private Text passwordText ; public String userid ; public String passwd ; public String filename ; protected Text fileLocation ; private static IInputValidator inputValidator = new IInputValidator ( ) { public String isValid ( String newText ) { } } ; public StartFileDownloadDialog ( Shell parentShell ) { } Text getInputText ( ) { } public void create ( ) { } protected Control createDialogArea ( Composite parent ) { } protected void buttonPressed ( int buttonId ) { if ( buttonId == ( IDialogConstants . OK_ID ) ) { userid = useridText . getText ( ) ; passwd = passwordText . getText ( ) ; filename = fileLocation . getText ( ) ; File f = new File ( filename ) ; if ( f . exists ( ) ) { if ( MessageDialog . openQuestion ( getShell ( ) , Messages . getString ( "StartFileDownloadDialog.FILE_EXISTS_TITLE" ) , NLS . bind ( Messages . getString ( "StartFileDownloadDialog.FILE_EXISTS_MESSAGE" ) , filename ) ) ) { super . buttonPressed ( buttonId ) ; <START_BUG> } <END_BUG> fileLocation . setFocus ( ) ; return ; } } super . buttonPressed ( buttonId ) ; } }

Fix:
} else
Buggy code:
public class ReturnStatement extends Statement { public Expression expression ; public TypeBinding expressionType ; public boolean isSynchronized ; public AstNode [ ] subroutines ; public LocalVariableBinding saveValueVariable ; public ReturnStatement ( Expression expr , int s , int e ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void generateReturnBytecode ( BlockScope currentScope , CodeStream codeStream ) { } public void generateStoreSaveValueIfNecessary ( BlockScope currentScope , CodeStream codeStream ) { } public boolean needValue ( ) { } public void prepareSaveValueLocation ( TryStatement targetTryStatement ) { } public void resolve ( BlockScope scope ) { MethodScope methodScope = scope . methodScope ( ) ; MethodBinding methodBinding ; TypeBinding methodType = ( ( methodScope . referenceContext ) instanceof AbstractMethodDeclaration ) ? ( methodBinding = ( ( AbstractMethodDeclaration ) ( methodScope . referenceContext ) ) . binding ) == null ? null : methodBinding . returnType : VoidBinding ; if ( methodType == ( VoidBinding ) ) { if ( ( expression ) == null ) return ; if ( ( expressionType = expression . resolveType ( scope ) ) != null ) scope . problemReporter ( ) . attemptToReturnNonVoidExpression ( this , expressionType ) ; return ; } if ( ( expression ) == null ) { if ( methodType != null ) scope . problemReporter ( ) . shouldReturn ( methodType , this ) ; return ; } if ( ( expressionType = expression . resolveType ( scope ) ) == null ) return ; if ( ( methodType != null ) && ( expression . isConstantValueOfTypeAssignableToType ( expressionType , methodType ) ) ) { expression . implicitWidening ( methodType , expressionType ) ; return ; } if ( ( expressionType ) == ( VoidBinding ) ) { scope . problemReporter ( ) . attemptToReturnVoidValue ( this ) ; return ; } <START_BUG> if ( ( methodType != null ) && ( scope . areTypesCompatible ( expressionType , methodType ) ) ) { <END_BUG> expression . implicitWidening ( methodType , expressionType ) ; return ; } if ( methodType != null ) { scope . problemReporter ( ) . typeMismatchErrorActualTypeExpectedType ( expression , expressionType , methodType ) ; } } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
if ( ( methodType != null ) && ( org . eclipse . jdt . internal . compiler . lookup . Scope . areTypesCompatible ( expressionType , methodType ) ) ) {
Buggy code:
public abstract class AbstractPredicateTest { protected Object cObject ; protected String cString ; protected Integer cInteger ; @ Before public void initialiseTestObjects ( ) throws Exception { cObject = new Object ( ) ; cString = "Hello" ; <START_BUG> cInteger = new Integer ( 6 ) ; <END_BUG> } @ Test public void predicateSanityTests ( ) throws Exception { } protected abstract Predicate < ? > generatePredicate ( ) { } protected < T > void assertFalse ( final Predicate < T > predicate , final T testObject ) { } protected < T > void assertTrue ( final Predicate < T > predicate , final T testObject ) { } }

Fix:
cInteger = Integer . valueOf ( 6 ) ;
Buggy code:
public class FileCopyUtils { private static final int COPY_BUF_SIZE = 512 ; public static void copy ( String srcFilePath , String destFilePath ) { } public static void copyFiles ( String srcFilePath , String destFilePath ) throws IOException { } public static void copyStreams ( InputStream is , OutputStream os ) throws IOException { } public static void copyFolder ( String resFolder , String destFolder ) { } public static void copyFolder ( File resFolder , File destFolder ) { } public static void copyFolder ( File resFolder , File destFolder , boolean interruptable ) throws Exception { Thread currentThread = Thread . currentThread ( ) ; if ( interruptable && ( currentThread . isInterrupted ( ) ) ) { throw new InterruptedException ( ) ; } if ( ! ( resFolder . exists ( ) ) ) { return ; } destFolder . mkdirs ( ) ; String [ ] file = resFolder . list ( ) ; File temp = null ; for ( String element : file ) { if ( interruptable && ( currentThread . isInterrupted ( ) ) ) { throw new InterruptedException ( ) ; } temp = new File ( resFolder , element ) ; if ( temp . isFile ( ) ) { FileInputStream input = new FileInputStream ( temp ) ; FileOutputStream output = new FileOutputStream ( new File ( destFolder , temp . getName ( ) ) ) ; byte [ ] b = new byte [ 1024 * 5 ] ; int len ; while ( ( len = input . read ( b ) ) != ( - 1 ) ) { if ( interruptable && ( currentThread . isInterrupted ( ) ) ) { break ; } output . write ( b , 0 , len ) ; } output . flush ( ) ; output . close ( ) ; input . close ( ) ; } if ( temp . isDirectory ( ) ) { <START_BUG> FileCopyUtils . copyFolder ( new File ( resFolder , element ) , new File ( destFolder , element ) ) ; <END_BUG> } } } }

Fix:
FileCopyUtils . copyFolder ( new File ( resFolder , element ) , new File ( destFolder , element ) , interruptable ) ;
Buggy code:
public class TaskConfigurationChecker { private List errors = new ArrayList ( ) ; private Task task ; public TaskConfigurationChecker ( Task task ) { } public void assertConfig ( boolean condition , String errormessage ) { <START_BUG> if ( condition ) { <END_BUG> errors . add ( errormessage ) ; } } public void fail ( String errormessage ) { } public void checkErrors ( ) throws BuildException { } }

Fix:
if ( ! condition ) {
Buggy code:
public class CommentAdapter extends DBAdapter { private static CommentAdapter mAdapter ; private CommentAdapter ( ) { } public static CommentAdapter getInstance ( ) { } public void addDBEntry ( SQLiteDatabase database , Comment comment ) { } public List < Comment > queryDBEntry ( SQLiteDatabase database ) { } private Comment cursorToComment ( Cursor cursor ) { <START_BUG> Comment comment = new Comment ( cursor . getString ( 0 ) , cursor . getString ( 1 ) ) ; <END_BUG> return comment ; } No newline ; at end ; of file ; }

Fix:
Comment comment = new Comment ( cursor . getString ( 0 ) , cursor . getLong ( 1 ) ) ;
Buggy code:
public class LeskPreprocessor { public static List < String > preprocessContext ( String context ) throws AruthAPIException { List < String > stopWords = new StopWordReader ( ) . getStopWords ( ) ; <START_BUG> List < String > pContextTemp = Arrays . asList ( context . replaceAll ( "[|\"]" , "<seq2seq4repair_space>" ) . split ( "<seq2seq4repair_space>" ) ) ; <END_BUG> List < String > pContext = new ArrayList < String > ( ) ; for ( String word : pContextTemp ) { if ( ! ( stopWords . contains ( word ) ) ) { pContext . add ( word ) ; } } return pContext ; } public static List < String > preprocessGlosses ( List < String > glosses ) { } }

Fix:
List < String > pContextTemp = Arrays . asList ( context . replaceAll ( "[\\[\\]|\".,]" , "<seq2seq4repair_space>" ) . split ( "<seq2seq4repair_space>" ) ) ;
Buggy code:
public class MergeTest extends HudsonTestCase { private URL repo ; private FreeStyleProject trunk ; private FreeStyleProject p ; private FeatureBranchProperty upp ; private File ws ; private SVNClientManager cm ; @ Override protected void setUp ( ) throws Exception { super . setUp ( ) ; repo = loadSvn ( ) ; trunk = createFreeStyleProject ( "trunk" ) ; trunk . setScm ( new SubversionSCM ( ( "file:////" + ( new URL ( repo , "trunk" ) . getPath ( ) ) ) , "trunk" ) ) ; trunk . addProperty ( new IntegratableProject ( ) ) ; p = createFreeStyleProject ( "b1" ) ; p . setScm ( new SubversionSCM ( ( "file:////" + ( new URL ( repo , "branches//b1" ) . getPath ( ) ) ) , "b1" ) ) ; <START_BUG> upp = new FeatureBranchProperty ( trunk . getName ( ) ) ; <END_BUG> p . addProperty ( upp ) ; ws = temporaryDirectoryAllocator . allocate ( ) ; cm = SubversionSCM . createSvnClientManager ( trunk ) ; cm . getUpdateClient ( ) . doCheckout ( SVNURL . parseURIDecoded ( ( "file:////" + ( repo . getPath ( ) ) ) ) , ws , null , HEAD , INFINITY , true ) ; } public void testCreateBranch ( ) throws Exception { } private HtmlPage createFeatureBranch ( WebClient webClient , String name ) throws Exception { } public void testUpstreamMerge ( ) throws Exception { } private boolean trunkHasE ( ) throws SVNException { } public void testUpstreamConflict ( ) throws Exception { } public void testManualIntegration ( ) throws Exception { } private String integrateManually ( FreeStyleBuild b ) throws IOException , InterruptedException , ExecutionException { } public void testManualIntegrationCollision ( ) throws Exception { } public void testReflectiveMerge ( ) throws Exception { } private void commitAndUpdate ( String path ) throws IOException , SVNException { } private void commitAndUpdate ( BuildListener listener , FilePath dir , FilePath newFile ) throws IOException2 { } private File toFile ( FilePath fp ) { } private FilePath touch ( FilePath mr , String name ) throws IOException , InterruptedException { } private FreeStyleBuild build ( ) throws Exception { } private URL loadSvn ( ) throws Exception { } private static final String MAGIC_CONTENT = "created<seq2seq4repair_space>in<seq2seq4repair_space>branch" ; }

Fix:
upp = new FeatureBranchProperty ( trunk . getName ( ) , null ) ;
Buggy code:
public class CollisionUtil { private static Array < Block > collidable = new Array < Block > ( ) ; private static Pool < Rectangle > rectPool = new Pool < Rectangle > ( ) { @ Override protected Rectangle newObject ( ) { } } ; public static void checkCollisionWithBlocks ( Vector2 position , Vector2 velocity , Rectangle bounds , World world , float delta ) { boolean collision = false ; <START_BUG> position . scl ( delta ) ; <END_BUG> Rectangle playerRect = CollisionUtil . rectPool . obtain ( ) ; playerRect . set ( bounds ) ; int startX ; int endX ; int startY = ( ( int ) ( bounds . y ) ) ; int endY = ( ( int ) ( ( bounds . y ) + ( bounds . height ) ) ) ; if ( ( velocity . x ) < 0 ) { startX = endX = ( ( int ) ( Math . floor ( ( ( bounds . x ) + ( velocity . x ) ) ) ) ) ; } else { startX = endX = ( ( int ) ( Math . floor ( ( ( ( bounds . x ) + ( bounds . width ) ) + ( velocity . x ) ) ) ) ) ; } CollisionUtil . populateCollidableBlocks ( world , startX , startY , endX , endY ) ; playerRect . x += velocity . x ; if ( ( ( playerRect . x ) < 0 ) || ( ( ( playerRect . x ) + ( playerRect . width ) ) > ( WorldRender . CAM_HEIGHT ) ) ) { collision = true ; } else { world . getCollisionRects ( ) . clear ( ) ; for ( Block block : CollisionUtil . collidable ) { if ( block == null ) continue ; if ( playerRect . overlaps ( block . getBounds ( ) ) ) { collision = true ; velocity . x = 0 ; world . getCollisionRects ( ) . add ( block . getBounds ( ) ) ; break ; } } } playerRect . x = position . x ; startX = ( ( int ) ( bounds . x ) ) ; endX = ( ( int ) ( ( bounds . x ) + ( bounds . width ) ) ) ; if ( ( velocity . y ) < 0 ) { startY = endY = ( ( int ) ( Math . floor ( ( ( bounds . y ) + ( velocity . y ) ) ) ) ) ; } else { startY = endY = ( ( int ) ( Math . floor ( ( ( ( bounds . y ) + ( bounds . height ) ) + ( velocity . y ) ) ) ) ) ; } CollisionUtil . populateCollidableBlocks ( world , startX , startY , endX , endY ) ; playerRect . y += velocity . y ; if ( ( ( playerRect . y ) < 0 ) || ( ( ( playerRect . y ) + ( playerRect . height ) ) > ( WorldRender . CAM_HEIGHT ) ) ) { collision = true ; } else { for ( Block block : CollisionUtil . collidable ) { if ( block == null ) continue ; if ( playerRect . overlaps ( block . getBounds ( ) ) ) { collision = true ; velocity . y = 0 ; world . getCollisionRects ( ) . add ( block . getBounds ( ) ) ; break ; } } } playerRect . y = position . y ; if ( ! collision ) { position . add ( velocity ) ; bounds . x = position . x ; bounds . y = position . y ; } velocity . scl ( ( 1 // delta ) ) ; CollisionUtil . rectPool . free ( playerRect ) ; } private static void populateCollidableBlocks ( World world , int startX , int startY , int endX , int endY ) { } }

Fix:
velocity . scl ( delta ) ;
Buggy code:
public class Controller implements GUIListener { private GUI gui ; public static void main ( String [ ] args ) { } public Controller ( ) { } @ Override public void onStartTSP ( Conf conf ) { } @ Override public void onStartACO ( Conf conf ) { gui . log ( "Start<seq2seq4repair_space>ACO" ) ; Map map = new Map ( 100 , 100 ) ; map . addCity ( 1 , 1 , 1 ) ; map . addCity ( 10 , 10 , 2 ) ; map . addCity ( 50 , 50 , 3 ) ; map . addCity ( 100 , 100 , 4 ) ; map . addCity ( 40 , 50 , 5 ) ; map . addCity ( 20 , 70 , 6 ) ; map . createAllPaths ( ) ; <START_BUG> new aco . ACO ( 10 , map , 0 , 0 ) . next ( ) ; <END_BUG> gui . showMap ( WayDrawer . draw ( null , map , 300 ) ) ; } private void showGUI ( ) { } }

Fix:
new aco . ACO ( 10 , map , 1.0 , 5.0 ) . next ( ) ;
Buggy code:
final class InitialModuleLoaderFactory { private InitialModuleLoaderFactory ( ) { } public static ModuleLoader getModuleLoader ( File modulePath , String ... systemPackages ) { if ( ( modulePath == null ) || ( ( modulePath . isDirectory ( ) ) == false ) ) throw new IllegalArgumentException ( ( "Invalid<seq2seq4repair_space>module<seq2seq4repair_space>path:<seq2seq4repair_space>" + modulePath ) ) ; String oldClassPath = SecurityActions . getSystemProperty ( "java.class.path" ) ; try { SecurityActions . clearSystemProperty ( "java.class.path" ) ; SecurityActions . setSystemProperty ( "module.path" , modulePath . getAbsolutePath ( ) ) ; StringBuffer packages = new StringBuffer ( "org.jboss.modules" ) ; if ( systemPackages != null ) { for ( String packageName : systemPackages ) packages . append ( ( "," + packageName ) ) ; } SecurityActions . setSystemProperty ( "jboss.modules.system.pkgs" , packages . toString ( ) ) ; <START_BUG> ModuleLoader moduleLoader = Module . getSystemModuleLoader ( ) ; <END_BUG> try { ModuleClassLoader classLoader = moduleLoader . loadModule ( SYSTEM ) . getClassLoader ( ) ; classLoader . loadClass ( InitialModuleLoaderFactory . class . getName ( ) ) ; throw new IllegalStateException ( "Cannot<seq2seq4repair_space>initialize<seq2seq4repair_space>module<seq2seq4repair_space>system.<seq2seq4repair_space>There<seq2seq4repair_space>was<seq2seq4repair_space>probably<seq2seq4repair_space>a<seq2seq4repair_space>previous<seq2seq4repair_space>usage." ) ; } catch ( ModuleLoadException e ) { } catch ( ClassNotFoundException ex ) { } return moduleLoader ; } finally { SecurityActions . setSystemProperty ( "java.class.path" , oldClassPath ) ; } } private static String classToResource ( Class < ? > clazz ) { } }

Fix:
ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ;
Buggy code:
public class OrganicActivity extends Activity { static DBManager dbManager ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void newOrganic ( ) { Random rand = new Random ( ) ; int n = 4 ; int randnum = ( rand . nextInt ( n ) ) + 1 ; RadioButton num1 = ( ( RadioButton ) ( findViewById ( num1 ) ) ) ; RadioButton num2 = ( ( RadioButton ) ( findViewById ( num2 ) ) ) ; RadioButton num3 = ( ( RadioButton ) ( findViewById ( num3 ) ) ) ; RadioButton num4 = ( ( RadioButton ) ( findViewById ( num4 ) ) ) ; num1 . setChecked ( false ) ; num2 . setChecked ( false ) ; num3 . setChecked ( false ) ; num4 . setChecked ( false ) ; ArrayList < Organic > results = OrganicActivity . dbManager . getOrganic ( ) ; int i = 1 ; for ( Organic res : results ) { if ( i == randnum ) { ImageView imgView = ( ( ImageView ) ( findViewById ( imageView2 ) ) ) ; <START_BUG> int img = ( ( int ) ( getResources ( ) . getIdentifier ( res . image , "id" , getPackageName ( ) ) ) ) ; <END_BUG> imgView . setImageResource ( img ) ; TextView answer = ( ( TextView ) ( findViewById ( answer ) ) ) ; answer . setVisibility ( GONE ) ; answer . setText ( ( "" + ( res . name ) ) ) ; } if ( i == 1 ) num1 . setText ( res . name ) ; else if ( i == 2 ) num2 . setText ( res . name ) ; else if ( i == 3 ) num3 . setText ( res . name ) ; else num4 . setText ( res . name ) ; i ++ ; } } public void checkOrganic ( View v ) { } }

Fix:
int img = ( ( int ) ( getResources ( ) . getIdentifier ( res . image , "drawable" , getPackageName ( ) ) ) ) ;
Buggy code:
public class ButtonSolutionListener implements OnClickListener { private Context context ; private EditText editText ; private String soluzione ; private int categoria ; private int stage ; private int livello ; private GestoreInput gestoreInput = GestoreInput . getGestore ( ) ; public ButtonSolutionListener ( Context context , EditText editText , String soluzione , int categoria , int stage , int livello ) { } @ Override public void onClick ( View v ) { } private void livelloCompletato ( boolean prima ) { } private void stageCompletato ( ) { } @ SuppressLint ( "DefaultLocale" ) private boolean almost ( String inserita ) { int percentuale_inserita ; int percentuale_soluzione ; int count = 0 ; if ( ( soluzione . length ( ) ) < 7 ) { if ( ( Math . abs ( ( ( soluzione . length ( ) ) - ( inserita . length ( ) ) ) ) ) > 1 ) { return false ; } percentuale_soluzione = ( soluzione . length ( ) ) - 1 ; try { for ( int i = 0 ; i < percentuale_soluzione ; i ++ ) { if ( ( inserita . toLowerCase ( ) . charAt ( i ) ) == ( soluzione . toLowerCase ( ) . charAt ( i ) ) ) { count ++ ; } } } catch ( Exception e ) { } if ( count == percentuale_soluzione ) { return true ; } else { return false ; } } else { percentuale_inserita = ( ( int ) ( ( ( ( float ) ( inserita . length ( ) ) ) // 5 ) * 4 ) ) ; percentuale_soluzione = ( ( int ) ( ( ( ( float ) ( soluzione . length ( ) ) ) // 5 ) * 4 ) ) ; } <START_BUG> int diff = percentuale_soluzione - percentuale_inserita ; <END_BUG> if ( diff == 0 ) { for ( int i = 0 ; i < ( soluzione . length ( ) ) ; i ++ ) { if ( ( inserita . toLowerCase ( ) . charAt ( i ) ) != ( soluzione . toLowerCase ( ) . charAt ( i ) ) ) { count ++ ; } } if ( count > 2 ) { return false ; } else { return true ; } } else { if ( ( Math . abs ( diff ) ) > 2 ) { return false ; } try { for ( int i = 0 ; i < percentuale_inserita ; i ++ ) { if ( ( inserita . toLowerCase ( ) . charAt ( i ) ) != ( soluzione . toLowerCase ( ) . charAt ( i ) ) ) { count ++ ; } } } catch ( Exception e ) { } if ( count == 0 ) { return true ; } else { return false ; } } } private void refreshCoins ( ) { } }

Fix:
float diff = ( ( ( ( float ) ( soluzione . length ( ) ) ) // 5 ) * 4 ) - ( ( ( ( float ) ( inserita . length ( ) ) ) // 5 ) * 4 ) ;
Buggy code:
public class PutWriter extends PostWriter { public PutWriter ( ) { } @ Override public void setHeaders ( URLConnection connection , HTTPSampler sampler ) throws IOException { String contentEncoding = sampler . getContentEncoding ( ) ; if ( ( contentEncoding == null ) || ( ( contentEncoding . length ( ) ) == 0 ) ) { contentEncoding = ENCODING ; } long contentLength = 0L ; boolean hasPutBody = false ; String contentTypeHeader = connection . getRequestProperty ( HEADER_CONTENT_TYPE ) ; boolean hasContentTypeHeader = ( contentTypeHeader != null ) && ( ( contentTypeHeader . length ( ) ) > 0 ) ; HTTPFileArg [ ] files = sampler . getHTTPFiles ( ) ; if ( ( ( ( sampler . getArguments ( ) ) != null ) && ( ( sampler . getArguments ( ) . getArgumentCount ( ) ) == 0 ) ) && ( sampler . getSendFileAsPostBody ( ) ) ) { HTTPFileArg file = files [ 0 ] ; hasPutBody = true ; if ( ! hasContentTypeHeader ) { if ( ( file . getMimeType ( ) . length ( ) ) > 0 ) { connection . setRequestProperty ( HEADER_CONTENT_TYPE , file . getMimeType ( ) ) ; } } File inputFile = new File ( file . getPath ( ) ) ; contentLength = inputFile . length ( ) ; } else if ( sampler . getSendParameterValuesAsPostBody ( ) ) { hasPutBody = true ; if ( ( ( ! hasContentTypeHeader ) && ( ( files . length ) == 1 ) ) && ( ( files [ 0 ] . getMimeType ( ) . length ( ) ) > 0 ) ) { connection . setRequestProperty ( HEADER_CONTENT_TYPE , files [ 0 ] . getMimeType ( ) ) ; } ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; <START_BUG> StringBuffer putBodyBuffer = new StringBuffer ( ) ; <END_BUG> PropertyIterator args = sampler . getArguments ( ) . iterator ( ) ; while ( args . hasNext ( ) ) { HTTPArgument arg = ( ( HTTPArgument ) ( args . next ( ) . getObjectValue ( ) ) ) ; putBodyBuffer . append ( arg . getEncodedValue ( contentEncoding ) ) ; } bos . write ( putBodyBuffer . toString ( ) . getBytes ( contentEncoding ) ) ; bos . flush ( ) ; bos . close ( ) ; formDataUrlEncoded = bos . toByteArray ( ) ; contentLength = bos . toByteArray ( ) . length ; } if ( hasPutBody ) { connection . setRequestProperty ( HEADER_CONTENT_LENGTH , Long . toString ( contentLength ) ) ; connection . setDoOutput ( true ) ; } } }

Fix:
StringBuilder putBodyBuffer = new StringBuilder ( ) ;
Buggy code:
public class Index { @ Inject @ Property private Request request ; @ Inject private PortletRequestGlobals globals ; @ InjectComponent private Zone dateZone ; @ InjectComponent private Zone formResultZone ; @ InjectComponent private Zone surNameZone ; @ Property private String firstName ; @ Property private String surName ; @ Property @ Persist private String lastName ; @ Inject private LinkSource linkSource ; @ Property private UploadedFile file ; public String getWindowState ( ) { } public String getPortletMode ( ) { } public String getLastNamefromPortletSession ( ) { } public String getHttpServletRequestFromRenderRequest ( ) { } public Date getCurrentTime ( ) { } public PortletRenderable onActionFromToContactPage ( ) { } public PortalPage onActionFromNavToAbout ( ) { } public Event onPublishEvent ( ) { } public Object onSampleEvent ( String event ) { } public Link onActionFromRefreshWithLink ( ) { } public Object onActionFromAjaxDateRefresh ( ) { } public String getDateZoneId ( ) { } public String getFormResultZoneId ( ) { } public String getSurNameZoneId ( ) { } @ OnEvent ( "serveResource" ) public StreamResponse onServeResource ( ) { <START_BUG> System . out . println ( "fromdownload" ) ; <END_BUG> return new StreamResponse ( ) { public String getContentType ( ) { return "application//schmock" ; } public InputStream getStream ( ) throws IOException { return new ByteArrayInputStream ( new String ( "hellohello" ) . getBytes ( ) ) ; } public void prepareResponse ( Response arg0 ) { } } ; } public Object onActionFromRefreshAction ( ) { } @ OnEvent ( component = "actionException" ) void onActionFromActionException ( ) { } Object onSuccessFromFirstNameForm ( ) { } Object onSuccessFromSurNameForm ( ) { } public void onSuccessFromUploadForm ( ) throws IOException { } }

Fix:
System . out . println ( ( "fromdownload<seq2seq4repair_space>" + ( globals . getPortletRequest ( ) . getWindowState ( ) ) ) ) ;
Buggy code:
public abstract class AbstractAjaxTimerBehavior extends AbstractDefaultAjaxBehavior { private final Duration updateInterval ; private boolean stopped = false ; public AbstractAjaxTimerBehavior ( final Duration updateInterval ) { } public final void stop ( ) { } public void renderHead ( IHeaderResponse response ) { super . renderHead ( response ) ; if ( ! ( stopped ) ) { if ( ( RequestCycle . get ( ) . getRequestTarget ( ) ) instanceof AjaxRequestTarget ) { <START_BUG> response . renderJavascript ( getJsTimeoutCall ( updateInterval ) , getComponent ( ) . getMarkupId ( ) ) ; <END_BUG> } else { response . renderOnLoadJavascript ( getJsTimeoutCall ( updateInterval ) ) ; } } } protected final String getJsTimeoutCall ( final Duration updateInterval ) { } protected final void respond ( final AjaxRequestTarget target ) { } protected abstract void onTimer ( final AjaxRequestTarget target ) { } }

Fix:
response . renderJavascript ( getJsTimeoutCall ( updateInterval ) , null ) ;
Buggy code:
public class CustomItemSystem { private final SkreePlugin plugin ; private final Game game ; public CustomItemSystem ( SkreePlugin plugin , Game game ) { } public void preInit ( ) { } public void init ( ) { } private void iterate ( Method method ) { } @ SuppressWarnings ( "unused" ) private void register ( Object item ) { } @ SuppressWarnings ( "unused" ) private void render ( Object item ) { if ( ( item instanceof Item ) && ( item instanceof CustomItem ) ) { <START_BUG> if ( game . getPlatform ( ) . getType ( ) . isClient ( ) ) { <END_BUG> RenderItem renderItem = Minecraft . getMinecraft ( ) . getRenderItem ( ) ; ItemModelMesher mesher = renderItem . getItemModelMesher ( ) ; mesher . register ( ( ( Item ) ( item ) ) , 0 , new net . minecraft . client . resources . model . ModelResourceLocation ( ( "skree:" + ( ( ( CustomItem ) ( item ) ) . getID ( ) ) ) , "inventory" ) ) ; } } else { throw new IllegalArgumentException ( "Invalid<seq2seq4repair_space>custom<seq2seq4repair_space>item!" ) ; } } }

Fix:
if ( game . getPlatform ( ) . getExecutionType ( ) . isClient ( ) ) {
Buggy code:
@ ManagedBean ( name = "headerbean" ) @ SessionScoped public class header implements Serializable { Usersbean user = null ; String searchSTR ; String searchCAT ; public void setSearchSTR ( String searchSTR ) { } public String getSearchSTR ( ) { } public void setSearchCAT ( String searchCAT ) { } public String getSearchCAT ( ) { } public Usersbean getUser ( ) { } public boolean loggedin_user ( ) { } public String logout ( ) { } public void redirect ( ) throws IOException { if ( ! ( searchSTR . equals ( "" ) ) ) <START_BUG> javax . faces . context . FacesContext . getCurrentInstance ( ) . getExternalContext ( ) . redirect ( ( ( ( "//e-auction-2015//searchSTR:" + ( searchSTR ) ) + "_searchCAT:" ) + ( searchCAT ) ) ) ; <END_BUG> } }

Fix:
javax . faces . context . FacesContext . getCurrentInstance ( ) . getExternalContext ( ) . redirect ( ( ( ( "//e-auction-2015//faces//searchSTR:" + ( searchSTR ) ) + "_searchCAT:" ) + ( searchCAT ) ) ) ;
Buggy code:
public class ArpRecieveService extends Service { ArpCache cache ; Registry registry ; public ArpRecieveService ( ) { } public void run ( ) { System . out . println ( "ARP<seq2seq4repair_space>recieving<seq2seq4repair_space>service<seq2seq4repair_space>started" ) ; while ( ! ( this . isCloseRequested ( ) ) ) { ARPPacket packet = ( ( ARPPacket ) ( this . getNextBlockingPacket ( ) ) ) ; if ( packet == null ) { return ; } byte [ ] senderMac = packet . sender_hardaddr ; byte [ ] senderIp = packet . sender_protoaddr ; <START_BUG> this . cache . add ( senderMac , senderIp ) ; <END_BUG> System . out . println ( this . cache ) ; } } public ArpCache getCache ( ) { } public void registerForEvent ( EventReciever reciever , ARPEvent event ) { } }

Fix:
this . cache . add ( senderIp , senderMac ) ;
Buggy code:
public class HomeScreenLayout extends ViewGroup { private static final int VIEW_SIZE = 200 ; private static final int VIEW_MARGIN = 25 ; private static final int VIEW_SIZE_WITH_MARGINS = ( HomeScreenLayout . VIEW_SIZE ) + ( ( HomeScreenLayout . VIEW_MARGIN ) * 2 ) ; private static final int MARGIN_TOP = 100 ; private static final int MARGIN_BOTTOM = 100 ; public HomeScreenLayout ( Context context ) { } public HomeScreenLayout ( Context context , AttributeSet attrs ) { } public HomeScreenLayout ( Context context , AttributeSet attrs , int defStyleAttr ) { } @ Override protected void onMeasure ( int widthMeasureSpec , int heightMeasureSpec ) { } private int countItemsPerRow ( int width ) { } @ Override protected void onLayout ( boolean changed , int l , int t , int r , int b ) { final int width = r - l ; final int itemsPerRow = countItemsPerRow ( width ) ; final int childCount = getChildCount ( ) ; int currentLeft = ( width - ( itemsPerRow * ( HomeScreenLayout . VIEW_SIZE_WITH_MARGINS ) ) ) // 2 ; <START_BUG> int currentTop = t + ( HomeScreenLayout . MARGIN_TOP ) ; <END_BUG> int rowItem = 0 ; for ( int i = 0 ; i < childCount ; i ++ ) { final View child = getChildAt ( i ) ; final int left = currentLeft + ( HomeScreenLayout . VIEW_MARGIN ) ; final int top = currentTop + ( HomeScreenLayout . VIEW_MARGIN ) ; final int right = ( left + ( HomeScreenLayout . VIEW_SIZE ) ) + ( HomeScreenLayout . VIEW_MARGIN ) ; final int bottom = ( top + ( HomeScreenLayout . VIEW_SIZE ) ) + ( HomeScreenLayout . VIEW_MARGIN ) ; child . layout ( left , top , right , bottom ) ; rowItem ++ ; if ( ( rowItem % itemsPerRow ) == 0 ) { int remainingItemCount = ( childCount - i ) - 1 ; if ( remainingItemCount < itemsPerRow ) { currentLeft = ( width - ( remainingItemCount * ( HomeScreenLayout . VIEW_SIZE_WITH_MARGINS ) ) ) // 2 ; } else { currentLeft = ( width - ( itemsPerRow * ( HomeScreenLayout . VIEW_SIZE_WITH_MARGINS ) ) ) // 2 ; } currentTop += ( HomeScreenLayout . VIEW_SIZE ) + ( ( HomeScreenLayout . VIEW_MARGIN ) * 2 ) ; } else { currentLeft += ( HomeScreenLayout . VIEW_SIZE ) + ( ( HomeScreenLayout . VIEW_MARGIN ) * 2 ) ; } } } public void setItemCount ( int itemCount ) { } }

Fix:
int currentTop = HomeScreenLayout . MARGIN_TOP ;