nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Depend extends MatchingTask { private static class ClassFileInfo { public File absoluteFile ; public String relativeName ; public String className ; } private Path srcPath ; private Path destPath ; private File cache ; private Hashtable affectedClassMap ; private Hashtable classFileInfoMap ; private Vector outOfDateClasses ; private boolean closure ; private void writeDependencyList ( File depFile , Vector dependencyList ) throws IOException { } private Vector readDependencyList ( File depFile ) throws IOException { } private void determineDependencies ( ) throws IOException { } private void deleteAllAffectedFiles ( ) { } private void deleteAffectedFiles ( String className ) { Hashtable affectedClasses = ( ( Hashtable ) ( affectedClassMap . get ( className ) ) ) ; if ( affectedClasses != null ) { for ( Enumeration e = affectedClasses . keys ( ) ; e . hasMoreElements ( ) ; ) { String affectedClassName = ( ( String ) ( e . nextElement ( ) ) ) ; Depend . ClassFileInfo affectedClassInfo = ( ( Depend . ClassFileInfo ) ( affectedClasses . get ( affectedClassName ) ) ) ; if ( affectedClassInfo . absoluteFile . exists ( ) ) { log ( ( ( ( ( "Deleting<seq2seq4repair_space>file<seq2seq4repair_space>" + ( affectedClassInfo . absoluteFile . getPath ( ) ) ) + "<seq2seq4repair_space>since<seq2seq4repair_space>" ) + className ) + "<seq2seq4repair_space>out<seq2seq4repair_space>of<seq2seq4repair_space>date" ) , MSG_VERBOSE ) ; affectedClassInfo . absoluteFile . delete ( ) ; if ( closure ) { deleteAffectedFiles ( affectedClassName ) ; } else { if ( ( affectedClassName . indexOf ( "$" ) ) != ( - 1 ) ) { String topLevelClassName = affectedClassName . substring ( 0 , affectedClassName . indexOf ( "$" ) ) ; <START_BUG> System . out . println ( ( "Top<seq2seq4repair_space>level<seq2seq4repair_space>class<seq2seq4repair_space>=<seq2seq4repair_space>" + topLevelClassName ) ) ; <END_BUG> Depend . ClassFileInfo topLevelClassInfo = ( ( Depend . ClassFileInfo ) ( classFileInfoMap . get ( topLevelClassName ) ) ) ; if ( topLevelClassInfo . absoluteFile . exists ( ) ) { log ( ( ( ( "Deleting<seq2seq4repair_space>file<seq2seq4repair_space>" + ( topLevelClassInfo . absoluteFile . getPath ( ) ) ) + "<seq2seq4repair_space>since<seq2seq4repair_space>" ) + "one<seq2seq4repair_space>of<seq2seq4repair_space>its<seq2seq4repair_space>inner<seq2seq4repair_space>classes<seq2seq4repair_space>was<seq2seq4repair_space>removed" ) , MSG_VERBOSE ) ; topLevelClassInfo . absoluteFile . delete ( ) ; if ( closure ) { deleteAffectedFiles ( topLevelClassName ) ; } } } } } } } } public void execute ( ) throws BuildException { } protected void scanDir ( File srcDir , String [ ] files ) { } private Vector getClassFiles ( Path classLocations ) { } private void addClassFiles ( Vector classFileList , File dir , File root ) { } public void setSrcdir ( Path srcPath ) { } public void setDestDir ( Path destPath ) { } public void setCache ( File cache ) { } public void setClosure ( boolean closure ) { } }

Fix:
log ( ( "Top<seq2seq4repair_space>level<seq2seq4repair_space>class<seq2seq4repair_space>=<seq2seq4repair_space>" + topLevelClassName ) , MSG_INFO ) ;
Buggy code:
public class TestRecursivePrefixTreeStrategy extends StrategyTestCase { private int maxLength ; private void init ( int maxLength ) { } @ Test public void testFilterWithVariableScanLevel ( ) throws IOException { init ( GeohashPrefixTree . getMaxLevelsPossible ( ) ) ; getAddAndVerifyIndexedDocuments ( DATA_WORLD_CITIES_POINTS ) ; for ( int i = 0 ; i <= ( maxLength ) ; i ++ ) { ( ( RecursivePrefixTreeStrategy ) ( strategy ) ) . setPrefixGridScanLevel ( i ) ; <START_BUG> executeQueries ( FILTER , QTEST_Cities_IsWithin_BBox ) ; <END_BUG> } } @ Test public void testOneMeterPrecision ( ) { } @ Test public void testPrecision ( ) throws IOException { } @ Test public void geohashRecursiveRandom ( ) throws IOException { } private SpatialArgs q ( Point pt , double distDEG ) { } private SpatialArgs q ( Point pt , double distDEG , double distErrPct ) { } private void checkHits ( SpatialArgs args , int assertNumFound , int [ ] assertIds ) { } private Document newDoc ( String id , Shape shape ) { } private Point alignGeohash ( Point p ) { } }

Fix:
executeQueries ( FILTER , QTEST_Cities_Intersects_BBox ) ;
Buggy code:
public class TopicList extends ActionBarActivity { private String [ ] topics = new String [ ] { "Math" , "Physics" , "Marvel<seq2seq4repair_space>Superheroes" } ; private ListView topicList ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_topic_list ) ; topicList = ( ( ListView ) ( findViewById ( list_of_topics ) ) ) ; ArrayAdapter < String > topicListAdapter = new ArrayAdapter < String > ( this , layout . simple_list_item_1 , topics ) ; topicList . setAdapter ( topicListAdapter ) ; topicList . setOnItemClickListener ( new AdapterView . OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { <START_BUG> Intent next = new Intent ( TopicList . this , Overview . class ) ; <END_BUG> next . putExtra ( "selectedTopic" , topics [ position ] ) ; startActivity ( next ) ; } } ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
Intent next = new Intent ( TopicList . this , ViewFramework . class ) ;
Buggy code:
public final class ColorUtil { private static Field [ ] cachedFields ; private static RGB process ( String value ) { Field [ ] fields = ColorUtil . getFields ( ) ; try { for ( int i = 0 ; i < ( fields . length ) ; i ++ ) { Field field = fields [ i ] ; <START_BUG> if ( value . equals ( field . getName ( ) ) ) { <END_BUG> return ColorUtil . getSystemColor ( field . getInt ( null ) ) ; } } } catch ( IllegalArgumentException e ) { } catch ( IllegalAccessException e ) { } return ColorUtil . getSystemColor ( COLOR_BLACK ) ; } private static Field [ ] getFields ( ) { } public static RGB blend ( RGB val1 , RGB val2 ) { } private static int blend ( int temp1 , int temp2 ) { } private static RGB getSystemColor ( int colorId ) { } public static RGB getColorValue ( String rawValue ) { } public static RGB [ ] getColorValues ( String [ ] rawValues ) { } private static boolean isDirectValue ( String rawValue ) { } private ColorUtil ( ) { } }

