nus-yam/ex-repair huggingface dataset:
Buggy code:
@ RunWith ( SpringJUnit4ClassRunner . class ) @ ContextConfiguration ( classes = TestConfig . class ) @ TransactionConfiguration ( defaultRollback = true ) public class UserDaoTest { @ Inject private CredentialDao credentialDao ; @ Inject private UserDao userDao ; @ Before public void setUp ( ) { } @ Test @ Transactional public void testSaveAndFetch ( ) { Credential credential = new Credential ( ) ; credential . setAccessToken ( "fakeAccessToken" ) ; credential . setFoursquareAccessToken ( "fakeFoursquareAccessToken" ) ; credentialDao . save ( credential ) ; assertThat ( userDao . fetchCompactByAccessToken ( credential . getAccessToken ( ) ) ) . isNull ( ) ; User expectedUser = new User ( ) ; expectedUser . setName ( "name" ) ; expectedUser . setLastName ( "lastName" ) ; expectedUser . setPhotoUrl ( "url" ) ; expectedUser . setFoursquareId ( "id" ) ; expectedUser . setCredential ( credential ) ; <START_BUG> userDao . save ( expectedUser ) ; <END_BUG> expectedUser . setCredential ( null ) ; assertThat ( userDao . fetchCompactByAccessToken ( credential . getAccessToken ( ) ) ) . isNotNull ( ) . isEqualTo ( expectedUser ) ; } No newline ; at end ; of file ; }

Fix:
userDao . saveOrUpdate ( expectedUser ) ;
Buggy code:
public class AnalyzationTest extends TestCase { private Set < AnalysationIssue > issues ; private ExecutionContextImpl ec ; @ Override protected void setUp ( ) throws Exception { } private Expression parse ( final String expression ) { } private void dumpIssues ( ) { } public final void testEquals ( ) { } public final void testStaticPropertyCall ( ) { } public final void testCollectionLiteral1 ( ) { } public final void testCollectionLiteral3 ( ) { } public final void testCollectionLiteral2 ( ) { } public final void testFeatureCall ( ) { } public final void testFeatureCall1 ( ) { } public final void testOperationCall1 ( ) { } public final void testOperationCall2 ( ) { } public final void testOperationCall3 ( ) { } public final void testOperationCall4 ( ) { } public final void testSwitchExpr ( ) { } public final void testSwitchExpr1 ( ) { } public final void testSwitchExpr2 ( ) { } public final void testChainExpr ( ) { } public final void testChainExpr1 ( ) { } public final void testTypeLiteral1 ( ) { } public final void testTypeLiteral2 ( ) { <START_BUG> final Expression e = parse ( "String.getOperation('length',(List[oaw::Type]){})" ) ; <END_BUG> assertEquals ( ec . getOperationType ( ) , e . analyze ( ec , new HashSet < AnalysationIssue > ( ) ) ) ; } public final void testTypeLiteral3 ( ) { } private String getATypeName ( ) { } public final void testSelect ( ) { } public final void testTypeSelect ( ) { } public final void testPath1 ( ) { } public final void testPath2 ( ) { } public final void testPath3 ( ) { } public final void testPath4 ( ) { } public final void testImplies ( ) { } public final void testImplies1 ( ) { } public final void testLet1 ( ) { } public final void testLet2 ( ) { } public final void testLet3 ( ) { } public final void testCast1 ( ) { } public final void testCast2 ( ) { } public final void testConstruction ( ) { } public void testSelectFirst ( ) throws Exception { } public void testSortBy ( ) throws Exception { } public void testBug174611 ( ) throws Exception { } public void testCollectShortCutWithFeatureCalls ( ) throws Exception { } public void testCollectShortCutWithOperationCalls ( ) throws Exception { } public void testCollectShortCutWithExtensionCalls ( ) throws Exception { } public void testCollectShortCutWithMixedCalls ( ) throws Exception { } public void testGetAllFeatures ( ) throws Exception { } }

Fix:
final Expression e = parse ( "String.getOperation('length',(List[xpand2::Type]){})" ) ;
Buggy code:
public class ModClusterDisableContext implements OperationStepHandler { static final ModClusterDisableContext INSTANCE = new ModClusterDisableContext ( ) ; static OperationDefinition getDefinition ( ResourceDescriptionResolver descriptionResolver ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { if ( ( context . isNormalServer ( ) ) && ( ( context . getServiceRegistry ( false ) . getService ( SERVICE_NAME ) ) != null ) ) { context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( SERVICE_NAME ) ; final ModClusterServiceMBean service = ( ( ModClusterServiceMBean ) ( controller . getValue ( ) ) ) ; ModClusterLogger . ROOT_LOGGER . debugf ( "disable-context:<seq2seq4repair_space>%s" , operation ) ; final String webHost = ModClusterSubsystemResourceDefinition . VIRTUAL_HOST . resolveModelAttribute ( context , operation ) . asString ( ) ; final String webContext = ModClusterSubsystemResourceDefinition . CONTEXT . resolveModelAttribute ( context , operation ) . asString ( ) ; try { service . disableContext ( webHost , webContext ) ; } catch ( IllegalArgumentException e ) { <START_BUG> throw new OperationFailedException ( new ModelNode ( ) . set ( ROOT_LOGGER . contextOrHostNotFound ( webHost , webContext ) ) ) ; <END_BUG> } context . completeStep ( new OperationContext . RollbackHandler ( ) { @ Override public void handleRollback ( OperationContext context , ModelNode operation ) { service . enableContext ( webHost , webContext ) ; } } ) ; } } , RUNTIME ) ; } context . stepCompleted ( ) ; } }

Fix:
throw new OperationFailedException ( ROOT_LOGGER . contextOrHostNotFound ( webHost , webContext ) ) ;
Buggy code:
public class InsideSubRoutineFlowContext extends FlowContext { public UnconditionalFlowInfo initsOnReturn ; public InsideSubRoutineFlowContext ( FlowContext parent , AstNode associatedNode ) { } public String individualToString ( ) { } public UnconditionalFlowInfo initsOnReturn ( ) { } public boolean isNonReturningContext ( ) { } public SubRoutineStatement subRoutine ( ) { } public void recordReturnFrom ( FlowInfo flowInfo ) { if ( ! ( flowInfo . isReachable ( ) ) ) return ; if ( ( initsOnReturn ) == ( FlowInfo . DEAD_END ) ) { initsOnReturn = flowInfo . copy ( ) . unconditionalInits ( ) ; } else { <START_BUG> initsOnReturn . mergedWith ( flowInfo . unconditionalInits ( ) ) ; <END_BUG> } } }

