nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CacheWriteAttributeHandler implements SelfRegisteringAttributeHandler , OperationStepHandler { static final SelfRegisteringAttributeHandler CACHE_ATTR = new CacheWriteAttributeHandler ( CommonAttributes . CACHE_ATTRIBUTES ) ; static final SelfRegisteringAttributeHandler CLUSTERED_CACHE_ATTR = new CacheWriteAttributeHandler ( CommonAttributes . CLUSTERED_CACHE_ATTRIBUTES ) ; static final SelfRegisteringAttributeHandler DISTRIBUTED_CACHE_ATTR = new CacheWriteAttributeHandler ( CommonAttributes . DISTRIBUTED_CACHE_ATTRIBUTES ) ; public static final CacheWriteAttributeHandler INSTANCE = new CacheWriteAttributeHandler ( ) ; private final ParametersValidator nameValidator = new ParametersValidator ( ) ; private final Map < String , AttributeDefinition > attributeDefinitions ; private CacheWriteAttributeHandler ( final AttributeDefinition ... definitions ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } protected boolean requiresRuntime ( OperationContext context ) { } protected AttributeDefinition getAttributeDefinition ( final String attributeName ) { } public void registerAttributes ( final ManagementResourceRegistration registry ) { final EnumSet < AttributeAccess . Flag > flags = EnumSet . of ( RESTART_ALL_SERVICES ) ; for ( AttributeDefinition attr : attributeDefinitions . values ( ) ) { <START_BUG> registry . registerReadWriteAttribute ( attr . getName ( ) , CacheReadAttributeHandler . INSTANCE , this , flags ) ; <END_BUG> } } public static CacheMode getCacheMode ( ModelNode operation ) { } }

Fix:
registry . registerReadWriteAttribute ( attr , CacheReadAttributeHandler . INSTANCE , this ) ;
Buggy code:
public class CommandGetApplicationIdFromApplicationTokenId extends HystrixCommand < String > { private static final Logger log = LoggerFactory . getLogger ( CommandGetApplicationIdFromApplicationTokenId . class ) ; private final URI tokenServiceUri ; private final String applicationTokenId ; public CommandGetApplicationIdFromApplicationTokenId ( URI tokenServiceUri , String applicationTokenId ) { } @ Override protected String run ( ) { CommandGetApplicationIdFromApplicationTokenId . log . trace ( "ComandGetApplicationIDFromApplicationTokenId<seq2seq4repair_space>-<seq2seq4repair_space>uri={}<seq2seq4repair_space>applicationTokenId={}" , tokenServiceUri . toString ( ) , applicationTokenId ) ; if ( ( ( applicationTokenId ) == null ) || ( ( applicationTokenId . length ( ) ) < 4 ) ) { CommandGetApplicationIdFromApplicationTokenId . log . warn ( "ComandGetApplicationIDFromApplicationTokenId<seq2seq4repair_space>-<seq2seq4repair_space>Null<seq2seq4repair_space>or<seq2seq4repair_space>too<seq2seq4repair_space>short<seq2seq4repair_space>applicationTokenId={}.<seq2seq4repair_space>return<seq2seq4repair_space>false" , applicationTokenId ) ; return null ; } Client tokenServiceClient = ClientBuilder . newClient ( ) ; WebTarget verifyResource = tokenServiceClient . target ( tokenServiceUri ) . path ( applicationTokenId ) . path ( "get_application_id" ) ; Response response = verifyResource . request ( ) . get ( Response . class ) ; if ( ( response . getStatus ( ) ) == ( OK . getStatusCode ( ) ) ) { CommandGetApplicationIdFromApplicationTokenId . log . info ( "ComandGetApplicationIDFromApplicationTokenId<seq2seq4repair_space>-<seq2seq4repair_space>ApplicationTokenId<seq2seq4repair_space>authentication<seq2seq4repair_space>for<seq2seq4repair_space>{}:<seq2seq4repair_space>{}<seq2seq4repair_space>{}" , verifyResource . getUri ( ) . toString ( ) , response . getStatusInfo ( ) . getStatusCode ( ) , response . getStatusInfo ( ) . getReasonPhrase ( ) ) ; <START_BUG> return response . toString ( ) ; <END_BUG> } if ( ( response . getStatus ( ) ) == ( CONFLICT . getStatusCode ( ) ) ) { CommandGetApplicationIdFromApplicationTokenId . log . warn ( "ComandGetApplicationIDFromApplicationTokenId<seq2seq4repair_space>-<seq2seq4repair_space>ApplicationTokenId<seq2seq4repair_space>authentication<seq2seq4repair_space>for<seq2seq4repair_space>{}:<seq2seq4repair_space>{}<seq2seq4repair_space>{}" , verifyResource . getUri ( ) . toString ( ) , response . getStatusInfo ( ) . getStatusCode ( ) , response . getStatusInfo ( ) . getReasonPhrase ( ) ) ; } return null ; } @ Override protected String getFallback ( ) { } }