Fix:
if ( field . getName ( ) . equals ( value ) ) {
Buggy code:
public class TestActivationAction extends BaseAction { @ Override protected ActionForward performAction ( ActionMapping mapping , ActionForm form , HttpServletRequest request , HttpServletResponse response ) throws Exception { } private List < TestActivationBean > createTestList ( boolean active ) { ArrayList < TestActivationBean > testList = new ArrayList < TestActivationBean > ( ) ; List < IdValuePair > sampleTypeList = DisplayListService . getList ( ( active ? ListType . SAMPLE_TYPE_ACTIVE : ListType . SAMPLE_TYPE_INACTIVE ) ) ; if ( ! active ) { IdValuePair . sortByValue ( sampleTypeList ) ; } for ( IdValuePair pair : sampleTypeList ) { TestActivationBean bean = new TestActivationBean ( ) ; <START_BUG> List < Test > tests = TypeOfSampleUtil . getTestListBySampleTypeId ( pair . getId ( ) , false ) ; <END_BUG> List < IdValuePair > activeTests = new ArrayList < IdValuePair > ( ) ; List < IdValuePair > inactiveTests = new ArrayList < IdValuePair > ( ) ; Collections . sort ( tests , new Comparator < Test > ( ) { @ Override public int compare ( Test o1 , Test o2 ) { return ( Integer . parseInt ( o1 . getSortOrder ( ) ) ) - ( Integer . parseInt ( o2 . getSortOrder ( ) ) ) ; } } ) ; for ( Test test : tests ) { if ( test . isActive ( ) ) { activeTests . add ( new IdValuePair ( test . getId ( ) , TestService . getUserLocalizedTestName ( test ) ) ) ; } else { inactiveTests . add ( new IdValuePair ( test . getId ( ) , TestService . getUserLocalizedTestName ( test ) ) ) ; } } IdValuePair . sortByValue ( inactiveTests ) ; bean . setActiveTests ( activeTests ) ; bean . setInactiveTests ( inactiveTests ) ; if ( ( ! ( activeTests . isEmpty ( ) ) ) || ( ! ( inactiveTests . isEmpty ( ) ) ) ) { bean . setSampleType ( pair ) ; testList . add ( bean ) ; } } return testList ; } @ Override protected String getPageTitleKey ( ) { } @ Override protected String getPageSubtitleKey ( ) { } }

Fix:
List < Test > tests = TypeOfSampleUtil . getAllTestsBySampleTypeId ( pair . getId ( ) ) ;
Buggy code:
public class Activator implements BundleActivator { private static Activator plugin ; public static final String PLUGIN_ID = "org.eclipse.ecf.provider.discovery" ; public static Activator getDefault ( ) { } public Activator ( ) { } public void start ( final BundleContext context ) throws Exception { final Properties props = new Properties ( ) ; props . put ( CONTAINER_ID , IDFactory . getDefault ( ) . createStringID ( "org.eclipse.ecf.provider.discovery.CompositeDiscoveryContainer" ) ) ; props . put ( CONTAINER_NAME , NAME ) ; <START_BUG> props . put ( Constants . SERVICE_RANKING , Integer . toString ( 1000 ) ) ; <END_BUG> String [ ] clazzes = new String [ ] { IDiscoveryService . class . getName ( ) , IDiscoveryLocator . class . getName ( ) , IDiscoveryAdvertiser . class . getName ( ) } ; context . registerService ( clazzes , new ServiceFactory ( ) { public Object getService ( final Bundle bundle , final ServiceRegistration registration ) { Filter filter = null ; try { final String filter2 = ( ( ( ( ( ( ( "(&(" + ( Constants . OBJECTCLASS ) ) + "=" ) + ( IDiscoveryService . class . getName ( ) ) ) + ")(!(" ) + ( IDiscoveryLocator . CONTAINER_NAME ) ) + "=" ) + ( CompositeDiscoveryContainer . NAME ) ) + ")))" ; filter = context . createFilter ( filter2 ) ; } catch ( final InvalidSyntaxException e2 ) { Trace . catching ( Activator . PLUGIN_ID , ( ( Activator . PLUGIN_ID ) + "//debug//methods//catching" ) , this . getClass ( ) , "getService(Bundle,<seq2seq4repair_space>ServiceRegistration)" , e2 ) ; return null ; } final ServiceTracker tracker = new ServiceTracker ( context , filter , null ) ; tracker . open ( ) ; final Object [ ] services = tracker . getServices ( ) ; tracker . close ( ) ; final List discoveries = ( services == null ) ? new ArrayList ( ) : new ArrayList ( Arrays . asList ( services ) ) ; final CompositeDiscoveryContainer cdc ; cdc = new CompositeDiscoveryContainer ( discoveries ) ; try { cdc . connect ( null , null ) ; } catch ( final ContainerConnectException e ) { Trace . catching ( Activator . PLUGIN_ID , ( ( Activator . PLUGIN_ID ) + "//debug//methods//catching" ) , this . getClass ( ) , "getService(Bundle,<seq2seq4repair_space>ServiceRegistration)" , e ) ; return null ; } try { context . addServiceListener ( new ServiceListener ( ) { public void serviceChanged ( final ServiceEvent arg0 ) { final IDiscoveryService anIDS = ( ( IDiscoveryService ) ( context . getService ( arg0 . getServiceReference ( ) ) ) ) ; switch ( arg0 . getType ( ) ) { case ServiceEvent . REGISTERED : cdc . addContainer ( anIDS ) ; break ; case ServiceEvent . UNREGISTERING : cdc . removeContainer ( anIDS ) ; break ; default : break ; } } } , ( ( ( ( "(" + ( Constants . OBJECTCLASS ) ) + "=" ) + ( IDiscoveryService . class . getName ( ) ) ) + ")" ) ) ; } catch ( final InvalidSyntaxException e ) { } return cdc ; } public void ungetService ( final Bundle bundle , final ServiceRegistration registration , final Object service ) { } } , props ) ; } public void stop ( final BundleContext context ) throws Exception { } }

Fix:
props . put ( Constants . SERVICE_RANKING , new Integer ( 1000 ) ) ;
Buggy code:
public class TownController extends SceneController { @ FXML Button return_button ; @ FXML AnchorPane main_pane ; @ FXML AnchorPane town_pane ; @ FXML private void initialize ( ) { Image img = new Image ( TownController . class . getResourceAsStream ( "town_pictures//town.png" ) ) ; <START_BUG> BackgroundSize size = new BackgroundSize ( BackgroundSize . AUTO , BackgroundSize . AUTO , false , false , true , true ) ; <END_BUG> town_pane . setBackground ( new Background ( new BackgroundImage ( img , BackgroundRepeat . NO_REPEAT , BackgroundRepeat . NO_REPEAT , BackgroundPosition . DEFAULT , size ) ) ) ; } public void loadLandSelect ( ) { } No newline ; at end ; of file ; }

Fix:
BackgroundSize size = new BackgroundSize ( BackgroundSize . AUTO , BackgroundSize . AUTO , false , false , true , false ) ;
Buggy code:
public class MockBuildListener extends Assert implements BuildListener { private final Vector buffer = new Vector ( ) ; private final Project project ; public MockBuildListener ( final Project project ) { } public void buildStarted ( BuildEvent event ) { } public void buildFinished ( BuildEvent event ) { } public void targetStarted ( BuildEvent event ) { } public void targetFinished ( BuildEvent event ) { } public void taskStarted ( BuildEvent event ) { } public void taskFinished ( BuildEvent event ) { } public void messageLogged ( final BuildEvent actual ) { } public void assertEmpty ( ) { <START_BUG> assertTrue ( "MockBuilListener<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>empty" , buffer . isEmpty ( ) ) ; <END_BUG> } public void addBuildEvent ( final String message , final int priority ) { } }

Fix:
assertTrue ( "MockBuildListener<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>empty" , buffer . isEmpty ( ) ) ;
Buggy code:
public class TestFrenchMinimalStemFilter extends BaseTokenStreamTestCase { private Analyzer analyzer = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } ; public void testExamples ( ) throws IOException { } public void testVocabulary ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , analyzer , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , analyzer , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class jnamed { Cache cache ; Hashtable znames ; Hashtable TSIGs ; public jnamed ( String conffile ) throws IOException { } public void addPrimaryZone ( String zonefile ) throws IOException { } public void addSecondaryZone ( String zone , String remote ) throws IOException { } public void addTSIG ( String name , String key ) { } public Zone findBestZone ( Name name ) { } public RRset findExactMatch ( Name name , short type , short dclass , boolean glue ) { } void addRRset ( Name name , Message response , RRset rrset , boolean sigonly ) { } void addAuthority ( Message response , Name name , Zone zone ) { } private void addGlue ( Message response , Name name ) { } private void addAdditional2 ( Message response , int section ) { } void addAdditional ( Message response ) { } TSIG findTSIG ( Name name ) { byte [ ] key = ( ( byte [ ] ) ( TSIGs . get ( name ) ) ) ; if ( key != null ) <START_BUG> return new TSIG ( name . toString ( ) , key ) ; <END_BUG> else return null ; } Message doAXFR ( Name name , Message query , Socket s ) { } Message generateReply ( Message query , byte [ ] in , Socket s ) { } public int truncateSection ( Message in , int maxLength , int length , int section ) { } public void truncate ( Message in , int length , int maxLength ) { } public Message formerrMessage ( byte [ ] in ) { } public Message errorMessage ( Message query , short rcode ) { } public void serveTCP ( short port ) { } public void serveUDP ( short port ) { } public void addTCP ( final short port ) { } public void addUDP ( final short port ) { } public static void main ( String [ ] args ) { } }

Fix:
return new TSIG ( name , key ) ;
Buggy code:
public class CookieValuePersister implements IValuePersister { private static final Log log = LogFactory . getLog ( CookieValuePersister . class ) ; public void clear ( FormComponent component ) { } public void load ( FormComponent component ) { final Cookie cookie = getCookie ( component ) ; if ( cookie != null ) { final String value = cookie . getValue ( ) ; if ( value != null ) { <START_BUG> component . setValue ( value ) ; <END_BUG> } } } public void save ( FormComponent component ) { } private void clear ( Cookie cookie ) { } private String cookieToDebugString ( Cookie cookie ) { } private Cookie getCookie ( final FormComponent component ) { } private Cookie [ ] getCookies ( ) { } private CookieValuePersisterSettings getSettings ( ) { } private WebRequest getWebRequest ( ) { } private WebResponse getWebResponse ( ) { } private Cookie save ( Cookie cookie ) { } }

Fix:
component . setModelValue ( value ) ;
Buggy code:
public class CategoryAdapter extends ArrayAdapter < Category > { List < Category > categories ; public CategoryAdapter ( Context context , List < Category > categories ) { } public View getView ( int position , View convertView , ViewGroup parent ) { Category categories = getItem ( position ) ; if ( convertView == null ) { <START_BUG> convertView = LayoutInflater . from ( getContext ( ) ) . inflate ( list_item , parent , false ) ; <END_BUG> } TextView title = ( ( TextView ) ( convertView . findViewById ( title_id ) ) ) ; title . setText ( categories . getTitle ( ) ) ; return convertView ; } }

Fix:
convertView = LayoutInflater . from ( getContext ( ) ) . inflate ( list_item_category , parent , false ) ;
Buggy code:
public class HierarchyResolver implements ITypeRequestor { IHierarchyRequestor requestor ; LookupEnvironment lookupEnvironment ; private int typeIndex ; private IGenericType [ ] typeModels ; private ReferenceBinding [ ] typeBindings ; public HierarchyResolver ( INameEnvironment nameEnvironment , IErrorHandlingPolicy policy , ConfigurableOption [ ] settings , IHierarchyRequestor requestor , IProblemFactory problemFactory ) { } public HierarchyResolver ( INameEnvironment nameEnvironment , IHierarchyRequestor requestor , IProblemFactory problemFactory ) { } public void accept ( IBinaryType binaryType , PackageBinding packageBinding ) { } public void accept ( ICompilationUnit sourceUnit ) { <START_BUG> lookupEnvironment . problemReporter . abortDueToInternalError ( new StringBuffer ( "Cannot<seq2seq4repair_space>accept<seq2seq4repair_space>the<seq2seq4repair_space>compilation<seq2seq4repair_space>unit:<seq2seq4repair_space>" ) . append ( sourceUnit . getFileName ( ) ) . toString ( ) ) ; <END_BUG> } public void accept ( ISourceType sourceType , PackageBinding packageBinding ) { } private void remember ( IGenericType suppliedType , ReferenceBinding typeBinding ) { } private void rememberWithMemberTypes ( TypeDeclaration typeDeclaration , HierarchyType enclosingType , ICompilationUnit unit ) { } private void rememberWithMemberTypes ( ISourceType suppliedType , ReferenceBinding typeBinding ) { } private void reportHierarchy ( ) { } private void reset ( ) { } public void resolve ( IGenericType [ ] suppliedTypes ) { } public void resolve ( IGenericType [ ] suppliedTypes , ICompilationUnit [ ] sourceUnits ) { } public void resolve ( IGenericType suppliedType ) { } }

Fix:
lookupEnvironment . problemReporter . abortDueToInternalError ( new StringBuffer ( org . eclipse . jdt . internal . compiler . util . Util . bind ( "accept.cannot" ) ) . append ( sourceUnit . getFileName ( ) ) . toString ( ) ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class VarsNode extends DefaultMutableTreeNode implements VarListListener { public VarsNode ( ) { } @ Override public void onVarListChanged ( ) { this . children = null ; for ( Var < ? > var : VarList . getList ( ) . values ( ) ) { <START_BUG> DefaultMutableTreeNode node = new DefaultMutableTreeNode ( ( ( ( ( ( ( "<html><body><strong<seq2seq4repair_space>style=\"color:<seq2seq4repair_space>red\">" + ( var . getClazz ( ) . getSimpleName ( ) . replace ( "Integer" , "Int" ) ) ) + "<//strong><seq2seq4repair_space><em<seq2seq4repair_space>style=\"color:<seq2seq4repair_space>green\">" ) + ( var . getName ( ) ) ) + "<//em><seq2seq4repair_space>=<seq2seq4repair_space><span<seq2seq4repair_space>style=\"color:<seq2seq4repair_space>blue\">" ) + ( new Gson ( ) . toJson ( var . getValue ( ) ) ) ) + "<//span><//body><//html>" ) ) ; <END_BUG> node . setAllowsChildren ( false ) ; add ( node ) ; } } }

Fix:
DefaultMutableTreeNode node = new DefaultMutableTreeNode ( ( ( ( ( ( ( "<html><body><strong<seq2seq4repair_space>style=\"color:<seq2seq4repair_space>red\">" + ( var . getClazz ( ) . getSimpleName ( ) . replace ( "Integer" , "Int" ) ) ) + "<//strong><seq2seq4repair_space><em<seq2seq4repair_space>style=\"color:<seq2seq4repair_space>green\">" ) + ( var . getName ( ) ) ) + "<//em><seq2seq4repair_space>=<seq2seq4repair_space><span<seq2seq4repair_space>style=\"color:<seq2seq4repair_space>blue\">" ) + ( new Gson ( ) . toJson ( var . getValue ( ) ) . replaceAll ( "\\\\u0027" , "\'" ) ) ) + "<//span><//body><//html>" ) ) ;
Buggy code:
public class TestDocumentWriter extends LuceneTestCase { private Directory dir ; @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } public void test ( ) { } public void testAddDocument ( ) throws Exception { Document testDoc = new Document ( ) ; DocHelper . setupDoc ( testDoc ) ; IndexWriter writer = new IndexWriter ( dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new MockAnalyzer ( random ( ) ) ) ) ; writer . addDocument ( testDoc ) ; writer . commit ( ) ; SegmentInfoPerCommit info = writer . newestSegment ( ) ; writer . close ( ) ; SegmentReader reader = new SegmentReader ( info , DirectoryReader . DEFAULT_TERMS_INDEX_DIVISOR , newIOContext ( random ( ) ) ) ; assertTrue ( ( reader != null ) ) ; StoredDocument doc = reader . document ( 0 ) ; assertTrue ( ( doc != null ) ) ; StorableField [ ] fields = doc . getFields ( "textField2" ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( FIELD_2_TEXT ) ) ; assertTrue ( fields [ 0 ] . fieldType ( ) . storeTermVectors ( ) ) ; fields = doc . getFields ( "textField1" ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( FIELD_1_TEXT ) ) ; assertFalse ( fields [ 0 ] . fieldType ( ) . storeTermVectors ( ) ) ; fields = doc . getFields ( "keyField" ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( KEYWORD_TEXT ) ) ; fields = doc . getFields ( NO_NORMS_KEY ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( NO_NORMS_TEXT ) ) ; fields = doc . getFields ( TEXT_FIELD_3_KEY ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( FIELD_3_TEXT ) ) ; for ( FieldInfo fi : reader . getFieldInfos ( ) ) { if ( fi . isIndexed ( ) ) { <START_BUG> assertTrue ( ( ( fi . omitsNorms ( ) ) == ( ( reader . simpleNormValues ( fi . name ) ) == null ) ) ) ; <END_BUG> } } reader . close ( ) ; } public void testPositionIncrementGap ( ) throws IOException { } public void testTokenReuse ( ) throws IOException { } public void testPreAnalyzedField ( ) throws IOException { } public void testMixedTermVectorSettingsSameField ( ) throws Exception { } public void testLUCENE_1590 ( ) throws Exception { } }

