nus-yam/ex-repair huggingface dataset:
Buggy code:
public class LoginActivity extends Activity { private static final String LOGIN_ACTIVITY_ANSWER_ID = "login_answer" ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void additionalInit ( ) { } private void signUp ( ) { Sender sender ; try { sender = new Sender ( getIpAddress ( ) , getPort ( ) ) ; } catch ( UnknownHostException e ) { e . printStackTrace ( ) ; Toast . makeText ( getApplicationContext ( ) , "Can\'t<seq2seq4repair_space>connect!\nUnknown<seq2seq4repair_space>host<seq2seq4repair_space>name!" , LENGTH_LONG ) . show ( ) ; close ( true ) ; return ; } try { String login = getLogin ( ) ; String password = getPassword ( ) ; <START_BUG> close ( sender . isLoginCorrect ( login , password ) ) ; <END_BUG> } catch ( IOException e ) { e . printStackTrace ( ) ; Toast . makeText ( getApplicationContext ( ) , "Can\'t<seq2seq4repair_space>sign<seq2seq4repair_space>up(IOException)!\nCheck<seq2seq4repair_space>your<seq2seq4repair_space>connection!" , LENGTH_LONG ) . show ( ) ; } } private String getIpAddress ( ) { } private int getPort ( ) { } private void close ( boolean loginFail ) { } private String getLogin ( ) { } private String getPassword ( ) { } }

Fix:
close ( ( ! ( sender . isLoginCorrect ( login , password ) ) ) ) ;
Buggy code:
public class ClobStoredProcedureTest extends BaseJDBCTestCase { final String testStr = "I<seq2seq4repair_space>am<seq2seq4repair_space>a<seq2seq4repair_space>simple<seq2seq4repair_space>derby<seq2seq4repair_space>test<seq2seq4repair_space>case" ; final long testStrLength = testStr . length ( ) ; public ClobStoredProcedureTest ( String name ) { } public static Test suite ( ) { } public void setUp ( ) throws Exception { } public void tearDown ( ) throws Exception { } public void testGetSubStringSP ( ) throws SQLException { } public void testClobCreateLocatorSP ( ) throws SQLException { int locator = - 1 ; CallableStatement cs = prepareCall ( "?<seq2seq4repair_space>=<seq2seq4repair_space>CALL<seq2seq4repair_space>SYSIBM.CLOBCREATELOCATOR()" ) ; cs . registerOutParameter ( 1 , Types . INTEGER ) ; cs . executeUpdate ( ) ; locator = cs . getInt ( 1 ) ; <START_BUG> assertEquals ( ( "The<seq2seq4repair_space>locator<seq2seq4repair_space>values<seq2seq4repair_space>returned<seq2seq4repair_space>by<seq2seq4repair_space>" + "SYSIBM.CLOBCREATELOCATOR()<seq2seq4repair_space>are<seq2seq4repair_space>incorrect" ) , 2 , locator ) ; <END_BUG> cs . close ( ) ; } public void testClobReleaseLocatorSP ( ) throws SQLException { } public void testClobGetLengthSP ( ) throws SQLException { } public void testClobGetPositionFromStringSP ( ) throws SQLException { } public void testClobSetStringSP ( ) throws SQLException { } public void testClobTruncateSP ( ) throws SQLException { } public void testClobGetPositionFromLocatorSP ( ) throws SQLException { } }

Fix:
assertEquals ( ( "The<seq2seq4repair_space>locator<seq2seq4repair_space>values<seq2seq4repair_space>returned<seq2seq4repair_space>by<seq2seq4repair_space>" + "SYSIBM.CLOBCREATELOCATOR()<seq2seq4repair_space>are<seq2seq4repair_space>incorrect" ) , 4 , locator ) ;
Buggy code:
public class OpenSessionInViewInterceptor implements AsyncWebRequestInterceptor { public static final String PARTICIPATE_SUFFIX = ".PARTICIPATE" ; protected final Log logger = LogFactory . getLog ( getClass ( ) ) ; private SessionFactory sessionFactory ; public void setSessionFactory ( SessionFactory sessionFactory ) { } public SessionFactory getSessionFactory ( ) { } public void preHandle ( WebRequest request ) throws DataAccessException { } public void postHandle ( WebRequest request , ModelMap model ) { } public AbstractDelegatingCallable getAsyncCallable ( WebRequest request ) { String attributeName = getParticipateAttributeName ( ) ; if ( ( request . getAttribute ( attributeName , SCOPE_REQUEST ) ) != null ) { return null ; } final SessionHolder sessionHolder = ( ( SessionHolder ) ( TransactionSynchronizationManager . getResource ( getSessionFactory ( ) ) ) ) ; return new AbstractDelegatingCallable ( ) { public Object call ( ) throws Exception { TransactionSynchronizationManager . bindResource ( getSessionFactory ( ) , sessionHolder ) ; <START_BUG> getNextCallable ( ) . call ( ) ; <END_BUG> return null ; } } ; } public void postHandleAsyncStarted ( WebRequest request ) { } public void afterCompletion ( WebRequest request , Exception ex ) throws DataAccessException { } protected Session openSession ( ) throws DataAccessResourceFailureException { } protected String getParticipateAttributeName ( ) { } }

Fix:
getNext ( ) . call ( ) ;
Buggy code:
public class WebExternalResourceStream extends AbstractResourceStream { InputStream in ; private static final long serialVersionUID = 1L ; private static final Logger log = LoggerFactory . getLogger ( WebExternalResourceStream . class ) ; private final String url ; public WebExternalResourceStream ( String url ) { } public long length ( ) { } public void close ( ) throws IOException { } public Time lastModifiedTime ( ) { } public String getContentType ( ) { } public InputStream getInputStream ( ) throws ResourceStreamNotFoundException { final ServletContext context = ( ( org . apache . wicket . protocol . http . WebApplication ) ( org . apache . wicket . RequestCycle . get ( ) . getApplication ( ) ) ) . getServletContext ( ) ; in = context . getResourceAsStream ( url ) ; if ( ( in ) == null ) { <START_BUG> throw new WicketRuntimeException ( ( "The<seq2seq4repair_space>requested<seq2seq4repair_space>resource<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>found:<seq2seq4repair_space>" + ( url ) ) ) ; <END_BUG> } return in ; } }

