nus-yam/ex-repair huggingface dataset:
Buggy code:
public class PluginLoader { public PluginLoader ( ) { } public static Object loadExternalPlugin ( String className , String type , File file , Object [ ] args ) throws Exception { log . debug ( "loading.." ) ; if ( ( type . equals ( "java" ) ) || ( type . equals ( "jar" ) ) ) { String path = file . getPath ( ) ; URL [ ] url = new URL [ 1 ] ; URL newURL = new File ( path ) . toURL ( ) ; url [ 0 ] = newURL ; log . debug ( ( "url=" + newURL ) ) ; return new ExternalClassLoader ( url ) . instanciate ( className , args ) ; } <START_BUG> InterpreterHandler handler = ( ( InterpreterHandler ) ( pluginManager . getHandler ( "interpreter" ) ) ) ; <END_BUG> Object instance = handler . getInterpreter ( type ) ; if ( instance != null ) { AbstractInterpreter ip = ( ( AbstractInterpreter ) ( instance ) ) ; String pythonFile = ( ( file . toString ( ) ) + "//" ) + ( className . toString ( ) ) ; String pythonClass = className . toString ( ) . substring ( 0 , ( ( className . toString ( ) . length ( ) ) - 3 ) ) ; Object i = ip . instanciate ( pythonFile , pythonClass , args , "test" ) ; return i ; } return null ; } }

Fix:
InterpreterHandler handler = ( ( InterpreterHandler ) ( pluginManager . getHandler ( "org.columba.core.interpreter" ) ) ) ;
Buggy code:
public class TermsFilterBuilder implements FilterBuilder { private final Analyzer analyzer ; public TermsFilterBuilder ( Analyzer analyzer ) { } public Filter getFilter ( Element e ) throws ParserException { TermsFilter tf = new TermsFilter ( ) ; String text = DOMUtils . getNonBlankTextOrFail ( e ) ; String fieldName = DOMUtils . getAttributeWithInheritanceOrFail ( e , "fieldName" ) ; try { TokenStream ts = analyzer . tokenStream ( fieldName , new StringReader ( text ) ) ; TermToBytesRefAttribute termAtt = ts . addAttribute ( TermToBytesRefAttribute . class ) ; Term term = null ; BytesRef bytes = termAtt . getBytesRef ( ) ; ts . reset ( ) ; while ( ts . incrementToken ( ) ) { termAtt . fillBytesRef ( ) ; <START_BUG> term = new Term ( fieldName , new BytesRef ( bytes ) ) ; <END_BUG> tf . addTerm ( term ) ; } ts . end ( ) ; ts . close ( ) ; } catch ( IOException ioe ) { throw new RuntimeException ( ( "Error<seq2seq4repair_space>constructing<seq2seq4repair_space>terms<seq2seq4repair_space>from<seq2seq4repair_space>index:" + ioe ) ) ; } return tf ; } }

Fix:
term = new Term ( fieldName , BytesRef . deepCopyOf ( bytes ) ) ;
Buggy code:
public class SimpleSpleef extends JavaPlugin { public static final Logger log = Logger . getLogger ( "Minecraft" ) ; public static Economy economy = null ; public static Permission permission = null ; public static boolean checkPermission ( CommandSender sender , String permission ) { if ( ( SimpleSpleef . permission ) != null ) { try { return SimpleSpleef . permission . has ( sender , permission ) ; <START_BUG> } catch ( Exception e ) { <END_BUG> SimpleSpleef . log . warning ( "[SimpleSpleef]<seq2seq4repair_space>Checking<seq2seq4repair_space>Vault<seq2seq4repair_space>permission<seq2seq4repair_space>threw<seq2seq4repair_space>an<seq2seq4repair_space>exception.<seq2seq4repair_space>Are<seq2seq4repair_space>you<seq2seq4repair_space>using<seq2seq4repair_space>the<seq2seq4repair_space>most<seq2seq4repair_space>recent<seq2seq4repair_space>version?<seq2seq4repair_space>Falling<seq2seq4repair_space>back<seq2seq4repair_space>to<seq2seq4repair_space>to<seq2seq4repair_space>default<seq2seq4repair_space>permission<seq2seq4repair_space>checking." ) ; } } return ( sender . hasPermission ( permission ) ) || ( sender . hasPermission ( "simplespleef.*" ) ) ; } private static SimpleSpleef simpleSpleef ; public static SimpleSpleef getPlugin ( ) { } private static GameHandler gameHandler ; public static GameHandler getGameHandler ( ) { } private static WorldEditAPI worldEditAPI = null ; public static void setWorldEditAPI ( WorldEditAPI worldEditAPI ) { } public static WorldEditAPI getWorldEditAPI ( ) { } private static OriginalPositionKeeper originalPositionKeeper ; public static OriginalPositionKeeper getOriginalPositionKeeper ( ) { } private SimpleSpleefAdmin admin ; private SimpleSpleefCommandExecutor commandExecutor ; private Translator lang ; private SimpleSpleefBlockListener blockListener ; private SimpleSpleefPlayerListener playerListener ; private SimpleSpleefEntityListener entityListener ; public void onEnable ( ) { } public void onDisable ( ) { } public void configurePlugin ( ) { } public void reloadSimpleSpleefConfiguration ( ) { } protected void checkForUpdate ( ) { } protected void registerEvents ( ) { } public SimpleSpleefAdmin getAdminClass ( ) { } public SimpleSpleefCommandExecutor getCommandExecutor ( ) { } public SimpleSpleefBlockListener getBlockListener ( ) { } public SimpleSpleefPlayerListener getPlayerListener ( ) { } public SimpleSpleefEntityListener getEntityListener ( ) { } public String ll ( String key , String ... replacers ) { } public Map < String , String > lls ( String section ) { } private boolean setupEconomy ( ) { } private boolean setupPermission ( ) { } private void checkForWorldEdit ( ) { } No newline ; at end ; of file ; }

