nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Server implements Runnable { private static final Logger LOGGER = Logger . getLogger ( Server . class ) ; private static final long SLEEP_TIME = 10000 ; private List < ServerModule > modules = new ArrayList < > ( ) ; private volatile boolean shutdown = false ; @ Override public void run ( ) { } public void shutdown ( ) { } public void addModule ( ServerModule module ) { } public void addModules ( List < ServerModule > newModules ) { } private void init ( ) { } private void start ( ) { <START_BUG> modules . forEach ( ( m ) -> start ( ) ) ; <END_BUG> Server . LOGGER . info ( "Server<seq2seq4repair_space>started." ) ; } private void loop ( ) { } private void stop ( ) { } }

Fix:
modules . forEach ( ( m ) -> m . start ( ) ) ;
Buggy code:
public class SingleTypeReference extends TypeReference { public char [ ] token ; public SingleTypeReference ( char [ ] source , long pos ) { } public TypeReference copyDims ( int dim ) { } protected TypeBinding getTypeBinding ( Scope scope ) { if ( ( this . resolvedType ) != null ) return this . resolvedType ; this . resolvedType = scope . getType ( token ) ; if ( ( ( scope . kind ) == ( Scope . CLASS_SCOPE ) ) && ( this . resolvedType . isValidBinding ( ) ) ) <START_BUG> if ( ( ( ClassScope ) ( scope ) ) . detectCycle ( this . resolvedType , this , null ) ) <END_BUG> return null ; return this . resolvedType ; } public char [ ] [ ] getTypeName ( ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveTypeEnclosing ( BlockScope scope , ReferenceBinding enclosingType ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void traverse ( ASTVisitor visitor , ClassScope scope ) { } }

Fix:
if ( ( ( ClassScope ) ( scope ) ) . detectHierarchyCycle ( this . resolvedType , this , null ) )
Buggy code:
public class Zeitgeist { public static Scanner scn ; public static void main ( String [ ] args ) { } private static void dispatchCommand ( ParsedInput userInput , Memory memory ) { Signal processSignal ; KEYWORDS commandType = userInput . getType ( ) ; if ( commandType == null ) { SignalHandler . printProcessStateMessage ( new Signal ( Signal . SIGNAL_INVALID_COMMAND ) ) ; } switch ( commandType ) { case ADD : processSignal = AddHandler . process ( userInput , memory ) ; SignalHandler . printProcessStateMessage ( processSignal ) ; break ; case DELETE : processSignal = DeleteHandler . process ( userInput , memory ) ; SignalHandler . printProcessStateMessage ( processSignal ) ; break ; case MARK : processSignal = MarkHandler . process ( userInput , memory ) ; SignalHandler . printProcessStateMessage ( processSignal ) ; break ; case UNDO : processSignal = UndoHandler . process ( userInput , memory ) ; SignalHandler . printProcessStateMessage ( processSignal ) ; break ; case EDIT : <START_BUG> processSignal = SearchHandler . process ( userInput , memory ) ; <END_BUG> SignalHandler . printProcessStateMessage ( processSignal ) ; break ; case DISPLAY : processSignal = DisplayHandler . process ( userInput , memory ) ; SignalHandler . printProcessStateMessage ( processSignal ) ; break ; case SEARCH : processSignal = SearchHandler . process ( userInput , memory ) ; SignalHandler . printProcessStateMessage ( processSignal ) ; break ; default : SignalHandler . printProcessStateMessage ( new Signal ( Signal . SIGNAL_INVALID_COMMAND ) ) ; break ; } } }

Fix:
processSignal = EditHandler . process ( userInput , memory ) ;
Buggy code:
public class Mask extends DefaultFlexoObject implements PropertyChangeListener { private final FlexoConceptInstance flexoConceptInstance ; private final String name ; private static String NAME = "name" ; private final List < MaskableElement > selection ; private final TraceAnalysisProject project ; private final TraceVirtualModelInstance trace ; private List < OBPTraceConfiguration > relevantConfigs ; private boolean computingRequired = true ; public Mask ( FlexoConceptInstance flexoConceptInstance , TraceAnalysisProject project , TraceVirtualModelInstance trace ) { } public TraceAnalysisProject getTraceAnalysisProject ( ) { } public TraceVirtualModelInstance getTrace ( ) { } public String getName ( ) { } public void setName ( String name ) { <START_BUG> flexoConceptInstance . setFlexoActor ( name , ( ( PrimitiveRole ) ( flexoConceptInstance . getFlexoConcept ( ) . getFlexoProperty ( Mask . NAME ) ) ) ) ; <END_BUG> } public FlexoConceptInstance getFlexoConceptInstance ( ) { } public List < MaskableElement > getSelection ( ) { } public List < ? extends MaskableElement > getFilteredSelection ( Class < ? extends MaskableElement > objectKind ) { } public void updateSelection ( MaskableElement selected ) { } public List < OBPTraceObject > getVisibleOBPTraceObjects ( ) { } public boolean isContainedInSelection ( Object object ) { } private void computeRelevantConfiguration ( ) { } public List < OBPTraceConfiguration > getRelevantConfigurations ( ) { } public List < OBPTraceConfiguration > getRelevantConfigurationsForObject ( OBPTraceObject object ) { } public boolean isRelevant ( OBPTraceConfiguration configuration , OBPTraceObject object ) { } public List < OBPTraceBehaviourObjectInstance > getConfigurations ( ) { } public List < OBPTraceBehaviourObjectInstance > getBehaviourObjects ( ) { } public List < OBPTraceVariable > getVariables ( ) { } public List < ? extends OBPTraceObject > getOBPTraceObjectsFromFederatedElements ( List < MaskableFederatedElement > elements ) { } public List < MaskableElement > getMaskableElements ( ) { } public List < MaskableFederatedElement > getParentMaskableElements ( ) { } @ Override public void propertyChange ( PropertyChangeEvent evt ) { } }

Fix:
flexoConceptInstance . setFlexoActor ( name , ( ( PrimitiveRole ) ( flexoConceptInstance . getFlexoConcept ( ) . getAccessibleProperty ( Mask . NAME ) ) ) ) ;
Buggy code:
public abstract class AbstractFormatterTest extends AbstractCoreIntegrationTest { protected static final String UUID = "80f1c261-1495-4e3b-bd22-f32a5f0ad643" ; @ Autowired protected Format formatService ; @ Autowired protected SystemInfo systemInfo ; @ Autowired private IsoLanguagesMapper mapper ; @ Autowired MetadataRepository metadataRepository ; @ Autowired SchemaManager schemaManager ; @ Autowired SettingManager settingManager ; @ Autowired DataManager dataManager ; protected int id ; protected String xml ; @ Before public void setUp ( ) throws Exception { } public boolean isHarvested ( ) { } protected abstract File getTestMetadataFile ( ) { } protected Handlers getHandlers ( MockHttpServletRequest request , String formatterId ) throws Exception { } protected Pair < FormatterImpl , FormatterParams > getFormatterFormatterParamsPair ( MockHttpServletRequest request , String formatterId ) throws Exception { final ServletWebRequest webRequest = new ServletWebRequest ( request ) ; Key key = new Key ( id , getUILang ( ) , getOutputType ( ) , formatterId , false , FormatterWidth . _100 ) ; <START_BUG> return this . formatService . loadMetadataAndCreateFormatterAndParams ( key , webRequest ) ; <END_BUG> } protected void measureFormatterPerformance ( final MockHttpServletRequest request , final String formatterId ) throws Exception { } private FormatType getOutputType ( ) { } private String getUILang ( ) { } private double round ( double num ) { } public static GPathResult parseXml ( String xmlString , Namespace ... namespaces ) throws Exception { } protected String executeHandler ( MockHttpServletRequest request , String formatterId , GPathResult elem , Handler handler ) throws Exception { } protected String escapeXmlText ( String text ) { } }

Fix:
return this . formatService . loadMetadataAndCreateFormatterAndParams ( createServiceContext ( ) , key , webRequest ) ;
Buggy code:
public class TestTurnObserver { private AbstractPiece [ ] [ ] pieces ; @ Before public void setup ( ) { } @ Test public void testCreateTurnObserver ( ) throws IllegalAccessException , IllegalArgumentException , NoSuchFieldException , SecurityException { ITurnObserver observer = new TurnObserver ( ) ; <START_BUG> GameBoard board = new GameBoard ( User . PLAYER1 , pieces ) ; <END_BUG> board . setObserver ( observer ) ; Field privateObserverField = GameBoard . class . getDeclaredField ( "observer" ) ; privateObserverField . setAccessible ( true ) ; ITurnObserver fieldValue = ( ( ITurnObserver ) ( privateObserverField . get ( board ) ) ) ; assertTrue ( ( fieldValue != null ) ) ; } @ Test public void testEndTurn ( ) { } @ Test public void testIsTurn ( ) { } }

Fix:
GameBoard board = new GameBoard ( User . PLAYER1 , pieces , pieces ) ;
Buggy code:
public class MySQLDictionary extends DBDictionary { public static final String SELECT_HINT = "openjpa.hint.MySQLSelectHint" ; public String tableType = "innodb" ; public boolean useClobs = true ; public boolean driverDeserializesBlobs = false ; public boolean optimizeMultiTableDeletes = false ; public MySQLDictionary ( ) { } public void connectedConfiguration ( Connection conn ) throws SQLException { } public Connection decorate ( Connection conn ) throws SQLException { } private static int [ ] getMajorMinorVersions ( String versionStr ) throws IllegalArgumentException { } public String [ ] getCreateTableSQL ( Table table ) { } public String [ ] getDropIndexSQL ( Index index ) { } @ Override public String [ ] getDropPrimaryKeySQL ( PrimaryKey pk ) { } @ Override public String [ ] getDropForeignKeySQL ( ForeignKey fk , Connection conn ) { } public String [ ] getAddPrimaryKeySQL ( PrimaryKey pk ) { } public String [ ] getDeleteTableContentsSQL ( Table [ ] tables , Connection conn ) { if ( ! ( optimizeMultiTableDeletes ) ) return super . getDeleteTableContentsSQL ( tables , conn ) ; else { <START_BUG> StringBuffer buf = new StringBuffer ( ( ( tables . length ) * 8 ) ) ; <END_BUG> buf . append ( "DELETE<seq2seq4repair_space>FROM<seq2seq4repair_space>" ) ; for ( int i = 0 ; i < ( tables . length ) ; i ++ ) { buf . append ( tables [ i ] . getFullName ( ) ) ; if ( i < ( ( tables . length ) - 1 ) ) buf . append ( ",<seq2seq4repair_space>" ) ; } return new String [ ] { buf . toString ( ) } ; } } protected void appendSelectRange ( SQLBuffer buf , long start , long end , boolean subselect ) { } protected Column newColumn ( ResultSet colMeta ) throws SQLException { } public Object getBlobObject ( ResultSet rs , int column , JDBCStore store ) throws SQLException { } public int getPreferredType ( int type ) { } public void appendXmlComparison ( SQLBuffer buf , String op , FilterValue lhs , FilterValue rhs , boolean lhsxml , boolean rhsxml ) { } private void appendXmlValue ( SQLBuffer buf , FilterValue val ) { } public int getBatchFetchSize ( int batchFetchSize ) { } @ Override public String getSelectOperation ( JDBCFetchConfiguration fetch ) { } @ Override protected Collection < String > getSelectTableAliases ( Select sel ) { } }

Fix:
StringBuilder buf = new StringBuilder ( ( ( tables . length ) * 8 ) ) ;
Buggy code:
public class SimpleSubsystemExtension implements Extension { public static final String NAMESPACE = "urn:mycompany:mysubsystem:1.0" ; public static final String SUBSYSTEM_NAME = "mysubsystem" ; private final SimpleSubsystemExtension . SubsystemParser parser = new SimpleSubsystemExtension . SubsystemParser ( ) ; @ Override public void initializeParsers ( ExtensionParsingContext context ) { } @ Override public void initialize ( ExtensionContext context ) { } private static ModelNode createAddSubsystemOperation ( ) { } private static class SubsystemParser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { @ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context ) throws XMLStreamException { } @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } } private static class SubsystemDescribeHandler implements OperationStepHandler , DescriptionProvider { static final SimpleSubsystemExtension . SubsystemDescribeHandler INSTANCE = new SimpleSubsystemExtension . SubsystemDescribeHandler ( ) ; public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . getResult ( ) . add ( SimpleSubsystemExtension . createAddSubsystemOperation ( ) ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } @ Override public ModelNode getModelDescription ( Locale locale ) { } } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public abstract class ChessRoom extends AbstractRoom { private final ChessGame chessGame ; private boolean joinable ; protected ChessRoom ( final GameComponent component , final JID roomJID , final ChessGame chessGame ) { } @ Override protected final String getXMLNS ( ) { } @ Override public final boolean joinable ( ) { } @ Override protected final void commandReceived ( final JID user , final Element x ) throws Exception { } @ Override protected void playerJoined ( final JID user ) { } @ Override protected void playerLeft ( final JID user ) { final ChessColor left = playerColor ( user ) ; <START_BUG> if ( left == null ) <END_BUG> return ; if ( ( players . size ( ) ) == 2 ) { chessGame . setWinner ( left . other ( ) ) ; final Message msg = new Message ( ) ; final Element x = msg . addChildElement ( "x" , getXMLNS ( ) ) ; x . addElement ( "winner" ) . addAttribute ( "color" , chessGame . getWinner ( ) . name ( ) ) ; sendGroupMessage ( msg ) ; } } private final ChessColor playerColor ( final JID user ) { } }

Fix:
if ( ( left == null ) || ( chessGame . isFinished ( ) ) )
Buggy code:
public class MSVSSGET extends MSVSS { private String m_LocalPath = null ; private boolean m_Recursive = false ; private boolean m_Writable = false ; private String m_Version = null ; private String m_Date = null ; private String m_Label = null ; private String m_AutoResponse = null ; private boolean m_Quiet = false ; public final void setQuiet ( boolean quiet ) { } public final void setWritable ( boolean argWritable ) { } public void setAutoresponse ( String response ) { } public void setDate ( String date ) { } public void setLabel ( String label ) { } public void setLocalpath ( Path localPath ) { } public void setRecursive ( boolean recursive ) { } public void setVersion ( String version ) { } public void getAutoresponse ( Commandline cmd ) { } public void getLocalpathCommand ( Commandline cmd ) throws TaskException { if ( ( m_LocalPath ) == null ) { return ; } else { File dir = resolveFile ( m_LocalPath ) ; if ( ! ( dir . exists ( ) ) ) { boolean done = dir . mkdirs ( ) ; if ( done == false ) { String msg = ( ( "Directory<seq2seq4repair_space>" + ( m_LocalPath ) ) + "<seq2seq4repair_space>creation<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>" ) + "successful<seq2seq4repair_space>for<seq2seq4repair_space>an<seq2seq4repair_space>unknown<seq2seq4repair_space>reason" ; throw new TaskException ( msg ) ; } <START_BUG> log ( ( "Created<seq2seq4repair_space>dir:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; <END_BUG> } cmd . createArgument ( ) . setValue ( ( ( FLAG_OVERRIDE_WORKING_DIR ) + ( m_LocalPath ) ) ) ; } } public void getQuietCommand ( Commandline cmd ) { } public void getRecursiveCommand ( Commandline cmd ) { } public void getVersionCommand ( Commandline cmd ) { } public void getWritableCommand ( Commandline cmd ) { } public void execute ( ) throws TaskException { } }

Fix:
getLogger ( ) . info ( ( "Created<seq2seq4repair_space>dir:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ;
Buggy code:
public class AspectJElementHierarchy implements IHierarchy { protected IProgramElement root = null ; protected String configFile = null ; private Map fileMap = null ; private Map handleMap = null ; private Map typeMap = null ; public IProgramElement getElement ( String handle ) { } public IProgramElement getRoot ( ) { } public void setRoot ( IProgramElement root ) { } public void addToFileMap ( Object key , Object value ) { } public boolean removeFromFileMap ( Object key ) { } public void setFileMap ( HashMap fileMap ) { } public Object findInFileMap ( Object key ) { } public Set getFileMapEntrySet ( ) { } public boolean isValid ( ) { } public IProgramElement findElementForSignature ( IProgramElement parent , IProgramElement . Kind kind , String signature ) { } public IProgramElement findElementForLabel ( IProgramElement parent , IProgramElement . Kind kind , String label ) { for ( Iterator it = parent . getChildren ( ) . iterator ( ) ; it . hasNext ( ) ; ) { IProgramElement node = ( ( IProgramElement ) ( it . next ( ) ) ) ; if ( ( ( node . getKind ( ) ) == kind ) && ( label . equals ( node . toLabelString ( ) ) ) ) { return node ; } else { <START_BUG> IProgramElement childSearch = findElementForSignature ( node , kind , label ) ; <END_BUG> if ( childSearch != null ) return childSearch ; } } return null ; } public IProgramElement findElementForType ( String packageName , String typeName ) { } private IProgramElement findClassInNodes ( Collection nodes , String name ) { } public IProgramElement findElementForSourceFile ( String sourceFile ) { } public IProgramElement findElementForSourceLine ( ISourceLocation location ) { } public IProgramElement findElementForSourceLine ( String sourceFilePath , int lineNumber ) { } private IProgramElement createFileStructureNode ( String sourceFilePath ) { } private IProgramElement findNodeForSourceLineHelper ( IProgramElement node , String sourceFilePath , int lineNumber ) { } private boolean matches ( IProgramElement node , String sourceFilePath , int lineNumber ) { } private boolean hasMoreSpecificChild ( IProgramElement node , String sourceFilePath , int lineNumber ) { } public String getConfigFile ( ) { } public void setConfigFile ( String configFile ) { } public IProgramElement findElementForHandle ( String handle ) { } protected void cache ( String handle , ProgramElement pe ) { } public void flushTypeMap ( ) { } public void flushHandleMap ( ) { } public void updateHandleMap ( Set deletedFiles ) { } private String getFilename ( String hid ) { } }

Fix:
IProgramElement childSearch = findElementForLabel ( node , kind , label ) ;
Buggy code:
public class SqlQuery extends ColumnFixture { private static final Logger logger = LoggerFactory . getLogger ( SqlQuery . class ) ; private DBUtil dbUtil = new DBUtil ( ) ; private DataSourceInfo dataSource ; private Statement statement ; private Connection con ; public SqlQuery ( ) { } @ Override public void doRows ( Parse rows ) { if ( ( args . length ) != 2 ) { exception ( rows . parts , new Exception ( "Usage:<seq2seq4repair_space>!|SqlQuery|data-source-name|sql<seq2seq4repair_space>query|" ) ) ; return ; } String dataSourceName = args [ 0 ] ; String sqlQueryText = args [ 1 ] ; ResultSet result = null ; SqlQuery . logger . info ( "SqlQuery<seq2seq4repair_space>from<seq2seq4repair_space>data-source<seq2seq4repair_space>{},<seq2seq4repair_space>sql<seq2seq4repair_space>query<seq2seq4repair_space>{}" , dataSourceName , sqlQueryText ) ; try { List < String > sqlCommands = new ArrayList < String > ( ) ; String [ ] rowNames = findTableHeaders ( rows . parts ) ; dataSource = dbUtil . getDataSource ( dataSourceName ) ; Parse row = rows ; while ( ( row = row . more ) != null ) { Parse column = row . parts ; do { SqlQuery . logger . debug ( "sql:<seq2seq4repair_space>{}" , column . text ( ) ) ; sqlCommands . add ( column . text ( ) ) ; } while ( ( column = column . more ) != null ) ; } result = executeSql ( dataSource , sqlQueryText ) ; SqlQuery . logger . debug ( "DB<seq2seq4repair_space>query<seq2seq4repair_space>returned" ) ; compareResultToTable ( rows , result , rowNames ) ; } catch ( Exception e ) { <START_BUG> SqlQuery . logger . error ( "SqlScript" , e ) ; <END_BUG> exception ( rows , e ) ; } finally { if ( ( statement ) != null ) { try { statement . close ( ) ; } catch ( SQLException e ) { } statement = null ; } if ( ( con ) != null ) { dataSource . releaseConnection ( con ) ; con = null ; } } } public String [ ] findTableHeaders ( Parse headerCells ) { } private void compareResultToTable ( Parse row , ResultSet result , String [ ] fieldNames ) throws StreamBaseException , SQLException { } private boolean checkNull ( Parse cell , ResultSet result , String expected , String found ) throws SQLException { } private void compareColumn ( ResultSet result , ResultSetMetaData meta , Parse cell , int colNumber , String columnName , String expected ) throws StreamBaseException , SQLException { } private void addUnexpectedRows ( Parse priorRow , ResultSet result , String [ ] columnNames ) throws SQLException { } private void addUnexpectedRow ( Parse priorRow , ResultSet result , String [ ] columnNames ) { } public ResultSet executeSql ( DataSourceInfo dataSource , String sql ) throws StreamBaseException { } public void forciblyReleaseConnection ( ) { } private ResultSet execute ( Statement statement , String command ) throws StreamBaseException { } }

Fix:
SqlQuery . logger . error ( "SqlQuery<seq2seq4repair_space>exception" , e ) ;
Buggy code:
public class EnhancedMediaPlayer extends MediaPlayer implements MediaPlayer . OnCompletionListener , Runnable { private static final String TAG = EnhancedMediaPlayer . class . getName ( ) ; private static final int FADE_OUT_DURATION = 100 ; private static final int INT_VOLUME_MAX = 100 ; private static final int INT_VOLUME_MIN = 0 ; private static final float FLOAT_VOLUME_MAX = 1 ; private static final float FLOAT_VOLUME_MIN = 0 ; private enum State { IDLE , INIT , PREPARED , STARTED , STOPPED , PAUSED , DESTROYED ; } private EnhancedMediaPlayer . State currentState ; private MediaPlayerData rawData ; private int duration ; private int volume ; private Handler handler = new Handler ( ) ; public EnhancedMediaPlayer ( Context context , MediaPlayerData data ) throws IOException { } public static EnhancedMediaPlayer getInstanceForPlayList ( Context context , MediaPlayerData data ) throws IOException { } public static MediaPlayerData getMediaPlayerData ( String fragmentTag , Uri uri , String label ) { } private void init ( Context context ) throws IOException { } public void destroy ( ) { } public MediaPlayerData getMediaPlayerData ( ) { } @ Override public int getDuration ( ) { } @ Override public boolean isPlaying ( ) { } @ Override public void setLooping ( boolean looping ) { } public void setIsInPlaylist ( boolean inPlaylist ) { } public boolean playSound ( ) { } public boolean stopSound ( ) { } public boolean pauseSound ( ) { } public void fadeOutSound ( ) { } private void scheduleNextVolumeChange ( ) { } @ Override public void run ( ) { } private void updateVolume ( int change ) { } public boolean setPositionTo ( int timePosition ) { } @ Override public void onCompletion ( MediaPlayer mp ) { } private void postStateChangedEvent ( boolean isAlive ) { <START_BUG> EventBus . getDefault ( ) . post ( new MediaPlayerStateChangedEvent ( isAlive , this . rawData . getPlayerId ( ) ) ) ; <END_BUG> } private void postCompletedEvent ( ) { } }

Fix:
EventBus . getDefault ( ) . post ( new MediaPlayerStateChangedEvent ( isAlive , this . rawData . getPlayerId ( ) , this . rawData . getFragmentTag ( ) ) ) ;
Buggy code:
public abstract class NitroContentExtractor < SOURCE , CONTENT extends Content > implements ContentExtractor < SOURCE , CONTENT > { private static final Logger log = LoggerFactory . getLogger ( NitroContentExtractor . class ) ; private static final String PID_NAMESPACE = "gb:bbc:pid" ; private static final String URI_NAMESPACE = "uri" ; private final Clock clock ; private final NitroImageExtractor imageExtractor = new NitroImageExtractor ( 1024 , 576 ) ; public NitroContentExtractor ( Clock clock ) { } @ Override public final CONTENT extract ( SOURCE source ) { } @ Nullable protected abstract MasterBrand extractMasterBrand ( SOURCE source ) { } @ Nonnull protected abstract CONTENT createContent ( SOURCE source ) { } @ Nonnull protected abstract String extractPid ( SOURCE source ) { } @ Nullable protected abstract String extractTitle ( SOURCE source ) { } @ Nullable protected abstract Synopses extractSynopses ( SOURCE source ) { } @ Nullable protected abstract Image extractImage ( SOURCE source ) { } protected void extractAdditionalFields ( SOURCE source , CONTENT content , DateTime now ) { } private String longestSynopsis ( Synopses synopses ) { } private MediaType computeMediaType ( MasterBrand masterBrand ) { if ( masterBrand == null ) { return MediaType . VIDEO ; } <START_BUG> return ionIdToService . containsKey ( masterBrand . getMid ( ) ) ? MediaType . AUDIO : MediaType . VIDEO ; <END_BUG> } }

Fix:
return masterBrandIdToService . containsKey ( masterBrand . getMid ( ) ) ? MediaType . AUDIO : MediaType . VIDEO ;
Buggy code:
public class AjpListenerService extends ListenerService < AjpListenerService > { private volatile AcceptingChannel < StreamConnection > server ; private final String scheme ; public AjpListenerService ( String name , final String scheme , OptionMap listenerOptions ) { } @ Override protected OpenListener createOpenListener ( ) { } @ Override void startListening ( XnioWorker worker , InetSocketAddress socketAddress , ChannelListener < AcceptingChannel < StreamConnection > > acceptListener ) throws IOException { } @ Override void stopListening ( ) { } @ Override public AjpListenerService getValue ( ) throws IllegalArgumentException , IllegalStateException { } @ Override public boolean isSecure ( ) { <START_BUG> return false ; <END_BUG> } @ Override protected void preStart ( final StartContext context ) { } @ Override protected String getProtocol ( ) { } }

Fix:
return ( ( scheme ) != null ) && ( scheme . equals ( "https" ) ) ;
Buggy code:
public class List extends Scrollable { NSTableColumn column ; String [ ] items ; int itemCount ; boolean ignoreSelect ; public List ( Composite parent , int style ) { } public void add ( String string ) { } public void add ( String string , int index ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } void createWidget ( ) { } Color defaultBackground ( ) { } Color defaultForeground ( ) { } public void deselect ( int index ) { } public void deselect ( int start , int end ) { } public void deselect ( int [ ] indices ) { } public void deselectAll ( ) { } void fixSelection ( int index , boolean add ) { } public int getFocusIndex ( ) { } public String getItem ( int index ) { } public int getItemCount ( ) { } public int getItemHeight ( ) { } public String [ ] getItems ( ) { } public String [ ] getSelection ( ) { } public int getSelectionCount ( ) { } public int getSelectionIndex ( ) { } public int [ ] getSelectionIndices ( ) { } public int getTopIndex ( ) { } public int indexOf ( String item ) { } public int indexOf ( String string , int start ) { } public boolean isSelected ( int index ) { } int numberOfRowsInTableView ( int aTableView ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } public void remove ( int index ) { } public void remove ( int start , int end ) { } public void remove ( String string ) { } public void remove ( int [ ] indices ) { } public void removeAll ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void select ( int index ) { checkWidget ( ) ; if ( ( 0 <= index ) && ( index < ( itemCount ) ) ) { NSIndexSet indexes = ( ( NSIndexSet ) ( new NSIndexSet ( ) . alloc ( ) ) ) ; indexes . initWithIndex ( index ) ; NSTableView widget = ( ( NSTableView ) ( view ) ) ; ignoreSelect = true ; <START_BUG> ( ( NSTableView ) ( view ) ) . selectRowIndexes ( indexes , true ) ; <END_BUG> ignoreSelect = false ; } } public void select ( int start , int end ) { } public void select ( int [ ] indices ) { } void select ( int [ ] ids , int count , boolean clear ) { } public void selectAll ( ) { } void sendDoubleSelection ( ) { } public void setItem ( int index , String string ) { } public void setItems ( String [ ] items ) { } public void setSelection ( int index ) { } void setSelection ( int index , boolean notify ) { } public void setSelection ( int start , int end ) { } public void setSelection ( int [ ] indices ) { } public void setSelection ( String [ ] items ) { } public void setTopIndex ( int index ) { } void showIndex ( int index ) { } public void showSelection ( ) { } void tableViewSelectionDidChange ( int aNotification ) { } boolean tableView_shouldEditTableColumn_row ( int aTableView , int aTableColumn , int rowIndex ) { } int tableView_objectValueForTableColumn_row ( int aTableView , int aTableColumn , int rowIndex ) { } }

Fix:
widget . selectRowIndexes ( indexes , true ) ;
Buggy code:
public class Ant extends Task { private String dir = null ; private String antFile = null ; private String target = null ; private String output = null ; Vector properties = new Vector ( ) ; Project p1 ; public void init ( ) { } public void execute ( ) throws BuildException { } public void setDir ( String d ) { } public void setAntfile ( String s ) { } public void setTarget ( String s ) { } public void setOutput ( String s ) { } <START_BUG> public Task createProperty ( ) { <END_BUG> Property p = ( ( Property ) ( p1 . createTask ( "property" ) ) ) ; p . setUserProperty ( true ) ; properties . addElement ( p ) ; return p ; } }

Fix:
public Property createProperty ( ) {
Buggy code:
public final class ThreadFactoryGroupNameUpdate extends AbstractThreadsSubsystemUpdate < Void > { private static final long serialVersionUID = 4253625376544201028L ; private final String name ; private final String newGroupName ; public ThreadFactoryGroupNameUpdate ( final String name , final String newGroupName ) { } public ThreadFactoryGroupNameUpdate getCompensatingUpdate ( final ThreadsSubsystemElement original ) { } protected < P > void applyUpdate ( final UpdateContext updateContext , final UpdateResultHandler < ? super Void , P > handler , final P param ) { <START_BUG> final ServiceController < ? > service = updateContext . getServiceContainer ( ) . getService ( ThreadsServices . threadFactoryName ( name ) ) ; <END_BUG> if ( service == null ) { handler . handleFailure ( notConfigured ( ) , param ) ; } else { try { final ThreadFactoryService threadFactoryService = ( ( ThreadFactoryService ) ( service . getValue ( ) ) ) ; threadFactoryService . setThreadGroupName ( newGroupName ) ; handler . handleSuccess ( null , param ) ; } catch ( Throwable t ) { handler . handleFailure ( t , param ) ; } } } protected void applyUpdate ( final ThreadsSubsystemElement element ) throws UpdateFailedException { } public String getNewGroupName ( ) { } public String getName ( ) { } private UpdateFailedException notConfigured ( ) { } }

Fix:
final ServiceController < ? > service = updateContext . getServiceRegistry ( ) . getService ( ThreadsServices . threadFactoryName ( name ) ) ;
Buggy code:
public class DropColumnFamily extends Migration { private String tableName ; private String cfName ; protected DropColumnFamily ( ) { } public DropColumnFamily ( String tableName , String cfName ) throws IOException , ConfigurationException { } private KSMetaData makeNewKeyspaceDefinition ( KSMetaData ksm ) { } public void applyModels ( ) throws IOException { ColumnFamilyStore cfs = Table . open ( tableName , schema ) . getColumnFamilyStore ( cfName ) ; KSMetaData existing = schema . getTableDefinition ( tableName ) ; CFMetaData cfm = existing . cfMetaData ( ) . get ( cfName ) ; KSMetaData ksm = makeNewKeyspaceDefinition ( existing ) ; schema . purge ( cfm ) ; schema . setTableDefinition ( ksm , newVersion ) ; if ( ! ( instance . isClientMode ( ) ) ) { <START_BUG> cfs . snapshot ( Table . getTimestampedSnapshotName ( null ) ) ; <END_BUG> CompactionManager . instance . getCompactionLock ( ) . lock ( ) ; cfs . flushLock . lock ( ) ; try { Table . open ( ksm . name , schema ) . dropCf ( cfm . cfId ) ; } finally { cfs . flushLock . unlock ( ) ; CompactionManager . instance . getCompactionLock ( ) . unlock ( ) ; } } } public void subdeflate ( org . apache . cassandra . db . migration . avro . Migration mi ) { } public void subinflate ( org . apache . cassandra . db . migration . avro . Migration mi ) { } @ Override public String toString ( ) { } }

Fix:
cfs . snapshot ( Table . getTimestampedSnapshotName ( cfs . columnFamily ) ) ;
Buggy code:
@ SuppressWarnings ( "PublicInnerClass" ) public class Message implements RelayCat { private final String message ; private final String nick ; private final String me ; private final String channel ; private final boolean action ; private boolean dispose = false ; private final BasicRelayCat inst ; protected Message ( String message , String nick , String channel , boolean action , BasicRelayCat inst ) { } public boolean isAction ( ) { } public String getMessage ( ) { } public String getChannel ( ) { } public String getSender ( ) { } @ Override public String getNick ( ) { } public synchronized void reply ( String message ) { } public synchronized void act ( String action ) { } public synchronized void replyToAll ( String message ) { } public void dispose ( ) { } @ Override public void message ( String target , String message ) { } @ Override public void act ( String target , String message ) { if ( dispose ) return ; <START_BUG> inst . act ( target , nick ) ; <END_BUG> } @ Override public void join ( String channel ) { } @ Override public void leave ( String channel ) { } @ Override public User [ ] names ( String channel ) { } @ Override public String [ ] channels ( ) { } public boolean isDisposed ( ) { } }

Fix:
inst . act ( target , message ) ;
Buggy code:
public class TrafficViolationSource implements Source < TrafficViolation > { private static int count = 0 ; private static List < TrafficViolation > list = new ArrayList < TrafficViolation > ( ) ; public static void main ( String [ ] args ) throws IOException , URISyntaxException { } public static void getAPIData ( List < TrafficViolation > list ) throws IOException , URISyntaxException { System . out . println ( "Started<seq2seq4repair_space>getting<seq2seq4repair_space>data<seq2seq4repair_space>from<seq2seq4repair_space>api" ) ; BufferedReader bf = null ; <START_BUG> String link_url = ( "https:////data.montgomerycountymd.gov//resource//ms8i-8ux3.json?$$app_token=" + ( AccessToken . accessToken ) ) + "&$limit=1000000" ; <END_BUG> URL url = new URL ( link_url ) ; HttpsURLConnection con = ( ( HttpsURLConnection ) ( url . openConnection ( ) ) ) ; bf = new BufferedReader ( new InputStreamReader ( con . getInputStream ( ) ) ) ; ObjectMapper objectmapper = new ObjectMapper ( ) ; String line = null ; while ( ( line = bf . readLine ( ) ) != null ) { try { if ( line . substring ( 0 , 1 ) . contains ( "[" ) ) line = line . substring ( 1 ) ; else if ( line . substring ( 0 , 1 ) . contains ( "," ) ) line = line . substring ( 1 ) ; TrafficViolation tvobj = objectmapper . readValue ( line , TrafficViolation . class ) ; list . add ( tvobj ) ; if ( ( list . size ( ) ) == 50000 ) { TrafficViolationCollector c = new TrafficViolationCollector ( ) ; c . mungee ( list ) ; c . save ( list ) ; c . saveElasticsearch ( list ) ; System . out . println ( "50000<seq2seq4repair_space>records<seq2seq4repair_space>are<seq2seq4repair_space>inserted<seq2seq4repair_space>in<seq2seq4repair_space>mongo" ) ; TrafficViolationSource . count = 0 ; list = new ArrayList < TrafficViolation > ( ) ; } ( TrafficViolationSource . count ) ++ ; System . out . println ( TrafficViolationSource . count ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } TrafficViolationCollector c = new TrafficViolationCollector ( ) ; c . mungee ( list ) ; c . save ( list ) ; c . saveElasticsearch ( list ) ; list = new ArrayList < TrafficViolation > ( ) ; System . out . println ( ( ( "Total<seq2seq4repair_space>" + ( TrafficViolationSource . count ) ) + "<seq2seq4repair_space>inserted" ) ) ; } public static void readData ( File descriptionCsvFile , List < TrafficViolation > list ) throws URISyntaxException { } @ Override public boolean hasNext ( ) { } @ Override public Collection < TrafficViolation > next ( ) { } }

Fix:
String link_url = "https:////data.montgomerycountymd.gov//resource//ms8i-8ux3.json" ;
Buggy code:
public final class ExceptionClosure < E > implements Serializable , Closure < E > { private static final long serialVersionUID = 7179106032121985545L ; public static final Closure < Object > INSTANCE = new ExceptionClosure < Object > ( ) ; @ SuppressWarnings ( "unchecked" ) public static < E > Closure < E > exceptionClosure ( ) { } private ExceptionClosure ( ) { } <START_BUG> public void execute ( E input ) { <END_BUG> throw new FunctorException ( "ExceptionClosure<seq2seq4repair_space>invoked" ) ; } private Object readResolve ( ) { } }

Fix:
public void execute ( final E input ) {
Buggy code:
public class PooledConnectionFactoryAdd extends AbstractAddStepHandler { public static ModelNode getAddOperation ( final ModelNode address , ModelNode subModel ) { } public static final PooledConnectionFactoryAdd INSTANCE = new PooledConnectionFactoryAdd ( ) ; protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { ModelNode opAddr = operation . require ( OP_ADDR ) ; final PathAddress address = PathAddress . pathAddress ( opAddr ) ; final String name = address . getLastElement ( ) . getValue ( ) ; for ( final AttributeDefinition attribute : JMSServices . POOLED_CONNECTION_FACTORY_ATTRS ) { <START_BUG> attribute . validateResolvedOperation ( model ) ; <END_BUG> } final String jndiName = operation . get ( ENTRIES . getName ( ) ) . asList ( ) . get ( 0 ) . asString ( ) ; final String txSupport ; if ( operation . hasDefined ( CommonAttributes . TRANSACTION ) ) { String txType = operation . get ( CommonAttributes . TRANSACTION ) . asString ( ) ; if ( CommonAttributes . LOCAL . equals ( txType ) ) { txSupport = CommonAttributes . LOCAL_TX ; } else if ( CommonAttributes . NONE . equals ( txType ) ) { txSupport = CommonAttributes . NO_TX ; } else { txSupport = CommonAttributes . XA_TX ; } } else { txSupport = CommonAttributes . XA_TX ; } ServiceTarget serviceTarget = context . getServiceTarget ( ) ; List < String > connectors = PooledConnectionFactoryAdd . getConnectors ( operation ) ; List < PooledConnectionFactoryConfigProperties > adapterParams = PooledConnectionFactoryAdd . getAdapterParams ( operation ) ; final ServiceName hqServiceName = MessagingServices . getHornetQServiceName ( PathAddress . pathAddress ( operation . get ( ModelDescriptionConstants . OP_ADDR ) ) ) ; ServiceName hornetQResourceAdapterService = JMSServices . getPooledConnectionFactoryBaseServiceName ( hqServiceName ) . append ( name ) ; PooledConnectionFactoryService resourceAdapterService = new PooledConnectionFactoryService ( name , connectors , adapterParams , jndiName , txSupport ) ; ServiceBuilder serviceBuilder = serviceTarget . addService ( hornetQResourceAdapterService , resourceAdapterService ) . addDependency ( JBOSS_TXN_TRANSACTION_MANAGER , resourceAdapterService . getTransactionManager ( ) ) . addDependency ( hqServiceName , HornetQServer . class , resourceAdapterService . getHornetQService ( ) ) . addListener ( verificationHandler ) ; newControllers . add ( serviceBuilder . setInitialMode ( ACTIVE ) . install ( ) ) ; } static List < String > getConnectors ( final ModelNode operation ) { } static List < PooledConnectionFactoryConfigProperties > getAdapterParams ( ModelNode operation ) { } }

Fix:
attribute . resolveModelAttribute ( context , model ) ;
Buggy code:
public class BatchDiscardHandler extends CommandHandlerWithHelp { public BatchDiscardHandler ( ) { } @ Override public boolean isAvailable ( CommandContext ctx ) { } @ Override protected void doHandle ( CommandContext ctx ) { boolean result = ctx . getBatchManager ( ) . discardActiveBatch ( ) ; if ( ! result ) { <START_BUG> ctx . printLine ( "There<seq2seq4repair_space>is<seq2seq4repair_space>no<seq2seq4repair_space>active<seq2seq4repair_space>batch<seq2seq4repair_space>to<seq2seq4repair_space>discard." ) ; <END_BUG> } } }

Fix:
ctx . error ( "There<seq2seq4repair_space>is<seq2seq4repair_space>no<seq2seq4repair_space>active<seq2seq4repair_space>batch<seq2seq4repair_space>to<seq2seq4repair_space>discard." ) ;
Buggy code:
public class CCCheckout extends ClearCase { private boolean m_Reserved = true ; private String m_Out = null ; private boolean m_Ndata = false ; private String m_Branch = null ; private boolean m_Version = false ; private boolean m_Nwarn = false ; private String m_Comment = null ; private String m_Cfile = 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_CHECKOUT ) ; checkOptions ( commandLine ) ; 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 setReserved ( boolean reserved ) { } public boolean getReserved ( ) { } public void setOut ( String outf ) { } public String getOut ( ) { } public void setNoData ( boolean ndata ) { } public boolean getNoData ( ) { } public void setBranch ( String branch ) { } public String getBranch ( ) { } public void setVersion ( boolean version ) { } public boolean getVersion ( ) { } public void setNoWarn ( boolean nwarn ) { } public boolean getNoWarn ( ) { } public void setComment ( String comment ) { } public String getComment ( ) { } public void setCommentFile ( String cfile ) { } public String getCommentFile ( ) { } private void getOutCommand ( Commandline cmd ) { } private void getBranchCommand ( Commandline cmd ) { } private void getCommentCommand ( Commandline cmd ) { } private void getCommentFileCommand ( Commandline cmd ) { } public static final String FLAG_RESERVED = "-reserved" ; public static final String FLAG_UNRESERVED = "-unreserved" ; public static final String FLAG_OUT = "-out" ; public static final String FLAG_NODATA = "-ndata" ; public static final String FLAG_BRANCH = "-branch" ; public static final String FLAG_VERSION = "-version" ; public static final String FLAG_NOWARN = "-nwarn" ; public static final String FLAG_COMMENT = "-c" ; public static final String FLAG_COMMENTFILE = "-cfile" ; public static final String FLAG_NOCOMMENT = "-nc" ; }

Fix:
throw new BuildException ( msg , getLocation ( ) ) ;
Buggy code:
public class ContactInfo extends Activity { private Profile user ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_contact_info ) ; Mongo . getProfile ( new MongoReceiver ( ) { @ Override public void process ( JSONArray result ) { try { <START_BUG> user = new Profile ( new JSONArray ( result ) . getJSONObject ( 0 ) ) ; <END_BUG> } catch ( JSONException f ) { Log . d ( "ProcessResult" , f . getLocalizedMessage ( ) ) ; } Toast . makeText ( getBaseContext ( ) , user . getName ( ) , LENGTH_LONG ) . show ( ) ; } } , 1 ) ; TextView name = ( ( TextView ) ( findViewById ( name ) ) ) ; name . setText ( ( ( name . getText ( ) ) + ( user . getName ( ) ) ) ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
user = new Profile ( result . getJSONObject ( 0 ) ) ;
Buggy code:
public class TransformedSortedSetTest < E > extends AbstractSortedSetTest < E > { public TransformedSortedSetTest ( final String testName ) { } public static Test suite ( ) { } @ Override @ SuppressWarnings ( "unchecked" ) public SortedSet < E > makeObject ( ) { } @ Override @ SuppressWarnings ( "unchecked" ) public SortedSet < E > makeFullCollection ( ) { } @ SuppressWarnings ( "unchecked" ) public void testTransformedSet ( ) { } public void testTransformedSet_decorateTransform ( ) { final Set < Object > originalSet = new TreeSet < Object > ( ) ; final Object [ ] els = new Object [ ] { "1" , "3" , "5" , "7" , "2" , "4" , "6" } ; Collections . addAll ( originalSet , els ) ; <START_BUG> final Set < ? > set = TransformedSortedSet . transformedSet ( originalSet , STRING_TO_INTEGER_TRANSFORMER ) ; <END_BUG> TransformedSortedSetTest . assertEquals ( els . length , set . size ( ) ) ; for ( final Object el : els ) { TransformedSortedSetTest . assertEquals ( true , set . contains ( Integer . valueOf ( ( ( String ) ( el ) ) ) ) ) ; } TransformedSortedSetTest . assertEquals ( true , set . remove ( Integer . valueOf ( ( ( String ) ( els [ 0 ] ) ) ) ) ) ; } @ Override public String getCompatibilityVersion ( ) { } }

Fix:
final Set < ? > set = TransformedSet . transformedSet ( originalSet , STRING_TO_INTEGER_TRANSFORMER ) ;
Buggy code:
public class RenderWorld { public static void AllBlocks ( ) { GL11 . glEnable ( GL_TEXTURE_2D ) ; RenderWorld . setRenderMins ( ) ; for ( int cx = RenderWorld . xMin ; cx < ( ( ( RenderWorld . xMin ) + ( ( CaveGame . getWorld ( ) . thePlayer . getRenderDistance ( ) ) * 2 ) ) + 4 ) ; cx ++ ) { for ( int cz = RenderWorld . zMin ; cz < ( ( ( RenderWorld . zMin ) + ( ( CaveGame . getWorld ( ) . thePlayer . getRenderDistance ( ) ) * 2 ) ) + 4 ) ; cz ++ ) { if ( CaveGame . getWorld ( ) . thePlayer . isWithinRenderDistance ( cx , cz ) ) { if ( ( ChunkInfo [ cx ] [ cz ] ) != null ) { Chunk chunk = ChunkInfo [ cx ] [ cz ] ; <START_BUG> chunk . renderChunk ( cx , cz ) ; <END_BUG> } } } } GL11 . glDisable ( GL_TEXTURE_2D ) ; } public static void PrepBlocks ( ) { } private static int xMin = 0 ; private static int zMin = 0 ; private static void setRenderMins ( ) { } public static void renderTest ( ) { } }

Fix:
chunk . renderChunkLagTest ( cx , cz ) ;
Buggy code:
@ SuppressWarnings ( { "checkstyle:methodlength" , "PMD.ModifiedCyclomaticComplexity" , "PMD.NPathComplexity" , "PMD.StdCyclomaticComplexity" , "PMD.CyclomaticComplexity" } ) public class CollisionsLevelModifier implements LevelModifier { private KineticsLevelModifier kinetics ; private ScoreCounter score ; public CollisionsLevelModifier ( KineticsLevelModifier kinetics , ScoreCounter score ) { } public void modify ( Level level , double delta ) { } protected void detectFruitPlatform ( Level level , double delta ) { } protected void detectPlayerPlatform ( Level level , double delta ) { } public void detectNPCPlatform ( Level level , double delta ) { } protected void detectBubblePlatform ( Level level , double delta ) { } protected void detectPlayerBubble ( Level level , double delta ) { ArrayList < Player > players = level . getPlayers ( ) ; for ( Player player : players ) { ArrayList < Bubble > bubbles = new ArrayList < Bubble > ( ) ; ArrayList < Fruit > fruits = level . getFruits ( ) ; for ( Bubble bubble : level . getBubbles ( ) ) { bubbles . add ( bubble ) ; } for ( Bubble bubble : bubbles ) { if ( bubble . inBoxRangeOf ( player , COLLISION_RADIUS ) ) { Collision collision = new Collision ( player , bubble , delta ) ; <START_BUG> if ( ( ( collision . collidingFromTop ( ) ) && ( ( player . vSpeed ( ) ) > 0 ) ) && ( ! ( bubble . hasNPC ( ) ) ) ) { <END_BUG> player . getSpeed ( ) . setY ( ( - ( Constants . PLAYER_JUMP ) ) ) ; kinetics . snapTop ( player , bubble ) ; break ; } if ( ( collision . colliding ( ) ) && ( bubble . hasNPC ( ) ) ) { Fruit newFruit = null ; try { newFruit = new Fruit ( bubble . getPosition ( ) . clone ( ) , new Vector ( Constants . BLOCKSIZE , Constants . BLOCKSIZE ) ) ; } catch ( CloneNotSupportedException e ) { e . printStackTrace ( ) ; } fruits . add ( newFruit ) ; level . getEnemyBubbles ( ) . remove ( bubble ) ; level . getBubbles ( ) . remove ( bubble ) ; if ( Constants . isLoggingWantEnemy ( ) ) { Logger . getInstance ( ) . log ( "Player<seq2seq4repair_space>executed<seq2seq4repair_space>an<seq2seq4repair_space>encapsulated<seq2seq4repair_space>enemy." ) ; } break ; } } } } } protected void detectBubbleEnemy ( Level level , double delta ) { } protected void detectBubbleBubble ( Level level , double delta ) { } protected void detectPlayerFruit ( Level level , double delta ) { } protected void detectPlayerEnemy ( Level level , double delta ) { } public KineticsLevelModifier getKinetics ( ) { } public ScoreCounter getScore ( ) { } }

Fix:
if ( ( collision . collidingFromTop ( ) ) && ( ! ( bubble . hasNPC ( ) ) ) ) {