Fix:
assertTrue ( ( ( fi . omitsNorms ( ) ) == ( ( reader . getNormValues ( fi . name ) ) == null ) ) ) ;
Buggy code:
public class JavaScriptDebugger extends WindowAdapter implements ActionListener , Observer { private static final Logger LOG = LoggerFactory . getLogger ( JavaScriptDebugger . class ) ; private UiAutomationDevice device ; private final JSplitPane jSplitPane = new JSplitPane ( ) ; private final JComboBox < String > jcbDevices = new JComboBox < > ( new String [ ] { "detecting<seq2seq4repair_space>devices..." } ) ; private final JTextField jtfApp = new JTextField ( ) ; private final JButton jbLaunch = new JButton ( "Launch" ) ; private final JTextArea jtaJavaScript = new JTextArea ( ) ; private final JButton jbSendJs = new JButton ( "Send" ) ; private final JButton jbElementTree = new JButton ( "Log<seq2seq4repair_space>Element<seq2seq4repair_space>Tree" ) ; private final JTextArea jtaResponse = new JTextArea ( ) ; private final JButton jbClear = new JButton ( "Clear" ) ; private String appName = "" ; public JavaScriptDebugger ( String app ) { } @ SuppressWarnings ( "ResultOfObjectAllocationIgnored" ) private void initUi ( ) { } public void detectDevices ( ) throws InterruptedException , SDKException { } public JSplitPane getJPanel ( ) { } @ Override public void actionPerformed ( ActionEvent e ) { } public void launchApp ( ) throws Exception { String app = jtfApp . getText ( ) . trim ( ) ; if ( StringUtils . isEmpty ( app ) ) { JOptionPane . showMessageDialog ( jSplitPane , "No<seq2seq4repair_space>app<seq2seq4repair_space>name<seq2seq4repair_space>specified" ) ; return ; } String uuid = ( jcbDevices . getSelectedItem ( ) ) + "" ; device = new UiAutomationDevice ( uuid ) ; <START_BUG> device . start ( appName , 5000 ) ; <END_BUG> this . jcbDevices . setEnabled ( false ) ; this . jtfApp . setEnabled ( false ) ; this . jbElementTree . setEnabled ( true ) ; this . jbSendJs . setEnabled ( true ) ; } public void sendJavaScript ( ) throws EntityDriverException , InterruptedException { } @ Override public void update ( Observable o , Object arg ) { } @ Override public void windowClosing ( WindowEvent e ) { } private void appendResponse ( String res ) { } public static void main ( String [ ] args ) throws Exception { } }