Fix:
} catch ( NoSuchMethodError e ) {
Buggy code:
public class SearchEngineMain { public static void main ( String [ ] args ) throws Exception { Scanner in = new Scanner ( System . in ) ; System . out . println ( "Search<seq2seq4repair_space>Engine<seq2seq4repair_space>Implementation" ) ; System . out . println ( "\nPart1:<seq2seq4repair_space>Text<seq2seq4repair_space>Processing\n-----------------------------------------------------------------\n" ) ; System . out . println ( "\nPart2:<seq2seq4repair_space>Web<seq2seq4repair_space>Crawling\n-----------------------------------------------------------------\n" ) ; String crawlStorageFolder = ".//Files//Dump" ; int numberOfCrawlers = 10 ; CrawlConfig config = new CrawlConfig ( ) ; config . setCrawlStorageFolder ( crawlStorageFolder ) ; config . setUserAgentString ( "UCI<seq2seq4repair_space>WebCrawler<seq2seq4repair_space>10604535<seq2seq4repair_space>12647996<seq2seq4repair_space>82721916" ) ; config . setPolitenessDelay ( 300 ) ; config . setMaxDepthOfCrawling ( 10 ) ; <START_BUG> config . setMaxPagesToFetch ( 1000 ) ; <END_BUG> PageFetcher pageFetcher = new PageFetcher ( config ) ; RobotstxtConfig robotstxtConfig = new RobotstxtConfig ( ) ; RobotstxtServer robotstxtServer = new RobotstxtServer ( robotstxtConfig , pageFetcher ) ; CrawlController controller = new CrawlController ( config , pageFetcher , robotstxtServer ) ; controller . addSeed ( "http:////www.ics.uci.edu//" ) ; System . out . println ( config . toString ( ) ) ; Date dt1 = new Date ( ) ; controller . start ( MyCrawler . class , numberOfCrawlers ) ; Date dt2 = new Date ( ) ; long diff = ( dt2 . getTime ( ) ) - ( dt1 . getTime ( ) ) ; long diffSeconds = ( diff // 1000 ) % 60 ; long diffMinutes = ( diff // ( 60 * 1000 ) ) % 60 ; long diffHours = ( diff // ( ( 60 * 60 ) * 1000 ) ) % 24 ; System . out . println ( ( ( ( ( ( ( "Time:<seq2seq4repair_space>" + diffHours ) + "<seq2seq4repair_space>hr<seq2seq4repair_space>" ) + diffMinutes ) + "<seq2seq4repair_space>m<seq2seq4repair_space>" ) + diffSeconds ) + "<seq2seq4repair_space>s" ) ) ; MyCrawler . writeIndexMap ( ) ; MyCrawler . writeDomainMap ( ) ; controller . shutdown ( ) ; System . out . println ( "Text<seq2seq4repair_space>process<seq2seq4repair_space>begins" ) ; TextProcessingWebFiles . textProcessing ( ".//Files//Result//IndexMap.txt" ) ; System . out . println ( "End" ) ; } No newline ; at end ; of file ; }

Fix:
config . setMaxPagesToFetch ( 150 ) ;
Buggy code:
public class RecoveredType extends RecoveredStatement implements CompilerModifiers , TerminalTokens { public TypeDeclaration typeDeclaration ; public RecoveredType [ ] memberTypes ; public int memberTypeCount ; public RecoveredField [ ] fields ; public int fieldCount ; public RecoveredMethod [ ] methods ; public int methodCount ; public boolean preserveContent = false ; public int bodyEnd ; public RecoveredType ( TypeDeclaration typeDeclaration , RecoveredElement parent , int bracketBalance ) { } public RecoveredElement add ( AbstractMethodDeclaration methodDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( Block nestedBlockDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( FieldDeclaration fieldDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( TypeDeclaration memberTypeDeclaration , int bracketBalanceValue ) { if ( ( ( typeDeclaration . declarationSourceEnd ) != 0 ) && ( ( memberTypeDeclaration . declarationSourceStart ) > ( typeDeclaration . declarationSourceEnd ) ) ) { return this . parent . add ( memberTypeDeclaration , bracketBalanceValue ) ; } if ( ( ( memberTypeDeclaration . bits ) & ( IsAnonymousTypeMASK ) ) != 0 ) { if ( ( this . methodCount ) > 0 ) { RecoveredMethod lastMethod = this . methods [ ( ( this . methodCount ) - 1 ) ] ; lastMethod . methodDeclaration . bodyEnd = 0 ; lastMethod . methodDeclaration . declarationSourceEnd = 0 ; ( lastMethod . bracketBalance ) ++ ; <START_BUG> return lastMethod . add ( typeDeclaration , bracketBalanceValue ) ; <END_BUG> } else { return this ; } } if ( ( memberTypes ) == null ) { memberTypes = new RecoveredType [ 5 ] ; memberTypeCount = 0 ; } else { if ( ( memberTypeCount ) == ( memberTypes . length ) ) { System . arraycopy ( memberTypes , 0 , ( memberTypes = new RecoveredType [ 2 * ( memberTypeCount ) ] ) , 0 , memberTypeCount ) ; } } RecoveredType element = new RecoveredType ( memberTypeDeclaration , this , bracketBalanceValue ) ; memberTypes [ ( ( memberTypeCount ) ++ ) ] = element ; if ( ! ( foundOpeningBrace ) ) { foundOpeningBrace = true ; ( this . bracketBalance ) ++ ; } if ( ( memberTypeDeclaration . declarationSourceEnd ) == 0 ) return element ; return this ; } public int bodyEnd ( ) { } public boolean bodyStartsAtHeaderEnd ( ) { } public RecoveredType enclosingType ( ) { } public char [ ] name ( ) { } public ASTNode parseTree ( ) { } public int sourceEnd ( ) { } public String toString ( int tab ) { } public void updateBodyStart ( int bodyStart ) { } public Statement updatedStatement ( ) { } public TypeDeclaration updatedTypeDeclaration ( ) { } public void updateFromParserState ( ) { } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { } public RecoveredElement updateOnOpeningBrace ( int braceStart , int braceEnd ) { } public void updateParseTree ( ) { } public void updateSourceEndIfNecessary ( int start , int end ) { } }

Fix:
return lastMethod . add ( memberTypeDeclaration , bracketBalanceValue ) ;
Buggy code:
public class GameScreen extends ScreenAdapter { ShapesGame game ; Player player ; Map map ; FPSLogger log ; public GameScreen ( ShapesGame game ) { } @ Override public void render ( float delta ) { gl . glClearColor ( 1 , 1 , 1 , 1 ) ; gl . glClear ( GL_COLOR_BUFFER_BIT ) ; game . cam . position . x = 700 ; game . cam . update ( ) ; player . update ( delta ) ; map . update ( delta ) ; for ( Obstacle ob : map . getObstacles ( ) ) { <START_BUG> player . collide ( ob . getRect ( ) ) ; <END_BUG> } game . batch . setColor ( 1 , 1 , 1 , 1 ) ; game . batch . setProjectionMatrix ( game . cam . combined ) ; game . batch . begin ( ) ; { player . draw ( game . batch ) ; } game . batch . end ( ) ; game . ren . setProjectionMatrix ( game . cam . combined ) ; game . ren . begin ( Filled ) ; { map . draw ( game . ren ) ; } game . ren . end ( ) ; if ( ( ( player . getPosition ( ) . x ) + ( player . getShape ( ) . width ) ) < 200 ) { gameOver ( ) ; } } private void gameOver ( ) { } @ Override public void dispose ( ) { } }

Fix:
player . collide ( ob ) ;
Buggy code:
public class Label extends Control { int frameHandle ; int labelHandle ; int imageHandle ; ImageList imageList ; Image image ; String text ; public Label ( Composite parent , int style ) { } static int checkStyle ( int style ) { } void addRelation ( Control control ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( int index ) { } void createWidget ( int index ) { } void deregister ( ) { } int eventHandle ( ) { } public int getAlignment ( ) { } public int getBorderWidth ( ) { } public Image getImage ( ) { } String getNameText ( ) { } public String getText ( ) { } void hookEvents ( ) { super . hookEvents ( ) ; if ( ( labelHandle ) != 0 ) { <START_BUG> OS . g_signal_connect ( labelHandle , mnemonic_activate , windowProc3 , MNEMONIC_ACTIVATE ) ; <END_BUG> } } boolean isDescribedByLabel ( ) { } boolean mnemonicHit ( char key ) { } boolean mnemonicMatch ( char key ) { } void register ( ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } void resizeHandle ( int width , int height ) { } public void setAlignment ( int alignment ) { } void setBackgroundColor ( GdkColor color ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize ) { } void setFontDescription ( int font ) { } void setForegroundColor ( GdkColor color ) { } void setOrientation ( ) { } public void setImage ( Image image ) { } public void setText ( String string ) { } void showWidget ( ) { } }

Fix:
OS . g_signal_connect_closure_by_id ( labelHandle , display . signalIds [ MNEMONIC_ACTIVATE ] , 0 , display . closures [ MNEMONIC_ACTIVATE ] , false ) ;
Buggy code:
public class ClassLiteralAccess extends Expression { public TypeReference type ; public TypeBinding targetType ; FieldBinding syntheticField ; public ClassLiteralAccess ( int sourceEnd , TypeReference type ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = Constant . NotAConstant ; if ( ( targetType = type . resolveType ( scope , true ) ) == null ) return null ; <START_BUG> if ( ( targetType . isArrayType ( ) ) && ( ( ( ( ArrayBinding ) ( targetType ) ) . leafComponentType ) == ( VoidBinding ) ) ) { <END_BUG> scope . problemReporter ( ) . cannotAllocateVoidArray ( this ) ; return null ; } else if ( targetType . isTypeVariable ( ) ) { scope . problemReporter ( ) . illegalClassLiteralForTypeVariable ( ( ( TypeVariableBinding ) ( targetType ) ) , this ) ; } ReferenceBinding classType = scope . getJavaLangClass ( ) ; if ( classType . isGenericType ( ) ) { TypeBinding boxedType = null ; if ( ( targetType . id ) == ( TypeIds . T_void ) ) { boxedType = scope . environment ( ) . getType ( TypeConstants . JAVA_LANG_VOID ) ; if ( boxedType == null ) { boxedType = new ProblemReferenceBinding ( TypeConstants . JAVA_LANG_VOID , null , ProblemReasons . NotFound ) ; } } else { boxedType = scope . boxing ( targetType ) ; } this . resolvedType = scope . environment ( ) . createParameterizedType ( classType , new TypeBinding [ ] { boxedType } , null ) ; } else { this . resolvedType = classType ; } return this . resolvedType ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
if ( ( targetType . isArrayType ( ) ) && ( ( ( ( ArrayBinding ) ( targetType ) ) . leafComponentType ) == ( TypeBinding . VOID ) ) ) {
Buggy code:
@ UseNoMemoryExpensiveCodec public class TestTermsEnum extends LuceneTestCase { public void test ( ) throws Exception { } private void addDoc ( RandomIndexWriter w , Collection < String > terms , Map < BytesRef , Integer > termToID , int id ) throws IOException { Document doc = new Document ( ) ; <START_BUG> doc . add ( new NumericField ( "id" ) . setIntValue ( id ) ) ; <END_BUG> if ( VERBOSE ) { System . out . println ( ( ( ( "TEST:<seq2seq4repair_space>addDoc<seq2seq4repair_space>id:" + id ) + "<seq2seq4repair_space>terms=" ) + terms ) ) ; } for ( String s2 : terms ) { doc . add ( newField ( "f" , s2 , TYPE_UNSTORED ) ) ; termToID . put ( new BytesRef ( s2 ) , id ) ; } w . addDocument ( doc ) ; terms . clear ( ) ; } private boolean accepts ( CompiledAutomaton c , BytesRef b ) { } public void testIntersectRandom ( ) throws IOException { } private Directory d ; private IndexReader r ; private final String FIELD = "field" ; private IndexReader makeIndex ( String ... terms ) throws Exception { } private void close ( ) throws Exception { } private int docFreq ( IndexReader r , String term ) throws Exception { } public void testEasy ( ) throws Exception { } public void testFloorBlocks ( ) throws Exception { } public void testZeroTerms ( ) throws Exception { } private String getRandomString ( ) { } public void testRandomTerms ( ) throws Exception { } private boolean seekExact ( TermsEnum te , String term ) throws IOException { } private String next ( TermsEnum te ) throws IOException { } private BytesRef getNonExistTerm ( BytesRef [ ] terms ) { } private static class TermAndState { public final BytesRef term ; public final TermState state ; public TermAndState ( BytesRef term , TermState state ) { } } private void testRandomSeeks ( IndexReader r , String ... validTermStrings ) throws IOException { } }

Fix:
doc . add ( new NumericField ( "id" , id ) ) ;
Buggy code:
public class LanguageParserTest { private LanguageParser parser ; @ Before public void setUp ( ) throws Exception { } @ Test public void testProcess ( ) throws Exception { } @ Test public void testPipe ( ) throws Exception { } @ Test public void testMacro ( ) throws Exception { BasicParseRunner runner = new BasicParseRunner ( parser . Macro ( ) ) ; <START_BUG> ParsingResult result = runner . run ( "def<seq2seq4repair_space>test()<seq2seq4repair_space>:<seq2seq4repair_space>Constraint<seq2seq4repair_space>=<seq2seq4repair_space>test1.value<seq2seq4repair_space>=<seq2seq4repair_space>10;" ) ; <END_BUG> MacroInfo info = ( ( MacroInfo ) ( result . valueStack . pop ( ) ) ) ; assertEquals ( "test" , info . getIdentifier ( ) . getName ( ) ) ; } @ Test public void testBooleanLiteral ( ) throws Exception { } @ Test public void testBooleanOperation ( ) throws Exception { } @ Test public void testBooleanExpression ( ) throws Exception { } @ Test public void testNotOperation ( ) throws Exception { } @ Test public void testNumberExpression ( ) throws Exception { } @ Test public void testParenthesizedBooleanExpression ( ) throws Exception { } @ Test public void testParenthesizedNumberExpression ( ) throws Exception { } @ Test public void testPeriodLiteral ( ) throws Exception { } @ Test public void testDateTimeExpression ( ) throws Exception { } @ Test public void testDateExpression ( ) throws Exception { } @ Test public void testDateComparison ( ) throws Exception { } @ Test public void testDateOperation ( ) throws Exception { } @ Test public void testRelative ( ) throws Exception { } No newline ; at end ; of file ; }

Fix:
ParsingResult result = runner . run ( "def<seq2seq4repair_space>test<seq2seq4repair_space>:<seq2seq4repair_space>Constraint<seq2seq4repair_space>=<seq2seq4repair_space>test1.value<seq2seq4repair_space>=<seq2seq4repair_space>10;" ) ;
Buggy code:
public class Macros { public static Construct Field ( String name , int length ) { } public static Adapter BitField ( final String name , final int length , boolean swapped , boolean signed , int bytesize ) { } public static Adapter BitField ( final String name , final int length ) { } public static Adapter Padding ( int length , byte pattern , boolean strict ) { <START_BUG> return PaddingAdapter ( Macros . Field ( "" , length ) , pattern , strict ) ; <END_BUG> } public static Adapter Padding ( int length ) { } public static Adapter Flag ( String name ) { } public static Adapter Flag ( String name , byte truth , byte falsehood , Object defaultmapping ) { } public static Adapter Bit ( String name ) { } public static Adapter Nibble ( String name ) { } public static Adapter Octet ( String name ) { } static FormatField UBInt8 ( String name ) { } public static FormatField UBInt16 ( String name ) { } public static FormatField UBInt32 ( String name ) { } public static FormatField UBInt64 ( String name ) { } public static FormatField SBInt8 ( String name ) { } public static FormatField SBInt16 ( String name ) { } public static FormatField SBInt32 ( String name ) { } public static FormatField SBInt64 ( String name ) { } public static FormatField ULInt8 ( String name ) { } public static FormatField ULInt16 ( String name ) { } public static FormatField ULInt32 ( String name ) { } public static FormatField ULInt64 ( String name ) { } public static FormatField SLInt8 ( String name ) { } public static FormatField SLInt16 ( String name ) { } public static FormatField SLInt32 ( String name ) { } public static FormatField SLInt64 ( String name ) { } public static FormatField UNInt8 ( String name ) { } public static FormatField UNInt16 ( String name ) { } public static FormatField UNInt32 ( String name ) { } public static FormatField UNInt64 ( String name ) { } public static FormatField SNInt8 ( String name ) { } public static FormatField SNInt16 ( String name ) { } public static FormatField SNInt32 ( String name ) { } public static FormatField SNInt64 ( String name ) { } public static Subconstruct Bitwise ( Construct subcon ) { } public static Adapter SymmetricMapping ( Construct subcon , final Container mapping , Object mappingdefault ) { } public static Construct BitStruct ( String name , Subconstruct ... subcons ) { } }

Fix:
return PaddingAdapter ( Macros . Field ( null , length ) , pattern , strict ) ;
Buggy code:
public final class ScheduledThreadPoolService implements Service < ManagedScheduledExecutorService > { private final InjectedValue < ThreadFactory > threadFactoryValue = new InjectedValue < ThreadFactory > ( ) ; private ManagedScheduledExecutorService executor ; private StopContext context ; private final int maxThreads ; private final TimeSpec keepAlive ; public ScheduledThreadPoolService ( final int maxThreads , final TimeSpec keepAlive ) { } public synchronized void start ( final StartContext context ) throws StartException { } public synchronized void stop ( final StopContext context ) { } public synchronized ManagedScheduledExecutorService getValue ( ) throws IllegalStateException { final ManagedScheduledExecutorService value = this . executor ; if ( value == null ) { <START_BUG> throw ROOT_LOGGER . scheduledThreadPoolExecutorUninitialized ( ) ; <END_BUG> } return value ; } public Injector < ThreadFactory > getThreadFactoryInjector ( ) { } public int getActiveCount ( ) { } public long getCompletedTaskCount ( ) { } public int getCurrentThreadCount ( ) { } public int getLargestThreadCount ( ) { } public long getTaskCount ( ) { } public int getQueueSize ( ) { } private class ExecutorImpl extends ScheduledThreadPoolExecutor { ExecutorImpl ( final int corePoolSize , final ThreadFactory threadFactory ) { } protected void terminated ( ) { } } }

Fix:
throw MESSAGES . scheduledThreadPoolExecutorUninitialized ( ) ;
Buggy code:
public class TestEnglishAnalyzer extends BaseTokenStreamTestCase { public void testResourcesAvailable ( ) { } public void testBasics ( ) throws IOException { } public void testExclude ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new EnglishAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } }

Fix:
checkRandomData ( random ( ) , new EnglishAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public final class LookupInjectionSource extends InjectionSource { private final String lookupName ; public LookupInjectionSource ( final String lookupName ) { } public void getResourceValue ( final ResolutionContext resolutionContext , final ServiceBuilder < ? > serviceBuilder , final DeploymentPhaseContext phaseContext , final Injector < ManagedReferenceFactory > injector ) { final String applicationName = resolutionContext . getApplicationName ( ) ; final String moduleName = resolutionContext . getModuleName ( ) ; final String componentName = resolutionContext . getComponentName ( ) ; final boolean compUsesModule = resolutionContext . isCompUsesModule ( ) ; final String lookupName ; if ( ! ( this . lookupName . contains ( "java:" ) ) ) { if ( ( componentName != null ) && ( ! compUsesModule ) ) { lookupName = "java:comp//env//" + ( this . lookupName ) ; } else if ( compUsesModule ) { lookupName = "java:module//env//" + ( this . lookupName ) ; } else { lookupName = "java:jboss//env" + ( this . lookupName ) ; } } else if ( ( this . lookupName . startsWith ( "java:comp//" ) ) && compUsesModule ) { lookupName = "java:module//" + ( this . lookupName . substring ( 10 ) ) ; } else { lookupName = this . lookupName ; } final ContextNames . BindInfo bindInfo = ContextNames . bindInfoFor ( applicationName , moduleName , componentName , lookupName ) ; <START_BUG> bindInfo . setupLookupInjection ( serviceBuilder , injector , phaseContext . getDeploymentUnit ( ) ) ; <END_BUG> } public boolean equals ( Object configuration ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
bindInfo . setupLookupInjection ( serviceBuilder , injector ) ;
Buggy code:
public class Argument extends LocalDeclaration { public Argument ( char [ ] name , long posNom , TypeReference tr , int modifiers ) { } public void bind ( MethodScope scope , TypeBinding typeBinding , boolean used ) { } public TypeBinding resolveForCatch ( BlockScope scope ) { TypeBinding tb = type . resolveTypeExpecting ( scope , scope . getJavaLangThrowable ( ) ) ; if ( tb == null ) return null ; if ( ( binding = scope . duplicateName ( name ) ) != null ) { scope . problemReporter ( ) . redefineArgument ( this ) ; return null ; } <START_BUG> binding = new LocalVariableBinding ( this , tb , modifiers , true ) ; <END_BUG> scope . addLocalVariable ( binding ) ; binding . constant = NotAConstant ; return tb ; } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
binding = new LocalVariableBinding ( this , tb , modifiers , false ) ;
Buggy code:
@ ManagedBean @ SessionScoped public class MyCarBean implements Serializable { @ ManagedProperty ( "#{serviceOffice}" ) private OfficeService serviceOffice ; private ArrayList < Office > listOffices ; private ArrayList < Book > listBooks ; private Office currentOffice ; private Float total ; private Integer row ; public MyCarBean ( ) { } @ PostConstruct public void init ( ) { } public void addListBooks ( Book book ) { } public void removeBook ( Book book ) { } public void cleanVariables ( ) { } public String addBook ( int id ) { SessionService sessionBean = new SessionService ( ) ; if ( sessionBean . checkSession ( ) ) { BookDAO bookDAO = new BookDAO ( ) ; Book book = bookDAO . findById ( id ) ; cleanVariables ( ) ; addListBooks ( book ) ; <START_BUG> return "//public//MyCar.jsf?faces-redirect=true" ; <END_BUG> } else { return "//public//Login.jsf?faces-redirect=true" ; } } public String buyBooks ( ) { } public Integer getRow ( ) { } public void setRow ( Integer row ) { } public Float getTotal ( ) { } public void setTotal ( Float total ) { } public ArrayList < Book > getListBooks ( ) { } public void setListBooks ( ArrayList < Book > listBooks ) { } public ArrayList < Office > getListOffices ( ) { } public void setListOffices ( ArrayList < Office > listOffices ) { } public OfficeService getServiceOffice ( ) { } public void setServiceOffice ( OfficeService serviceOffice ) { } public Office getCurrentOffice ( ) { } public void setCurrentOffice ( Office currentOffice ) { } }

Fix:
return "//public//BookCatalog.jsf?faces-redirect=true" ;
Buggy code:
public class ImageLayerTest { private Composition comp ; private ImageLayer layer ; @ Before public void setUp ( ) { } @ After public void tearDown ( ) { } @ Test public void testGetImage ( ) { } @ Test public void testSetImage ( ) { } @ Test public void testStartPreviewing ( ) { } @ Test public void testStartNewPreviewFromDialog ( ) { } @ Test public void testOkPressedInDialog ( ) { } @ Test ( expected = AssertionError . class ) public void testCancelPressedInDialog_Fail ( ) { } @ Test public void testCancelPressedInDialog_OK ( ) { } @ Test public void testTweenCalculatingStarted ( ) { } @ Test ( expected = AssertionError . class ) public void testTweenCalculatingEnded_Fail ( ) { } @ Test public void testTweenCalculatingEnded_OK ( ) { } <START_BUG> @ Test ( expected = AssertionError . class ) <END_BUG> public void testChangePreviewImage_Fail ( ) { layer . changePreviewImage ( TestHelper . createTestImage ( ) , "filterName" ) ; assertEquals ( PREVIEW , layer . getState ( ) ) ; } @ Test public void testChangePreviewImage_OK ( ) { } @ Test public void testFilterWithoutDialogFinished ( ) { } @ Test public void testChangeImageUndoRedo ( ) { } @ Test public void testGetBounds ( ) { } @ Test public void testCheckForLayerEnlargement ( ) { } @ Test public void testEnlargeLayer ( ) { } @ Test public void testGetImageForFilterDialogs ( ) { } @ Test public void testCreateTmpDrawingLayer ( ) { } @ Test public void testMergeTmpDrawingImageDown ( ) { } @ Test public void testCreateCompositionSizedTmpImage ( ) { } @ Test public void testCreateCompositionSizedSubImage ( ) { } @ Test public void testGetFilterSourceImage ( ) { } @ Test public void testGetImageOrSubImageIfSelected ( ) { } @ Test public void testGetSelectionSizedPartFrom ( ) { } @ Test public void testCropToCanvasSize ( ) { } No newline ; at end ; of file ; }

Fix:
@ Test ( expected = IllegalStateException . class )
Buggy code:
public class StoreCacheImpl implements StoreCache { private final MetaDataRepository _repos ; private final DelegatingDataCache _cache ; public StoreCacheImpl ( EntityManagerFactoryImpl emf , DataCache cache ) { } public DataCache getDelegate ( ) { } public boolean contains ( Class cls , Object oid ) { } public boolean containsAll ( Class cls , Object ... oids ) { } public boolean containsAll ( Class cls , Collection oids ) { } public void pin ( Class cls , Object oid ) { } public void pinAll ( Class cls , Object ... oids ) { } public void pinAll ( Class cls , Collection oids ) { } public void unpin ( Class cls , Object oid ) { } public void unpinAll ( Class cls , Object ... oids ) { } public void unpinAll ( Class cls , Collection oids ) { } public void evict ( Class cls , Object oid ) { } public void evictAll ( Class cls , Object ... oids ) { } public void evictAll ( Class cls , Collection oids ) { } public void evictAll ( ) { } public CacheStatistics getStatistics ( ) { } private ClassMetaData getMetaData ( Class cls ) { } public int hashCode ( ) { } public boolean equals ( Object other ) { } @ SuppressWarnings ( "unchecked" ) public void evict ( Class cls ) { if ( ( getMetaData ( cls ) ) != null ) { <START_BUG> _cache . removeAll ( cls , false ) ; <END_BUG> } } }

Fix:
_cache . removeAll ( cls , true ) ;
Buggy code:
public class WebRequestWithCryptedUrl extends ServletWebRequest { private final String queryString ; private final ValueMap parameters ; private String path ; public WebRequestWithCryptedUrl ( final HttpServletRequest request ) { } private String rebuildUrl ( String queryString ) { } private ValueMap analyzeQueryString ( final String queryString ) { } public String getParameter ( final String key ) { } public Map getParameterMap ( ) { } public String [ ] getParameters ( final String key ) { <START_BUG> return ( ( String [ ] ) ( parameters . keySet ( ) . toArray ( ) ) ) ; <END_BUG> } public String toString ( ) { } }

Fix:
return ( ( String [ ] ) ( this . parameters . get ( key ) ) ) ;
Buggy code:
public class ViewUtils { private static long mAnimTime = - 1 ; protected ViewUtils ( ) { } @ TargetApi ( VERSION_CODES . HONEYCOMB_MR2 ) public static void toogleViews ( final View view1 , final View view2 ) { } @ TargetApi ( VERSION_CODES . HONEYCOMB_MR2 ) public static void toogleViews ( final View view1 , final View view2 , final boolean showView2 ) { } @ TargetApi ( VERSION_CODES . HONEYCOMB_MR2 ) public static void toogleViews ( final View view1 , final View view2 , final boolean showView2 , long animTime ) { } public static void showKeyboard ( Activity activity ) { } public static void hideKeyboard ( Activity activity ) { InputMethodManager inputManager = ( ( InputMethodManager ) ( activity . getSystemService ( INPUT_METHOD_SERVICE ) ) ) ; <START_BUG> inputManager . hideSoftInputFromWindow ( ( null == ( activity . getCurrentFocus ( ) ) ? null : activity . getCurrentFocus ( ) . getWindowToken ( ) ) , HIDE_NOT_ALWAYS ) ; <END_BUG> } private static void initAnimTime ( View view ) { } }

Fix:
inputManager . hideSoftInputFromWindow ( ( null == ( activity . getCurrentFocus ( ) ) ? null : activity . getCurrentFocus ( ) . getWindowToken ( ) ) , ( ( InputMethodManager . HIDE_NOT_ALWAYS ) | ( InputMethodManager . HIDE_IMPLICIT_ONLY ) ) ) ;
Buggy code:
public class PebbleTemplateImpl implements PebbleTemplate { protected final PebbleEngine engine ; private final Map < String , Block > blocks = new HashMap < > ( ) ; private final Map < String , Macro > macros = new HashMap < > ( ) ; private final RootNode rootNode ; private final String name ; private final ClassAttributeCache attributeCache = new ClassAttributeCache ( ) ; public PebbleTemplateImpl ( PebbleEngine engine , RootNode root , String name ) throws PebbleException { } public void buildContent ( Writer writer , EvaluationContext context ) throws PebbleException , IOException { } public void evaluate ( Writer writer ) throws PebbleException , IOException { } public void evaluate ( Writer writer , Locale locale ) throws PebbleException , IOException { } public void evaluate ( Writer writer , Map < String , Object > map ) throws PebbleException , IOException { } public void evaluate ( Writer writer , Map < String , Object > map , Locale locale ) throws PebbleException , IOException { } public void evaluate ( Writer writer , EvaluationContext context ) throws PebbleException , IOException { if ( ( context . getExecutorService ( ) ) != null ) { <START_BUG> writer = new com . mitchellbosecke . pebble . utils . FutureWriter ( writer , context . getExecutorService ( ) ) ; <END_BUG> } buildContent ( writer , context ) ; writer . flush ( ) ; } private EvaluationContext initContext ( Locale locale ) { } public void importTemplate ( EvaluationContext context , String name ) throws PebbleException { } public void includeTemplate ( Writer writer , EvaluationContext context , String name ) throws PebbleException , IOException { } public boolean hasMacro ( String macroName ) { } public void registerBlock ( Block block ) { } public boolean hasBlock ( String blockName ) { } public void registerMacro ( Macro macro ) throws PebbleException { } public void block ( Writer writer , EvaluationContext context , String blockName , boolean ignoreOverriden ) throws PebbleException , IOException { } public String macro ( EvaluationContext context , String macroName , ArgumentsNode args , boolean ignoreOverriden ) throws PebbleException { } public void setParent ( EvaluationContext context , String parentName ) throws PebbleException { } public String getName ( ) { } public ClassAttributeCache getAttributeCache ( ) { } }

Fix:
writer = new FutureWriter ( writer ) ;
Buggy code:
public class CCUpdate extends ClearCase { private boolean m_Graphical = false ; private boolean m_Overwrite = false ; private boolean m_Rename = false ; private boolean m_Ctime = false ; private boolean m_Ptime = false ; private String m_Log = null ; public void execute ( ) throws BuildException { Commandline commandLine = new Commandline ( ) ; Project aProj = getProject ( ) ; int result = 0 ; if ( ( getViewPath ( ) ) == null ) { setViewPath ( aProj . getBaseDir ( ) . getPath ( ) ) ; } commandLine . setExecutable ( getClearToolCommand ( ) ) ; commandLine . createArgument ( ) . setValue ( COMMAND_UPDATE ) ; checkOptions ( commandLine ) ; System . out . println ( commandLine . toString ( ) ) ; result = run ( commandLine ) ; if ( result != 0 ) { String msg = "Failed<seq2seq4repair_space>executing:<seq2seq4repair_space>" + ( commandLine . toString ( ) ) ; <START_BUG> throw new BuildException ( msg , location ) ; <END_BUG> } } private void checkOptions ( Commandline cmd ) { } public void setGraphical ( boolean graphical ) { } public boolean getGraphical ( ) { } public void setOverwrite ( boolean ow ) { } public boolean getOverwrite ( ) { } public void setRename ( boolean ren ) { } public boolean getRename ( ) { } public void setCurrentTime ( boolean ct ) { } public boolean getCurrentTime ( ) { } public void setPreserveTime ( boolean pt ) { } public boolean getPreserveTime ( ) { } public void setLog ( String log ) { } public String getLog ( ) { } private void getLogCommand ( Commandline cmd ) { } public static final String FLAG_GRAPHICAL = "-graphical" ; public static final String FLAG_LOG = "-log" ; public static final String FLAG_OVERWRITE = "-overwrite" ; public static final String FLAG_NOVERWRITE = "-noverwrite" ; public static final String FLAG_RENAME = "-rename" ; public static final String FLAG_CURRENTTIME = "-ctime" ; public static final String FLAG_PRESERVETIME = "-ptime" ; }

Fix:
throw new BuildException ( msg , getLocation ( ) ) ;
Buggy code:
public class AddressbookMain implements IComponentPlugin { private static final Logger LOG = Logger . getLogger ( "org.columba.addressbook.main" ) ; private static final String RESOURCE_PATH = "org.columba.addressbook.i18n.global" ; public AddressbookMain ( ) { } public void handleCommandLineParameters ( CommandLine commandLine ) { } public void init ( ) { Runnable plugin = new SaveAllAddressbooksPlugin ( ) ; BackgroundTaskManager . getInstance ( ) . register ( plugin ) ; ShutdownManager . getInstance ( ) . register ( plugin ) ; ServiceRegistry . getInstance ( ) . register ( IContactFacade . class , new ContactFacade ( ) ) ; ServiceRegistry . getInstance ( ) . register ( IFolderFacade . class , new FolderFacade ( ) ) ; <START_BUG> ServiceRegistry . getInstance ( ) . register ( IDialogFacade . class , new ModelFacade ( ) ) ; <END_BUG> ServiceRegistry . getInstance ( ) . register ( IDialogFacade . class , new DialogFacade ( ) ) ; } public void postStartup ( ) { } public void registerCommandLineArguments ( ) { } }

Fix:
ServiceRegistry . getInstance ( ) . register ( IModelFacade . class , new ModelFacade ( ) ) ;
Buggy code:
public class TestSimpleLRUCache extends BaseTestLRU { public void testLRUCache ( ) throws Exception { final int n = 100 ; <START_BUG> testCache ( new SimpleLRUCache ( n ) , n ) ; <END_BUG> } }

Fix:
testCache ( new SimpleLRUCache < Integer , Object > ( n ) , n ) ;
Buggy code:
public class HangManTest extends WebTestCase { public HangManTest ( String message ) { } public void testHangmanWinGame ( ) throws Exception { } private Letter letter ( Game hangman , char c ) { } private boolean guess ( Game hangman , char c ) { } public void testHangmanLoseGame ( ) throws Exception { } public void testHangmanSuccessWebGame ( ) { } public void testHangmanFailureWebGame ( ) { getTestContext ( ) . setBaseUrl ( "http:////localhost:8098//wicket-examples" ) ; beginAt ( "//hangman?word=hangman" ) ; assertTitleEquals ( "Wicket<seq2seq4repair_space>Examples<seq2seq4repair_space>-<seq2seq4repair_space>hangman" ) ; assertLinkPresent ( "start" ) ; clickLink ( "start" ) ; assertTitleEquals ( "Wicket<seq2seq4repair_space>Examples<seq2seq4repair_space>-<seq2seq4repair_space>hangman" ) ; assertTextPresent ( "guesses<seq2seq4repair_space>remaining" ) ; assertElementPresent ( "guessesRemaining" ) ; assertTextInElement ( "guessesRemaining" , "5" ) ; clickLink ( "letter_f" ) ; assertElementPresent ( "guessesRemaining" ) ; assertTextInElement ( "guessesRemaining" , "4" ) ; assertLinkNotPresent ( "letter_f" ) ; clickLink ( "letter_x" ) ; assertTextInElement ( "guessesRemaining" , "3" ) ; clickLink ( "letter_e" ) ; assertTextInElement ( "guessesRemaining" , "2" ) ; clickLink ( "letter_t" ) ; assertTextInElement ( "guessesRemaining" , "1" ) ; clickLink ( "letter_v" ) ; <START_BUG> assertTextPresent ( "Bad<seq2seq4repair_space>Luck!<seq2seq4repair_space>You<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>guess<seq2seq4repair_space>that<seq2seq4repair_space>the<seq2seq4repair_space>word<seq2seq4repair_space>was" ) ; <END_BUG> } private void doGuessTest ( Game hangman , char c , boolean expected ) { } public static Test suite ( ) { } }

Fix:
assertTextPresent ( "Bad<seq2seq4repair_space>luck.<seq2seq4repair_space>You<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>guess<seq2seq4repair_space>that<seq2seq4repair_space>the<seq2seq4repair_space>word<seq2seq4repair_space>was" ) ;
Buggy code:
public class ImportContainer extends SourceRefElement implements IImportContainer { protected ImportContainer ( ICompilationUnit parent ) { } public String getHandleMemento ( ) { } protected char getHandleMementoDelimiter ( ) { <START_BUG> Assert . isTrue ( false , Util . bind ( "assert.shouldNotImplement" ) ) ; <END_BUG> return 0 ; } public IImportDeclaration getImport ( String name ) { } public ISourceRange getSourceRange ( ) throws JavaModelException { } public boolean hasChildren ( ) throws JavaModelException { } public String readableName ( ) { } protected void toString ( int tab , StringBuffer buffer ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } }

Fix:
Assert . isTrue ( false , "Should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>called" ) ;
Buggy code:
public class DefaultPagesProcessor implements IPagesProcessor { public DefaultPagesProcessor ( ) { } private static final int PAGES_CHUNK_SIZE = 128 ; private int pagesCount ; private String longestPageUrl ; private HashMap < String , Integer > subdomainsCount ; private HashMap < String , Integer > mostCommonWords ; private HashMap < String , Integer > mostCommonNGrams ; @ Override public void processPages ( IPagesRepository repository , PagesProcessorConfiguration config ) throws SQLException { } @ Override public int getUniquePagesCount ( ) { } @ Override public Map < String , Integer > getSubdomainsCount ( ) { } @ Override public String getLongestPage ( ) { } @ Override public Map < String , Integer > getMostCommonWords ( int count ) { } @ Override public Map < String , Integer > getMostCommonNGrams ( int count ) { } private void processUniquePagesCount ( List < PageProcessingData > pages ) { } private void processMostCommonElements ( List < PageProcessingData > pages , PagesProcessorConfiguration config ) { } private void computeWord ( PagesProcessorConfiguration config , PageProcessingData page , int wordStartIndex , Queue < String > nGramWordsQueue , int i ) { } private void addToMap ( Map < String , Integer > map , String key ) { } private int processLongestPage ( List < PageProcessingData > pages , int longestPageLength ) { } private void processSubdomains ( List < PageProcessingData > pages ) { Pattern patt = Pattern . compile ( ".*ics\\.uci\\.edu.*" ) ; String url ; for ( PageProcessingData page : pages ) { url = page . getUrl ( ) ; if ( patt . matcher ( url ) . matches ( ) ) { String key = url . substring ( 0 , ( ( url . indexOf ( "\\.edu" , 0 ) ) + 4 ) ) ; if ( subdomainsCount . containsKey ( key ) ) <START_BUG> subdomainsCount . put ( page . getUrl ( ) , ( + 1 ) ) ; <END_BUG> else subdomainsCount . put ( page . getUrl ( ) , 1 ) ; } } } private < K , V extends Comparable < ? super V > > Map < K , V > sortMapByValueDescending ( Map < K , V > map ) { } private < K , V > Map < K , V > getMapFirstEntries ( Map < K , V > map , int elementsToReturn ) { } }

Fix:
subdomainsCount . put ( page . getUrl ( ) , ( ( subdomainsCount . get ( key ) ) + 1 ) ) ;
Buggy code:
class NewDomainModelImpl extends BasicModelController implements NewDomainModel { protected NewDomainModelImpl ( final ExtensibleConfigurationPersister configurationPersister ) { } protected NewDomainModelImpl ( final ModelNode model , final ExtensibleConfigurationPersister configurationPersister ) { } private void createCoreModel ( ) { } public ModelNode getModel ( ) { <START_BUG> return super . getModel ( ) . clone ( ) ; <END_BUG> } protected static void initialize ( final ModelNodeRegistration root , final ExtensibleConfigurationPersister configurationPersister ) { } protected ModelNodeRegistration getRegistry ( ) { } }

Fix:
return super . getModel ( ) ;
Buggy code:
public class CacheReadAttributeHandler implements OperationStepHandler { public static final CacheReadAttributeHandler INSTANCE = new CacheReadAttributeHandler ( ) ; private final ParametersValidator nameValidator = new ParametersValidator ( ) ; private CacheReadAttributeHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { nameValidator . validate ( operation ) ; final String attributeName = operation . require ( ModelDescriptionConstants . NAME ) . asString ( ) ; final ModelNode submodel = context . readResource ( EMPTY_ADDRESS ) . getModel ( ) ; final ModelNode currentValue = submodel . get ( attributeName ) . clone ( ) ; context . getResult ( ) . set ( currentValue ) ; <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class Game { public static void main ( String [ ] args ) { JFrame window = new JFrame ( "My<seq2seq4repair_space>test<seq2seq4repair_space>Game" ) ; <START_BUG> window . setContentPane ( new GameWindow ( ) ) ; <END_BUG> window . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE ) ; window . setResizable ( false ) ; window . pack ( ) ; window . setVisible ( true ) ; } }

Fix:
window . setContentPane ( new GamePanel ( ) ) ;
Buggy code:
public class SearchAccessorGaeImpl extends com . claymus . data . access . SearchAccessorGaeImpl implements SearchAccessor { public SearchAccessorGaeImpl ( String indexName ) { } @ Override public DataListCursorTuple < Long > searchPratilipi ( PratilipiFilter pratilipiFilter , String cursorStr , Integer resultCount ) { <START_BUG> SortOptions sortOptions = SortOptions . newBuilder ( ) . addSortExpression ( SortExpression . newBuilder ( ) . setExpression ( "relevance" ) . setDirection ( DESCENDING ) . setDefaultValueNumeric ( ( - 999999999 ) ) ) . setLimit ( 10000 ) . build ( ) ; <END_BUG> String searchQuery = ( ( pratilipiFilter . getType ( ) ) == null ) ? "docType:Pratilipi" : "docType:Pratilipi-" + ( pratilipiFilter . getType ( ) ) ; if ( ( pratilipiFilter . getLanguageId ( ) ) != null ) searchQuery = ( searchQuery + "<seq2seq4repair_space>AND<seq2seq4repair_space>language:" ) + ( pratilipiFilter . getLanguageId ( ) ) ; if ( ( pratilipiFilter . getAuthorId ( ) ) != null ) searchQuery = ( searchQuery + "<seq2seq4repair_space>AND<seq2seq4repair_space>author:" ) + ( pratilipiFilter . getAuthorId ( ) ) ; Results < ScoredDocument > result = search ( searchQuery , sortOptions , cursorStr , resultCount , "docId" ) ; List < Long > pratilipiIdList = new java . util . ArrayList ( result . getNumberReturned ( ) ) ; for ( ScoredDocument document : result ) pratilipiIdList . add ( Long . parseLong ( document . getFields ( "docId" ) . iterator ( ) . next ( ) . getAtom ( ) ) ) ; Cursor cursor = result . getCursor ( ) ; return new DataListCursorTuple < Long > ( pratilipiIdList , ( cursor == null ? null : cursor . toWebSafeString ( ) ) ) ; } @ Override public void indexPratilipiData ( PratilipiData pratilipiData ) throws UnexpectedServerException { } @ Override public void indexPratilipiDataList ( List < PratilipiData > pratilipiDataList ) throws UnexpectedServerException { } @ Override public void deletePratilipiDataIndex ( Long pratilipiId ) { } private Document createDocument ( PratilipiData pratilipiData ) { } No newline ; at end ; of file ; }

Fix:
SortOptions sortOptions = SortOptions . newBuilder ( ) . addSortExpression ( SortExpression . newBuilder ( ) . setExpression ( "relevance" ) . setDirection ( DESCENDING ) . setDefaultValueNumeric ( 0 ) ) . setLimit ( 10000 ) . build ( ) ;