Fix:
return response . readEntity ( String . class ) ;
Buggy code:
public class FieldAccess extends Expression { public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor ( FieldAccess . class , "expression" , Expression . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( FieldAccess . class , "name" , SimpleName . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Expression expression = null ; private SimpleName fieldName = null ; FieldAccess ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { FieldAccess result = new FieldAccess ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setExpression ( ( ( Expression ) ( getExpression ( ) . clone ( target ) ) ) ) ; result . setName ( ( ( SimpleName ) ( getName ( ) . clone ( target ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Expression getExpression ( ) { } public void setExpression ( Expression expression ) { } public SimpleName getName ( ) { } public void setName ( SimpleName fieldName ) { } int memSize ( ) { } public IVariableBinding resolveFieldBinding ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class DrawPhase extends AbstractState { @ Override public void drawOpen ( final IController controller ) { <START_BUG> if ( ( controller . getDiscardPile ( ) . size ( ) ) > 0 ) { <END_BUG> controller . drawOpenCard ( ) ; } } @ Override public void drawHidden ( final IController controller ) { } @ Override public String toString ( ) { } }

Fix:
if ( ! ( controller . getDiscardPile ( ) . isEmpty ( ) ) ) {
Buggy code:
public class SplitFunction extends AbstractFunction { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final List < String > desc = new LinkedList < String > ( ) ; private static final String KEY = "__split" ; private static final int MIN_PARAMETER_COUNT = 2 ; private static final int MAX_PARAMETER_COUNT = 3 ; private Object [ ] values ; public SplitFunction ( ) { } @ Override public synchronized String execute ( SampleResult previousResult , Sampler currentSampler ) throws InvalidVariableException { JMeterVariables vars = getVariables ( ) ; String stringToSplit = ( ( CompoundVariable ) ( values [ 0 ] ) ) . execute ( ) ; String varNamePrefix = ( ( CompoundVariable ) ( values [ 1 ] ) ) . execute ( ) . trim ( ) ; String splitString = "," ; if ( ( values . length ) > 2 ) { splitString = ( ( CompoundVariable ) ( values [ 2 ] ) ) . execute ( ) ; } if ( SplitFunction . log . isDebugEnabled ( ) ) { SplitFunction . log . debug ( ( ( ( ( ( "Split<seq2seq4repair_space>" + stringToSplit ) + "<seq2seq4repair_space>using<seq2seq4repair_space>" ) + splitString ) + "<seq2seq4repair_space>into<seq2seq4repair_space>" ) + varNamePrefix ) ) ; } String [ ] parts = JOrphanUtils . split ( stringToSplit , splitString , "?" ) ; vars . put ( varNamePrefix , stringToSplit ) ; <START_BUG> vars . put ( ( varNamePrefix + "_n" ) , ( "" + ( parts . length ) ) ) ; <END_BUG> for ( int i = 1 ; i <= ( parts . length ) ; i ++ ) { if ( SplitFunction . log . isDebugEnabled ( ) ) { SplitFunction . log . debug ( parts [ ( i - 1 ) ] ) ; } vars . put ( ( ( varNamePrefix + "_" ) + i ) , parts [ ( i - 1 ) ] ) ; } vars . remove ( ( ( varNamePrefix + "_" ) + ( ( parts . length ) + 1 ) ) ) ; return stringToSplit ; } @ Override public synchronized void setParameters ( Collection < CompoundVariable > parameters ) throws InvalidVariableException { } @ Override public String getReferenceKey ( ) { } public List < String > getArgumentDesc ( ) { } }

Fix:
vars . put ( ( varNamePrefix + "_n" ) , Integer . toString ( parts . length ) ) ;
Buggy code:
public class Variance extends AbstractStorelessUnivariateStatistic implements Serializable , WeightedEvaluation { private static final long serialVersionUID = - 9111962718267217978L ; protected SecondMoment moment = null ; protected boolean incMoment = true ; private boolean isBiasCorrected = true ; public Variance ( ) { } public Variance ( final SecondMoment m2 ) { } public Variance ( boolean isBiasCorrected ) { } public Variance ( boolean isBiasCorrected , SecondMoment m2 ) { } public Variance ( Variance original ) { } @ Override public void increment ( final double d ) { } @ Override public double getResult ( ) { } public long getN ( ) { } @ Override public void clear ( ) { } @ Override public double evaluate ( final double [ ] values ) { } @ Override public double evaluate ( final double [ ] values , final int begin , final int length ) { } public double evaluate ( final double [ ] values , final double [ ] weights , final int begin , final int length ) { } public double evaluate ( final double [ ] values , final double [ ] weights ) { } public double evaluate ( final double [ ] values , final double mean , final int begin , final int length ) { } public double evaluate ( final double [ ] values , final double mean ) { } public double evaluate ( final double [ ] values , final double [ ] weights , final double mean , final int begin , final int length ) { double var = Double . NaN ; if ( test ( values , weights , begin , length ) ) { if ( length == 1 ) { var = 0.0 ; } else if ( length > 1 ) { double accum = 0.0 ; double dev = 0.0 ; double accum2 = 0.0 ; for ( int i = begin ; i < ( begin + length ) ; i ++ ) { dev = ( values [ i ] ) - mean ; accum += ( weights [ i ] ) * ( dev * dev ) ; accum2 += ( weights [ i ] ) * dev ; } double sumWts = 0 ; <START_BUG> for ( int i = 0 ; i < ( weights . length ) ; i ++ ) { <END_BUG> sumWts += weights [ i ] ; } if ( isBiasCorrected ) { var = ( accum - ( ( accum2 * accum2 ) // sumWts ) ) // ( sumWts - 1.0 ) ; } else { var = ( accum - ( ( accum2 * accum2 ) // sumWts ) ) // sumWts ; } } } return var ; } public double evaluate ( final double [ ] values , final double [ ] weights , final double mean ) { } public boolean isBiasCorrected ( ) { } public void setBiasCorrected ( boolean biasCorrected ) { } @ Override public Variance copy ( ) { } public static void copy ( Variance source , Variance dest ) throws NullArgumentException { } }

Fix:
for ( int i = begin ; i < ( begin + length ) ; i ++ ) {
Buggy code:
public class Theories extends BlockJUnit4ClassRunner { public Theories ( Class < ? > klass ) throws InitializationError { } @ Override protected void collectInitializationErrors ( List < Throwable > errors ) { } @ Override protected List < FrameworkMethod > computeTestMethods ( ) { } @ Override public Statement childBlock ( final FrameworkMethod method ) { } public class TheoryAnchor extends Statement { private int successes = 0 ; private FrameworkMethod fTestMethod ; private List < AssumptionViolatedException > fInvalidParameters = new ArrayList < AssumptionViolatedException > ( ) ; public TheoryAnchor ( FrameworkMethod method ) { } @ Override public void evaluate ( ) throws Throwable { } protected void runWithAssignment ( Assignments parameterAssignment ) throws Throwable { } protected void runWithIncompleteAssignment ( Assignments incomplete ) throws IllegalAccessException , InstantiationException , Throwable { } protected void runWithCompleteAssignment ( final Assignments complete ) throws IllegalAccessException , InstantiationException , NoSuchMethodException , Throwable , InvocationTargetException { <START_BUG> new BlockJUnit4ClassRunner ( getTestClass ( ) ) { <END_BUG> @ Override protected void collectInitializationErrors ( List < Throwable > errors ) { } @ Override public Statement childBlock ( FrameworkMethod method ) { final Statement statement = super . childBlock ( method ) ; return new Statement ( ) { @ Override public void evaluate ( ) throws Throwable { try { statement . evaluate ( ) ; handleDataPointSuccess ( ) ; } catch ( AssumptionViolatedException e ) { handleAssumptionViolation ( e ) ; } catch ( Throwable e ) { reportParameterizedError ( e , complete . getArgumentStrings ( nullsOk ( ) ) ) ; } } } ; } @ Override protected Statement invoke ( FrameworkMethod method , Object test ) { return methodCompletesWithParameters ( method , complete , test ) ; } @ Override public Object createTest ( ) throws Exception { return getTestClass ( ) . getConstructor ( ) . newInstance ( complete . getConstructorArguments ( nullsOk ( ) ) ) ; } } . childBlock ( fTestMethod ) . evaluate ( ) ; } private Statement methodCompletesWithParameters ( final FrameworkMethod method , final Assignments complete , final Object freshInstance ) { } protected void handleAssumptionViolation ( AssumptionViolatedException e ) { } protected void reportParameterizedError ( Throwable e , Object ... params ) throws Throwable { } private boolean nullsOk ( ) { } protected void handleDataPointSuccess ( ) { } } }

Fix:
new BlockJUnit4ClassRunner ( getTestClass ( ) . getJavaClass ( ) ) {
Buggy code:
public abstract class DHistogram < TDH extends DHistogram > extends Iced { public final transient String _name ; public final byte _isInt ; public final char _nbin ; public final float _step ; public final float _min ; public final float _maxEx ; public int [ ] _bins ; protected float _min2 ; protected float _maxIn ; private static final Unsafe _unsafe = UtilUnsafe . getUnsafe ( ) ; private static final long _min2Offset ; private static final long _max2Offset ; public void setMin ( float min ) { } public void setMax ( float max ) { } private static int MAX_FACTOR_BINS = 1024 ; public DHistogram ( String name , final int nbins , final byte isInt , final float min , final float maxEx , long nelems ) { } abstract boolean isBinom ( ) { } int bin ( float col_data ) { } float binAt ( int b ) { } public int nbins ( ) { } public int bins ( int b ) { } public float mins ( int b ) { } public float maxsIn ( int b ) { } public abstract double mean ( int b ) { } public abstract double var ( int b ) { } abstract void init0 ( ) { } final void init ( ) { } abstract void incr0 ( int b , float y ) { } final void incr ( float col_data , float y ) { } abstract void add0 ( TDH dsh ) { } void add ( TDH dsh ) { } public float find_min ( ) { } public float find_maxIn ( ) { } public float find_maxEx ( ) { } public static float find_maxEx ( float maxIn , int isInt ) { } public abstract Split scoreMSE ( int col , int min_rows ) { } public static DHistogram [ ] initialHist ( Frame fr , int ncols , int nbins , DHistogram [ ] hs , boolean isBinom ) { } public static DHistogram make ( String name , final int nbins , byte isInt , float min , float maxEx , long nelems , boolean isBinom ) { } public boolean isConstantResponse ( ) { double m = Double . NaN ; for ( int b = 0 ; b < ( _bins . length ) ; b ++ ) { if ( ( _bins [ b ] ) == 0 ) continue ; if ( ( var ( b ) ) > 1.0E-6 ) return false ; double mean = mean ( b ) ; if ( mean != m ) if ( Double . isNaN ( m ) ) m = mean ; else <START_BUG> if ( ( Math . abs ( ( m - mean ) ) ) > 1.0E-6 ) <END_BUG> return false ; } return true ; } @ Override public String toString ( ) { } public abstract long byteSize0 ( ) { } public long byteSize ( ) { } }

Fix:
if ( ( Math . abs ( ( m - mean ) ) ) > 1.0E-4 )
Buggy code:
public class TextSuggestion { public static final String DIRECTORY_SUGGESTION = "storage//resource//suggestion//" ; private SpellChecker spellChecker ; public TextSuggestion ( ) throws IOException { } public List < String > suggest ( String query ) throws IOException { <START_BUG> return Arrays . asList ( spellChecker . suggestSimilar ( query . toLowerCase ( ) , 5 ) ) ; <END_BUG> } }

Fix:
return Arrays . asList ( spellChecker . suggestSimilar ( query , 5 ) ) ;
Buggy code:
public class MatchAllDocsQueryNode extends QueryNodeImpl { private static final long serialVersionUID = - 7050381275423477809L ; public MatchAllDocsQueryNode ( ) { } @ Override public String toString ( ) { <START_BUG> return "<matchAllDocs<seq2seq4repair_space>field='*'<seq2seq4repair_space>term='*'>" ; <END_BUG> } public CharSequence toQueryString ( EscapeQuerySyntax escapeSyntaxParser ) { } @ Override public MatchAllDocsQueryNode cloneTree ( ) throws CloneNotSupportedException { } }

Fix:
return "<matchAllDocs<seq2seq4repair_space>field='*'<seq2seq4repair_space>term='*'//>" ;
Buggy code:
@ RestController @ RequestMapping ( "//user" ) public class UserController { private static Logger logger = Logger . getLogger ( UserController . class ) ; @ Autowired private SystemService systemService ; @ RequestMapping ( value = "" , method = RequestMethod . GET , produces = MediaTypes . JSON_UTF_8 ) public Map < String , Object > getUserInfoList ( @ RequestParam int pageNo , @ RequestParam int pageSize ) { BasicReturnedJson result = new BasicReturnedJson ( ) ; <START_BUG> Page < User > userPage = new Page < User > ( pageNo , ( pageSize - 1 ) ) ; <END_BUG> List < User > userList = systemService . findUser ( userPage , new User ( ) ) . getList ( ) ; for ( User user : userList ) { if ( user != null ) { result . addEntity ( getUserMapFromUser ( user ) ) ; result . setErrno ( OK . value ( ) ) ; result . setError ( OK . name ( ) ) ; } else { result . setErrno ( NOT_FOUND . value ( ) ) ; result . setError ( NOT_FOUND . name ( ) ) ; break ; } } return result . getMap ( ) ; } @ RequestMapping ( value = "//{uid}" , method = RequestMethod . GET , produces = MediaTypes . JSON_UTF_8 ) public Map < String , Object > getUserInfoFromUserId ( @ PathVariable ( "uid" ) int uid ) { } @ RequestMapping ( value = "//{uid}" , method = RequestMethod . PUT , produces = MediaTypes . JSON_UTF_8 ) public Map < String , Object > updateUserInfoFromUserId ( @ PathVariable ( "uid" ) int uid , @ RequestParam ( "name" ) String name , @ RequestParam ( "photo_url" ) String photoUrl ) { } @ RequestMapping ( value = "//{uid}//password" , method = RequestMethod . PUT , produces = MediaTypes . JSON_UTF_8 ) public Map < String , Object > updateUserPasswordFromUserId ( @ PathVariable ( "uid" ) int uid , @ RequestParam ( "old_password" ) String oldPassword , @ RequestParam ( "new_password" ) String newPassword ) { } private Map < String , Object > getUserMapFromUser ( User user ) { } }

Fix:
Page < User > userPage = new Page < User > ( pageNo , pageSize ) ;
Buggy code:
public class Win32Provider extends Provider { public Win32Provider ( ImgMap plugin ) { } @ Override public void execute ( String video , File file ) { <START_BUG> startProcess ( buildProcess ( ) . command ( generateArguments ( video , file , ( ( video . indexOf ( '.' ) ) != ( - 1 ) ) ) ) ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
startProcess ( buildProcess ( ) . command ( generateArguments ( video , file , ( ( video . indexOf ( '.' ) ) == ( - 1 ) ) ) ) ) ;
Buggy code:
public class App { public static void main ( String [ ] args ) { <START_BUG> out . println ( "Hello<seq2seq4repair_space>World!" ) ; <END_BUG> } }

Fix:
System . out . println ( "Hello<seq2seq4repair_space>World!" ) ;
Buggy code:
public class Button extends FormComponent { private static final long serialVersionUID = 1L ; private boolean defaultFormProcessing = true ; public Button ( String id ) { } public Button ( final String id , final IModel object ) { } public final boolean getDefaultFormProcessing ( ) { } public final Button setDefaultFormProcessing ( boolean defaultFormProcessing ) { } public void updateModel ( ) { } protected String getOnClickScript ( ) { } protected void onComponentTag ( final ComponentTag tag ) { super . onComponentTag ( tag ) ; try { <START_BUG> String value = getValue ( ) ; <END_BUG> if ( ( value != null ) && ( ! ( "" . equals ( value ) ) ) ) { tag . put ( "value" , value ) ; } } catch ( Exception e ) { } final String onClickJavaScript = getOnClickScript ( ) ; if ( onClickJavaScript != null ) { tag . put ( "onclick" , onClickJavaScript ) ; } } protected void onSubmit ( ) { } }

Fix:
String value = getModelObjectAsString ( ) ;
Buggy code:
public class TestCompoundWordTokenFilter extends BaseTokenStreamTestCase { private static CharArraySet makeDictionary ( String ... dictionary ) { } public void testHyphenationCompoundWordsDA ( ) throws Exception { } public void testHyphenationCompoundWordsDELongestMatch ( ) throws Exception { } public void testHyphenationOnly ( ) throws Exception { } public void testDumbCompoundWordsSE ( ) throws Exception { } public void testDumbCompoundWordsSELongestMatch ( ) throws Exception { } public void testTokenEndingWithWordComponentOfMinimumLength ( ) throws Exception { } public void testWordComponentWithLessThanMinimumLength ( ) throws Exception { } public void testReset ( ) throws Exception { } public void testRetainMockAttribute ( ) throws Exception { } public static interface MockRetainAttribute extends Attribute { void setRetain ( boolean attr ) { } boolean getRetain ( ) { } } public static final class MockRetainAttributeImpl extends AttributeImpl implements TestCompoundWordTokenFilter . MockRetainAttribute { private boolean retain = false ; @ Override public void clear ( ) { } public boolean getRetain ( ) { } public void setRetain ( boolean retain ) { } @ Override public void copyTo ( AttributeImpl target ) { } } private static class MockRetainAttributeFilter extends TokenFilter { TestCompoundWordTokenFilter . MockRetainAttribute retainAtt = addAttribute ( TestCompoundWordTokenFilter . MockRetainAttribute . class ) ; MockRetainAttributeFilter ( TokenStream input ) { } @ Override public boolean incrementToken ( ) throws IOException { } } public void testInvalidOffsets ( ) throws Exception { final CharArraySet dict = TestCompoundWordTokenFilter . makeDictionary ( "fall" ) ; final NormalizeCharMap . Builder builder = new NormalizeCharMap . Builder ( ) ; builder . add ( "ü" , "ue" ) ; final NormalizeCharMap normMap = builder . build ( ) ; Analyzer analyzer = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { Tokenizer tokenizer = new MockTokenizer ( reader , MockTokenizer . WHITESPACE , false ) ; TokenFilter filter = new DictionaryCompoundWordTokenFilter ( TEST_VERSION_CURRENT , tokenizer , dict ) ; return new TokenStreamComponents ( tokenizer , filter ) ; } @ Override <START_BUG> protected Reader initReader ( Reader reader ) { <END_BUG> return new org . apache . lucene . analysis . charfilter . MappingCharFilter ( normMap , CharReader . get ( reader ) ) ; } } ; assertAnalyzesTo ( analyzer , "banküberfall" , new String [ ] { "bankueberfall" , "fall" } , new int [ ] { 0 , 0 } , new int [ ] { 12 , 12 } ) ; } public void testRandomStrings ( ) throws Exception { } public void testEmptyTerm ( ) throws Exception { } }

Fix:
protected Reader initReader ( String fieldName , Reader reader ) {
Buggy code:
public class NavigationDrawerFragment extends Fragment { private static final String STATE_SELECTED_POSITION = "selected_navigation_drawer_position" ; private static final String PREF_USER_LEARNED_DRAWER = "navigation_drawer_learned" ; private NavigationDrawerFragment . NavigationDrawerCallbacks mCallbacks ; private ActionBarDrawerToggle mDrawerToggle ; private DrawerLayout mDrawerLayout ; private ListView mDrawerListView ; private View mFragmentContainerView ; private int mCurrentSelectedPosition = 0 ; private boolean mFromSavedInstanceState ; private boolean mUserLearnedDrawer ; public NavigationDrawerFragment ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { mDrawerListView = ( ( ListView ) ( inflater . inflate ( fragment_navigation_drawer , container , false ) ) ) ; mDrawerListView . setOnItemClickListener ( new AdapterView . OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { selectItem ( position ) ; } } ) ; <START_BUG> mDrawerListView . setAdapter ( new android . widget . ArrayAdapter ( getActionBar ( ) . getThemedContext ( ) , layout . simple_list_item_activated_1 , id . text1 , new String [ ] { getString ( title_section1 ) , getString ( title_section2 ) , getString ( title_section_favoris ) , getString ( title_section_budget ) , getString ( title_section_nearby ) } ) ) ; <END_BUG> mDrawerListView . setItemChecked ( mCurrentSelectedPosition , true ) ; return mDrawerListView ; } public boolean isDrawerOpen ( ) { } public void setUp ( int fragmentId , DrawerLayout drawerLayout ) { } private void selectItem ( int position ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public void onDetach ( ) { } @ Override public void onSaveInstanceState ( Bundle outState ) { } @ Override public void onConfigurationChanged ( Configuration newConfig ) { } @ Override public void onCreateOptionsMenu ( Menu menu , MenuInflater inflater ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void showGlobalContextActionBar ( ) { } private ActionBar getActionBar ( ) { } public static interface NavigationDrawerCallbacks { void onNavigationDrawerItemSelected ( int position ) { } } public ActionBarDrawerToggle getToggle ( ) { } }

Fix:
mDrawerListView . setAdapter ( new android . widget . ArrayAdapter ( getActionBar ( ) . getThemedContext ( ) , layout . simple_list_item_activated_1 , id . text1 , new String [ ] { getString ( title_section1 ) , getString ( title_section2 ) , getString ( title_section_favorites ) , getString ( title_section_budget ) , getString ( title_section_nearby ) } ) ) ;
Buggy code:
@ Path ( "//project" ) public class ProjectService implements ServiceConstants { @ Context private ServletContext context ; @ POST @ Path ( "{projectID}" ) @ Consumes ( "application//json" ) @ Produces ( "application//json" ) public Response processProject ( @ PathParam ( "projectID" ) long projectID , String message , @ Context HttpServletRequest req ) { } @ POST @ Consumes ( "application//json" ) public Response createProject ( String message , @ Context HttpServletRequest req ) { } private Response executeProjectJob ( long projectID ) { try { ProjectDAO pDAO = DAOFactory . getProjectDAO ( ) ; Project project = pDAO . getProject ( projectID ) ; TransformProject projectInstance = new TransformProject ( ) ; new com . lumens . engine . serializer . ProjectSerializer ( projectInstance ) . readFromJson ( new ByteArrayInputStream ( project . data . getBytes ( ) ) ) ; List < ResultHandler > handlers = new ArrayList < > ( ) ; <START_BUG> handlers . add ( new DataElementLoggingHandler ( ) ) ; <END_BUG> ApplicationContext . get ( ) . getTransformEngine ( ) . execute ( new com . lumens . engine . run . SequenceTransformExecuteJob ( projectInstance , handlers ) ) ; JsonUtility utility = JsonUtility . createJsonUtility ( ) ; JsonGenerator json = utility . getGenerator ( ) ; json . writeStartObject ( ) ; json . writeStringField ( "status" , "OK" ) ; json . writeStringField ( "result_content" , "executing<seq2seq4repair_space>is<seq2seq4repair_space>invoked" ) ; json . writeEndObject ( ) ; return Response . ok ( ) . entity ( utility . toUTF8String ( ) ) . build ( ) ; } catch ( Exception ex ) { return ServerUtils . getErrorMessageResponse ( ex ) ; } } private Response createProject ( JsonNode contentJson ) { } private Response updateProject ( long projectID , JsonNode contentJson ) { } private Response activeProject ( long projectID , HttpServletRequest req ) { } @ GET @ Path ( "//result" ) @ Produces ( "application//json" ) public Response getProjectExecutionResults ( @ QueryParam ( "page" ) int page , @ Context HttpServletRequest req ) throws IOException { } @ GET @ Produces ( "application//json" ) public Response listProject ( @ QueryParam ( "page" ) int page , @ Context HttpServletRequest req ) throws IOException { } @ GET @ Path ( "{projectID}" ) @ Produces ( "application//json" ) public Response getProject ( @ PathParam ( "projectID" ) long projectID , @ Context HttpServletRequest req ) throws IOException { } @ GET @ Path ( "{projectID}//format" ) @ Produces ( "application//json" ) public Response getFormatFromComponent ( @ PathParam ( "projectID" ) long projectID , @ QueryParam ( "component_id" ) String componentId , @ QueryParam ( "format_name" ) String formatName , @ QueryParam ( "format_path" ) String formatPath , @ QueryParam ( "direction" ) String direction , @ Context HttpServletRequest req ) { } private Response deleteProject ( long projectID , HttpServletRequest req ) { } private Response deployProject ( long projectID , HttpServletRequest req ) { } }

Fix:
handlers . add ( new DataElementLoggingHandler ( projectID ) ) ;
Buggy code:
public class Untar extends Expand { private Untar . UntarCompressionMethod compression = new Untar . UntarCompressionMethod ( ) ; public void setCompression ( Untar . UntarCompressionMethod method ) { } public void setEncoding ( String encoding ) { } protected void expandFile ( FileUtils fileUtils , File srcF , File dir ) { } protected void expandResource ( Resource srcR , File dir ) { } private void expandStream ( String name , InputStream stream , File dir ) throws IOException { TarInputStream tis = null ; try { tis = new TarInputStream ( compression . decompress ( name , new BufferedInputStream ( stream ) ) ) ; log ( ( ( ( "Expanding:<seq2seq4repair_space>" + name ) + "<seq2seq4repair_space>into<seq2seq4repair_space>" ) + dir ) , MSG_INFO ) ; TarEntry te = null ; boolean empty = true ; FileNameMapper mapper = getMapper ( ) ; while ( ( te = tis . getNextEntry ( ) ) != null ) { empty = false ; extractFile ( FileUtils . getFileUtils ( ) , null , dir , tis , te . getName ( ) , te . getModTime ( ) , te . isDirectory ( ) , mapper ) ; } if ( empty && ( getFailOnEmptyArchive ( ) ) ) { <START_BUG> throw new BuildException ( "archive<seq2seq4repair_space>is<seq2seq4repair_space>empty" ) ; <END_BUG> } log ( "expand<seq2seq4repair_space>complete" , MSG_VERBOSE ) ; } finally { FileUtils . close ( tis ) ; } } public static final class UntarCompressionMethod extends EnumeratedAttribute { private static final String NONE = "none" ; private static final String GZIP = "gzip" ; private static final String BZIP2 = "bzip2" ; public UntarCompressionMethod ( ) { } public String [ ] getValues ( ) { } public InputStream decompress ( final String name , final InputStream istream ) throws IOException , BuildException { } } }

Fix:
throw new BuildException ( ( ( "archive<seq2seq4repair_space>'" + name ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>empty" ) ) ;
Buggy code:
@ WebServlet ( "//createaccount" ) public class CreateAccountServlet extends HttpServlet { private static final long serialVersionUID = 1L ; protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { request . setCharacterEncoding ( "UTF-8" ) ; String action = null ; String path = null ; action = request . getParameter ( "action" ) ; if ( action == null ) { path = ".//createaccount.jsp" ; } else if ( action . equals ( "create" ) ) { String login = request . getParameter ( "login" ) ; String password = request . getParameter ( "password" ) ; String confirm = request . getParameter ( "confirm" ) ; PreparedStatement statement = null ; try { statement = Database . getConnection ( ) . prepareStatement ( "SELECT<seq2seq4repair_space>login<seq2seq4repair_space>FROM<seq2seq4repair_space>users<seq2seq4repair_space>WHERE<seq2seq4repair_space>login<seq2seq4repair_space>=<seq2seq4repair_space>?" ) ; statement . setString ( 1 , login ) ; if ( statement . executeQuery ( ) . next ( ) ) { request . setAttribute ( "exists" , "true" ) ; path = ".//createaccount.jsp" ; request . getRequestDispatcher ( path ) . forward ( request , response ) ; return ; } else if ( ! ( password . equals ( confirm ) ) ) { request . setAttribute ( "passmismatch" , "true" ) ; path = ".//createaccount.jsp" ; request . getRequestDispatcher ( path ) . forward ( request , response ) ; return ; } else { <START_BUG> path = ".//index.jsp" ; <END_BUG> } } catch ( SQLException e ) { e . printStackTrace ( ) ; } UserDAO . addUser ( new User ( login , password ) ) ; HttpSession session = request . getSession ( ) ; session . setAttribute ( "login" , login ) ; session . setAttribute ( "itemCount" , 0 ) ; response . sendRedirect ( path ) ; } } }

Fix:
path = ".//list" ;
Buggy code:
public class LocalTimeAdapter extends XmlAdapter < String , LocalTime > { @ Override public String marshal ( final LocalTime localTime ) throws Exception { <START_BUG> return String . format ( "%s:%s" , localTime . getHour ( ) , localTime . getMinute ( ) ) ; <END_BUG> } @ Override public LocalTime unmarshal ( final String string ) throws Exception { } }

Fix:
return String . format ( "%02d:%02d" , localTime . getHour ( ) , localTime . getMinute ( ) ) ;
Buggy code:
public class ColognePhoneticTest extends StringEncoderAbstractTest < ColognePhonetic > { @ Override protected ColognePhonetic createStringEncoder ( ) { } @ Test public void testAabjoe ( ) throws EncoderException { } @ Test public void testAaclan ( ) throws EncoderException { } @ Test public void testAychlmajrForCodec122 ( ) throws EncoderException { } @ Test public void testEdgeCases ( ) throws EncoderException { } @ Test public void testExamples ( ) throws EncoderException { } @ Test public void testHyphen ( ) throws EncoderException { } @ Test public void testIsEncodeEquals ( ) { String [ ] [ ] data = new String [ ] [ ] { new String [ ] { "Meyer" , "Müller" } , new String [ ] { "Meyer" , "Mayr" } , new String [ ] { "house" , "house" } , new String [ ] { "House" , "house" } , new String [ ] { "Haus" , "house" } , new String [ ] { "ganz" , "Gans" } , new String [ ] { "ganz" , "Gänse" } , new String [ ] { "Miyagi" , "Miyako" } } ; for ( String [ ] element : data ) { <START_BUG> ( ( ColognePhonetic ) ( this . getStringEncoder ( ) ) ) . isEncodeEqual ( element [ 1 ] , element [ 0 ] ) ; <END_BUG> } } @ Test public void testVariationsMella ( ) throws EncoderException { } @ Test public void testVariationsMeyer ( ) throws EncoderException { } }

Fix:
this . getStringEncoder ( ) . isEncodeEqual ( element [ 1 ] , element [ 0 ] ) ;
Buggy code:
public class TestXmlns { public static void main ( String [ ] args ) { DocumentImpl document = new DocumentImpl ( ) ; <START_BUG> document . setEncoding ( "utf-8" ) ; <END_BUG> Element outerNode = document . createElement ( "outer" ) ; outerNode . setAttribute ( "xmlns" , "myuri:" ) ; document . appendChild ( outerNode ) ; Element innerNode = document . createElement ( "inner" ) ; outerNode . appendChild ( innerNode ) ; Writer writer = new StringWriter ( ) ; OutputFormat format = new OutputFormat ( ) ; format . setEncoding ( "utf-8" ) ; Serializer serializer = SerializerFactory . getSerializerFactory ( "xml" ) . makeSerializer ( writer , format ) ; try { serializer . asDOMSerializer ( ) . serialize ( document ) ; } catch ( IOException exception ) { exception . printStackTrace ( ) ; System . exit ( 1 ) ; } System . out . println ( "\n---XMLSerializer<seq2seq4repair_space>output---" ) ; System . out . println ( writer . toString ( ) ) ; System . out . println ( "\n---DOMWriter<seq2seq4repair_space>output---" ) ; DOMWriter domWriter = ( ( org . w3c . dom . ls . DOMImplementationLS ) ( org . apache . xerces . dom . DOMImplementationImpl . getDOMImplementation ( ) ) ) . createDOMWriter ( ) ; try { domWriter . writeNode ( System . out , document ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } }

Fix:
document . setXmlEncoding ( "utf-8" ) ;
Buggy code:
public class XMPPUserSearchManager extends AbstractUserSearchManager { protected static final String SERVICE_SEARCH = "search." ; protected ECFConnection ecfConnection ; protected Namespace connectNamespace ; protected ID connectedID ; protected Form form ; protected UserSearch manager ; protected boolean enabled ; protected ICriteria criteria ; protected static final String FORM_TYPE = "FORM_TYPE" ; protected static final String NAME = "name" ; protected static final String JID = "jid" ; protected static final String SEARCH_ACTION = "search" ; public XMPPUserSearchManager ( ) { } public ICriteria createCriteria ( ) { } public IRestriction createRestriction ( ) { } public ISearch search ( ICriteria criteria ) throws UserSearchException { } protected IResultList createResultList ( ReportedData data ) { } public void search ( final ICriteria criteria , final IUserSearchListener listener ) { Assert . isNotNull ( criteria ) ; Assert . isNotNull ( listener ) ; Job job = new Job ( Messages . XMPPUserSearchManager_JOB ) { protected IStatus run ( IProgressMonitor monitor ) { try { ISearch search = search ( criteria ) ; UserSearchCompleteEvent complete = new UserSearchCompleteEvent ( search ) ; listener . handleUserSearchEvent ( complete ) ; } catch ( UserSearchException e ) { log ( e . getLocalizedMessage ( ) , e ) ; <START_BUG> return Status . CANCEL_STATUS ; <END_BUG> } return Status . OK_STATUS ; } } ; job . schedule ( ) ; } public void setConnection ( Namespace connectNamespace , ID connectedID , ECFConnection connection ) { } public String [ ] getUserPropertiesFields ( ) throws ECFException { } public boolean isEnabled ( ) { } public void setEnabled ( boolean enabled ) { } public IUserSearchListener createUserSearchListener ( ) { } protected void log ( String msg , Throwable e ) { } public void fireUserSearchEvent ( IUserSearchEvent event ) { } class UserListener implements IUserSearchListener { public void handleUserSearchEvent ( IUserSearchEvent event ) { } } }

Fix:
return new Status ( IStatus . ERROR , XmppPlugin . PLUGIN_ID , IStatus . ERROR , "Exception<seq2seq4repair_space>in<seq2seq4repair_space>user<seq2seq4repair_space>search" , e ) ;
Buggy code:
public class CreateExecutor extends AbstractExecutor { public CreateExecutor ( JavaPlugin plugin , String permissionRoot , StylizedMessager messager ) { } protected boolean execute ( CommandSender sender , String [ ] args ) { if ( ( ( args . length ) != 2 ) && ( ( args . length ) != 3 ) ) { return false ; } String worldName = args [ 0 ] ; if ( worldExists ( worldName ) ) { getMessager ( ) . send ( sender , ( ( "World<seq2seq4repair_space>'" + worldName ) + "'<seq2seq4repair_space>already<seq2seq4repair_space>exists!" ) ) ; return false ; } Environment environment = null ; try { environment = Environment . valueOf ( args [ 1 ] . toUpperCase ( ) ) ; } catch ( IllegalArgumentException e ) { getMessager ( ) . send ( sender , ( ( "Invalid<seq2seq4repair_space>environment<seq2seq4repair_space>'" + ( args [ 1 ] ) ) + "'!" ) ) ; return false ; } WorldCreator worldCreator = new WorldCreator ( worldName ) ; worldCreator . environment ( environment ) ; if ( ( args . length ) == 3 ) { Long seed = Long . getLong ( args [ 2 ] ) ; if ( seed != null ) { worldCreator . seed ( seed ) ; } } getMessager ( ) . send ( sender , ( ( "Creating<seq2seq4repair_space>world<seq2seq4repair_space>'" + worldName ) + "'..." ) ) ; getPlugin ( ) . getServer ( ) . createWorld ( worldCreator ) ; <START_BUG> getPlugin ( ) . getConfig ( ) . set ( ( ( "worlds." + worldName ) + ".environment" ) , environment ) ; <END_BUG> getPlugin ( ) . getConfig ( ) . set ( ( ( "worlds." + worldName ) + ".seed" ) , getPlugin ( ) . getServer ( ) . getWorld ( worldName ) . getSeed ( ) ) ; getPlugin ( ) . saveConfig ( ) ; getMessager ( ) . send ( sender , ( ( "World<seq2seq4repair_space>'" + worldName ) + "'<seq2seq4repair_space>successfully<seq2seq4repair_space>created!" ) ) ; return true ; } }

Fix:
getPlugin ( ) . getConfig ( ) . set ( ( ( "worlds." + worldName ) + ".environment" ) , environment . toString ( ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class JMSMessageDrivenBeanTestCase { @ Deployment public static Archive < ? > deployment ( ) { } @ Test public void testSendMessage ( ) throws JMSException , NamingException { final InitialContext ctx = new InitialContext ( ) ; final QueueConnectionFactory factory = ( ( QueueConnectionFactory ) ( ctx . lookup ( "java://JmsXA" ) ) ) ; final QueueConnection connection = factory . createQueueConnection ( ) ; connection . start ( ) ; try { final QueueSession session = connection . createQueueSession ( false , AUTO_ACKNOWLEDGE ) ; final Queue replyDestination = session . createTemporaryQueue ( ) ; final QueueReceiver receiver = session . createReceiver ( replyDestination ) ; final Message message = session . createTextMessage ( "Test" ) ; message . setJMSReplyTo ( replyDestination ) ; <START_BUG> final Destination destination = ( ( Destination ) ( ctx . lookup ( "java:jboss//queue//test" ) ) ) ; <END_BUG> final MessageProducer producer = session . createProducer ( destination ) ; producer . send ( message ) ; producer . close ( ) ; final Message reply = receiver . receive ( 1000 ) ; assertNotNull ( reply ) ; final String result = ( ( javax . jms . TextMessage ) ( reply ) ) . getText ( ) ; assertEquals ( "replying<seq2seq4repair_space>Test" , result ) ; } finally { } } }

Fix:
final Destination destination = ( ( Destination ) ( ctx . lookup ( "java:jboss//jms//queue//test" ) ) ) ;
Buggy code:
abstract class AbstractDateTimeAnnotationFormatterFactory < A extends Annotation > implements AnnotationFormatterFactory < A > { private final Set < Class < ? > > propertyTypes ; public AbstractDateTimeAnnotationFormatterFactory ( ) { } public Set < Class < ? > > getFieldTypes ( ) { } public Printer < ? > getPrinter ( A annotation , Class < ? > propertyType ) { } public Parser < DateTime > getParser ( A annotation , Class < ? > propertyType ) { } protected abstract DateTimeFormatter configureDateTimeFormatterFrom ( A annotation ) { } private Set < Class < ? > > createPropertyTypes ( ) { <START_BUG> Set < Class < ? > > propertyTypes = new HashSet < Class < ? > > ( ) ; <END_BUG> propertyTypes . add ( ReadableInstant . class ) ; propertyTypes . add ( ReadablePartial . class ) ; propertyTypes . add ( Date . class ) ; propertyTypes . add ( Calendar . class ) ; propertyTypes . add ( Long . class ) ; return propertyTypes ; } }

Fix:
Set < Class < ? > > propertyTypes = new HashSet < Class < ? > > ( 5 ) ;
Buggy code:
public class InterpreterError { public String getDescription ( ) { <START_BUG> return "not<seq2seq4repair_space>further<seq2seq4repair_space>specified<seq2seq4repair_space>" + ( this . getClass ( ) . getName ( ) ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
return "not<seq2seq4repair_space>further<seq2seq4repair_space>specified<seq2seq4repair_space>Interpreter<seq2seq4repair_space>error" ;
Buggy code:
public class PublicGroupsSeachActivity extends BaseActivity { private RelativeLayout containerLayout ; private EditText idET ; private TextView nameText ; public static EMGroup searchedGroup ; @ Override protected void onCreate ( Bundle arg0 ) { } public void searchGroup ( View v ) { if ( TextUtils . isEmpty ( idET . getText ( ) ) ) { return ; } final ProgressDialog pd = new ProgressDialog ( this ) ; <START_BUG> pd . setMessage ( "正在搜索..." ) ; <END_BUG> pd . setCancelable ( false ) ; pd . show ( ) ; new Thread ( new Runnable ( ) { public void run ( ) { try { PublicGroupsSeachActivity . searchedGroup = EMGroupManager . getInstance ( ) . getGroupFromServer ( idET . getText ( ) . toString ( ) ) ; runOnUiThread ( new Runnable ( ) { public void run ( ) { pd . dismiss ( ) ; containerLayout . setVisibility ( VISIBLE ) ; nameText . setText ( PublicGroupsSeachActivity . searchedGroup . getGroupName ( ) ) ; } } ) ; } catch ( final EaseMobException e ) { e . printStackTrace ( ) ; runOnUiThread ( new Runnable ( ) { public void run ( ) { pd . dismiss ( ) ; PublicGroupsSeachActivity . searchedGroup = null ; containerLayout . setVisibility ( GONE ) ; if ( ( e . getErrorCode ( ) ) == ( EMError . GROUP_NOT_EXIST ) ) { Toast . makeText ( getApplicationContext ( ) , getResources ( ) . getString ( group_not_existed ) , 0 ) . show ( ) ; } else { Toast . makeText ( getApplicationContext ( ) , ( ( ( getResources ( ) . getString ( group_search_failed ) ) + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( getString ( connect_failuer_toast ) ) ) , 0 ) . show ( ) ; } } } ) ; } } } ) . start ( ) ; } public void enterToDetails ( View view ) { } }

Fix:
pd . setMessage ( getResources ( ) . getString ( searching ) ) ;
Buggy code:
public class MoveableMass extends GLKugel implements Updateable { GLVektor speed ; GLVektor force ; double mass ; Material matter ; public MoveableMass ( GLVektor pPosition , Material matter , double mass ) { } public void initial ( ) { } public void setMaterial ( Material matter ) { } public void setMass ( double pMass ) { this . mass = pMass ; <START_BUG> this . setzeSkalierung ( Math . pow ( ( ( ( ( 3 // 4 ) * ( mass ) ) // ( matter . getDensity ( ) ) ) // ( Math . PI ) ) , ( 1 // 3 ) ) ) ; <END_BUG> } public double getMass ( ) { } public void setRadius ( double pRadius ) { } public void setForce ( GLVektor pForce ) { } public void calcSpeed ( double time ) { } public void move ( double time ) { } public void calcForce ( ) { } @ Override public void update ( double delta ) { } }

Fix:
this . setzeSkalierung ( Math . pow ( ( ( ( 3.0 // 4.0 ) * ( ( mass ) // ( matter . getDensity ( ) ) ) ) // ( Math . PI ) ) , ( 1.0 // 3.0 ) ) ) ;
Buggy code:
public class TestFilteredSearch extends LuceneTestCase { public TestFilteredSearch ( String name ) { } private static final String FIELD = "category" ; public void testFilteredSearch ( ) { RAMDirectory directory = new RAMDirectory ( ) ; int [ ] filterBits = new int [ ] { 1 , 36 } ; Filter filter = new TestFilteredSearch . SimpleDocIdSetFilter ( filterBits ) ; try { IndexWriter writer = new IndexWriter ( directory , new WhitespaceAnalyzer ( ) , true , MaxFieldLength . LIMITED ) ; for ( int i = 0 ; i < 60 ; i ++ ) { Document doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . Field ( TestFilteredSearch . FIELD , Integer . toString ( i ) , Store . YES , Index . NOT_ANALYZED ) ) ; writer . addDocument ( doc ) ; } writer . close ( ) ; BooleanQuery booleanQuery = new BooleanQuery ( ) ; booleanQuery . add ( new TermQuery ( new Term ( TestFilteredSearch . FIELD , "36" ) ) , SHOULD ) ; <START_BUG> IndexSearcher indexSearcher = new IndexSearcher ( directory ) ; <END_BUG> ScoreDoc [ ] hits = indexSearcher . search ( booleanQuery , filter , 1000 ) . scoreDocs ; assertEquals ( "Number<seq2seq4repair_space>of<seq2seq4repair_space>matched<seq2seq4repair_space>documents" , 1 , hits . length ) ; } catch ( IOException e ) { fail ( e . getMessage ( ) ) ; } } public static final class SimpleDocIdSetFilter extends Filter { private OpenBitSet bits ; public SimpleDocIdSetFilter ( int [ ] docs ) { } public DocIdSet getDocIdSet ( IndexReader reader ) { } } }

Fix:
IndexSearcher indexSearcher = new IndexSearcher ( directory , true ) ;
Buggy code:
public class CommandSendScheduledSms extends BaseHttpPostHystrixCommand < Boolean > { private String timestamp ; private String phoneNo ; private String msg ; public CommandSendScheduledSms ( URI tokenServiceUri , String appTokenId , String appTokenXml , String timestamp , String phoneNo , String msg ) { } @ Override protected Boolean dealWithFailedResponse ( String responseBody , int statusCode ) { } @ Override protected Boolean dealWithResponse ( String response ) { } @ Override protected Map < String , String > getFormParameters ( ) { } @ Override protected String getTargetPath ( ) { <START_BUG> return ( myAppTokenId ) + "//send_scheduled_sms" ; <END_BUG> } }

Fix:
return ( "user//" + ( myAppTokenId ) ) + "//send_scheduled_sms" ;