Fix:
device . start ( app , 5000 ) ;
Buggy code:
public abstract class DriverSupport { private static Logger log = LoggerFactory . getLogger ( DriverSupport . class ) ; private Options options ; public DriverSupport ( Options options ) { } public void die ( ) { } public void usage ( ) { } public CommandLine parseArgs ( String [ ] args ) { } public final void execute ( String [ ] args ) { CommandLine cmd = parseArgs ( args ) ; <START_BUG> if ( cmd . hasOption ( "h" ) ) { <END_BUG> die ( ) ; } processConfigFileOption ( cmd ) ; executeImpl ( cmd ) ; } protected void processConfigFileOption ( CommandLine cmd ) { } protected abstract void executeImpl ( CommandLine cmd ) { } protected void setSystemProperty ( String name , String value ) { } protected void setSystemProperty ( String name , String value , String defaultValue ) { } }

Fix:
if ( cmd . hasOption ( "H" ) ) {
Buggy code:
class PathDataController { private HashMap < WorldTile , int [ ] > dataSource ; public PathDataController ( ) { } public int [ ] getHistory ( WorldTile key ) { if ( this . dataSource . containsKey ( key ) ) { return this . dataSource . get ( key ) ; } else { <START_BUG> return null ; <END_BUG> } } public void putScores ( WorldTile key , int [ ] scoreArray ) { } public boolean containsEnv ( WorldTile key ) { } }

Fix:
return new int [ 0 ] ;
Buggy code:
public class ToolBar extends Composite { int itemCount ; ToolItem [ ] items ; public ToolBar ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } void createItem ( ToolItem item , int index ) { } void createWidget ( ) { } int defaultThemeFont ( ) { } void destroyItem ( ToolItem item ) { } void drawBackground ( int control ) { } void enableWidget ( boolean enabled ) { } public ToolItem getItem ( int index ) { } public ToolItem getItem ( Point pt ) { } public int getItemCount ( ) { } public ToolItem [ ] getItems ( ) { } public int getRowCount ( ) { } public int indexOf ( ToolItem item ) { } void invalidateChildrenVisibleRegion ( int control ) { } int [ ] layoutHorizontal ( int width , int height , boolean resize ) { } int [ ] layoutVertical ( int width , int height , boolean resize ) { } int [ ] layout ( int nWidth , int nHeight , boolean resize ) { } void relayout ( ) { } void releaseChildren ( boolean destroy ) { if ( ( items ) != null ) { for ( int i = 0 ; i < ( itemCount ) ; i ++ ) { ToolItem item = items [ i ] ; if ( ( item != null ) && ( ! ( item . isDisposed ( ) ) ) ) { <START_BUG> item . releaseChildren ( false ) ; <END_BUG> } } itemCount = 0 ; items = null ; } super . releaseChildren ( destroy ) ; } void removeControl ( Control control ) { } void setBackground ( float [ ] color ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } void setFontStyle ( Font font ) { } void setForeground ( float [ ] color ) { } public void setRedraw ( boolean redraw ) { } }