Fix:
initsOnReturn = initsOnReturn . mergedWith ( flowInfo . unconditionalInits ( ) ) ;
Buggy code:
public final class ExecutionContextImpl implements ExecutionContext { private final CreationCache _creationCache = new CreationCacheImpl ( ) ; private FunctionDefContext _functionDefContext ; private LocalVarContext _localVarContext = new LocalVarContext ( ) ; private final FunctionInvoker _functionInvoker = new FunctionInvokerImpl ( ) ; private final BackendTypesystem _typeSystem ; private final GlobalParamContext _globalParamContext = new GlobalParamContextImpl ( ) ; private final boolean _logStacktrace ; private final List < StacktraceEntry > _stacktrace = new ArrayList < StacktraceEntry > ( ) ; private final ContributionStateContext _contributionStateContext = new ContributionStateContext ( ) ; public ExecutionContextImpl ( FunctionDefContext initialFunctionDefContext , BackendTypesystem typesystem , boolean logStacktrace ) { } public CreationCache getCreationCache ( ) { } public FunctionDefContext getFunctionDefContext ( ) { } public void setFunctionDefContext ( FunctionDefContext ctx ) { } public LocalVarContext getLocalVarContext ( ) { } public void setLocalVarContext ( LocalVarContext ctx ) { } public FunctionInvoker getFunctionInvoker ( ) { } public BackendTypesystem getTypesystem ( ) { } public GlobalParamContext getGlobalParamContext ( ) { } public void logNullDeRef ( SourcePos pos ) { <START_BUG> final StringBuilder sb = new StringBuilder ( ( ( "dereferenced<seq2seq4repair_space>null<seq2seq4repair_space>(" + pos ) + ")" ) ) ; <END_BUG> for ( int i = ( _stacktrace . size ( ) ) - 1 ; i >= 0 ; i -- ) sb . append ( ( "\n<seq2seq4repair_space>" + ( _stacktrace . get ( i ) ) ) ) ; LogFactory . getLog ( LOG_NULL_DEREF ) . warn ( sb ) ; } public ContributionStateContext getContributionStateContext ( ) { } public List < StacktraceEntry > getStacktrace ( ) { } public boolean isLogStacktrace ( ) { } }

