nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TestNRTThreads extends LuceneTestCase { @ Test public void testNRTThreads ( ) throws Exception { final long t0 = System . currentTimeMillis ( ) ; <START_BUG> final LineFileDocs docs = new LineFileDocs ( true ) ; <END_BUG>

Fix:
final LineFileDocs docs = new LineFileDocs ( random ) ;
Buggy code:
public class DateUtilsTest extends TestCase { public DateUtilsTest ( String s ) { } public void testElapsedTime ( ) { } public void testDateTimeISO ( ) { } public void testDateISO ( ) { TimeZone timeZone = TimeZone . getTimeZone ( "GMT" ) ; Calendar cal = Calendar . getInstance ( timeZone ) ; <START_BUG> emailtaskcal . set ( 2002 , 1 , 23 ) ; <END_BUG> String text = DateUtils . format ( cal . getTime ( ) , ISO8601_DATE_PATTERN ) ; assertEquals ( "2002-02-23" , text ) ; } public void testTimeISODate ( ) { } public void testTimeISO ( ) { } }

Fix:
cal . set ( 2002 , 1 , 23 ) ;
Buggy code:
public enum MessageId { JUNK ( 0 ) , LOG_IN ( 1 , MessageId . ErrorId . BAD_LOGIN_OR_PASSWORD , MessageId . ErrorId . TOO_MUCH_USERS_LOGGED , MessageId . ErrorId . ALREADY_LOGGED ) , SIGN_UP ( 2 , MessageId . ErrorId . BUSY_LOGIN , MessageId . ErrorId . INCORRECT_LOGIN , MessageId . ErrorId . BAD_PASSWORD_LENGTH , MessageId . ErrorId . TO_MUCH_REGISTERED ) , CONVERSATION_REQUEST ( 3 , MessageId . ErrorId . USER_NOT_LOGGED , MessageId . ErrorId . BUSY_USER , MessageId . ErrorId . CONVERSATION_WITH_ANOTHER_USER , MessageId . ErrorId . ON_BLACK_LIST ) , INCOMING_CONVERSATION ( 4 , MessageId . ErrorId . IM_BUSY ) , CLIENT_MESSAGE ( 5 , MessageId . ErrorId . FAILED ) , SERVER_MESSAGE ( 6 ) , CONVERSATIONALIST_DISCONNECTED ( 7 ) , END_TALK ( 8 ) , CLIENTS_LIST ( 9 ) , BLACK_LIST ( 10 ) , ADD_TO_BLACK_LIST ( 11 , MessageId . ErrorId . USER_DOESNT_EXIST , MessageId . ErrorId . TOO_MUCH_USERS_ON_BLACKLIST , MessageId . ErrorId . ALREADY_ADDED ) , REMOVE_FROM_BLACK_LIST ( 12 , MessageId . ErrorId . USER_NOT_ON_BLACKLIST , MessageId . ErrorId . USER_NOT_EXIST ) , DISCONNECT ( 13 ) , LOGOUT ( 14 ) , SERVER_ERROR ( 15 , MessageId . ErrorId . MESSAGE_DECRYPTING_FAILED , MessageId . ErrorId . MESSAGE_ENCRYPTING_FAILED , MessageId . ErrorId . SERVER_OVERLOADED ) ; private final int id ; private final EnumSet < MessageId . ErrorId > errorIds ; private MessageId ( int id , MessageId . ErrorId ... eerrorIds ) { } public static enum ErrorId { OK ( 0 ) , BAD_LOGIN_OR_PASSWORD ( 1 ) , TOO_MUCH_USERS_LOGGED ( 2 ) , ALREADY_LOGGED ( 3 ) , BUSY_LOGIN ( 1 ) , INCORRECT_LOGIN ( 2 ) , BAD_PASSWORD_LENGTH ( 3 ) , TO_MUCH_REGISTERED ( 4 ) , USER_NOT_LOGGED ( 1 ) , BUSY_USER ( 2 ) , CONVERSATION_WITH_ANOTHER_USER ( 3 ) , ON_BLACK_LIST ( 4 ) , IM_BUSY ( 1 ) , FAILED ( 1 ) , USER_DOESNT_EXIST ( 1 ) , TOO_MUCH_USERS_ON_BLACKLIST ( 2 ) , ALREADY_ADDED ( 3 ) , USER_NOT_ON_BLACKLIST ( 1 ) , USER_NOT_EXIST ( 2 ) , MESSAGE_DECRYPTING_FAILED ( 1 ) , MESSAGE_ENCRYPTING_FAILED ( 2 ) , SERVER_OVERLOADED ( 3 ) ; private final int id ; private ErrorId ( int iid ) { } public int getIntRepresentation ( ) { } } public MessageId . ErrorId createErrorId ( int id ) { } public static MessageId createMessageId ( int id ) { for ( MessageId messageId : MessageId . values ( ) ) { if ( ( messageId . getIntRepresentation ( ) ) == id ) { return messageId ; } } <START_BUG> throw new IncorrectMessageId ( ( ( "Incorrect<seq2seq4repair_space>message<seq2seq4repair_space>id<seq2seq4repair_space>!!!<seq2seq4repair_space>Was:<seq2seq4repair_space>" + id ) + "<seq2seq4repair_space>expected:<seq2seq4repair_space>[0<seq2seq4repair_space>-<seq2seq4repair_space>13]" ) ) ; <END_BUG> } public int getIntRepresentation ( ) { } }

Fix:
throw new IncorrectMessageId ( ( ( "Incorrect<seq2seq4repair_space>message<seq2seq4repair_space>id<seq2seq4repair_space>!!!<seq2seq4repair_space>Was:<seq2seq4repair_space>" + id ) + "<seq2seq4repair_space>expected:<seq2seq4repair_space>[0<seq2seq4repair_space>-<seq2seq4repair_space>15]" ) ) ;
Buggy code:
public class MonoHybrid { private int f = 3 ; ArrayList < MonoCreature > bufferMC = new ArrayList < MonoCreature > ( ) ; ArrayList < ArrayList < MonoCreature > > monoCreaturesTotalList = new ArrayList < ArrayList < MonoCreature > > ( ) ; MonoCreature [ ] seedCreatures = new MonoCreature [ 2 ] ; public MonoHybrid ( int maxGenerationsToSee ) { } protected MonoHybrid ( ) { } protected void seedParents ( MonoCreature parent1 , MonoCreature parent2 ) { } private void fuseTwo ( MonoCreature parent1 , MonoCreature parent2 ) { String [ ] gamete = new String [ 4 ] ; MonoCreature [ ] offSpring = new MonoCreature [ 4 ] ; for ( int i = 0 ; i < 4 ; i ++ ) { if ( ( i == 0 ) || ( i == 1 ) ) { gamete [ i ] = parent1 . getGamete ( i ) ; System . out . print ( "From<seq2seq4repair_space>p1:<seq2seq4repair_space>" ) ; } else if ( ( i == 2 ) || ( i == 3 ) ) { gamete [ i ] = parent2 . getGamete ( ( i - 2 ) ) ; System . out . print ( "From<seq2seq4repair_space>p2:<seq2seq4repair_space>" ) ; } System . out . println ( ( ( ( "Gamete<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>is<seq2seq4repair_space>" ) + ( gamete [ i ] ) ) ) ; } System . out . println ( "\n" ) ; offSpring [ 0 ] = new MonoCreature ( gamete [ 0 ] , gamete [ 2 ] ) ; offSpring [ 1 ] = new MonoCreature ( gamete [ 0 ] , gamete [ 3 ] ) ; offSpring [ 2 ] = new MonoCreature ( gamete [ 1 ] , gamete [ 2 ] ) ; offSpring [ 3 ] = new MonoCreature ( gamete [ 1 ] , gamete [ 3 ] ) ; for ( int childInt = 0 ; childInt < 4 ; childInt ++ ) { System . out . println ( ( "for<seq2seq4repair_space>" + childInt ) ) ; <START_BUG> System . out . println ( ( ( "Adding<seq2seq4repair_space>" + ( offSpring [ childInt ] . geneMakeup ( ) ) ) + "<seq2seq4repair_space>+<seq2seq4repair_space>to<seq2seq4repair_space>buffer<seq2seq4repair_space>AL" ) ) ; <END_BUG> bufferMC . add ( offSpring [ childInt ] ) ; System . out . println ( ( ( ( ( offSpring [ childInt ] . geneMakeup ( ) ) + "<seq2seq4repair_space>added\nTotal<seq2seq4repair_space>length<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>buffer<seq2seq4repair_space>array-list:<seq2seq4repair_space>" ) + ( bufferMC . size ( ) ) ) + "\n" ) ) ; } parent1 . fusedWith ( parent2 ) ; parent2 . fusedWith ( parent1 ) ; } private void addToList ( ) { } private void generator ( ) { } protected void nextGen ( ) { } }

Fix:
System . out . println ( ( ( "Adding<seq2seq4repair_space>" + ( offSpring [ childInt ] . geneMakeup ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>buffer<seq2seq4repair_space>AL" ) ) ;
Buggy code:
public class AgentStack implements Iterable < AgentInstance > { private static final Log logger = LogFactory . getLog ( AgentStack . class . getName ( ) ) ; private CursorableLinkedList < AgentInstance > stack = new CursorableLinkedList ( ) ; private AgentInstance activeAgentInstance = null ; public void push ( AgentInstance agent ) { } public void push ( AgentInstance agentInstance , boolean cut ) { } public void replaceActive ( AgentInstance agentInstance ) { AgentInstance activeAgentInstance = getActiveAgentInstance ( ) ; if ( activeAgentInstance == null ) { throw new IllegalStateException ( "There<seq2seq4repair_space>is<seq2seq4repair_space>no<seq2seq4repair_space>active<seq2seq4repair_space>agent!" ) ; } <START_BUG> popIncluding ( activeAgentInstance , true ) ; <END_BUG> stack . addFirst ( agentInstance ) ; } public AgentInstance popActive ( ) { } private void popIncluding ( AgentInstance lastAgentInstanceToRemove , boolean removeLast ) { } private void popExcluding ( AgentInstance firstAgentInstanceToKeep ) { } @ Override public Iterator < AgentInstance > iterator ( ) { } public Iterator < AgentInstance > reverseIterator ( ) { } public AgentInstance peekTop ( ) { } public int size ( ) { } public boolean isEmpty ( ) { } public boolean contains ( AgentInstance agentInstance ) { } public AgentInstance getActiveAgentInstance ( ) { } public void setActiveAgentInstance ( AgentInstance agentInstance ) { } public AgentInstance getAt ( int index ) { } public List < AgentInstance > getAt ( IntRange range ) { } public List < AgentInstance > asList ( ) { } @ Override public String toString ( ) { } }

Fix:
popIncluding ( activeAgentInstance , false ) ;
Buggy code:
class ReflectiveMethodExecutor implements MethodExecutor { private final Method method ; private final Integer varargsPosition ; private final int [ ] argsRequiringConversion ; public ReflectiveMethodExecutor ( Method theMethod , int [ ] argumentsRequiringConversion ) { } public TypedValue execute ( EvaluationContext context , Object target , Object ... arguments ) throws AccessException { try { <START_BUG> if ( ( ( this . argsRequiringConversion ) != null ) && ( arguments != null ) ) { <END_BUG> ReflectionHelper . convertArguments ( context . getTypeConverter ( ) , arguments , this . method , this . argsRequiringConversion , this . varargsPosition ) ; } if ( this . method . isVarArgs ( ) ) { arguments = ReflectionHelper . setupArgumentsForVarargsInvocation ( this . method . getParameterTypes ( ) , arguments ) ; } ReflectionUtils . makeAccessible ( this . method ) ; Object value = this . method . invoke ( target , arguments ) ; return new TypedValue ( value , new org . springframework . core . convert . TypeDescriptor ( new org . springframework . core . MethodParameter ( this . method , ( - 1 ) ) ) . narrow ( value ) ) ; } catch ( Exception ex ) { throw new AccessException ( ( "Problem<seq2seq4repair_space>invoking<seq2seq4repair_space>method:<seq2seq4repair_space>" + ( this . method ) ) , ex ) ; } } }

Fix:
if ( arguments != null ) {
Buggy code:
public class EnsureKeysStage implements KeyUploadDelegate , SyncStorageRequestDelegate , GlobalSyncStage { private static final String LOG_TAG = "EnsureKeysStage" ; private GlobalSession session ; private boolean retrying = false ; @ Override public void execute ( GlobalSession session ) throws NoSuchStageException { } @ Override public String credentials ( ) { } @ Override public String ifUnmodifiedSince ( ) { } @ Override public void handleRequestSuccess ( SyncStorageResponse response ) { CollectionKeys k = new CollectionKeys ( ) ; try { ExtendedJSONObject body = response . jsonObjectBody ( ) ; <START_BUG> Log . i ( "rnewman" , ( "Fetched<seq2seq4repair_space>keys:<seq2seq4repair_space>" + ( body . toJSONString ( ) ) ) ) ; <END_BUG> k . setKeyPairsFromWBO ( CryptoRecord . fromJSONRecord ( body ) , session . config . syncKeyBundle ) ; } catch ( IllegalStateException e ) { session . abort ( e , "Invalid<seq2seq4repair_space>keys<seq2seq4repair_space>WBO." ) ; return ; } catch ( ParseException e ) { session . abort ( e , "Invalid<seq2seq4repair_space>keys<seq2seq4repair_space>WBO." ) ; return ; } catch ( NonObjectJSONException e ) { session . abort ( e , "Invalid<seq2seq4repair_space>keys<seq2seq4repair_space>WBO." ) ; return ; } catch ( IOException e ) { session . abort ( e , "IOException<seq2seq4repair_space>fetching<seq2seq4repair_space>keys." ) ; return ; } catch ( CryptoException e ) { session . abort ( e , "CryptoException<seq2seq4repair_space>handling<seq2seq4repair_space>keys<seq2seq4repair_space>WBO." ) ; return ; } Log . i ( "rnewman" , "Setting<seq2seq4repair_space>keys.<seq2seq4repair_space>Yay!" ) ; session . setCollectionKeys ( k ) ; try { session . advance ( ) ; } catch ( NoSuchStageException e ) { session . abort ( e , "No<seq2seq4repair_space>stage." ) ; } } @ Override public void handleRequestFailure ( SyncStorageResponse response ) { } @ Override public void handleRequestError ( Exception ex ) { } @ Override public void onKeysUploaded ( ) { } @ Override public void onKeyUploadFailed ( Exception e ) { } }

Fix:
Log . i ( EnsureKeysStage . LOG_TAG , ( "Fetched<seq2seq4repair_space>keys:<seq2seq4repair_space>" + ( body . toJSONString ( ) ) ) ) ;
Buggy code:
public class PutITest extends WithJetty { @ Rule public ExpectedException exception = ExpectedException . none ( ) ; @ Test public void requestSpecificationAllowsSpecifyingCookie ( ) throws Exception { } @ Test public void bodyHamcrestMatcherWithoutKey ( ) throws Exception { } @ Test public void putSupportsBinaryBody ( ) throws Exception { } @ Test public void putSupportsStringBody ( ) throws Exception { } @ Test public void putWithFormParams ( ) throws Exception { } @ Test public void putWithFormParam ( ) throws Exception { } @ Test public void putSupportsMultiValueFormParameters ( ) throws Exception { <START_BUG> RestAssured . given ( ) . formParam ( "list" , "1" , "2,3" ) . expect ( ) . body ( "list" , equalTo ( "1,2,3" ) ) . when ( ) . put ( "//multiValueParam" ) ; <END_BUG> } }

Fix:
RestAssured . given ( ) . formParam ( "list" , "1" , "2" , "3" ) . expect ( ) . body ( "list" , equalTo ( "1,2,3" ) ) . when ( ) . put ( "//multiValueParam" ) ;
Buggy code:
class HostAdd extends AbstractAddStepHandler { static final HostAdd INSTANCE = new HostAdd ( ) ; private HostAdd ( ) { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } private ServiceController < WebHost > addCommonHost ( OperationContext context , ServiceVerificationHandler verificationHandler , String hostName , List < String > aliases , String serverName , ServiceName virtualHostServiceName , PathAddress parent ) { WebHostService service = new WebHostService ( ) ; final ServiceBuilder < WebHost > builder = context . getServiceTarget ( ) . addService ( SERVICE_NAME . append ( hostName ) , service ) . addDependency ( SERVER . append ( serverName ) , Server . class , service . getServer ( ) ) . addDependency ( virtualHostServiceName , Host . class , service . getHost ( ) ) ; if ( aliases != null ) { for ( String alias : aliases ) { builder . addAliases ( SERVICE_NAME . append ( alias ) ) ; } } addCommonHostListenerDeps ( context , parent , builder , HTTP_LISTENER_PATH ) ; addCommonHostListenerDeps ( context , parent , builder , AJP_LISTENER_PATH ) ; addCommonHostListenerDeps ( context , parent , builder , HTTPS_LISTENER_PATH ) ; builder . addListener ( verificationHandler ) ; <START_BUG> builder . setInitialMode ( ON_DEMAND ) ; <END_BUG> return builder . install ( ) ; } private void addCommonHostListenerDeps ( OperationContext context , PathAddress parent , ServiceBuilder < WebHost > builder , final PathElement listenerPath ) { } }

Fix:
builder . setInitialMode ( PASSIVE ) ;
Buggy code:
final class RequestDispatcherImpl implements RequestDispatcher { private static StringManager sm = StringManager . getManager ( "org.apache.tomcat.resources" ) ; Context context ; String path ; String queryString ; String name ; public RequestDispatcherImpl ( Context context ) { } public void setPath ( String urlPath ) { } public void setName ( String name ) { } public void forward ( ServletRequest request , ServletResponse response ) throws IOException , ServletException { } private void doForward ( ServletRequest request , ServletResponse response ) throws IOException , ServletException { Request realRequest = ( ( HttpServletRequestFacade ) ( request ) ) . getRealRequest ( ) ; Response realResponse = realRequest . getResponse ( ) ; if ( realResponse . isBufferCommitted ( ) ) throw new IllegalStateException ( RequestDispatcherImpl . sm . getString ( "rdi.forward.ise" ) ) ; realResponse . resetBuffer ( ) ; if ( ( name ) != null ) { forwardNamed ( request , response ) ; return ; } realRequest . setContext ( context ) ; realRequest . requestURI ( ) . setString ( ( ( context . getPath ( ) ) + ( path ) ) ) ; if ( ( queryString ) != null ) addQueryString ( realRequest , queryString ) ; context . getContextManager ( ) . processRequest ( realRequest ) ; realRequest . removeAttribute ( "javax.servlet.include.request_uri" ) ; realRequest . removeAttribute ( "javax.servlet.include.servlet_path" ) ; Handler wr = realRequest . getHandler ( ) ; if ( wr != null ) invoke ( wr , realRequest , realResponse ) ; if ( realResponse . isExceptionPresent ( ) ) { if ( null == ( realResponse . getErrorURI ( ) ) ) realResponse . setErrorURI ( ( ( context . getPath ( ) ) + ( path ) ) ) ; Exception ex = realResponse . getErrorException ( ) ; if ( ex instanceof IOException ) throw ( ( IOException ) ( ex ) ) ; if ( ex instanceof RuntimeException ) throw ( ( RuntimeException ) ( ex ) ) ; else if ( ex instanceof ServletException ) throw ( ( ServletException ) ( ex ) ) ; else <START_BUG> throw new ServletException ( RequestDispatcherImpl . sm . getString ( "dispatcher.forwardException" , ex ) ) ; <END_BUG> } realResponse . finish ( ) ; } public void include ( ServletRequest request , ServletResponse response ) throws IOException , ServletException { } private void doInclude ( ServletRequest request , ServletResponse response ) throws IOException , ServletException { } public void includeNamed ( ServletRequest request , ServletResponse response ) throws IOException , ServletException { } public void forwardNamed ( ServletRequest request , ServletResponse response ) throws IOException , ServletException { } void addQueryString ( Request req , String inQueryString ) { } private void replaceAttribute ( Request realRequest , String name , Object value ) { } private void invoke ( Handler wr , Request req , Response resp ) throws IOException , ServletException { } }

Fix:
throw new ServletException ( RequestDispatcherImpl . sm . getString ( "dispatcher.forwardException" ) , ex ) ;
Buggy code:
public interface LegacyKernelServicesInitializer { LegacyKernelServicesInitializer setExtensionClassName ( String extensionClassName ) { } LegacyKernelServicesInitializer addURL ( URL url ) { } LegacyKernelServicesInitializer addSimpleResourceURL ( String resource ) throws MalformedURLException { } <START_BUG> LegacyKernelServicesInitializer addMavenResourceURL ( String artifactGav ) throws IOException , ClassNotFoundException ; <END_BUG> LegacyKernelServicesInitializer addParentFirstClassPattern ( String pattern ) { } LegacyKernelServicesInitializer addChildFirstClassPattern ( String pattern ) { } LegacyKernelServicesInitializer dontPersistXml ( ) { } LegacyKernelServicesInitializer skipReverseControllerCheck ( ) { } LegacyKernelServicesInitializer configureReverseControllerCheck ( AdditionalInitialization additionalInit , ModelFixer modelFixer ) { } LegacyKernelServicesInitializer configureReverseControllerCheck ( AdditionalInitialization additionalInit , ModelFixer modelFixer , OperationFixer operationFixer ) { } LegacyKernelServicesInitializer addOperationValidationExclude ( String name , PathAddress pathAddress ) { } LegacyKernelServicesInitializer addOperationValidationResolve ( String name , PathAddress pathAddress ) { } LegacyKernelServicesInitializer excludeFromParent ( ClassFilter exclusionFilter ) { } LegacyKernelServicesInitializer addSingleChildFirstClass ( Class < ? > ... classes ) { } }

Fix:
LegacyKernelServicesInitializer addMavenResourceURL ( String ... artifactGav ) throws IOException , ClassNotFoundException ;
Buggy code:
public class TransactionDAO extends GenericDAO < TransactionBean > { public TransactionDAO ( String tableName , ConnectionPool pool ) throws DAOException { } public TransactionBean [ ] getTransactions ( int customer_id ) throws RollbackException { } public TransactionBean [ ] getPendingTransactions ( ) throws RollbackException { } public void buyFund ( CustomerDAO customerDAO , CustomerBean customer , int fund_id , long amount ) throws RollbackException { } public void sellFund ( PositionDAO positionDAO , int customer_id , int fund_id , long shares ) throws RollbackException { TransactionBean trans = new TransactionBean ( ) ; trans . setTransaction_type ( TYPE_SELL ) ; trans . setCustomer_id ( customer_id ) ; trans . setFund_id ( fund_id ) ; trans . setShares ( shares ) ; trans . setStatus ( STATUS_PENDING ) ; try { Transaction . begin ( ) ; PositionBean position = positionDAO . getCustomerFundPosition ( customer_id , fund_id ) ; if ( shares > ( position . getShares ( ) ) ) { throw new RollbackException ( "Sell<seq2seq4repair_space>share<seq2seq4repair_space>number<seq2seq4repair_space>exceeds<seq2seq4repair_space>your<seq2seq4repair_space>current<seq2seq4repair_space>share<seq2seq4repair_space>numbers" ) ; } else if ( shares == ( position . getShares ( ) ) ) { <START_BUG> positionDAO . delete ( position ) ; <END_BUG> } else { position . setShares ( ( ( position . getShares ( ) ) - shares ) ) ; positionDAO . update ( position ) ; } this . createAutoIncrement ( trans ) ; Transaction . commit ( ) ; } catch ( RollbackException e ) { e . printStackTrace ( ) ; if ( Transaction . isActive ( ) ) { Transaction . rollback ( ) ; } throw e ; } } public CustomerBean requestCheck ( CustomerDAO customerDAO , int customer_id , long requestAmount ) throws RollbackException { } public void depositCheck ( int customer_id , long depositAmount ) throws RollbackException { } No newline ; at end ; of file ; }

Fix:
positionDAO . delete ( position . getPosition_id ( ) ) ;
Buggy code:
public class SVGAssetBitmapTextureAtlasSource extends SVGBaseBitmapTextureAtlasSource { private final Context mContext ; private final String mAssetPath ; private final ISVGColorMapper mSVGColorMapper ; public SVGAssetBitmapTextureAtlasSource ( final Context pContext , final String pAssetPath , final int pTexturePositionX , final int pTexturePositionY ) { } public SVGAssetBitmapTextureAtlasSource ( final Context pContext , final String pAssetPath , final int pTexturePositionX , final int pTexturePositionY , final int pWidth , final int pHeight ) { } public SVGAssetBitmapTextureAtlasSource ( final Context pContext , final String pAssetPath , final int pTexturePositionX , final int pTexturePositionY , final float pScale ) { } public SVGAssetBitmapTextureAtlasSource ( final Context pContext , final String pAssetPath , final int pTexturePositionX , final int pTexturePositionY , final ISVGColorMapper pSVGColorMapper ) { } public SVGAssetBitmapTextureAtlasSource ( final Context pContext , final String pAssetPath , final int pTexturePositionX , final int pTexturePositionY , final float pScale , final ISVGColorMapper pSVGColorMapper ) { } public SVGAssetBitmapTextureAtlasSource ( final Context pContext , final String pAssetPath , final int pTexturePositionX , final int pTexturePositionY , final int pWidth , final int pHeight , final ISVGColorMapper pSVGColorMapper ) { } @ Override public SVGAssetBitmapTextureAtlasSource deepCopy ( ) { <START_BUG> return new SVGAssetBitmapTextureAtlasSource ( this . mContext , this . mAssetPath , this . mTextureX , this . mTextureY , this . mTextureWidth , this . mTextureHeight , this . mSVGColorMapper ) ; <END_BUG> } private static SVG getSVG ( final Context pContext , final String pAssetPath , final ISVGColorMapper pSVGColorMapper ) { } }

Fix:
return new SVGAssetBitmapTextureAtlasSource ( this . mContext , this . mAssetPath , this . mTexturePositionX , this . mTexturePositionY , this . mWidth , this . mHeight , this . mSVGColorMapper ) ;
Buggy code:
public class HtmlHeaderResolver implements IComponentResolver { private static final long serialVersionUID = 1L ; public boolean resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { if ( tag . getId ( ) . equals ( HEADER_ID ) ) { final WebMarkupContainer header = new HtmlHeaderContainer ( ( ( HtmlHeaderSectionHandler . HEADER_ID ) + ( container . getPage ( ) . getAutoIndex ( ) ) ) ) ; container . autoAdd ( header , markupStream ) ; return true ; } else if ( ( tag instanceof WicketTag ) && ( ( ( WicketTag ) ( tag ) ) . isHeadTag ( ) ) ) { if ( container instanceof WebPage ) { final MarkupContainer header = new HtmlHeaderContainer ( ( ( HtmlHeaderSectionHandler . HEADER_ID ) + ( container . getPage ( ) . getAutoIndex ( ) ) ) ) ; final WebMarkupContainer header2 = new WebMarkupContainer ( HtmlHeaderSectionHandler . HEADER_ID ) { private static final long serialVersionUID = 1L ; @ Override public boolean isTransparentResolver ( ) { return true ; } } ; header2 . setRenderBodyOnly ( true ) ; header . add ( header2 ) ; container . autoAdd ( header , markupStream ) ; } else if ( container instanceof HtmlHeaderContainer ) { final WebMarkupContainer header = new WebMarkupContainer ( HtmlHeaderSectionHandler . HEADER_ID ) { private static final long serialVersionUID = 1L ; @ Override public boolean isTransparentResolver ( ) { return true ; } } ; header . setRenderBodyOnly ( true ) ; try { container . autoAdd ( header , markupStream ) ; } catch ( IllegalArgumentException ex ) { throw new WicketRuntimeException ( ( "If<seq2seq4repair_space>the<seq2seq4repair_space>root<seq2seq4repair_space>exception<seq2seq4repair_space>says<seq2seq4repair_space>something<seq2seq4repair_space>like<seq2seq4repair_space>" + ( ( "\"A<seq2seq4repair_space>child<seq2seq4repair_space>with<seq2seq4repair_space>id<seq2seq4repair_space>\'_header\'<seq2seq4repair_space>already<seq2seq4repair_space>exists\"<seq2seq4repair_space>" + "then<seq2seq4repair_space>you<seq2seq4repair_space>most<seq2seq4repair_space>likely<seq2seq4repair_space>forgot<seq2seq4repair_space>to<seq2seq4repair_space>override<seq2seq4repair_space>autoAdd()<seq2seq4repair_space>" ) + "in<seq2seq4repair_space>your<seq2seq4repair_space>bordered<seq2seq4repair_space>page<seq2seq4repair_space>component." ) ) , ex ) ; } } else { <START_BUG> throw new MarkupException ( "Mis-placed<seq2seq4repair_space><wicket:head>.<seq2seq4repair_space><wicket:head><seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>outside<seq2seq4repair_space>of<seq2seq4repair_space><wicket:panel><seq2seq4repair_space>and<seq2seq4repair_space><wicket:border>" ) ; <END_BUG> } return true ; } return false ; } }

Fix:
throw new MarkupException ( "Mis-placed<seq2seq4repair_space><wicket:head>.<seq2seq4repair_space><wicket:head><seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>outside<seq2seq4repair_space>of<seq2seq4repair_space><wicket:panel>,<seq2seq4repair_space><wicket:border>,<seq2seq4repair_space>and<seq2seq4repair_space><wicket:extend>" ) ;
Buggy code:
public class Othello extends BoardModel { public Othello ( int starting_player ) { } @ Override public boolean playMove ( int move ) { } @ Override protected boolean isValidMove ( int move ) { } @ Override <START_BUG> public int isAWin ( int side ) { <END_BUG> return 0 ; } }

Fix:
public int isAWin ( ) {
Buggy code:
class PeerNodeBackoffStatusChecker implements Runnable { final WeakReference < PeerNode > ref ; private static volatile boolean logMINOR ; public PeerNodeBackoffStatusChecker ( WeakReference < PeerNode > ref ) { } @ Override public void run ( ) { PeerNode pn = ref . get ( ) ; if ( pn == null ) return ; if ( pn . cachedRemoved ( ) ) { if ( ( PeerNodeBackoffStatusChecker . logMINOR ) && ( pn . node . peers . havePeer ( pn ) ) ) { Logger . error ( this , ( "Removed<seq2seq4repair_space>flag<seq2seq4repair_space>is<seq2seq4repair_space>set<seq2seq4repair_space>yet<seq2seq4repair_space>is<seq2seq4repair_space>in<seq2seq4repair_space>peers<seq2seq4repair_space>table?!:<seq2seq4repair_space>" + pn ) ) ; } else { return ; } } if ( ! ( pn . node . peers . havePeer ( pn ) ) ) { if ( ! ( pn . cachedRemoved ( ) ) ) Logger . error ( this , ( "Not<seq2seq4repair_space>in<seq2seq4repair_space>peers<seq2seq4repair_space>table<seq2seq4repair_space>but<seq2seq4repair_space>not<seq2seq4repair_space>flagged<seq2seq4repair_space>as<seq2seq4repair_space>removed:<seq2seq4repair_space>" + pn ) ) ; return ; } <START_BUG> pn . setPeerNodeStatus ( System . currentTimeMillis ( ) , true ) ; <END_BUG> } }

Fix:
pn . setPeerNodeStatus ( System . currentTimeMillis ( ) , true , false ) ;
Buggy code:
public class RenameFolderAction extends AbstractColumbaAction implements ISelectionListener { public RenameFolderAction ( FrameMediator frameMediator ) { } public void actionPerformed ( ActionEvent evt ) { } public void selectionChanged ( SelectionChangedEvent evt ) { if ( ( ( ( org . columba . mail . gui . tree . selection . TreeSelectionChangedEvent ) ( evt ) ) . getSelected ( ) . length ) > 0 ) { AbstractFolder folder = ( ( org . columba . mail . gui . tree . selection . TreeSelectionChangedEvent ) ( evt ) ) . getSelected ( ) [ 0 ] ; if ( ( folder != null ) && ( folder instanceof AbstractMessageFolder ) ) { IFolderItem item = folder . getConfiguration ( ) ; <START_BUG> if ( item . get ( "property" , "accessrights" ) . equals ( "user" ) ) { <END_BUG> setEnabled ( true ) ; } else { setEnabled ( false ) ; } } } else { setEnabled ( false ) ; } } }

Fix:
if ( item . getString ( "property" , "accessrights" ) . equals ( "user" ) ) {
Buggy code:
public class MyServer { public static String sendPostData ( String sendMsg ) { } public static void writeInFile ( Context context , String fileName , String input ) { try { FileOutputStream outFile = context . openFileOutput ( fileName , MODE_PRIVATE ) ; outFile . write ( input . getBytes ( ) ) ; <START_BUG> Log . e ( "Server" , ( "JSON<seq2seq4repair_space>=<seq2seq4repair_space>" + input ) ) ; <END_BUG> outFile . close ( ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } public static String readFromFile ( Context context , String fileName ) { } No newline ; at end ; of file ; }

Fix:
Log . e ( "Server" , ( "name<seq2seq4repair_space>:" + fileName ) ) ;
Buggy code:
public class ViewMessageCommand extends FolderCommand { MimePart bodyPart ; MimePartTree mimePartTree ; HeaderInterface header ; Folder srcFolder ; Object uid ; Object [ ] uids ; boolean encryptedMessage = false ; public ViewMessageCommand ( AbstractFrameController frame , DefaultCommandReference [ ] references ) { } protected void encryptMessage ( ) { LinkedList list = mimePartTree . getLeafsWithContentType ( mimePartTree . getRootMimeNode ( ) , "application//octet-stream" ) ; MimePart mimePart = ( ( MimePart ) ( list . getFirst ( ) ) ) ; String encryptedBodyPart = mimePart . getBody ( ) ; String to = ( ( String ) ( header . get ( "To" ) ) ) ; PGPItem pgpItem = MailConfig . getAccountList ( ) . getPGPItem ( to ) ; String decryptedBodyPart = "" ; <START_BUG> AbstractMessage message = new Rfc822Parser ( ) . parse ( decryptedBodyPart , true , null , 0 ) ; <END_BUG> mimePartTree = message . getMimePartTree ( ) ; header = message . getHeader ( ) ; } protected void verifyMessage ( ) { } protected void handlePGPMessage ( HeaderInterface header , Worker wsc ) { } public void updateGUI ( ) throws Exception { } public void execute ( Worker wsc ) throws Exception { } }

Fix:
AbstractMessage message = new Rfc822Parser ( ) . parse ( decryptedBodyPart , null ) ;
Buggy code:
class EstablishChannelModelControllerClient extends AbstractModelControllerClient { private final String hostName ; private final int port ; private final ExecutorService executorService = Executors . newCachedThreadPool ( ) ; public EstablishChannelModelControllerClient ( final String hostName , int port ) { } public EstablishChannelModelControllerClient ( final InetAddress address , int port ) { } @ Override ManagementClientChannelStrategy getClientChannelStrategy ( ) throws IOException , URISyntaxException { <START_BUG> return ManagementClientChannelStrategy . create ( hostName , port , executorService ) ; <END_BUG> } }

Fix:
return ManagementClientChannelStrategy . create ( hostName , port , executorService , null ) ;
Buggy code:
public class Main { public static void main ( String [ ] args ) { <START_BUG> System . out . Println ( "Hello<seq2seq4repair_space>Yaku" ) ; <END_BUG> } }

Fix:
System . out . println ( "Hello<seq2seq4repair_space>Yaku" ) ;
Buggy code:
public class BooleanEditor extends BaseEditor implements Editor { private static final String TRUE = "true" ; private static final String FALSE = "false" ; private final Template editorTemplate ; private Boolean value ; public BooleanEditor ( Template editorTemplate , Template viewTemplate , EditorService service ) { } @ Override public Object getValue ( ) { } @ Override public void setValue ( Object value ) { } @ Override public String getAsText ( ) { <START_BUG> return value ? BooleanEditor . TRUE : BooleanEditor . FALSE ; <END_BUG> } @ Override public Renderable getEditor ( Controller controller , PropertyValue property ) { } }

Fix:
return ( ( value ) == null ) || ( ! ( value ) ) ? BooleanEditor . FALSE : BooleanEditor . TRUE ;
Buggy code:
public class AStarWorldExaminer implements IAStarExaminer { private final World _world ; private double _entityHeight = 2 ; private AStarWorldExaminer . DoorPathMode _doorPathMode = AStarWorldExaminer . DoorPathMode . OPEN ; public enum DoorPathMode { OPEN , IGNORE_CLOSED , IGNORE_OPEN ; } public AStarWorldExaminer ( World world ) { } public World getWorld ( ) { } public double getEntityHeight ( ) { } public void setEntityHeight ( double height ) { } public AStarWorldExaminer . DoorPathMode getDoorPathMode ( ) { } public void setDoorPathMode ( AStarWorldExaminer . DoorPathMode mode ) { } @ Override public boolean isDestination ( AStarNode node ) { } @ Override public boolean canSearch ( AStarContext context ) { } @ Override public AStarScore getScore ( @ Nullable AStarNode parent , AStarNode node ) { } @ Override public PathableResult isPathable ( AStarNode from , AStarNode to ) { PreCon . notNull ( from ) ; PreCon . notNull ( to ) ; PreCon . isValid ( from . isAdjacent ( to ) , "'to'<seq2seq4repair_space>node<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>adjacent<seq2seq4repair_space>to<seq2seq4repair_space>'from'<seq2seq4repair_space>node" ) ; IAStarNodeContainer container = from . getContext ( ) . getContainer ( ) ; if ( container . isClosed ( to ) ) return PathableResult . INVALID_POINT ; Coords3Di parent = from . getCoords ( ) ; Coords3Di candidate = to . getCoords ( ) ; Coords3Di delta = candidate . getDelta ( parent ) ; int x = delta . getX ( ) ; int y = delta . getY ( ) ; int z = delta . getZ ( ) ; Material material = candidate . getBlock ( _world ) . getType ( ) ; if ( ( ! ( Materials . isSurface ( material ) ) ) || ( ! ( hasRoomForEntity ( to , getDoorPathMode ( ) ) ) ) ) { if ( ! ( Materials . isTransparent ( material ) ) ) { return PathableResult . INVALID_COLUMN ; } return PathableResult . INVALID_POINT ; } if ( ( ( x != 0 ) && ( z != 0 ) ) && ( y >= 0 ) ) { AStarNode diagX = from . getRelative ( x , y , 0 ) ; AStarNode diagZ = from . getRelative ( 0 , y , z ) ; boolean isXValid = hasRoomForEntity ( diagX , getDoorPathMode ( ) ) ; boolean isZValid = hasRoomForEntity ( diagZ , getDoorPathMode ( ) ) ; if ( ( ( y == 0 ) && ( ! isXValid ) ) && ( ! isZValid ) ) { return PathableResult . INVALID_COLUMN ; } if ( ( ! isXValid ) || ( ! isZValid ) ) { <START_BUG> return PathableResult . INVALID_POINT ; <END_BUG> } } return PathableResult . VALID ; } protected boolean hasRoomForEntity ( AStarNode node , AStarWorldExaminer . DoorPathMode doorMode ) { } }

Fix:
return PathableResult . INVALID_COLUMN ;
Buggy code:
public class ExpungeFolderAction extends FrameAction implements SelectionListener { public ExpungeFolderAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( frameController . getSelectionManager ( ) . getSelection ( "mail.tree" ) ) ) ; <END_BUG> ExpungeFolderCommand c = new ExpungeFolderCommand ( r ) ; processor . addOp ( c ) ; } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( frameMediator . getSelectionManager ( ) . getSelection ( "mail.tree" ) ) ) ;
Buggy code:
public class Max extends AbstractFunctionBox { int PROID = 399 ; @ Override protected DataSet initDataSet ( DataSet ds ) { } @ Override protected DataSet function ( DataSet ds ) { <START_BUG> UserData addedUserData = new UserData ( ds . getKeyString ( ) , ( ( ds . getValueString ( ) ) + "_MAX" ) ) ; <END_BUG> DataSet dataset = new DataSet ( addedUserData . getKeyString ( ) , addedUserData . getValueString ( ) ) ; int max_pro_id = getMaxProjectID ( ds ) ; Pair maxPair ; Pair tempPair ; for ( int index = 0 ; index < ( max_pro_id - ( PROID ) ) ; index ++ ) { maxPair = new Pair ( "" , "" ) ; for ( int i = 0 ; i < ( ds . getUserDataSize ( ) ) ; i ++ ) { try { if ( ( maxPair . getX ( ) ) == "" ) { maxPair = ds . getUserData ( i ) . getPair ( index ) ; } else { tempPair = ds . getUserData ( i ) . getPair ( index ) ; if ( maxPair . matchX ( tempPair ) ) { if ( ( Double . parseDouble ( maxPair . getY ( ) . toString ( ) ) ) < ( Double . parseDouble ( tempPair . getY ( ) . toString ( ) ) ) ) { maxPair = tempPair ; } } } } catch ( IndexOutOfBoundsException e ) { System . out . println ( ( ( ( ( "ST_ID<seq2seq4repair_space>=<seq2seq4repair_space>" + ( i + 1 ) ) + "<seq2seq4repair_space>don't<seq2seq4repair_space>have<seq2seq4repair_space>" ) + ( index + 400 ) ) + "<seq2seq4repair_space>data" ) ) ; } } addedUserData . addData ( maxPair ) ; } dataset . addUserData ( addedUserData ) ; return dataset ; } int getMaxProjectID ( DataSet ds ) { } }

Fix:
UserData addedUserData = new UserData ( ds . getKeyString ( ) , ( ( ds . getValueString ( ) ) + "_MAX" ) , ( - 1 ) , ds . getUserData ( 0 ) . getClass_ID ( ) ) ;
Buggy code:
public class ModClusterStopContext implements OperationStepHandler , DescriptionProvider { static final ModClusterStopContext INSTANCE = new ModClusterStopContext ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . getProcessType ( ) . isServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; ModClusterLogger . ROOT_LOGGER . debugf ( "stop-context:<seq2seq4repair_space>%s" , operation ) ; ContextHost contexthost = new ContextHost ( operation ) ; modcluster . stopContext ( contexthost . webhost , contexthost . webcontext , contexthost . waittime ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class CopyTest extends BuildFileTest { private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; public CopyTest ( String name ) { } public void setUp ( ) { } public void test1 ( ) { } public void tearDown ( ) { } public void test2 ( ) { } public void test3 ( ) { } public void testFilterTest ( ) { } public void testInfiniteFilter ( ) { } public void testFilterSet ( ) throws IOException { } public void testFilterChain ( ) throws IOException { } public void testSingleFileFileset ( ) { } public void testSingleFilePath ( ) { } public void testTranscoding ( ) throws IOException { } public void testMissingFileIgnore ( ) { } public void testMissingFileBail ( ) { } public void testMissingDirIgnore ( ) { } public void testMissingDirBail ( ) { expectBuildException ( "testMissingDirBail" , "not-there<seq2seq4repair_space>doesn't<seq2seq4repair_space>exist" ) ; <START_BUG> assertTrue ( getBuildException ( ) . getMessage ( ) . endsWith ( "<seq2seq4repair_space>not<seq2seq4repair_space>found." ) ) ; <END_BUG> } public void testFileResourcePlain ( ) { } public void _testFileResourceWithMapper ( ) { } public void testFileResourceWithFilter ( ) { } public void testPathAsResource ( ) { } public void testZipfileset ( ) { } public void testDirset ( ) { } public void _testResourcePlain ( ) { } public void _testResourcePlainWithMapper ( ) { } public void _testResourcePlainWithFilter ( ) { } public void _testOnlineResources ( ) { } }

Fix:
assertTrue ( getBuildException ( ) . getMessage ( ) . endsWith ( "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist." ) ) ;
Buggy code:
public class TestConfigView implements ConfigOperator { private static final TestConfigView INSTANCE = new TestConfigView ( ) ; private TestConfigView ( ) { } public static ConfigOperator of ( ) { } @ Override public Configuration operate ( final Configuration config ) { return new Configuration ( ) { @ Override public Map < String , String > getProperties ( ) { Map < String , String > result = new HashMap < > ( ) ; for ( Map . Entry < String , String > e : config . getProperties ( ) . entrySet ( ) ) { if ( e . getKey ( ) . startsWith ( "test" ) ) { result . put ( e . getKey ( ) , e . getValue ( ) ) ; } } return result ; } @ Override public Configuration with ( ConfigOperator operator ) { return operator . operate ( this ) ; } @ Override public < T > T query ( ConfigQuery < T > query ) { return query . query ( this ) ; } @ Override public String get ( String key ) { return getProperties ( ) . get ( key ) ; } @ Override public String getOrDefault ( String key , String defaultValue ) { String val = get ( key ) ; if ( val == null ) { return defaultValue ; } return val ; } @ Override public < T > T getOrDefault ( String key , Class < T > type , T defaultValue ) { T val = get ( key , type ) ; if ( val == null ) { return defaultValue ; } return val ; } @ Override public < T > T get ( String key , Class < T > type ) { return ( ( T ) ( get ( key , TypeLiteral . of ( type ) ) ) ) ; } @ Override public < T > T get ( String key , TypeLiteral < T > type ) { String value = get ( key ) ; if ( value != null ) { List < PropertyConverter < T > > converters = ConfigurationProvider . getConfigurationContext ( ) . getPropertyConverters ( type ) ; <START_BUG> ConversionContext ctx = new ConversionContext . Builder ( ConfigurationProvider . getConfiguration ( ) , key , type ) . build ( ) ; <END_BUG> for ( PropertyConverter < T > converter : converters ) { try { T t = converter . convert ( value , ctx ) ; if ( t != null ) { return t ; } } catch ( Exception e ) { Logger . getLogger ( getClass ( ) . getName ( ) ) . log ( Level . FINEST , ( ( ( "PropertyConverter:<seq2seq4repair_space>" + converter ) + "<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>convert<seq2seq4repair_space>value:<seq2seq4repair_space>" ) + value ) , e ) ; } } throw new org . apache . tamaya . ConfigException ( ( ( ( "Unparseable<seq2seq4repair_space>config<seq2seq4repair_space>value<seq2seq4repair_space>for<seq2seq4repair_space>type:<seq2seq4repair_space>" + ( type . getRawType ( ) . getName ( ) ) ) + ":<seq2seq4repair_space>" ) + key ) ) ; } return null ; } @ Override public < T > T getOrDefault ( String key , TypeLiteral < T > type , T defaultValue ) { T val = get ( key , type ) ; if ( val == null ) { return defaultValue ; } return val ; } } ; } }

Fix:
ConversionContext ctx = new ConversionContext . Builder ( ConfigurationProvider . getConfiguration ( ) , ConfigurationProvider . getConfigurationContext ( ) , key , type ) . build ( ) ;
Buggy code:
public class GzipCompressorOutputStream extends CompressorOutputStream { private static final int FNAME = 1 << 3 ; private static final int FCOMMENT = 1 << 4 ; private final OutputStream out ; private final Deflater deflater ; private final byte [ ] buffer = new byte [ 512 ] ; private boolean closed ; private final CRC32 crc = new CRC32 ( ) ; public GzipCompressorOutputStream ( OutputStream out ) throws IOException { } public GzipCompressorOutputStream ( OutputStream out , GzipParameters parameters ) throws IOException { } private void writeHeader ( GzipParameters parameters ) throws IOException { String filename = parameters . getFilename ( ) ; String comment = parameters . getComment ( ) ; ByteBuffer buffer = ByteBuffer . allocate ( 10 ) ; buffer . order ( ByteOrder . LITTLE_ENDIAN ) ; buffer . putShort ( ( ( short ) ( GZIPInputStream . GZIP_MAGIC ) ) ) ; <START_BUG> buffer . put ( ( ( byte ) ( 8 ) ) ) ; <END_BUG> buffer . put ( ( ( byte ) ( ( filename != null ? GzipCompressorOutputStream . FNAME : 0 ) | ( comment != null ? GzipCompressorOutputStream . FCOMMENT : 0 ) ) ) ) ; buffer . putInt ( ( ( int ) ( ( parameters . getModificationTime ( ) ) // 1000 ) ) ) ; int compressionLevel = parameters . getCompressionLevel ( ) ; if ( compressionLevel == ( Deflater . BEST_COMPRESSION ) ) { buffer . put ( ( ( byte ) ( 2 ) ) ) ; } else if ( compressionLevel == ( Deflater . BEST_SPEED ) ) { buffer . put ( ( ( byte ) ( 4 ) ) ) ; } else { buffer . put ( ( ( byte ) ( 0 ) ) ) ; } buffer . put ( ( ( byte ) ( parameters . getOperatingSystem ( ) ) ) ) ; out . write ( buffer . array ( ) ) ; if ( filename != null ) { out . write ( filename . getBytes ( "ISO-8859-1" ) ) ; out . write ( 0 ) ; } if ( comment != null ) { out . write ( comment . getBytes ( "ISO-8859-1" ) ) ; out . write ( 0 ) ; } } private void writeTrailer ( ) throws IOException { } @ Override public void write ( int b ) throws IOException { } @ Override public void write ( byte [ ] buffer ) throws IOException { } @ Override public void write ( byte [ ] buffer , int offset , int length ) throws IOException { } private void deflate ( ) throws IOException { } public void finish ( ) throws IOException { } @ Override public void flush ( ) throws IOException { } @ Override public void close ( ) throws IOException { } }

Fix:
buffer . put ( ( ( byte ) ( Deflater . DEFLATED ) ) ) ;
Buggy code:
public abstract class Migration { private static final Logger logger = LoggerFactory . getLogger ( Migration . class ) ; public static final String MIGRATIONS_CF = "Migrations" ; public static final String SCHEMA_CF = "Schema" ; public static final String MIGRATIONS_KEY = "Migrations<seq2seq4repair_space>Key" ; public static final String LAST_MIGRATION_KEY = "Last<seq2seq4repair_space>Migration" ; protected RowMutation rm ; protected final UUID newVersion ; protected UUID lastVersion ; Migration ( UUID newVersion , UUID lastVersion ) { } public final void apply ( ) throws IOException { } public final void announce ( ) { } public static UUID getLastMigrationId ( ) { Table defs = Table . open ( DEFINITIONS ) ; ColumnFamilyStore cfStore = defs . getColumnFamilyStore ( Migration . SCHEMA_CF ) ; QueryFilter filter = QueryFilter . getNamesFilter ( Migration . LAST_MIGRATION_KEY , new QueryPath ( Migration . SCHEMA_CF ) , Migration . LAST_MIGRATION_KEY . getBytes ( ) ) ; ColumnFamily cf = cfStore . getColumnFamily ( filter ) ; <START_BUG> if ( ( cf . getColumnNames ( ) . size ( ) ) == 0 ) <END_BUG> return null ; else return UUIDGen . makeType1UUID ( cf . getColumn ( Migration . LAST_MIGRATION_KEY . getBytes ( ) ) . value ( ) ) ; } abstract void applyModels ( ) throws IOException { } public abstract ICompactSerializer getSerializer ( ) { } private byte [ ] getBytes ( ) throws IOException { } public UUID getVersion ( ) { } static RowMutation makeDefinitionMutation ( KSMetaData add , KSMetaData remove , UUID versionId ) throws IOException { } static void cleanupDeadFiles ( boolean wait ) { } public static Migration deserialize ( InputStream in ) throws IOException { } public static Collection < IColumn > getLocalMigrations ( UUID start , UUID end ) { } }

Fix:
if ( ( cf == null ) || ( ( cf . getColumnNames ( ) . size ( ) ) == 0 ) )
Buggy code:
public class ResourceHelper { public static List < Class > findClassesInPackage ( String packageName ) throws IOException , ClassNotFoundException { } public static List < Class > findClassesFromJar ( JarFile jarFile , String packageName ) throws ClassNotFoundException , MalformedURLException { } private static List < Class > findClasses ( File directory , String packageName ) throws ClassNotFoundException { } private static JarFile getJarFile ( String filePath ) throws IOException { if ( ( filePath != null ) && ( filePath . contains ( ".jar!" ) ) ) { filePath = filePath . replaceAll ( "%20" , "<seq2seq4repair_space>" ) ; <START_BUG> filePath = filePath . substring ( ( ( filePath . indexOf ( "jar:file://" ) ) + 10 ) , filePath . indexOf ( '!' ) ) ; <END_BUG> JarFile jar = new JarFile ( filePath ) ; Manifest mf = jar . getManifest ( ) ; if ( mf != null ) { return jar ; } jar . close ( ) ; } return null ; } }

Fix:
filePath = filePath . substring ( ( ( filePath . indexOf ( "jar:file://" ) ) + 9 ) , filePath . indexOf ( '!' ) ) ;