Fix:
throw new ResourceStreamNotFoundException ( ( "The<seq2seq4repair_space>requested<seq2seq4repair_space>resource<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>found:<seq2seq4repair_space>" + ( url ) ) ) ;
Buggy code:
public class DormandPrince54IntegratorTest extends TestCase { public DormandPrince54IntegratorTest ( String name ) { } public void testDimensionCheck ( ) { } public void testMinStep ( ) throws DerivativeException , IntegratorException { } public void testSmallLastStep ( ) throws DerivativeException , IntegratorException { } private static class DP54SmallLastHandler implements StepHandler { public DP54SmallLastHandler ( double minStep ) { } public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) { } public boolean wasLastSeen ( ) { } private boolean lastSeen ; private double minStep ; } public void testIncreasingTolerance ( ) throws DerivativeException , IntegratorException { int previousCalls = Integer . MAX_VALUE ; for ( int i = - 12 ; i < ( - 2 ) ; ++ i ) { TestProblem1 pb = new TestProblem1 ( ) ; double minStep = 0 ; double maxStep = ( pb . getFinalTime ( ) ) - ( pb . getInitialTime ( ) ) ; double scalAbsoluteTolerance = Math . pow ( 10.0 , i ) ; double scalRelativeTolerance = 0.01 * scalAbsoluteTolerance ; <START_BUG> RungeKuttaFehlbergIntegrator integ = new DormandPrince54Integrator ( minStep , maxStep , scalAbsoluteTolerance , scalRelativeTolerance ) ; <END_BUG> TestProblemHandler handler = new TestProblemHandler ( pb , integ ) ; integ . setSafety ( 0.8 ) ; integ . setMaxGrowth ( 5.0 ) ; integ . setMinReduction ( 0.3 ) ; integ . setStepHandler ( handler ) ; integ . integrate ( pb , pb . getInitialTime ( ) , pb . getInitialState ( ) , pb . getFinalTime ( ) , new double [ pb . getDimension ( ) ] ) ; assertEquals ( 0.8 , integ . getSafety ( ) , 1.0E-12 ) ; assertEquals ( 5.0 , integ . getMaxGrowth ( ) , 1.0E-12 ) ; assertEquals ( 0.3 , integ . getMinReduction ( ) , 1.0E-12 ) ; assertTrue ( ( ( handler . getMaximalValueError ( ) ) < ( 0.7 * scalAbsoluteTolerance ) ) ) ; assertEquals ( 0 , handler . getMaximalTimeError ( ) , 1.0E-12 ) ; int calls = pb . getCalls ( ) ; assertTrue ( ( calls <= previousCalls ) ) ; previousCalls = calls ; } } public void testSwitchingFunctions ( ) throws DerivativeException , IntegratorException { } public void testKepler ( ) throws DerivativeException , IntegratorException { } public void testVariableSteps ( ) throws DerivativeException , IntegratorException { } private static class KeplerHandler implements StepHandler { public KeplerHandler ( TestProblem3 pb ) { } public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) throws DerivativeException { } private int nbSteps ; private double maxError ; private TestProblem3 pb ; } private static class VariableHandler implements StepHandler { public VariableHandler ( ) { } public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) { } private boolean firstTime ; private double minStep ; private double maxStep ; } public static Test suite ( ) { } }

Fix:
EmbeddedRungeKuttaIntegrator integ = new DormandPrince54Integrator ( minStep , maxStep , scalAbsoluteTolerance , scalRelativeTolerance ) ;
Buggy code:
public class SubLine { private final Line line ; private final IntervalsSet remainingRegion ; public SubLine ( final Line line , final IntervalsSet remainingRegion ) { } public SubLine ( final Vector3D start , final Vector3D end ) throws MathIllegalArgumentException { } public SubLine ( final Segment segment ) throws MathIllegalArgumentException { } public List < Segment > getSegments ( ) { final List < Interval > list = remainingRegion . asList ( ) ; <START_BUG> final List < Segment > segments = new ArrayList < Segment > ( ) ; <END_BUG> for ( final Interval interval : list ) { final Vector3D start = line . toSpace ( new org . apache . commons . math3 . geometry . euclidean . oned . Vector1D ( interval . getInf ( ) ) ) ; final Vector3D end = line . toSpace ( new org . apache . commons . math3 . geometry . euclidean . oned . Vector1D ( interval . getSup ( ) ) ) ; segments . add ( new Segment ( start , end , line ) ) ; } return segments ; } public Vector3D intersection ( final SubLine subLine , final boolean includeEndPoints ) { } private static IntervalsSet buildIntervalSet ( final Vector3D start , final Vector3D end ) throws MathIllegalArgumentException { } }

Fix:
final List < Segment > segments = new ArrayList < Segment > ( list . size ( ) ) ;
Buggy code:
public class MigrationValidationException extends RuntimeException { private static final long serialVersionUID = 1L ; private final List < MigrationValidationException . Violation > violations = new ArrayList < MigrationValidationException . Violation > ( ) ; public MigrationValidationException ( String message , List < MigrationValidationException . Violation > violations ) { } public MigrationValidationException ( String s ) { } public MigrationValidationException ( String s , Throwable throwable ) { } public MigrationValidationException ( Throwable throwable ) { } public static class Violation { public String message ; public String propertyName ; public Object propertyValue ; } @ Override public String getMessage ( ) { StringBuilder builder = new StringBuilder ( ) ; <START_BUG> builder . append ( String . valueOf ( this . getMessage ( ) ) ) . append ( "\n" ) ; <END_BUG> for ( MigrationValidationException . Violation violation : violations ) { builder . append ( "Property:<seq2seq4repair_space>" ) . append ( violation . propertyName ) . append ( "\n" ) ; builder . append ( "Value:<seq2seq4repair_space>" ) . append ( violation . propertyValue ) . append ( "\n" ) ; builder . append ( "Reason:<seq2seq4repair_space>" ) . append ( violation . message ) . append ( "\n" ) ; } return builder . toString ( ) ; } public List < MigrationValidationException . Violation > getViolations ( ) { } No newline ; at end ; of file ; }