Fix:
item . release ( false ) ;
Buggy code:
public class FileState { @ JsonIgnore private File file ; private String directory ; private String fileName ; @ JsonIgnore private long lastModified ; @ JsonIgnore private long size ; @ JsonIgnore private boolean deleted = false ; private long signature ; private int signatureLength ; @ JsonIgnore private boolean changed = false ; @ JsonIgnore private RandomAccessFile randomAccessFile ; private long pointer = 0 ; @ JsonIgnore private FileState oldFileState ; @ JsonIgnore private Event fields ; public FileState ( ) { } public FileState ( File file ) throws IOException { } private void setFileFromDirectoryAndName ( ) throws FileNotFoundException { file = new File ( ( ( ( directory ) + ( File . separator ) ) + ( fileName ) ) ) ; if ( file . exists ( ) ) { <START_BUG> randomAccessFile = new RandomAccessFile ( file , "r" ) ; <END_BUG> lastModified = file . lastModified ( ) ; size = file . length ( ) ; } else { deleted = true ; } } public File getFile ( ) { } public long getLastModified ( ) { } public long getSize ( ) { } public String getDirectory ( ) { } public void setDirectory ( String directory ) throws FileNotFoundException { } public String getFileName ( ) { } public void setFileName ( String fileName ) throws FileNotFoundException { } public boolean isDeleted ( ) { } public void setDeleted ( ) { } public boolean hasChanged ( ) { } public void setChanged ( boolean changed ) { } public long getSignature ( ) { } public void setSignature ( long signature ) { } public RandomAccessFile getRandomAccessFile ( ) { } public long getPointer ( ) { } public void setPointer ( long pointer ) { } public int getSignatureLength ( ) { } public void setSignatureLength ( int signatureLength ) { } public FileState getOldFileState ( ) { } public void setOldFileState ( FileState oldFileState ) { } public void deleteOldFileState ( ) { } public Event getFields ( ) { } public void setFields ( Event fields ) { } @ Override public String toString ( ) { } }