Fix:
final StringBuilder sb = new StringBuilder ( ( "dereferenced<seq2seq4repair_space>null<seq2seq4repair_space>" + ( pos != null ? ( "(" + pos ) + ")" : "" ) ) ) ;
Buggy code:
public class TestRegexQuery extends LuceneTestCase { private IndexSearcher searcher ; private IndexReader reader ; private Directory directory ; private final String FN = "field" ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; directory = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , directory ) ; Document doc = new Document ( ) ; doc . add ( newTextField ( FN , "the<seq2seq4repair_space>quick<seq2seq4repair_space>brown<seq2seq4repair_space>fox<seq2seq4repair_space>jumps<seq2seq4repair_space>over<seq2seq4repair_space>the<seq2seq4repair_space>lazy<seq2seq4repair_space>dog" , NO ) ) ; writer . addDocument ( doc ) ; reader = writer . getReader ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> searcher = newSearcher ( reader ) ; } @ Override public void tearDown ( ) throws Exception { } private Term newTerm ( String value ) { } private int regexQueryNrHits ( String regex , RegexCapabilities capability ) throws Exception { } private int spanRegexQueryNrHits ( String regex1 , String regex2 , int slop , boolean ordered ) throws Exception { } public void testMatchAll ( ) throws Exception { } public void testRegex1 ( ) throws Exception { } public void testRegex2 ( ) throws Exception { } public void testRegex3 ( ) throws Exception { } public void testSpanRegex1 ( ) throws Exception { } public void testSpanRegex2 ( ) throws Exception { } public void testEquals ( ) throws Exception { } public void testJakartaCaseSensativeFail ( ) throws Exception { } public void testJavaUtilCaseSensativeFail ( ) throws Exception { } public void testJakartaCaseInsensative ( ) throws Exception { } public void testJavaUtilCaseInsensative ( ) throws Exception { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class TimedTaskList { private final int TASKLIST_SIZE = 1000 ; private ArrayList < TimedTask > taskArray = new ArrayList < TimedTask > ( TASKLIST_SIZE ) ; private enum SORT_TYPE { NAME , TIMED , WORKLOAD , ID ; } private int numOfDisplayItems = 5 ; private ObservableList < TimedTask > observableTimed = FXCollections . observableArrayList ( ) ; public TimedTaskList ( ) { } public TimedTask get ( int index ) { } public void add ( TimedTask task ) { } public void delete ( int index ) { } public void delete ( String name ) { } public int size ( ) { } public boolean isEmpty ( ) { } public TimedTaskList . SORT_TYPE getSortType ( String keyword ) { } public void sortBy ( TimedTaskList . SORT_TYPE type ) { } public ObservableList < TimedTask > getObservable ( ) { int maxNumTasksToAdd ; observableTimed . removeAll ( observableTimed ) ; <START_BUG> if ( isEmpty ( ) ) { <END_BUG> if ( ( taskArray . size ( ) ) > ( numOfDisplayItems ) ) { maxNumTasksToAdd = numOfDisplayItems ; } else { maxNumTasksToAdd = taskArray . size ( ) ; } for ( int i = 0 ; i < maxNumTasksToAdd ; i ++ ) { observableTimed . add ( get ( i ) ) ; } } return observableTimed ; } private Comparator < TimedTask > taskNameComparator = new Comparator < TimedTask > ( ) { public int compare ( TimedTask t1 , TimedTask t2 ) { } } ; private Comparator < TimedTask > taskTimedComparator = new Comparator < TimedTask > ( ) { public int compare ( TimedTask t1 , TimedTask t2 ) { } } ; private Comparator < TimedTask > taskWorkloadComparator = new Comparator < TimedTask > ( ) { public int compare ( TimedTask t1 , TimedTask t2 ) { } } ; private Comparator < TimedTask > taskIdComparator = new Comparator < TimedTask > ( ) { public int compare ( TimedTask t1 , TimedTask t2 ) { } } ; }

Fix:
if ( ! ( isEmpty ( ) ) ) {
Buggy code:
public final class IndonesianAnalyzer extends StopwordAnalyzerBase { public static final String DEFAULT_STOPWORD_FILE = "stopwords.txt" ; public static Set < ? > getDefaultStopSet ( ) { } private static class DefaultSetHolder { static final Set < ? > DEFAULT_STOP_SET ; } private final Set < ? > stemExclusionSet ; public IndonesianAnalyzer ( Version matchVersion ) { } public IndonesianAnalyzer ( Version matchVersion , Set < ? > stopwords ) { } public IndonesianAnalyzer ( Version matchVersion , Set < ? > stopwords , Set < ? > stemExclusionSet ) { } @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { final Tokenizer source = new org . apache . lucene . analysis . standard . StandardTokenizer ( matchVersion , reader ) ; TokenStream result = new org . apache . lucene . analysis . standard . StandardFilter ( matchVersion , source ) ; <START_BUG> result = new org . apache . lucene . analysis . LowerCaseFilter ( matchVersion , source ) ; <END_BUG> result = new org . apache . lucene . analysis . StopFilter ( matchVersion , result , stopwords ) ; if ( ! ( stemExclusionSet . isEmpty ( ) ) ) { result = new org . apache . lucene . analysis . KeywordMarkerFilter ( result , stemExclusionSet ) ; } return new TokenStreamComponents ( source , new IndonesianStemFilter ( result ) ) ; } }

Fix:
result = new org . apache . lucene . analysis . LowerCaseFilter ( matchVersion , result ) ;
Buggy code:
public class MaxIterationsExceededExceptionTest extends TestCase { public void testSimpleConstructor ( ) { } public void testComplexConstructor ( ) { <START_BUG> MaxIterationsExceededException ex = new MaxIterationsExceededException ( 1000000 , "Continued<seq2seq4repair_space>fraction<seq2seq4repair_space>convergents<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>converge<seq2seq4repair_space>for<seq2seq4repair_space>value<seq2seq4repair_space>{0}" , new Object [ ] { new Double ( 1234567 ) } ) ; <END_BUG> assertNull ( ex . getCause ( ) ) ; assertNotNull ( ex . getMessage ( ) ) ; assertTrue ( ( ( ex . getMessage ( ) . indexOf ( "1,000,000" ) ) < 0 ) ) ; assertTrue ( ( ( ex . getMessage ( ) . indexOf ( "1,234,567" ) ) > 0 ) ) ; assertEquals ( 1000000 , ex . getMaxIterations ( ) ) ; assertFalse ( ex . getMessage ( ) . equals ( ex . getMessage ( Locale . FRENCH ) ) ) ; } }

Fix:
MaxIterationsExceededException ex = new MaxIterationsExceededException ( 1000000 , "Continued<seq2seq4repair_space>fraction<seq2seq4repair_space>convergents<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>converge<seq2seq4repair_space>for<seq2seq4repair_space>value<seq2seq4repair_space>{0}" , new Object [ ] { Double . valueOf ( 1234567 ) } ) ;
Buggy code:
public class TelnetTask extends Task { private String userid = null ; private String password = null ; private String server = null ; private int port = 23 ; private TelnetTask . AntTelnetClient telnet = null ; private Vector telnetTasks = new Vector ( ) ; private boolean addCarriageReturn = false ; private Integer defaultTimeout = null ; public void execute ( ) throws BuildException { } private void login ( ) { } public void setUserid ( String u ) { } public void setPassword ( String p ) { } public void setServer ( String m ) { } public void setPort ( int p ) { } public void setInitialCR ( boolean b ) { } public void setTimeout ( Integer i ) { } public TelnetTask . TelnetSubTask createRead ( ) { } public TelnetTask . TelnetSubTask createWrite ( ) { } public class TelnetSubTask { protected String taskString = "" ; public void execute ( TelnetTask . AntTelnetClient telnet ) throws BuildException { } public void addText ( String s ) { <START_BUG> setString ( project . replaceProperties ( s ) ) ; <END_BUG> } public void setString ( String s ) { } } public class TelnetWrite extends TelnetTask . TelnetSubTask { private boolean echoString = true ; public void execute ( TelnetTask . AntTelnetClient telnet ) throws BuildException { } public void setEcho ( boolean b ) { } } public class TelnetRead extends TelnetTask . TelnetSubTask { private Integer timeout = null ; public void execute ( TelnetTask . AntTelnetClient telnet ) throws BuildException { } public void setTimeout ( Integer i ) { } public void setDefaultTimeout ( Integer defaultTimeout ) { } } public class AntTelnetClient extends TelnetClient { public void waitForString ( String s ) { } public void waitForString ( String s , Integer timeout ) { } public void sendString ( String s , boolean echoString ) { } } }

Fix:
setString ( getProject ( ) . replaceProperties ( s ) ) ;
Buggy code:
class ContainerWithAssociatedMarkupHelper extends AbstractBehavior { private static final long serialVersionUID = 1L ; private boolean checkedBody = false ; private boolean noMoreWicketHeadTagsAllowed = false ; private final WebMarkupContainerWithAssociatedMarkup container ; ContainerWithAssociatedMarkupHelper ( final WebMarkupContainerWithAssociatedMarkup container ) { } protected final void renderHeadFromAssociatedMarkupFile ( final HtmlHeaderContainer htmlContainer ) { } private void checkBodyOnLoad ( ) { final MarkupStream associatedMarkupStream = container . getAssociatedMarkupStream ( false ) ; if ( associatedMarkupStream == null ) { return ; } int index = associatedMarkupStream . getCurrentIndex ( ) ; try { final Iterator iter = associatedMarkupStream . componentTagIterator ( ) ; while ( iter . hasNext ( ) ) { final ComponentTag tag = ( ( ComponentTag ) ( iter . next ( ) ) ) ; if ( TagUtils . isBodyTag ( tag ) ) { ValueMap attributes = tag . getAttributes ( ) ; final String onLoad = attributes . getString ( attributes . getKey ( "onload" ) ) ; if ( onLoad != null ) { <START_BUG> container . getWebPage ( ) . getBodyContainer ( ) . addOnLoadModifier ( onLoad ) ; <END_BUG> } break ; } } } finally { associatedMarkupStream . setCurrentIndex ( index ) ; } } private final HeaderPartContainer getHeaderPart ( final Class markupClass , final int index ) { } private final int nextHeaderMarkup ( final MarkupStream associatedMarkupStream ) { } }

Fix:
container . getWebPage ( ) . getBodyContainer ( ) . addOnLoadModifier ( onLoad , container ) ;
Buggy code:
public class CERRunner { private String [ ] args ; private String dataPath ; private String usernick ; public CERRunner ( ) { } public CERRunner ( String newUserNick , String [ ] newArgs ) { } public CERRunner ( String newUserNick , String newDataPath , String [ ] newArgs ) { } public void setArgs ( String [ ] newArgs ) { } private String [ ] getArgs ( ) { } public void setDataPath ( String newDataPath ) { } private String getDataPath ( ) { } private void setUserNick ( String newUserNick ) { } private String getUserNick ( ) { } public String run ( ) throws Exception { String result = "" ; CERTableUpdater updater = new CERTableUpdater ( this . getDataPath ( ) ) ; updater . update ( ) ; String [ ] cmd = null ; CERInfoProvider info = null ; <START_BUG> if ( ( this . getArgs ( ) ) == null ) { <END_BUG> String [ ] default_currency = null ; PropertyManager prop = new PropertyManager ( this . getDataPath ( ) , "customsetlist.prop" ) ; prop . loadProperties ( ) ; String [ ] userlist = prop . getKeyList ( ) ; if ( userlist == null ) { default_currency = new String [ 4 ] ; default_currency [ 0 ] = "USD" ; default_currency [ 1 ] = "EUR" ; default_currency [ 2 ] = "JPY" ; default_currency [ 3 ] = "CNY" ; } else { int existidx = this . indexOfContained ( userlist , this . getUserNick ( ) ) ; if ( existidx != ( - 1 ) ) { default_currency = prop . getValue ( userlist [ existidx ] ) . split ( "\\," ) ; } else { default_currency = new String [ 4 ] ; default_currency [ 0 ] = "USD" ; default_currency [ 1 ] = "EUR" ; default_currency [ 2 ] = "JPY" ; default_currency [ 3 ] = "CNY" ; } } for ( int i = 0 ; i < ( default_currency . length ) ; i ++ ) { String [ ] args = new String [ 1 ] ; args [ 0 ] = default_currency [ i ] ; cmd = CERMessageTokenAnalyzer . convertToCLICommandString ( args ) ; info = new CERInfoProvider ( this . getDataPath ( ) , cmd ) ; if ( i != 0 ) result += ",<seq2seq4repair_space>" + ( info . commandInterpreter ( ) ) ; else result += info . commandInterpreter ( ) ; } } else { cmd = CERMessageTokenAnalyzer . convertToCLICommandString ( this . getArgs ( ) ) ; info = new CERInfoProvider ( this . getDataPath ( ) , cmd ) ; result = info . commandInterpreter ( ) ; } return result ; } private int indexOfContained ( String [ ] strarray , String value ) { } }

Fix:
if ( ( ( this . getArgs ( ) ) == null ) || ( ( this . getArgs ( ) . length ) == 0 ) ) {
Buggy code:
public class TableColumn extends Item { Table parent ; boolean resizable ; boolean moveable ; public TableColumn ( Table parent , int style ) { } public TableColumn ( Table parent , int style , int index ) { } public void addControlListener ( ControlListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public int getAlignment ( ) { } String getNameText ( ) { } public Table getParent ( ) { } public boolean getMoveable ( ) { } public boolean getResizable ( ) { } public int getWidth ( ) { } public void pack ( ) { } void releaseChild ( ) { } void releaseWidget ( ) { super . releaseWidget ( ) ; <START_BUG> if ( ( parent . sortColumn ) == ( this ) ) { <END_BUG> parent . sortColumn = null ; } parent = null ; } public void removeControlListener ( ControlListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setAlignment ( int alignment ) { } public void setImage ( Image image ) { } void setImage ( Image image , boolean sort , boolean right ) { } public void setMoveable ( boolean moveable ) { } public void setResizable ( boolean resizable ) { } void setSortDirection ( int direction ) { } public void setText ( String string ) { } public void setWidth ( int width ) { } }

Fix:
if ( ( ( parent ) != null ) && ( ( parent . sortColumn ) == ( this ) ) ) {
Buggy code:
public class BcelTypeMunger extends ConcreteTypeMunger { public BcelTypeMunger ( ResolvedTypeMunger munger , ResolvedTypeX aspectType ) { } public String toString ( ) { } public boolean munge ( BcelClassWeaver weaver ) { } private boolean mungePrivilegedAccess ( BcelClassWeaver weaver , PrivilegedAccessMunger munger ) { } private void addFieldGetter ( LazyClassGen gen , ResolvedMember field , ResolvedMember accessMethod ) { } private void addFieldSetter ( LazyClassGen gen , ResolvedMember field , ResolvedMember accessMethod ) { } private void addMethodDispatch ( LazyClassGen gen , ResolvedMember method , ResolvedMember accessMethod ) { } private LazyMethodGen makeMethodGen ( LazyClassGen gen , ResolvedMember member ) { } private FieldGen makeFieldGen ( LazyClassGen gen , ResolvedMember member ) { } private boolean mungePerObjectInterface ( BcelClassWeaver weaver , PerObjectInterfaceTypeMunger munger ) { LazyClassGen gen = weaver . getLazyClassGen ( ) ; <START_BUG> if ( couldMatch ( gen . getType ( ) , munger . getTestPointcut ( ) ) ) { <END_BUG> FieldGen fg = makeFieldGen ( gen , AjcMemberMaker . perObjectField ( gen . getType ( ) , aspectType ) ) ; gen . addField ( fg . getField ( ) ) ; Type fieldType = BcelWorld . makeBcelType ( aspectType ) ; LazyMethodGen mg = new LazyMethodGen ( Modifier . PUBLIC , fieldType , NameMangler . perObjectInterfaceGet ( aspectType ) , new Type [ 0 ] , new String [ 0 ] , gen ) ; InstructionList il = new InstructionList ( ) ; InstructionFactory fact = gen . getFactory ( ) ; il . append ( fact . ALOAD_0 ) ; il . append ( fact . createFieldAccess ( gen . getClassName ( ) , fg . getName ( ) , fieldType , GETFIELD ) ) ; il . append ( fact . createReturn ( fieldType ) ) ; mg . getBody ( ) . insert ( il ) ; gen . addMethodGen ( mg ) ; LazyMethodGen mg1 = new LazyMethodGen ( Modifier . PUBLIC , Type . VOID , NameMangler . perObjectInterfaceSet ( aspectType ) , new Type [ ] { fieldType } , new String [ 0 ] , gen ) ; InstructionList il1 = new InstructionList ( ) ; il1 . append ( fact . ALOAD_0 ) ; il1 . append ( fact . createLoad ( fieldType , 1 ) ) ; il1 . append ( fact . createFieldAccess ( gen . getClassName ( ) , fg . getName ( ) , fieldType , PUTFIELD ) ) ; il1 . append ( fact . createReturn ( VOID ) ) ; mg1 . getBody ( ) . insert ( il1 ) ; gen . addMethodGen ( mg1 ) ; gen . addInterface ( munger . getInterfaceType ( ) ) ; return true ; } else { return false ; } } private boolean couldMatch ( BcelObjectType bcelObjectType , Pointcut pointcut ) { } private boolean mungeNewMethod ( BcelClassWeaver weaver , NewMethodTypeMunger munger ) { } private boolean mungeNewConstructor ( BcelClassWeaver weaver , NewConstructorTypeMunger newConstructorTypeMunger ) { } private static LazyMethodGen makeDispatcher ( LazyClassGen onGen , String dispatchName , ResolvedMember superMethod , BcelWorld world , boolean isSuper ) { } private boolean mungeNewField ( BcelClassWeaver weaver , NewFieldTypeMunger munger ) { } }

Fix:
if ( couldMatch ( gen . getBcelObjectType ( ) , munger . getTestPointcut ( ) ) ) {
Buggy code:
@ SuppressWarnings ( "deprecation" ) @ GET @ Path ( "create//{oppID}" ) public Response createOpp ( @ Context HttpServletRequest request , @ PathParam ( "oppID" ) String oppID ) throws Exception { String oppName = null ; String ammount = null ; String description = null ; String isClosed = null ; String stageName = null ; String closeDate = null ; String permId = null ; Identity sourceIdentity = Util . getAuthenticatedUserIdentity ( OppRestService . portalContainerName ) ; SpaceService spaceService = Util . getSpaceService ( OppRestService . portalContainerName ) ; IdentityManager identityManager = Util . getIdentityManager ( OppRestService . portalContainerName ) ; Cookie [ ] cookies = request . getCookies ( ) ; String accesstoken = null ; String instance_url = null ; ActivityManager activityManager = ( ( ActivityManager ) ( ExoContainerContext . getCurrentContainer ( ) . getComponentInstanceOfType ( ActivityManager . class ) ) ) ; ExoSocialActivity activity = new ExoSocialActivityImpl ( ) ; if ( sourceIdentity == null ) return Response . status ( UNAUTHORIZED ) . build ( ) ; for ( int i = 0 ; i < ( cookies . length ) ; i ++ ) { Cookie cookie1 = cookies [ i ] ; if ( cookie1 . getName ( ) . equals ( "tk_ck_" ) ) { accesstoken = cookie1 . getValue ( ) ; } if ( cookie1 . getName ( ) . equals ( "inst_ck_" ) ) { instance_url = cookie1 . getValue ( ) ; } } if ( ( accesstoken != null ) && ( instance_url != null ) ) { ForceApi api = OAuthServlet . initApiFromCookies ( accesstoken , instance_url ) ; Opportunity opp = null ; try { opp = api . getSObject ( "Opportunity" , oppID ) . as ( Opportunity . class ) ; } catch ( Exception e ) { return Response . serverError ( ) . status ( 404 ) . build ( ) ; } oppName = opp . getName ( ) ; if ( ( spaceService . getSpaceByPrettyName ( SpaceUtils . cleanString ( oppName ) ) ) != null ) { <START_BUG> return Response . seeOther ( URI . create ( ( ( ( Util . getBaseUrl ( ) ) + "//" ) + ( Utils . getSpaceUrl ( oppName ) ) ) ) ) . build ( ) ; <END_BUG>

Fix:
return Response . seeOther ( URI . create ( ( ( ( Util . getBaseUrl ( ) ) + "//" ) + ( Utils . getSpaceUrl ( SpaceUtils . cleanString ( oppName ) ) ) ) ) ) . build ( ) ;
Buggy code:
public class IconList extends ArrayAdapter < String > { private final Activity context ; private final String [ ] listOfChoices ; public IconList ( Activity context , String [ ] listOfChoices ) { } @ Override public View getView ( int position , View view , ViewGroup parent ) { LayoutInflater inflater = context . getLayoutInflater ( ) ; View rowView = inflater . inflate ( list_single , null , true ) ; ImageView imageView = ( ( ImageView ) ( rowView . findViewById ( navigation_icon ) ) ) ; <START_BUG> imageView . setImageResource ( Constants . getIconResource ( ( "" + ( listOfChoices [ position ] ) ) ) ) ; <END_BUG> return rowView ; } No newline ; at end ; of file ; }

Fix:
imageView . setImageResource ( Constants . getIconResource ( listOfChoices [ position ] ) ) ;
Buggy code:
public class RemoteServiceImpl implements InvocationHandler , IRemoteService { protected static final long DEFAULT_TIMEOUT = 30000 ; protected RemoteServiceRegistrationImpl registration = null ; protected RegistrySharedObject sharedObject = null ; public RemoteServiceImpl ( RegistrySharedObject sharedObject , RemoteServiceRegistrationImpl registration ) { } public void callAsynch ( IRemoteCall call , IRemoteCallListener listener ) { } <START_BUG> public IFutureStatus callAsynch ( IRemoteCall call ) { <END_BUG> final FutureStatus result = new FutureStatus ( ) ; final IRemoteCallListener listener = new IRemoteCallListener ( ) { public void handleEvent ( IRemoteCallEvent event ) { if ( event instanceof IRemoteCallCompleteEvent ) { IRemoteCallCompleteEvent cce = ( ( IRemoteCallCompleteEvent ) ( event ) ) ; if ( cce . hadException ( ) ) result . setException ( cce . getException ( ) ) ; else result . set ( cce . getResponse ( ) ) ; } } } ; callAsynch ( call , listener ) ; return result ; } public Object callSynch ( IRemoteCall call ) throws ECFException { } public void fireAsynch ( IRemoteCall call ) throws ECFException { } public Object getProxy ( ) throws ECFException { } public Object invoke ( Object proxy , final Method method , final Object [ ] args ) throws Throwable { } }

Fix:
public IFuture callAsynch ( IRemoteCall call ) {
Buggy code:
public class LibPath extends AbstractTask { private String libraryId ; private URL url ; public void setLibraryId ( String libraryId ) { } public void setURL ( URL url ) throws ValidationException { } public void setFile ( File file ) throws ValidationException { } public void setDir ( File dir ) throws ValidationException { } public void validateComponent ( ) throws ValidationException { } public void execute ( ) throws AntException { AntContext context = getAntContext ( ) ; ComponentService componentService = ( ( ComponentService ) ( context . getCoreService ( ComponentService . class ) ) ) ; <START_BUG> log ( ( ( ( "Adding<seq2seq4repair_space>lib<seq2seq4repair_space>path<seq2seq4repair_space>" + ( url ) ) + "<seq2seq4repair_space>for<seq2seq4repair_space>" ) + ( libraryId ) ) , MSG_DEBUG ) ; <END_BUG> componentService . addLibPath ( libraryId , url ) ; } private void checkNullURL ( ) throws ValidationException { } }

Fix:
log ( ( ( ( "Adding<seq2seq4repair_space>lib<seq2seq4repair_space>path<seq2seq4repair_space>" + ( url ) ) + "<seq2seq4repair_space>for<seq2seq4repair_space>" ) + ( libraryId ) ) , DEBUG ) ;
Buggy code:
public class ClassFinderMain { public static void main ( String [ ] args ) { try { UIManager . setLookAndFeel ( UIManager . getSystemLookAndFeelClassName ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } <START_BUG> JFrame principal = new JFrame ( "Class<seq2seq4repair_space>Finder<seq2seq4repair_space>App" ) ; <END_BUG> JPanel panel = new SearchPanel ( ) ; principal . setContentPane ( panel ) ; principal . setSize ( panel . getPreferredSize ( ) ) ; principal . setDefaultCloseOperation ( 3 ) ; principal . setLocationRelativeTo ( null ) ; principal . setVisible ( true ) ; } }

Fix:
JFrame principal = new JFrame ( RESOURCES . getLabel ( "app.header" ) ) ;
Buggy code:
public class TcpConnection extends SelectionKeyHandler implements Comparable { private static Logger logger_ = Logger . getLogger ( TcpConnection . class ) ; private static ISerializer serializer_ = new FastSerializer ( ) ; private SocketChannel socketChannel_ ; private SelectionKey key_ ; private TcpConnectionManager pool_ ; private boolean isIncoming_ = false ; private TcpReader tcpReader_ ; private TcpConnection . ReadWorkItem readWork_ = new TcpConnection . ReadWorkItem ( ) ; private Queue < ByteBuffer > pendingWrites_ = new ConcurrentLinkedQueue < ByteBuffer > ( ) ; private InetAddress localEp_ ; private InetAddress remoteEp_ ; boolean inUse_ = false ; private boolean bStream_ = false ; private Lock lock_ ; private Condition condition_ ; private TcpConnection ( InetAddress from , InetAddress to , TcpConnectionManager pool , boolean streaming ) throws IOException { } TcpConnection ( TcpConnectionManager pool , InetAddress from , InetAddress to ) throws IOException { } TcpConnection ( InetAddress from , InetAddress to ) throws IOException { } static void acceptConnection ( SocketChannel socketChannel , InetAddress localEp , boolean isIncoming ) throws IOException { } private void registerReadInterest ( ) throws IOException { } TcpConnection ( SocketChannel socketChannel , InetAddress localEp , boolean isIncoming ) throws IOException { } public InetAddress getEndPoint ( ) { } public SocketChannel getSocketChannel ( ) { } public void write ( Message message ) throws IOException { } public void stream ( File file , long startPosition , long endPosition ) throws IOException , InterruptedException { } private void resumeStreaming ( ) { } public void close ( ) { } public boolean isConnected ( ) { } public boolean equals ( Object o ) { } public int hashCode ( ) { } public String toString ( ) { } void closeSocket ( ) { } void errorClose ( ) { TcpConnection . logger_ . info ( ( "Closing<seq2seq4repair_space>errored<seq2seq4repair_space>connection<seq2seq4repair_space>" + ( socketChannel_ ) ) ) ; pendingWrites_ . clear ( ) ; cancel ( key_ ) ; pendingWrites_ . clear ( ) ; if ( ( pool_ ) != null ) <START_BUG> pool_ . destroy ( this ) ; <END_BUG> } private void cancel ( SelectionKey key ) { } public void connect ( SelectionKey key ) { } public void write ( SelectionKey key ) { } public void doPendingWrites ( ) { } public void read ( SelectionKey key ) { } class ReadWorkItem implements Runnable { public void run ( ) { } private void handleException ( Throwable th ) { } } public int compareTo ( Object o ) { } }

Fix:
pool_ . reset ( ) ;
Buggy code:
public class TridentState { TridentTopology _topology ; Node _node ; protected TridentState ( TridentTopology topology , Node node ) { } public Stream newValuesStream ( ) { <START_BUG> return new Stream ( _topology , _node ) ; <END_BUG> } public TridentState parallelismHint ( int parallelism ) { } }

Fix:
return new Stream ( _topology , _node . name , _node ) ;
Buggy code:
public class TestCacheModeAll extends AbstractCacheModeTestCase { private static OpenJPAEntityManagerFactorySPI emf = null ; private static Cache cache = null ; private static List < String > sql = new ArrayList < String > ( ) ; private static JDBCListener listener ; private static Class < ? > [ ] expectedInCache = persistentTypes ; private static Class < ? > [ ] expectedNotInCache = new Class < ? > [ ] { } ; @ Override public OpenJPAEntityManagerFactorySPI getEntityManagerFactory ( ) { if ( ( TestCacheModeAll . emf ) == null ) { <START_BUG> TestCacheModeAll . emf = createEntityManagerFactory ( "cache-mode-all" ) ; <END_BUG> assertNotNull ( TestCacheModeAll . emf ) ; TestCacheModeAll . cache = TestCacheModeAll . emf . getCache ( ) ; assertNotNull ( TestCacheModeAll . cache ) ; } return TestCacheModeAll . emf ; } public JDBCListener getListener ( ) { } public List < String > getSql ( ) { } public void testCacheables ( ) { } public void testUncacheables ( ) { } public void testUnspecified ( ) { } @ Override protected Class < ? > [ ] getExpectedInCache ( ) { } @ Override protected Class < ? > [ ] getExpectedNotInCache ( ) { } }

Fix:
TestCacheModeAll . emf = createEntityManagerFactory ( "cache-mode-all" , null ) ;
Buggy code:
public class TypeValidator extends AbstractValidator { private Locale locale = null ; private Class type ; public TypeValidator ( final Class type ) { } public TypeValidator ( final Class type , final Locale locale ) { } public final Class getType ( ) { } public String toString ( ) { } public final void validate ( final FormComponent component ) { } protected void conversionError ( final String input , final FormComponent component , final ConversionException e ) { } protected Map messageModel ( final FormComponent component , final String input , final ConversionException e ) { final Map model = super . messageModel ( component , input ) ; model . put ( "type" , type ) ; final Locale locale = e . getLocale ( ) ; if ( locale != null ) { model . put ( "locale" , locale ) ; } model . put ( "exception" , e . getMessage ( ) ) ; <START_BUG> model . put ( "pattern" , e . getPattern ( ) ) ; <END_BUG> return model ; } private final Locale getLocale ( ) { } }

Fix:
model . put ( "format" , e . getFormat ( ) ) ;
Buggy code:
public class RegexExtractorGui extends AbstractPostProcessorGui { private static final long serialVersionUID = 240L ; private JLabeledTextField regexField ; private JLabeledTextField templateField ; private JLabeledTextField defaultField ; private JLabeledTextField matchNumberField ; private JLabeledTextField refNameField ; private JRadioButton useBody ; private JRadioButton useUnescapedBody ; private JRadioButton useHeaders ; private JRadioButton useURL ; private JRadioButton useCode ; private JRadioButton useMessage ; private ButtonGroup group ; public RegexExtractorGui ( ) { } public String getLabelResource ( ) { } @ Override public void configure ( TestElement el ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement extractor ) { } @ Override public void clearGui ( ) { } private void init ( ) { setLayout ( new BorderLayout ( ) ) ; setBorder ( makeBorder ( ) ) ; Box box = Box . createVerticalBox ( ) ; box . add ( makeTitlePanel ( ) ) ; <START_BUG> box . add ( createScopePanel ( ) ) ; <END_BUG> box . add ( makeSourcePanel ( ) ) ; add ( box , BorderLayout . NORTH ) ; add ( makeParameterPanel ( ) , BorderLayout . CENTER ) ; } private JPanel makeSourcePanel ( ) { } private JPanel makeParameterPanel ( ) { } private void addField ( JPanel panel , JLabeledTextField field , GridBagConstraints gbc ) { } private void resetContraints ( GridBagConstraints gbc ) { } private void initConstraints ( GridBagConstraints gbc ) { } }

Fix:
box . add ( createScopePanel ( true ) ) ;
Buggy code:
public class SimpleVariable { private static final String KEY = "__unknownFunction" ; private Map varMap = new HashMap ( ) ; private String name ; public SimpleVariable ( String name ) { } public SimpleVariable ( ) { } public String getName ( ) { } public void setName ( String name ) { } public String toString ( ) { String ret = null ; JMeterVariables vars = getVariables ( ) ; if ( vars != null ) ret = vars . get ( name ) ; <START_BUG> if ( ( ret == null ) || ( ( ret . length ( ) ) == 0 ) ) <END_BUG> return ( "${" + ( name ) ) + "}" ; return ret ; } private JMeterVariables getVariables ( ) { } }

Fix:
if ( ret == null )
Buggy code:
public class ShowViewDialog extends Dialog implements IDoubleClickListener , ISelectionChangedListener { private static final String DIALOG_SETTING_SECTION_NAME = "ShowViewDialog" ; private static final int LIST_HEIGHT = 300 ; private static final int LIST_WIDTH = 250 ; private static final String STORE_EXPANDED_CATEGORIES_ID = ( ShowViewDialog . DIALOG_SETTING_SECTION_NAME ) + ".STORE_EXPANDED_CATEGORIES_ID" ; private static final String STORE_SELECTED_VIEW_ID = ( ShowViewDialog . DIALOG_SETTING_SECTION_NAME ) + ".STORE_SELECTED_VIEW_ID" ; private TreeViewer tree ; private Button okButton ; private IViewDescriptor [ ] viewDescs = new IViewDescriptor [ 0 ] ; private IViewRegistry viewReg ; public ShowViewDialog ( Shell parentShell , IViewRegistry viewReg ) { } protected void buttonPressed ( int buttonId ) { } protected void cancelPressed ( ) { } protected void configureShell ( Shell shell ) { super . configureShell ( shell ) ; <START_BUG> shell . setText ( WorkbenchMessages . getString ( "ShowView.shellTitle" ) ) ; <END_BUG> PlatformUI . getWorkbench ( ) . getHelpSystem ( ) . setHelp ( shell , SHOW_VIEW_DIALOG ) ; } protected void createButtonsForButtonBar ( Composite parent ) { } protected Control createDialogArea ( Composite parent ) { } private void createViewer ( Composite parent ) { } public void doubleClick ( DoubleClickEvent event ) { } protected IDialogSettings getDialogSettings ( ) { } public IViewDescriptor [ ] getSelection ( ) { } private void layoutTopControl ( Control control ) { } protected void restoreWidgetValues ( ) { } protected void saveWidgetValues ( ) { } public void selectionChanged ( SelectionChangedEvent event ) { } protected void updateButtons ( ) { } protected void updateSelection ( SelectionChangedEvent event ) { } }

Fix:
shell . setText ( ShowView_shellTitle ) ;
Buggy code:
public class QBLoadGroupDialogCommand extends ServiceCommand { private QBMultiChatHelper multiChatHelper ; public QBLoadGroupDialogCommand ( Context context , QBMultiChatHelper chatHelper , String successAction , String failAction ) { } public static void start ( Context context , QBDialog dialog ) { } @ Override public Bundle perform ( Bundle extras ) throws QBResponseException { QBDialog dialog = ( ( QBDialog ) ( extras . getSerializable ( EXTRA_DIALOG ) ) ) ; GroupDialog groupDialog = new GroupDialog ( dialog ) ; List < Integer > participantIdsList = dialog . getOccupants ( ) ; try { List < Integer > onlineParticipantIdsList = multiChatHelper . getRoomOnlineParticipantList ( dialog . getRoomJid ( ) ) ; QBPagedRequestBuilder requestBuilder = new QBPagedRequestBuilder ( ) ; requestBuilder . setPage ( FL_FRIENDS_PAGE_NUM ) ; <START_BUG> requestBuilder . setPerPage ( FL_FRIENDS_PER_PAGE ) ; <END_BUG> Bundle requestParams = new Bundle ( ) ; List < QBUser > userList = QBUsers . getUsersByIDs ( participantIdsList , requestBuilder , requestParams ) ; Map < Integer , User > friendMap = FriendUtils . createUserMap ( userList ) ; for ( Integer onlineParticipantId : onlineParticipantIdsList ) { User user = friendMap . get ( onlineParticipantId ) ; if ( user != null ) { user . setOnline ( true ) ; } } ArrayList < User > friendList = new ArrayList < User > ( friendMap . values ( ) ) ; Collections . sort ( friendList , new QBLoadGroupDialogCommand . UserComparator ( ) ) ; groupDialog . setOccupantList ( friendList ) ; } catch ( XMPPException e ) { throw new QBResponseException ( e . getLocalizedMessage ( ) ) ; } Bundle params = new Bundle ( ) ; params . putSerializable ( EXTRA_GROUP_DIALOG , groupDialog ) ; return params ; } private class UserComparator implements Comparator < User > { @ Override public int compare ( User firstUser , User secondUser ) { } } No newline ; at end ; of file ; }

Fix:
requestBuilder . setPerPage ( FL_FRIENDS_PER_PAGE_TEMP_VALUE ) ;
Buggy code:
public class dig { static dnsName name = null ; static short type = dns . A ; static short _class = dns . IN ; static void usage ( ) { } static void doQuery ( dnsMessage query , dnsResolver res ) throws IOException { } static void doAXFR ( dnsMessage query , dnsResolver res ) throws IOException { } public static void main ( String [ ] argv ) throws IOException { String server ; int arg ; dnsMessage query = new dnsMessage ( ) ; dnsRecord rec ; dnsResolver res = null ; query . getHeader ( ) . setFlag ( RD ) ; query . getHeader ( ) . setOpcode ( QUERY ) ; if ( ( argv . length ) < 1 ) { dig . usage ( ) ; } try { arg = 0 ; if ( argv [ arg ] . startsWith ( "@" ) ) { server = argv [ ( arg ++ ) ] . substring ( 1 ) ; res = new dnsResolver ( server ) ; } else <START_BUG> res = new dnsResolver ( "localhost" ) ; <END_BUG> dig . name = new dnsName ( argv [ ( arg ++ ) ] ) ; dig . type = dns . typeValue ( argv [ arg ] ) ; if ( ( dig . type ) < 0 ) dig . type = dns . A ; else arg ++ ; dig . _class = dns . classValue ( argv [ arg ] ) ; if ( ( dig . _class ) < 0 ) dig . _class = dns . IN ; else arg ++ ; while ( ( argv [ arg ] . startsWith ( "-" ) ) && ( ( argv [ arg ] . length ( ) ) > 1 ) ) { switch ( argv [ arg ] . charAt ( 1 ) ) { case 'p' : String portStr ; int port ; if ( ( argv [ arg ] . length ( ) ) > 2 ) portStr = argv [ arg ] . substring ( 2 ) ; else portStr = argv [ ( ++ arg ) ] ; port = Integer . parseInt ( portStr ) ; if ( ( port < 0 ) || ( port > 65536 ) ) { System . out . println ( "Invalid<seq2seq4repair_space>port" ) ; return ; } res . setPort ( port ) ; break ; case 'k' : String key ; if ( ( argv [ arg ] . length ( ) ) > 2 ) key = argv [ arg ] . substring ( 2 ) ; else key = argv [ ( ++ arg ) ] ; int index = key . indexOf ( '//' ) ; if ( index < 0 ) res . setTSIGKey ( key ) ; else res . setTSIGKey ( key . substring ( 0 , index ) , key . substring ( ( index + 1 ) ) ) ; break ; case 't' : res . setTCP ( true ) ; break ; case 'e' : res . setEDNS ( true ) ; break ; default : System . out . print ( "Invalid<seq2seq4repair_space>option" ) ; System . out . println ( argv [ arg ] ) ; } arg ++ ; } } catch ( ArrayIndexOutOfBoundsException e ) { if ( ( dig . name ) == null ) dig . usage ( ) ; } rec = dnsRecord . newRecord ( dig . name , dig . type , dig . _class ) ; query . addRecord ( QUESTION , rec ) ; if ( ( dig . type ) == ( dns . AXFR ) ) dig . doAXFR ( query , res ) ; else dig . doQuery ( query , res ) ; } }

Fix:
res = new dnsResolver ( ) ;
Buggy code:
public class TestSearch extends LuceneTestCase { public static void main ( String [ ] args ) { } public void testSearch ( ) throws Exception { } private void doTestSearch ( PrintWriter out , boolean useCompoundFile ) throws Exception { Directory directory = new RAMDirectory ( ) ; Analyzer analyzer = new SimpleAnalyzer ( ) ; IndexWriter writer = new IndexWriter ( directory , analyzer , true , MaxFieldLength . LIMITED ) ; writer . setUseCompoundFile ( useCompoundFile ) ; String [ ] docs = new String [ ] { "a<seq2seq4repair_space>b<seq2seq4repair_space>c<seq2seq4repair_space>d<seq2seq4repair_space>e" , "a<seq2seq4repair_space>b<seq2seq4repair_space>c<seq2seq4repair_space>d<seq2seq4repair_space>e<seq2seq4repair_space>a<seq2seq4repair_space>b<seq2seq4repair_space>c<seq2seq4repair_space>d<seq2seq4repair_space>e" , "a<seq2seq4repair_space>b<seq2seq4repair_space>c<seq2seq4repair_space>d<seq2seq4repair_space>e<seq2seq4repair_space>f<seq2seq4repair_space>g<seq2seq4repair_space>h<seq2seq4repair_space>i<seq2seq4repair_space>j" , "a<seq2seq4repair_space>c<seq2seq4repair_space>e" , "e<seq2seq4repair_space>c<seq2seq4repair_space>a" , "a<seq2seq4repair_space>c<seq2seq4repair_space>e<seq2seq4repair_space>a<seq2seq4repair_space>c<seq2seq4repair_space>e" , "a<seq2seq4repair_space>c<seq2seq4repair_space>e<seq2seq4repair_space>a<seq2seq4repair_space>b<seq2seq4repair_space>c" } ; for ( int j = 0 ; j < ( docs . length ) ; j ++ ) { Document d = new Document ( ) ; d . add ( new Field ( "contents" , docs [ j ] , Store . YES , Index . ANALYZED ) ) ; writer . addDocument ( d ) ; } writer . close ( ) ; <START_BUG> Searcher searcher = new IndexSearcher ( directory ) ; <END_BUG> String [ ] queries = new String [ ] { "a<seq2seq4repair_space>b" , "\"a<seq2seq4repair_space>b\"" , "\"a<seq2seq4repair_space>b<seq2seq4repair_space>c\"" , "a<seq2seq4repair_space>c" , "\"a<seq2seq4repair_space>c\"" , "\"a<seq2seq4repair_space>c<seq2seq4repair_space>e\"" } ; ScoreDoc [ ] hits = null ; QueryParser parser = new QueryParser ( "contents" , analyzer ) ; parser . setPhraseSlop ( 4 ) ; for ( int j = 0 ; j < ( queries . length ) ; j ++ ) { Query query = parser . parse ( queries [ j ] ) ; out . println ( ( "Query:<seq2seq4repair_space>" + ( query . toString ( "contents" ) ) ) ) ; hits = searcher . search ( query , null , 1000 ) . scoreDocs ; out . println ( ( ( hits . length ) + "<seq2seq4repair_space>total<seq2seq4repair_space>results" ) ) ; for ( int i = 0 ; ( i < ( hits . length ) ) && ( i < 10 ) ; i ++ ) { Document d = searcher . doc ( hits [ i ] . doc ) ; out . println ( ( ( ( ( i + "<seq2seq4repair_space>" ) + ( hits [ i ] . score ) ) + "<seq2seq4repair_space>" ) + ( d . get ( "contents" ) ) ) ) ; } } searcher . close ( ) ; } static long Time ( int year , int month , int day ) { } }

Fix:
Searcher searcher = new IndexSearcher ( directory , true ) ;