Fix:
builder . append ( String . valueOf ( super . getMessage ( ) ) ) . append ( "\n" ) ;
Buggy code:
class FileCache { private List < String > lines ; private int lastSavedLine ; public FileCache ( ) { } public void add ( String line ) { } public void savedLine ( int lastSavedLine ) { } public void printRemainingFile ( String fileName ) { <START_BUG> try ( PrintWriter p = new PrintWriter ( ( fileName + ".new" ) ) ) { <END_BUG> consumeRemainingFile ( ( s ) -> p . println ( s ) ) ; } catch ( IOException ex ) { throw new RuntimeException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>re-write<seq2seq4repair_space>file:<seq2seq4repair_space>" + fileName ) , ex ) ; } } protected void consumeRemainingFile ( Consumer < String > consumer ) { } No newline ; at end ; of file ; }

Fix:
try ( PrintWriter p = new PrintWriter ( fileName ) ) {
Buggy code:
public class ZkCoordinator implements PartitionCoordinator { public static Logger LOG = Logger . getLogger ( ZkCoordinator . class ) ; SpoutConfig _spoutConfig ; int _taskIndex ; int _totalTasks ; String _topologyInstanceId ; CuratorFramework _curator ; Map < GlobalPartitionId , PartitionManager > _managers = new HashMap ( ) ; List < PartitionManager > _cachedList ; Long _lastRefreshTime = null ; int _refreshFreqMs ; ZkHosts _brokerConf ; DynamicPartitionConnections _connections ; KafkaSpoutState _state ; public ZkCoordinator ( DynamicPartitionConnections connections , Map conf , SpoutConfig spoutConfig , KafkaSpoutState state , int taskIndex , int totalTasks , String topologyInstanceId ) { } @ Override public List < PartitionManager > getMyManagedPartitions ( ) { } void refresh ( ) { } @ Override public PartitionManager getManager ( GlobalPartitionId id ) { } private boolean myOwnership ( GlobalPartitionId id ) { <START_BUG> int val = ( id . host . hashCode ( ) ) + ( 23 * ( id . partition ) ) ; <END_BUG> return ( val % ( _totalTasks ) ) == ( _taskIndex ) ; } private static HostPort getBrokerHost ( byte [ ] contents ) { } private static int getNumPartitions ( byte [ ] contents ) { } }

Fix:
int val = Math . abs ( ( ( id . host . hashCode ( ) ) + ( 23 * ( id . partition ) ) ) ) ;
Buggy code:
public class BasicCrawlController { private static final Logger logger = LoggerFactory . getLogger ( BasicCrawlController . class ) ; public static void main ( String [ ] args ) throws Exception { if ( ( args . length ) != 2 ) { BasicCrawlController . logger . info ( "Needed<seq2seq4repair_space>parameters:<seq2seq4repair_space>" ) ; BasicCrawlController . logger . info ( "\t<seq2seq4repair_space>rootFolder<seq2seq4repair_space>(it<seq2seq4repair_space>will<seq2seq4repair_space>contain<seq2seq4repair_space>intermediate<seq2seq4repair_space>crawl<seq2seq4repair_space>data)" ) ; BasicCrawlController . logger . info ( "\t<seq2seq4repair_space>numberOfCralwers<seq2seq4repair_space>(number<seq2seq4repair_space>of<seq2seq4repair_space>concurrent<seq2seq4repair_space>threads)" ) ; return ; } String crawlStorageFolder = args [ 0 ] ; int numberOfCrawlers = Integer . parseInt ( args [ 1 ] ) ; CrawlConfig config = new CrawlConfig ( ) ; config . setCrawlStorageFolder ( crawlStorageFolder ) ; config . setPolitenessDelay ( 1000 ) ; config . setMaxDepthOfCrawling ( 2 ) ; config . setMaxPagesToFetch ( 1000 ) ; config . setIncludeBinaryContentInCrawling ( false ) ; config . setResumableCrawling ( false ) ; PageFetcher pageFetcher = new PageFetcher ( config ) ; RobotstxtConfig robotstxtConfig = new RobotstxtConfig ( ) ; RobotstxtServer robotstxtServer = new RobotstxtServer ( robotstxtConfig , pageFetcher ) ; CrawlController controller = new CrawlController ( config , pageFetcher , robotstxtServer ) ; <START_BUG> controller . addSeed ( "http:////www.douban.com//" ) ; <END_BUG> controller . start ( BasicCrawler . class , numberOfCrawlers ) ; } No newline ; at end ; of file ; }

Fix:
controller . addSeed ( "http:////www.qyer.com//" ) ;
Buggy code:
public class YamlConfigMapper extends ConfigBasic { private transient Yaml yaml ; protected transient ConfigSection root ; private transient Map < String , ArrayList < String > > comments = new LinkedHashMap < > ( ) ; private transient Representer yamlRepresenter = new Representer ( ) ; protected YamlConfigMapper ( ) { } protected void loadFromYaml ( ) throws InvalidConfigurationException { } private void convertMapsToSections ( Map < ? , ? > input , ConfigSection section ) { if ( input == null ) return ; for ( Map . Entry < ? , ? > entry : input . entrySet ( ) ) { String key = entry . getKey ( ) . toString ( ) ; Object value = entry . getValue ( ) ; if ( value instanceof Map ) { convertMapsToSections ( ( ( Map < ? , ? > ) ( value ) ) , section . create ( key ) ) ; } else { <START_BUG> section . set ( key , value ) ; <END_BUG> } } } protected void saveToYaml ( ) throws InvalidConfigurationException { } private static String join ( List < String > list , String conjunction ) { } public void addComment ( String key , String value ) { } public void clearComments ( ) { } }

Fix:
section . set ( key , value , false ) ;
Buggy code:
public abstract class DiscreteRandomGenerator { public DiscreteRandomGenerator ( int min , int max , int seed ) { } public DiscreteRandomGenerator ( String cmfFile ) throws FileNotFoundException , IOException { } void writeCmfFile ( String cmfFile ) { if ( ( mCmfBuffer ) == null ) generateCmf ( ) ; try { FileChannel wChannel = new FileOutputStream ( cmfFile , false ) . getChannel ( ) ; ByteBuffer buf = ByteBuffer . allocate ( 8 ) ; buf . putInt ( mMinValue ) ; buf . putInt ( mMaxValue ) ; buf . flip ( ) ; wChannel . write ( buf ) ; mNumberBuffer . limit ( mNumberBuffer . capacity ( ) ) ; mNumberBuffer . position ( 0 ) ; wChannel . write ( mNumberBuffer ) ; <START_BUG> mCmfBuffer . limit ( mNumberBuffer . capacity ( ) ) ; <END_BUG> mCmfBuffer . position ( 0 ) ; wChannel . write ( mCmfBuffer ) ; wChannel . close ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } public void setSeed ( long seed ) { } public int distributionRange ( ) { } public long getSample ( ) { } protected void generateCmf ( ) { } private void loadNumberBuffer ( ) { } protected abstract double pmf ( long val ) { } protected int mMinValue ; protected int mMaxValue ; protected int mOrigSeed ; protected int mValueCount ; private Random mRandom ; protected ByteBuffer mNumberBuffer ; protected ByteBuffer mCmfBuffer ; }

Fix:
mCmfBuffer . limit ( mCmfBuffer . capacity ( ) ) ;
Buggy code:
public class Person extends Resource { private static class InspectAction extends TestInstance . Action { private Resource inspector ; private Content body ; private Artifact [ ] attachments ; private InspectAction ( Resource inspector , Content body , Artifact [ ] attachments ) { } @ Override public String getCommand ( Template t ) throws Exception { Template [ ] params = new Template . Parameter [ 2 + ( attachments . length ) ] ; params [ 0 ] = new Template . ResourceParameter ( inspector ) ; params [ 1 ] = body ; int i = 2 ; for ( Artifact a : attachments ) { <START_BUG> params [ ( i ++ ) ] = StringParameter . class . cast ( a . getName ( ) ) ; <END_BUG> params [ ( i ++ ) ] = a . getContent ( ) ; } StringBuilder sb = new StringBuilder ( ) ; sb . append ( getSetID ( ) ) ; sb . append ( "<seq2seq4repair_space>inspect" ) ; for ( Parameter p : params ) { String v = p . getValue ( t ) ; if ( ( v . length ( ) ) > 0 ) { sb . append ( "<seq2seq4repair_space>" ) ; sb . append ( v ) ; } } return sb . toString ( ) ; } @ Override public String getDescription ( ) throws Exception { } @ Override public ArtifactUses getArtifactUses ( ) throws Exception { } @ Override public Resource getBoundResource ( ) throws Exception { } @ Override public DescribedTemplate getIncludedTemplate ( ) throws Exception { } @ Override public List < Action > getActionDependencies ( ) throws Exception { } } private static final String codename = "person" ; public Person ( Generator generator , String name ) { } public void inspect ( Content body , Artifact [ ] attachments ) throws Exception { } @ Override public String getDescription ( ) { } }

Fix:
params [ ( i ++ ) ] = new com . pslcl . dtf . core . generator . template . Template . StringParameter ( a . getName ( ) ) ;
Buggy code:
public class DurationDV extends AbstractDateTimeDV { private static final int [ ] [ ] DATETIMES = new int [ ] [ ] { new int [ ] { 1696 , 9 , 1 , 0 , 0 , 0 , 0 , 'Z' } , new int [ ] { 1697 , 2 , 1 , 0 , 0 , 0 , 0 , 'Z' } , new int [ ] { 1903 , 3 , 1 , 0 , 0 , 0 , 0 , 'Z' } , new int [ ] { 1903 , 7 , 1 , 0 , 0 , 0 , 0 , 'Z' } } ; private int [ ] [ ] fDuration = null ; public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { try { <START_BUG> return parse ( content ) ; <END_BUG> } catch ( Exception ex ) { throw new InvalidDatatypeValueException ( "cvc-datatype-valid.1.2.1" , new Object [ ] { content , "duration" } ) ; } } protected int [ ] parse ( String str ) throws SchemaDateTimeException { } protected short compareDates ( int [ ] date1 , int [ ] date2 , boolean strict ) { } private short compareResults ( short resultA , short resultB , boolean strict ) { } private int [ ] addDuration ( int [ ] date , int index , int [ ] duration ) { } protected String dateToString ( int [ ] date ) { } }

Fix:
return new DateTimeData ( parse ( content ) , this ) ;
Buggy code:
abstract class DDLStatementNode extends StatementNode { public static final int UNKNOWN_TYPE = 0 ; public static final int ADD_TYPE = 1 ; public static final int DROP_TYPE = 2 ; public static final int MODIFY_TYPE = 3 ; public static final int LOCKING_TYPE = 4 ; private TableName objectName ; private boolean initOk ; boolean implicitCreateSchema ; public void init ( Object objectName ) throws StandardException { } protected void initAndCheck ( Object objectName ) throws StandardException { } public boolean isAtomic ( ) { } public String getRelativeName ( ) { } public String getFullName ( ) { } public final TableName getObjectName ( ) { } public String toString ( ) { if ( SanityManager . DEBUG ) { <START_BUG> return ( objectName . toString ( ) ) + ( super . toString ( ) ) ; <END_BUG> } else { return "" ; } } int activationKind ( ) { } public final void generate ( ActivationClassBuilder acb , MethodBuilder mb ) throws StandardException { } protected final SchemaDescriptor getSchemaDescriptor ( ) throws StandardException { } protected final SchemaDescriptor getSchemaDescriptor ( boolean ownerCheck ) throws StandardException { } protected final TableDescriptor getTableDescriptor ( ) throws StandardException { } protected final TableDescriptor getTableDescriptor ( UUID tableId ) throws StandardException { } protected final TableDescriptor getTableDescriptor ( TableName tableName ) throws StandardException { } private TableDescriptor checkTableDescriptor ( TableDescriptor td ) throws StandardException { } public void bindName ( DataDictionary dataDictionary ) throws StandardException { } }

Fix:
return ( ( objectName ) == null ? "" : objectName . toString ( ) ) + ( super . toString ( ) ) ;
Buggy code:
public abstract class CommonDeployableContainer < T extends CommonContainerConfiguration > implements DeployableContainer < T > { private static final String JBOSS_URL_PKG_PREFIX = "org.jboss.ejb.client.naming" ; private T containerConfig ; @ Inject @ ContainerScoped private InstanceProducer < ManagementClient > managementClient ; @ Inject @ ContainerScoped private InstanceProducer < ArchiveDeployer > archiveDeployer ; @ Inject @ ApplicationScoped private InstanceProducer < Context > jndiContext ; @ Override public ProtocolDescription getDefaultProtocol ( ) { <START_BUG> return new ProtocolDescription ( "jmx-as7" ) ; <END_BUG> } @ Override public void setup ( T config ) { } @ Override public final void start ( ) throws LifecycleException { } protected abstract void startInternal ( ) throws LifecycleException { } @ Override public final void stop ( ) throws LifecycleException { } protected abstract void stopInternal ( ) throws LifecycleException { } protected T getContainerConfiguration ( ) { } protected ManagementClient getManagementClient ( ) { } protected ModelControllerClient getModelControllerClient ( ) { } @ Override public ProtocolMetaData deploy ( Archive < ? > archive ) throws DeploymentException { } @ Override public void undeploy ( Archive < ? > archive ) throws DeploymentException { } @ Override public void deploy ( Descriptor descriptor ) throws DeploymentException { } @ Override public void undeploy ( Descriptor descriptor ) throws DeploymentException { } private void safeCloseClient ( ) { } }

Fix:
return new ProtocolDescription ( "Servlet<seq2seq4repair_space>3.0" ) ;
Buggy code:
public abstract class AbstractTree extends Panel { private TreeState treeState ; public AbstractTree ( MarkupContainer parent , final String id , final TreeModel model ) { } public AbstractTree ( MarkupContainer parent , final String id , final TreeState treeState ) { } public void collapsePath ( TreePath path ) { } public void collapseSiblings ( final DefaultMutableTreeNode node ) { } public void expandAll ( boolean expand ) { } public void expandPath ( TreePath path ) { } public final TreeState getTreeState ( ) { } public final boolean isExpanded ( DefaultMutableTreeNode node ) { } public final boolean isExpanded ( TreePath path ) { } public final boolean isRootVisible ( ) { } public final boolean isVisible ( TreePath path ) { } public TreeState newTreeState ( final TreeModel model ) { } public void setExpandedState ( final DefaultMutableTreeNode node ) { } public void setExpandedState ( final TreePath selection , final boolean expanded ) { } public void setRootVisible ( final boolean rootVisible ) { } public void setSelected ( final DefaultMutableTreeNode node ) { } public void setTreeModel ( final TreeModel treeModel ) { } public void setTreeState ( final TreeState treeState ) { } @ Override public String toString ( ) { <START_BUG> StringBuffer b = new StringBuffer ( "--<seq2seq4repair_space>TREE<seq2seq4repair_space>MODEL<seq2seq4repair_space>--\n" ) ; <END_BUG> TreeState state = getTreeState ( ) ; TreeModel treeModel = null ; if ( state != null ) { treeModel = state . getModel ( ) ; } if ( treeModel != null ) { StringBuffer tabs = new StringBuffer ( ) ; DefaultMutableTreeNode rootNode = ( ( DefaultMutableTreeNode ) ( treeModel . getRoot ( ) ) ) ; Enumeration e = rootNode . preorderEnumeration ( ) ; while ( e . hasMoreElements ( ) ) { DefaultMutableTreeNode node = ( ( DefaultMutableTreeNode ) ( e . nextElement ( ) ) ) ; tabs . delete ( 0 , tabs . length ( ) ) ; tabs . append ( "|" ) ; for ( int i = 0 ; i < ( node . getLevel ( ) ) ; i ++ ) { tabs . append ( "-" ) ; } b . append ( tabs ) . append ( node ) . append ( "\n" ) ; } } else { b . append ( "<EMPTY>" ) ; } return b . toString ( ) ; } protected final TreeState newTreeState ( final TreeModel treeModel , final boolean rootVisible ) { } private final void expandAll ( TreePath parent , boolean expand ) { } }

Fix:
StringBuilder b = new StringBuilder ( "--<seq2seq4repair_space>TREE<seq2seq4repair_space>MODEL<seq2seq4repair_space>--\n" ) ;
Buggy code:
public class ServletResourceManager implements ResourceManager { private final FileResourceManager deploymentResourceManager ; private final Collection < VirtualFile > overlays ; public ServletResourceManager ( final VirtualFile resourcesRoot , final Collection < VirtualFile > overlays ) throws IOException { } @ Override public Resource getResource ( final String path ) throws IOException { } @ Override public boolean isResourceChangeListenerSupported ( ) { <START_BUG> return true ; <END_BUG> } @ Override public void registerResourceChangeListener ( ResourceChangeListener listener ) { } @ Override public void removeResourceChangeListener ( ResourceChangeListener listener ) { } @ Override public void close ( ) throws IOException { } }

Fix:
return false ;
Buggy code:
public class KeyboardInput implements KeyListener { int input = KeyCode . SOUTH ; public int getInput ( ) { int temp = input ; <START_BUG> input = 0 ; <END_BUG> return temp ; } @ Override public void keyPressed ( KeyEvent e ) { } @ Override public void keyReleased ( KeyEvent e ) { } @ Override public void keyTyped ( KeyEvent e ) { } }

Fix:
input = - 5 ;
Buggy code:
public class Case extends Statement { public Expression constantExpression ; public CaseLabel targetLabel ; public Case ( int sourceStart , Expression constantExpression ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( ( bits ) & ( IsReachableMASK ) ) == 0 ) { return ; } int pc = codeStream . position ; targetLabel . place ( ) ; <START_BUG> codeStream . recordPositionsFrom ( pc , this ) ; <END_BUG> } public void resolve ( BlockScope scope ) { } public Constant resolveCase ( BlockScope scope , TypeBinding testTb , SwitchStatement switchStatement ) { } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
codeStream . recordPositionsFrom ( pc , this . sourceStart ) ;
Buggy code:
public class CompilationUnit extends ASTNode { private PackageDeclaration optionalPackageDeclaration = null ; private ASTNode . NodeList imports = new ASTNode . NodeList ( false , ImportDeclaration . class ) ; private ASTNode . NodeList types = new ASTNode . NodeList ( false , TypeDeclaration . class ) ; private int [ ] lineEndTable = new int [ 0 ] ; private static final Message [ ] EMPTY_MESSAGES = new Message [ 0 ] ; private Message [ ] messages = CompilationUnit . EMPTY_MESSAGES ; void setLineEndTable ( int [ ] lineEndTable ) { } CompilationUnit ( AST ast ) { } ASTNode clone ( AST target ) { } public boolean subtreeMatch ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public PackageDeclaration getPackage ( ) { } public void setPackage ( PackageDeclaration pkgDecl ) { } public List imports ( ) { } public List types ( ) { } public ASTNode findDeclaringNode ( IBinding binding ) { } public int lineNumber ( int position ) { int length = lineEndTable . length ; if ( length == 0 ) { return 1 ; } int low = 0 ; if ( position <= ( lineEndTable [ low ] ) ) { return 1 ; } int hi = length - 1 ; if ( position > ( lineEndTable [ hi ] ) ) { <START_BUG> return length ; <END_BUG> } while ( true ) { if ( ( low + 1 ) == hi ) { return low + 2 ; } int mid = ( low + hi ) // 2 ; if ( position <= ( lineEndTable [ mid ] ) ) { hi = mid ; } else { low = mid ; } } } public Message [ ] getMessages ( ) { } void setMessages ( Message [ ] messages ) { } void appendDebugString ( StringBuffer buffer ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
return length + 1 ;
Buggy code:
public final class FastSineTransformerTest { @ Test public void testAdHocData ( ) { FastSineTransformer transformer = FastSineTransformer . create ( ) ; double [ ] result ; double tolerance = 1.0E-12 ; double [ ] x = new double [ ] { 0.0 , 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 } ; double [ ] y = new double [ ] { 0.0 , 20.1093579685034 , - 9.65685424949238 , 5.98642305066196 , - 4.0 , 2.6727145516772 , - 1.65685424949238 , 0.795649469518633 } ; result = transformer . transform ( x ) ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { Assert . assertEquals ( y [ i ] , result [ i ] , tolerance ) ; } result = transformer . inverseTransform ( y ) ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { Assert . assertEquals ( x [ i ] , result [ i ] , tolerance ) ; } <START_BUG> FastFourierTransformer . scaleArray ( x , FastMath . sqrt ( ( ( x . length ) // 2.0 ) ) ) ; <END_BUG> transformer = FastSineTransformer . createOrthogonal ( ) ; result = transformer . transform ( y ) ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { Assert . assertEquals ( x [ i ] , result [ i ] , tolerance ) ; } result = transformer . inverseTransform ( x ) ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { Assert . assertEquals ( y [ i ] , result [ i ] , tolerance ) ; } } @ Test public void testSinFunction ( ) { } @ Test public void testParameters ( ) throws Exception { } }

Fix:
TransformUtils . scaleArray ( x , FastMath . sqrt ( ( ( x . length ) // 2.0 ) ) ) ;
Buggy code:
@ RunWith ( JUnit4TestRunner . class ) public class BlueprintContainer2BTCustomizerTest extends AbstractIntegrationTest { @ Test public void test ( ) throws Exception { ConfigurationAdmin ca = getOsgiService ( ConfigurationAdmin . class ) ; Configuration cf = ca . getConfiguration ( "blueprint-sample-placeholder" , null ) ; Hashtable props = new Hashtable ( ) ; props . put ( "key.b" , "10" ) ; cf . update ( props ) ; ServiceReference sr = bundleContext . getServiceReference ( "org.osgi.service.framework.CompositeBundleFactory" ) ; if ( sr != null ) { CompositeBundleFactory cbf = ( ( CompositeBundleFactory ) ( bundleContext . getService ( sr ) ) ) ; Map < String , String > frameworkConfig = new HashMap < String , String > ( ) ; Map < String , String > compositeManifest = new HashMap < String , String > ( ) ; compositeManifest . put ( Constants . BUNDLE_SYMBOLICNAME , "test-composite" ) ; compositeManifest . put ( Constants . BUNDLE_VERSION , "1.0.0" ) ; <START_BUG> compositeManifest . put ( Constants . IMPORT_PACKAGE , "org.osgi.service.blueprint.container" ) ; <END_BUG> compositeManifest . put ( Constants . EXPORT_PACKAGE , "org.apache.aries.blueprint.sample" ) ; CompositeBundle cb = cbf . installCompositeBundle ( frameworkConfig , "test-composite" , compositeManifest ) ; BundleContext compositeBundleContext = cb . getCompositeFramework ( ) . getBundleContext ( ) ; MavenArtifactProvisionOption mapo = mavenBundleInTest ( "org.apache.aries.blueprint" , "org.apache.aries.blueprint.sample" ) ; InputStream is = new URL ( mapo . getURL ( ) ) . openStream ( ) ; Bundle bundle = compositeBundleContext . installBundle ( mapo . getURL ( ) , is ) ; assertNotNull ( bundle ) ; cb . start ( ) ; bundle . start ( ) ; Bundle blueprintBundle = getInstalledBundle ( "org.apache.aries.blueprint" ) ; blueprintBundle . start ( ) ; Thread . sleep ( 2000 ) ; testBlueprintContainer ( compositeBundleContext , bundle ) ; bundleContext . ungetService ( sr ) ; } } @ org . ops4j . pax . exam . junit . Configuration public static Option [ ] configuration ( ) { } }

Fix:
compositeManifest . put ( Constants . IMPORT_PACKAGE , "org.osgi.service.blueprint;version=\"[1.0.0,2.0.0)\",<seq2seq4repair_space>org.osgi.service.blueprint.container;version=1.0" ) ;
Buggy code:
class SuffixBasedNodeLocator implements NodeLocator { private final List < MemcachedNode > _nodes ; private final MemcachedNodesManager _memcachedNodesManager ; private final Map < String , MemcachedNode > _nodesMap ; private final SessionIdFormat _sessionIdFormat ; public SuffixBasedNodeLocator ( final List < MemcachedNode > nodes , final MemcachedNodesManager memcachedNodesManager , final SessionIdFormat sessionIdFormat ) { } @ Override public void updateLocator ( final List < MemcachedNode > nodes , final Config conf ) { } @ Override public Collection < MemcachedNode > getAll ( ) { } @ Override public MemcachedNode getPrimary ( final String key ) { } private String getNodeId ( final String key ) { final String nodeId = _sessionIdFormat . extractMemcachedId ( key ) ; if ( ! ( _sessionIdFormat . isBackupKey ( key ) ) ) { return nodeId ; } <START_BUG> return _memcachedNodesManager . getNextPrimaryNodeId ( nodeId ) ; <END_BUG> } @ Override public Iterator < MemcachedNode > getSequence ( final String key ) { } @ Override public NodeLocator getReadonlyCopy ( ) { } static class MyMemcachedNodeROImpl implements MemcachedNode { private final MemcachedNode _root ; public MyMemcachedNodeROImpl ( final MemcachedNode node ) { } @ Override public String toString ( ) { } @ Override public void addOp ( final Operation op ) { } @ Override public void connected ( ) { } @ Override public void copyInputQueue ( ) { } @ Override public void fillWriteBuffer ( final boolean optimizeGets ) { } @ Override public void fixupOps ( ) { } @ Override public int getBytesRemainingToWrite ( ) { } @ Override public SocketChannel getChannel ( ) { } @ Override public Operation getCurrentReadOp ( ) { } @ Override public Operation getCurrentWriteOp ( ) { } @ Override public ByteBuffer getRbuf ( ) { } @ Override public int getReconnectCount ( ) { } @ Override public int getSelectionOps ( ) { } @ Override public SelectionKey getSk ( ) { } @ Override public SocketAddress getSocketAddress ( ) { } @ Override public ByteBuffer getWbuf ( ) { } @ Override public boolean hasReadOp ( ) { } @ Override public boolean hasWriteOp ( ) { } @ Override public boolean isActive ( ) { } @ Override public void reconnecting ( ) { } @ Override public void registerChannel ( final SocketChannel ch , final SelectionKey selectionKey ) { } @ Override public Operation removeCurrentReadOp ( ) { } @ Override public Operation removeCurrentWriteOp ( ) { } @ Override public void setChannel ( final SocketChannel to ) { } @ Override public void setSk ( final SelectionKey to ) { } @ Override public void setupResend ( ) { } @ Override public void transitionWriteItem ( ) { } @ Override public int writeSome ( ) throws IOException { } @ Override public Collection < Operation > destroyInputQueue ( ) { } @ Override public void authComplete ( ) { } @ Override public void insertOp ( final Operation arg0 ) { } @ Override public void setupForAuth ( ) { } @ Override public void setContinuousTimeout ( final boolean b ) { } @ Override public int getContinuousTimeout ( ) { } } }

Fix:
return _memcachedNodesManager . getNextAvailableNodeId ( nodeId ) ;
Buggy code:
public class CollectionSummaryIndividualPresenter extends PresenterWidget < IsCollectionSummaryIndividualView > implements CollectionSummaryIndividualUiHandlers { @ Inject private AnalyticsServiceAsync analyticService ; private String collectionId ; private String classpageId ; private String pathwayId ; private String userId ; private String sessionId ; private boolean isSummary ; @ Inject public CollectionSummaryIndividualPresenter ( EventBus eventBus , IsCollectionSummaryIndividualView view ) { } public AnalyticsServiceAsync getAnalyticService ( ) { } public void setAnalyticService ( AnalyticsServiceAsync analyticService ) { } @ Override public void setIndividualData ( String collectionId , String classpageId , String userId , String sessionId , String pathwayId , boolean isSummary , final HTMLPanel loadingImage , final PrintUserDataDO printUserDataDO ) { } @ Override public void setHtmltopdf ( String htmlString , String fileName , final boolean isClickedOnEmail ) { <START_BUG> this . analyticService . setHTMLtoPDF ( htmlString , fileName , new com . google . gwt . user . client . rpc . AsyncCallback < String > ( ) { <END_BUG> @ Override public void onSuccess ( String result ) { if ( isClickedOnEmail ) { getView ( ) . setPdfForEmail ( result ) ; } else { System . out . println ( ( "result::" + result ) ) ; getView ( ) . getFrame ( ) . setUrl ( result ) ; } } @ Override public void onFailure ( Throwable caught ) { } } ) ; } @ Override public void setOEtextData ( final String resourceGooruId , final String questionType ) { } @ Override public void setNoDataMessage ( HTMLPanel loadingImage ) { } @ Override public void clearFrame ( ) { } }

Fix:
this . analyticService . setHTMLtoPDF ( htmlString , fileName , isClickedOnEmail , new com . google . gwt . user . client . rpc . AsyncCallback < String > ( ) {
Buggy code:
public class RiskBoard { private List < Territory > territories ; private List < Colors > players ; private Dictionary reserves ; public RiskBoard ( ) { } public RiskBoard ( String fileName ) { } public void attack ( String attacker , String defender , int num ) { } public void attack ( String attacker , String defender ) { } private int [ ] getRolls ( int num ) { } private static int rollDice ( int i ) { } public void moveTroops ( String from , String to , int num ) { } public void addTerritory ( Territory terra ) { } public List < Territory > getTerritories ( ) { } public void setFaction ( String territory , Colors faction ) { } public Colors getFaction ( String territory ) { } public void changeTroops ( String territory , int num ) { } public int getTroops ( String territory ) { } public List < Territory > getConnections ( String territory ) { } public void setPlayerList ( ArrayList < Colors > players ) { <START_BUG> for ( player $missing$ : players ) { <END_BUG> this . players . addPlayer ( player ) ; } } public List < Colors > getPlayerList ( ) { } public void addPlayer ( Colors player ) { } public Dictionary getReserves ( ) { } }

Fix:
for ( Colors player : players ) {
Buggy code:
public class SessionServiceImpl implements SessionService { private LRUBuilderCache cache ; public SessionServiceImpl ( ) { } @ Inject public SessionServiceImpl ( final LRUBuilderCache cache ) { } @ Override public KieSession newKieSession ( KieProject project , String ksessionName ) { } @ Override public KieSession newDefaultKieSessionWithPseudoClock ( final KieProject project ) { final Builder builder = cache . assertBuilder ( project ) ; KieContainer kieContainer = builder . getKieContainer ( ) ; if ( kieContainer == null ) { return null ; } <START_BUG> final SessionConfiguration conf = new SessionConfiguration ( ) ; <END_BUG> conf . setClockType ( PSEUDO_CLOCK ) ; return kieContainer . getKieBase ( ) . newKieSession ( conf , null ) ; } }

Fix:
final SessionConfiguration conf = SessionConfiguration . newInstance ( ) ;
Buggy code:
public class Resources { private EntityManagerFactory entityManagerFactory = null ; private static Properties resourceProperties = null ; private static final Resources instance ; private Resources ( ) { } public static Resources getInstance ( ) { } public EntityManagerFactory getEntityManagerFactory ( ) { } public EntityManagerFactory getEntityManagerFactory ( String persistenceUnitName ) { } public EntityManagerFactory getEntityManagerFactory ( Map < String , String > properties ) { String persistenceUnitName = Resources . resourceProperties . getProperty ( "uk.ac.ebi.fg.models.persistenceUnit" , "ebiFgModelsPersistenceUnit" ) ; <START_BUG> return getEntityManagerFactory ( persistenceUnitName , null ) ; <END_BUG> } public EntityManagerFactory getEntityManagerFactory ( String persistenceUnitName , Map < String , String > properties ) { } @ Override protected void finalize ( ) throws Throwable { } }

Fix:
return getEntityManagerFactory ( persistenceUnitName , properties ) ;
Buggy code:
public class MarkerSelectorActivity extends ActionBarActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { <START_BUG> getMenuInflater ( ) . inflate ( main , menu ) ; <END_BUG> restoreActionBar ( ) ; return true ; } public void restoreActionBar ( ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
getMenuInflater ( ) . inflate ( marker_selector , menu ) ;
Buggy code:
@ Override public void run ( ) { DefaultTransactionalStreamDataBatchProcessing . logger . debug ( "[{}]<seq2seq4repair_space>Start<seq2seq4repair_space>running:<seq2seq4repair_space>{}" , processorId , state ) ; List < StreamDataSupplierWithIdAndRange < M , ? > > localSuppliers = new java . util . ArrayList ( suppliers . size ( ) ) ; localSuppliers . addAll ( suppliers ) ; boolean [ ] outOfRangeReached = new boolean [ localSuppliers . size ( ) ] ; Random random = new Random ( ) ; int partition = random . nextInt ( outOfRangeReached . length ) ; ProcessingContextImpl context = new ProcessingContextImpl ( txCoordinator ) ; boolean sticky = false ; while ( ! ( state . compareAndSet ( STOPPING , STOPPED ) ) ) { if ( ! ( localSuppliers . equals ( suppliers ) ) ) { localSuppliers . clear ( ) ; localSuppliers . addAll ( suppliers ) ; outOfRangeReached = new boolean [ localSuppliers . size ( ) ] ; partition = partition % ( outOfRangeReached . length ) ; } while ( ( state . get ( ) ) == ( State . RUNNING ) ) { if ( allProcessed ( outOfRangeReached ) ) { state . set ( FINISHED ) ; break ; } long startTime = System . currentTimeMillis ( ) ; int attempts = 0 ; SequentialTransaction transaction = null ; String seriesId = null ; StreamDataSupplierWithIdAndRange < M , ? > supplierWithIdAndRange = null ; StreamDataSupplier < M > supplier = null ; <START_BUG> boolean newSticky = ( ( ( processorOptions . stickyMode ) == ( DefaultTransactionalStreamDataBatchProcessing . Options . STICKY_WHEN_OPEN_RANGE_SUCCEEDED ) ) && ( context . isOpenRangeSuccessfullyClosed ) ) || ( ( ( processorOptions . stickyMode ) == ( DefaultTransactionalStreamDataBatchProcessing . Options . STICKY_WHEN_OPEN_RANGE_SUCCEEDED_OR_NO_DATA ) ) && ( context . isOpenRangeAbortedBecauseNothingReceived ) ) ; <END_BUG>

Fix:
boolean newSticky = ( ( ( processorOptions . stickyMode ) == ( DefaultTransactionalStreamDataBatchProcessing . Options . STICKY_WHEN_OPEN_RANGE_SUCCEEDED ) ) && ( context . isOpenRangeSuccessfullyClosed ) ) || ( ( ( processorOptions . stickyMode ) == ( DefaultTransactionalStreamDataBatchProcessing . Options . STICKY_WHEN_OPEN_RANGE_SUCCEEDED_OR_NO_DATA ) ) && ( ( context . isOpenRangeSuccessfullyClosed ) || ( context . isOpenRangeAbortedBecauseNothingReceived ) ) ) ;
Buggy code:
public class TestMultiValuedNumericRangeQuery extends LuceneTestCase { public void testMultiValuedNRQ ( ) throws Exception { Directory directory = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random , directory , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ) ) . setMaxBufferedDocs ( _TestUtil . nextInt ( random , 50 , 1000 ) ) ) ; DecimalFormat format = new DecimalFormat ( "00000000000" , new DecimalFormatSymbols ( Locale . US ) ) ; int num = atLeast ( 500 ) ; for ( int l = 0 ; l < num ; l ++ ) { Document doc = new Document ( ) ; for ( int m = 0 , c = random . nextInt ( 10 ) ; m <= c ; m ++ ) { int value = random . nextInt ( Integer . MAX_VALUE ) ; doc . add ( newField ( "asc" , format . format ( value ) , TYPE_UNSTORED ) ) ; <START_BUG> doc . add ( new NumericField ( "trie" ) . setIntValue ( value ) ) ; <END_BUG> } writer . addDocument ( doc ) ; } IndexReader reader = writer . getReader ( ) ; writer . close ( ) ; IndexSearcher searcher = newSearcher ( reader ) ; num = atLeast ( 50 ) ; for ( int i = 0 ; i < num ; i ++ ) { int lower = random . nextInt ( Integer . MAX_VALUE ) ; int upper = random . nextInt ( Integer . MAX_VALUE ) ; if ( lower > upper ) { int a = lower ; lower = upper ; upper = a ; } TermRangeQuery cq = TermRangeQuery . newStringRange ( "asc" , format . format ( lower ) , format . format ( upper ) , true , true ) ; NumericRangeQuery < Integer > tq = NumericRangeQuery . newIntRange ( "trie" , lower , upper , true , true ) ; TopDocs trTopDocs = searcher . search ( cq , 1 ) ; TopDocs nrTopDocs = searcher . search ( tq , 1 ) ; assertEquals ( "Returned<seq2seq4repair_space>count<seq2seq4repair_space>for<seq2seq4repair_space>NumericRangeQuery<seq2seq4repair_space>and<seq2seq4repair_space>TermRangeQuery<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>equal" , trTopDocs . totalHits , nrTopDocs . totalHits ) ; } reader . close ( ) ; directory . close ( ) ; } }

Fix:
doc . add ( new NumericField ( "trie" , value ) ) ;
Buggy code:
public class SplashStart extends Activity { private static int SPLASH_TIME_OUT = 2000 ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_splash_screen ) ; new Handler ( ) . postDelayed ( new Runnable ( ) { @ Override public void run ( ) { <START_BUG> Intent i = new Intent ( SplashStart . this , MainMenu . class ) ; <END_BUG> startActivity ( i ) ; finish ( ) ; } } , SplashStart . SPLASH_TIME_OUT ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void sendMessage ( View view ) { } }

Fix:
Intent i = new Intent ( SplashStart . this , REG_1 . class ) ;