Fix:
randomAccessFile = null ;
Buggy code:
public class TestMoreLikeThis extends LuceneTestCase { private Directory directory ; private IndexReader reader ; private IndexSearcher searcher ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; directory = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , directory ) ; addDoc ( writer , "lucene" ) ; addDoc ( writer , "lucene<seq2seq4repair_space>release" ) ; reader = writer . getReader ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> searcher = newSearcher ( reader ) ; } @ Override public void tearDown ( ) throws Exception { } private void addDoc ( RandomIndexWriter writer , String text ) throws IOException { } public void testBoostFactor ( ) throws Throwable { } private Map < String , Float > getOriginalValues ( ) throws IOException { } public void testMultiFields ( ) throws Exception { } public void testMoreLikeThisQuery ( ) throws Exception { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class VmwarePropertiesModel extends Model { private EntityModel < String > vCenter = new EntityModel ( ) ; private EntityModel < String > esx = new EntityModel ( ) ; private EntityModel < String > vmwareDatacenter = new EntityModel ( ) ; private EntityModel < Boolean > verifySSL = new EntityModel ( false ) ; private ListModel < VDS > proxyHost = new ListModel ( ) ; private Guid lastStoragePoolId ; private Guid lastProxyHostId ; public VmwarePropertiesModel ( ) { } public boolean validate ( ) { } public ListModel < VDS > getProxyHost ( ) { } public EntityModel < Boolean > getVerifySSL ( ) { } public EntityModel < String > getvCenter ( ) { } public EntityModel < String > getEsx ( ) { } public EntityModel < String > getVmwareDatacenter ( ) { } void disableProxyHost ( ) { } VmwareVmProviderProperties getVmwareVmProviderProperties ( Guid dataCenterId ) { <START_BUG> return new VmwareVmProviderProperties ( getvCenter ( ) . getEntity ( ) , getEsx ( ) . getEntity ( ) , getVmwareDatacenter ( ) . getEntity ( ) , getVerifySSL ( ) . getEntity ( ) , dataCenterId , ( ( getProxyHost ( ) ) != null ? getProxyHost ( ) . getSelectedItem ( ) . getId ( ) : null ) ) ; <END_BUG> } public void init ( Provider < VmwareVmProviderProperties > provider ) { } public Guid getLastStoragePoolId ( ) { } public Guid getLastProxyHostId ( ) { } public String getUrl ( ) { } }

Fix:
return new VmwareVmProviderProperties ( getvCenter ( ) . getEntity ( ) , getEsx ( ) . getEntity ( ) , getVmwareDatacenter ( ) . getEntity ( ) , getVerifySSL ( ) . getEntity ( ) , dataCenterId , ( ( getProxyHost ( ) . getSelectedItem ( ) ) != null ? getProxyHost ( ) . getSelectedItem ( ) . getId ( ) : null ) ) ;
Buggy code:
public final class BodyTagAttributeModifier extends AttributeModifier { private static final long serialVersionUID = 1L ; private transient WeakReference componentReference ; public BodyTagAttributeModifier ( final String attribute , final boolean addAttributeIfNotPresent , final IModel replaceModel , final Component behaviorOwner ) { } public BodyTagAttributeModifier ( final String attribute , final IModel replaceModel , final Component behaviorOwner ) { } public BodyTagAttributeModifier ( final String attribute , final String pattern , final boolean addAttributeIfNotPresent , final IModel replaceModel , final Component behaviorOwner ) { } public BodyTagAttributeModifier ( final String attribute , final String pattern , final IModel replaceModel , final Component behaviorOwner ) { } private void init ( final Component behaviorOwner ) { } protected String newValue ( final String currentValue , final String replacementValue ) { if ( ( this . componentReference ) != null ) { final Component behaviorOwner = ( ( Component ) ( componentReference . get ( ) ) ) ; if ( behaviorOwner == null ) { setEnabled ( false ) ; return currentValue ; } <START_BUG> if ( ( behaviorOwner . findParent ( Page . class ) ) == null ) { <END_BUG> setEnabled ( false ) ; return currentValue ; } if ( ( behaviorOwner . isVisibleInHierarchy ( ) ) == false ) { return currentValue ; } } if ( ( currentValue != null ) && ( ! ( currentValue . trim ( ) . endsWith ( ";" ) ) ) ) { return ( currentValue + ";" ) + replacementValue ; } return currentValue == null ? replacementValue : currentValue + replacementValue ; } private void readObject ( final ObjectInputStream inputStream ) throws IOException , ClassNotFoundException { } private void writeObject ( final ObjectOutputStream outputStream ) throws IOException { } }

Fix:
if ( ( ! ( behaviorOwner instanceof Page ) ) && ( ( behaviorOwner . findParent ( Page . class ) ) == null ) ) {
Buggy code:
public final class AddressBookResultHandler extends ResultHandler { private static final DateFormat [ ] DATE_FORMATS = new DateFormat [ ] { new SimpleDateFormat ( "yyyyMMdd" ) , new SimpleDateFormat ( "yyyyMMdd'T'HHmmss" ) , new SimpleDateFormat ( "yyyy-MM-dd" ) , new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss" ) } ; private final boolean [ ] fields ; private int buttonCount ; private int mapIndexToAction ( int index ) { } public AddressBookResultHandler ( Activity activity , ParsedResult result ) { } @ Override public int getButtonCount ( ) { } @ Override public int getButtonText ( int index ) { } @ Override public void handleButtonPress ( int index ) { } private static Date parseDate ( String s ) { } @ Override public CharSequence getDisplayContents ( ) { AddressBookParsedResult result = ( ( AddressBookParsedResult ) ( getResult ( ) ) ) ; <START_BUG> StringBuffer contents = new StringBuffer ( ) ; <END_BUG> ParsedResult . maybeAppend ( result . getNames ( ) , contents ) ; int namesLength = contents . length ( ) ; String pronunciation = result . getPronunciation ( ) ; if ( ( pronunciation != null ) && ( ( pronunciation . length ( ) ) > 0 ) ) { contents . append ( "\n(" ) ; contents . append ( pronunciation ) ; contents . append ( ')' ) ; } ParsedResult . maybeAppend ( result . getTitle ( ) , contents ) ; ParsedResult . maybeAppend ( result . getOrg ( ) , contents ) ; ParsedResult . maybeAppend ( result . getAddresses ( ) , contents ) ; String [ ] numbers = result . getPhoneNumbers ( ) ; if ( numbers != null ) { for ( String number : numbers ) { ParsedResult . maybeAppend ( PhoneNumberUtils . formatNumber ( number ) , contents ) ; } } ParsedResult . maybeAppend ( result . getEmails ( ) , contents ) ; ParsedResult . maybeAppend ( result . getURL ( ) , contents ) ; String birthday = result . getBirthday ( ) ; if ( ( birthday != null ) && ( ( birthday . length ( ) ) > 0 ) ) { Date date = AddressBookResultHandler . parseDate ( birthday ) ; if ( date != null ) { ParsedResult . maybeAppend ( DateFormat . getDateInstance ( ) . format ( date . getTime ( ) ) , contents ) ; } } ParsedResult . maybeAppend ( result . getNote ( ) , contents ) ; if ( namesLength > 0 ) { Spannable styled = new SpannableString ( contents . toString ( ) ) ; styled . setSpan ( new android . text . style . StyleSpan ( Typeface . BOLD ) , 0 , namesLength , 0 ) ; return styled ; } else { return contents . toString ( ) ; } } @ Override public int getDisplayTitle ( ) { } }

Fix:
StringBuffer contents = new StringBuffer ( 100 ) ;
Buggy code:
public class NetHandlerLogin extends NetHandler { @ Override public boolean isServer ( ) { } @ Override public void handleNetworkShutdown ( String reason , Object [ ] info ) { } @ Override public void handleLogin ( Packet1Login packet ) { pendingConn . remove ( netManager ) ; netManager . user = new User ( netManager , packet . name ) ; if ( ( packet . version ) < ( Main . version ) ) { user . kick ( "Outdated<seq2seq4repair_space>client!" ) ; return ; } if ( ( packet . version ) > ( Main . version ) ) { user . kick ( "Outdated<seq2seq4repair_space>server!" ) ; return ; } <START_BUG> if ( ( User . find ( packet . name ) ) != null ) { <END_BUG> user . kick ( "Username<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>taken!" ) ; return ; } netManager . queuePacket ( new Packet1Login ( Main . version , server . name , false ) ) ; netManager . setNetHandler ( new NetHandlerServer ( ) ) ; users . add ( user ) ; for ( int i = 0 ; i < ( users . size ( ) ) ; i ++ ) { User user = users . get ( i ) ; if ( ! ( user . username . equals ( packet . name ) ) ) { netManager . queuePacket ( new Packet4UserList ( user . username , true ) ) ; } } User . globalPacket ( new Packet4UserList ( packet . name , true ) ) ; User . globalMessage ( new StringBuilder ( packet . name ) . append ( "<seq2seq4repair_space>has<seq2seq4repair_space>joined<seq2seq4repair_space>the<seq2seq4repair_space>chat." ) . toString ( ) ) ; } @ Override public void handlePassword ( Packet2Password packet ) { } }

Fix:
if ( ( User . findExact ( packet . name ) ) != null ) {
Buggy code:
public class Board { public static final float R = 1.0F // ( ( float ) ( Math . sqrt ( 3 ) ) ) ; public static final float DY = ( Board . R ) * 1.5F ; public final int width ; public final int height ; private final int [ ] array ; public int score = 0 ; private int oldLinesKilled = 0 ; public Board ( int width , int height ) { } public Board ( Board b ) { } public Board ( Unit unit ) { } public static FPoint getCoordsForIndexes ( final Point index ) { } public static Point getIndexForCoordinates ( final FPoint point ) { } public int readCell ( int i , int j ) { } public void setCell ( int i , int j , int value ) { } public void setCell ( final Point p , int value ) { } private int getIndex ( int i , int j ) { } public Unit transform ( Unit unit , UnitState state ) { } public boolean isValid ( Unit unit , UnitState state ) { } public void updateBoard ( Unit unit , UnitState state ) { final Unit transformed = transform ( unit , state ) ; for ( Point member : transformed . members ) { final int i = member . x ; final int j = member . y ; setCell ( i , j , FILLED . getState ( ) ) ; } int points = unit . members . length ; int linesKilled = 0 ; for ( int y = ( height ) - 1 ; y >= 0 ; y -- ) { boolean filled = true ; <START_BUG> for ( int x = 0 ; x < ( height ) ; ++ x ) { <END_BUG> if ( ( readCell ( x , y ) ) == 0 ) { filled = false ; break ; } } if ( filled ) { linesKilled ++ ; for ( int y2 = y - 1 ; y2 >= 0 ; y2 -- ) { for ( int x = 0 ; x < ( width ) ; ++ x ) { setCell ( x , ( y2 + 1 ) , readCell ( x , y2 ) ) ; } } y ++ ; } } points += ( ( 100 * ( 1 + linesKilled ) ) * linesKilled ) // 2 ; int bonus = 0 ; if ( ( oldLinesKilled ) != 0 ) { bonus += ( ( ( oldLinesKilled ) - 1 ) * points ) // 10 ; } score += points + bonus ; oldLinesKilled = linesKilled ; } public UnitState getSpawnState ( Unit unit , Board unitBoard ) { } }

Fix:
for ( int x = 0 ; x < ( width ) ; ++ x ) {
Buggy code:
public class IndicesController extends AuthenticatedController { @ Inject private ClusterService clusterService ; @ Inject private IndexService indexService ; public Result index ( ) { } public Result failures ( Integer page ) { BreadcrumbList bc = new BreadcrumbList ( ) ; bc . addCrumb ( "System" , SystemController . index ( 0 ) ) ; bc . addCrumb ( "Indices" , routes . IndicesController . index ( ) ) ; bc . addCrumb ( "Failures" , routes . IndicesController . failures ( 0 ) ) ; try { <START_BUG> return ok ( failures . render ( currentUser ( ) , bc , clusterService . getIndexerFailures ( 0 , 0 ) . total , page ) ) ; <END_BUG> } catch ( APIException e ) { String message = ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>get<seq2seq4repair_space>indexer<seq2seq4repair_space>failures.<seq2seq4repair_space>We<seq2seq4repair_space>expected<seq2seq4repair_space>HTTP<seq2seq4repair_space>200,<seq2seq4repair_space>but<seq2seq4repair_space>got<seq2seq4repair_space>a<seq2seq4repair_space>HTTP<seq2seq4repair_space>" + ( e . getHttpCode ( ) ) ) + "." ; return status ( 504 , error . render ( message , e , request ( ) ) ) ; } catch ( IOException e ) { return status ( 504 , error . render ( ERROR_MSG_IO , e , request ( ) ) ) ; } } public Result closeIndex ( String index ) { } public Result reopenIndex ( String index ) { } public Result deleteIndex ( String index ) { } public Result reCalculateRanges ( ) { } public Result cycleDeflector ( ) { } }

Fix:
return ok ( failures . render ( currentUser ( ) , bc , clusterService . getIndexerFailures ( 1 , 0 ) . total , page ) ) ;
Buggy code:
public class RunTimerActivity extends ActionBarActivity { TalkingTimerApplication mApp ; Button pauseButton ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onStop ( ) { } @ Override protected void onDestroy ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void onPauseClick ( View view ) { } public void onResetClick ( View view ) { } public static class AdFragment extends Fragment { @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle bundle ) { super . onActivityCreated ( bundle ) ; AdView mAdView = ( ( AdView ) ( getView ( ) . findViewById ( adView ) ) ) ; <START_BUG> AdRequest adRequest = new AdRequest . Builder ( ) . build ( ) ; <END_BUG> mAdView . loadAd ( adRequest ) ; } } }

Fix:
AdRequest adRequest = new AdRequest . Builder ( ) . addTestDevice ( "2A03F21CFB927C7611295A40C8666F5F" ) . build ( ) ;
Buggy code:
public class Description extends DataType { public void addText ( String text ) { <START_BUG> ProjectHelper ph = ProjectHelper . getProjectHelper ( ) ; <END_BUG> if ( ! ( ph instanceof ProjectHelperImpl ) ) { return ; } String currentDescription = getProject ( ) . getDescription ( ) ; if ( currentDescription == null ) { getProject ( ) . setDescription ( text ) ; } else { getProject ( ) . setDescription ( ( currentDescription + text ) ) ; } } public static String getDescription ( Project project ) { } private static void concatDescriptions ( Project project , Target t , StringBuffer description ) { } private static Vector findElementInTarget ( Project project , Target t , String name ) { } }

Fix:
ProjectHelper ph = ( ( ProjectHelper ) ( getProject ( ) . getReference ( PROJECTHELPER_REFERENCE ) ) ) ;
Buggy code:
public class GameManager implements GameEngine . Listener { public interface Listener { } public interface GameListener extends GameManager . Listener { void onGameStart ( ) { } void onGameOver ( boolean won ) { } } public interface WaveListener extends GameManager . Listener { void onNextWave ( ) { } void onWaveDone ( ) { } } public interface CreditsListener extends GameManager . Listener { void onCreditsChanged ( int credits ) { } } public interface LivesListener extends GameManager . Listener { void onLivesChanged ( int lives ) { } } private Level mLevel ; private Wave mWave ; private int mNextWaveIndex ; private int mCredits ; private int mLives ; private boolean mGameOver = true ; private Tower mSelectedTower ; private final GameEngine mGame ; private final List < GameManager . Listener > mListeners = new CopyOnWriteArrayList < > ( ) ; public GameManager ( GameEngine game ) { } public Level getLevel ( ) { } public void loadLevel ( Level level ) { } public Wave getWave ( ) { } public int getWaveNum ( ) { } public boolean hasWaves ( ) { } public void nextWave ( ) { } public int getCredits ( ) { } public void setCredits ( int credits ) { } public void giveCredits ( int amount ) { } public void takeCredits ( int amount ) { } public int getLives ( ) { } public void setLives ( int lives ) { } public void giveLives ( int count ) { } public void takeLives ( int count ) { } public void reportEnemyRemoved ( Enemy enemy ) { if ( ( mWave ) == null ) { return ; } <START_BUG> if ( mGame . getGameObjects ( TYPE_ID ) . isEmpty ( ) ) { <END_BUG> onWaveDone ( ) ; giveCredits ( mWave . getReward ( ) ) ; mWave = null ; if ( ( ! ( hasWaves ( ) ) ) && ( ! ( isGameOver ( ) ) ) ) { onGameOver ( true ) ; } } } public boolean isGameOver ( ) { } public Tower getSelectedTower ( ) { } public void selectTower ( Tower tower ) { } @ Override public void onTick ( ) { } public void addListener ( GameManager . Listener listener ) { } public void removeListener ( GameManager . Listener listener ) { } private void onGameStart ( ) { } private void onGameOver ( boolean won ) { } private void onNextWave ( ) { } private void onWaveDone ( ) { } private void onCreditsChanged ( ) { } private void onLivesChanged ( ) { } }

Fix:
if ( ( mGame . getGameObjects ( TYPE_ID ) . isEmpty ( ) ) && ( mWave . getEnemies ( ) . isEmpty ( ) ) ) {
Buggy code:
public class PaginationOutput implements Output { private static final Logger logger = CommonLog . getLogger ( ) ; private ConfigurationWrapper conf ; private Theme theme ; public PaginationOutput ( ConfigurationWrapper conf , Theme theme ) { } @ Override public String export ( Object object ) throws GeneralException { } public static String formatPaginationUrl ( String rootUrl , int i ) { } public static String formatPaginationFilePath ( String rootPath , int index ) { if ( index <= 1 ) { return ( rootPath + ( File . separator ) ) + "index.html" ; } else { <START_BUG> return ( ( ( rootPath + ( File . separator ) ) + "page" ) + ( File . separator ) ) + "index.html" ; <END_BUG> } } }

Fix:
return ( ( ( ( ( rootPath + ( File . separator ) ) + "page" ) + ( File . separator ) ) + index ) + ( File . separator ) ) + "index.html" ;