nus-yam/ex-repair huggingface dataset:
Buggy code:
public class QueryComparison { private String attribute ; private ComparisonEnum comparisonType ; private List < Object > arguments ; public QueryComparison ( ) { } public QueryComparison ( String attribute , ComparisonEnum comparisonType , List < Object > arguments ) { } public String getAttribute ( ) { } public void setAttribute ( String attribute ) { } public ComparisonEnum getComparison ( ) { } public Object getArgument ( int index ) { } public List < Object > getArguments ( ) { } public boolean apply ( Object instance ) { } public boolean compare ( Object value ) { } public boolean compareInteger ( Integer thisValue ) { } public boolean compareDouble ( Double thisValue ) { } public boolean compareLong ( Long thisValue ) { } public boolean compareString ( String thisValue ) { String value = castToString ( this . arguments . get ( 0 ) ) ; switch ( comparisonType ) { case GREATER_THAN : return ( thisValue . compareTo ( value ) ) > 0 ; case GREATER_THAN_EQUAL_TO : return ( thisValue . compareTo ( value ) ) >= 0 ; case LESS_THAN : return ( thisValue . compareTo ( value ) ) < 0 ; case LESS_THAN_EQUAL_TO : return ( thisValue . compareTo ( value ) ) <= 0 ; case LIKE : <START_BUG> String regex = thisValue . replace ( "%" , ".*" ) ; <END_BUG> return thisValue . matches ( regex ) ; case EQUAL_TO : return thisValue . equals ( value ) ; case NOT_EQUAL_TO : return ! ( thisValue . equals ( value ) ) ; default : throw new com . serotonin . ShouldNeverHappenException ( ( "Unsupported<seq2seq4repair_space>comparisonType:<seq2seq4repair_space>" + ( getComparison ( ) ) ) ) ; } } public boolean compareBoolean ( Boolean thisValue ) { } private Integer castToInteger ( Object object ) { } private Long castToLong ( Object object ) { } private Double castToDouble ( Object object ) { } private String castToString ( Object object ) { } private Boolean castToBoolean ( Object object ) { } public String toString ( ) { } }

Fix:
String regex = value . replace ( "%" , ".*" ) ;
Buggy code:
public class ReminderActivity extends DrawerActivity { private ArrayList < Reminder > mReminders ; private ArrayAdapter < Reminder > mAdapter ; private ReminderSqlAdapter mSqlAdapter ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_reminder ) ; mReminders = new ArrayList < Reminder > ( ) ; mSqlAdapter = new ReminderSqlAdapter ( this ) ; mSqlAdapter . open ( ) ; mSqlAdapter . setAllReminders ( mReminders ) ; mAdapter = new com . example . scanitgrocerystorehelper . adapters . ReminderArrayAdapter ( this , mReminders ) ; ListView listview = ( ( ListView ) ( findViewById ( reminders ) ) ) ; listview . setAdapter ( mAdapter ) ; listview . setOnItemLongClickListener ( new OnItemLongClickListener ( ) { @ Override public boolean onItemLongClick ( AdapterView < ? > parent , View view , int position , long id ) { showDeleteReminderDialog ( position ) ; <START_BUG> return false ; <END_BUG> } } ) ; listview . setOnItemClickListener ( new OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { Reminder r = mAdapter . getItem ( position ) ; if ( ( r . getClass ( ) ) == ( ExpirationReminder . class ) ) { enterExpirationReminderInfoDialog ( ( ( ExpirationReminder ) ( r ) ) ) ; } else { enterGeneralReminderInfoDialog ( ( ( GeneralReminder ) ( r ) ) ) ; } } } ) ; } @ Override protected void onDestroy ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onPrepareOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void selectReminderTypeDialog ( ) { } private void enterExpirationReminderInfoDialog ( final ExpirationReminder reminderToUpdate ) { } private void enterGeneralReminderInfoDialog ( final GeneralReminder reminderToUpdate ) { } public void showDeleteReminderDialog ( final int position ) { } private void addReminder ( Reminder r ) { } private void deleteReminder ( Reminder r ) { } public void updateReminder ( Reminder r ) { } private void updateNotifcations ( Reminder reminderToUpdate ) { } }

Fix:
return true ;
Buggy code:
public class RemoveAnnotationFromPackageTest extends AbstractAnnotationTest { @ Override public String getPackageName ( ) { } @ Override public String getClassName ( ) { } @ Override public String getClassContents ( ) { } @ Override public Annotation getAnnotation ( ) { } public void testRemoveAnnotationFromPackage ( ) { try { assertNotNull ( annotation ) ; assertEquals ( XmlSchema . class . getSimpleName ( ) , AnnotationUtils . getAnnotationName ( annotation ) ) ; IPackageDeclaration myPackage = source . getPackageDeclaration ( getPackageName ( ) ) ; assertNotNull ( myPackage ) ; assertTrue ( AnnotationUtils . isAnnotationPresent ( myPackage , AnnotationUtils . getAnnotationName ( annotation ) ) ) ; textFileChange . addEdit ( AnnotationUtils . createRemoveAnnotationTextEdit ( myPackage , annotation ) ) ; <START_BUG> textFileChange . addEdit ( AnnotationUtils . createRemoveImportTextEdit ( myPackage , XmlSchema . class ) ) ; <END_BUG> assertTrue ( executeChange ( new NullProgressMonitor ( ) , textFileChange ) ) ; assertFalse ( AnnotationUtils . isAnnotationPresent ( myPackage , AnnotationUtils . getAnnotationName ( annotation ) ) ) ; assertFalse ( source . getImport ( XmlSchema . class . getCanonicalName ( ) ) . exists ( ) ) ; } catch ( CoreException ce ) { fail ( ce . getLocalizedMessage ( ) ) ; } } }

Fix:
textFileChange . addEdit ( AnnotationUtils . createRemoveImportTextEdit ( myPackage , XmlSchema . class . getCanonicalName ( ) ) ) ;
Buggy code:
@ SuppressWarnings ( "nls" ) public class PluginClassLoader extends ClassLoader { private ZipFile pluginArtifactZip ; private List < ZipFile > dependencyZips ; private File workDir ; public PluginClassLoader ( File pluginArtifactFile ) throws IOException { } public PluginClassLoader ( File pluginArtifactFile , ClassLoader parent ) throws IOException { } protected File createWorkDir ( File pluginArtifactFile ) throws IOException { } private void indexPluginArtifact ( ) throws IOException { } private ZipFile extractDependency ( ZipEntry zipEntry ) throws IOException { } private URL extractResource ( ZipEntry zipEntry ) throws IOException { } @ Override protected Class < ? > findClass ( String name ) throws ClassNotFoundException { } protected InputStream findClassContent ( String className ) throws IOException { } @ Override protected URL findResource ( String name ) { Enumeration < ? extends ZipEntry > entries = this . pluginArtifactZip . entries ( ) ; while ( entries . hasMoreElements ( ) ) { ZipEntry zipEntry = entries . nextElement ( ) ; <START_BUG> if ( zipEntry . getName ( ) . equalsIgnoreCase ( name ) ) { <END_BUG> try { return extractResource ( zipEntry ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } } return super . findResource ( name ) ; } @ Override protected Enumeration < URL > findResources ( String name ) throws IOException { } @ Override protected void finalize ( ) throws Throwable { } public void close ( ) throws IOException { } public List < URL > getPolicyDefinitionResources ( ) { } }

Fix:
if ( ( zipEntry . getName ( ) . equalsIgnoreCase ( name ) ) || ( zipEntry . getName ( ) . equalsIgnoreCase ( ( "WEB-INF//classes//" + name ) ) ) ) {
Buggy code:
public class BecomeWorkingCopyOperation extends JavaModelOperation { IPath path ; IProblemRequestor problemRequestor ; public BecomeWorkingCopyOperation ( CompilationUnit workingCopy , IPath path , IProblemRequestor problemRequestor ) { } protected void executeOperation ( ) throws JavaModelException { CompilationUnit workingCopy = getWorkingCopy ( ) ; <START_BUG> JavaModelManager . getJavaModelManager ( ) . getPerWorkingCopyInfo ( workingCopy , this . path , true , true , problemRequestor ) ; <END_BUG> workingCopy . openWhenClosed ( workingCopy . createElementInfo ( ) , fMonitor ) ; if ( ( workingCopy . owner ) != ( DefaultWorkingCopyOwner . PRIMARY ) ) { JavaElementDelta delta = new JavaElementDelta ( this . getJavaModel ( ) ) ; delta . added ( workingCopy ) ; addDelta ( delta ) ; } else { JavaElementDelta delta = new JavaElementDelta ( this . getJavaModel ( ) ) ; delta . changed ( workingCopy , IJavaElementDelta . F_PRIMARY_WORKING_COPY ) ; addDelta ( delta ) ; } fResultElements = new IJavaElement [ ] { workingCopy } ; } protected CompilationUnit getWorkingCopy ( ) { } public boolean isReadOnly ( ) { } }

Fix:
JavaModelManager . getJavaModelManager ( ) . getPerWorkingCopyInfo ( workingCopy , this . path , true , true , this . problemRequestor ) ;
Buggy code:
public class Key { public Key ( String scope , String type , String keyname ) throws IllegalArgumentException { } public String get_scope ( ) { } public String get_type ( ) { } public String get_keyname ( ) { } public String toString ( ) { } public static Key buildkey ( List < String > key ) throws IllegalArgumentException { if ( ( key . size ( ) ) < 3 ) { throw new IllegalArgumentException ( ( ( "Tried<seq2seq4repair_space>to<seq2seq4repair_space>build<seq2seq4repair_space>a<seq2seq4repair_space>key<seq2seq4repair_space>out<seq2seq4repair_space>of<seq2seq4repair_space>" + ( key . size ( ) ) ) + "<seq2seq4repair_space>arguments.<seq2seq4repair_space>At<seq2seq4repair_space>leest<seq2seq4repair_space>three<seq2seq4repair_space>(scope,<seq2seq4repair_space>type,<seq2seq4repair_space>keyname)<seq2seq4repair_space>of<seq2seq4repair_space>them<seq2seq4repair_space>are<seq2seq4repair_space>necessary." ) ) ; } <START_BUG> return new Key ( key . get ( 0 ) , key . get ( 2 ) , key . get ( 1 ) ) ; <END_BUG> } public List < String > _buildkey ( ) { } public boolean equals ( Object obj ) { } public int hashCode ( ) { } private final String scope ; private final String keyname ; private final String type ; }

Fix:
return new Key ( key . get ( 0 ) , key . get ( 1 ) , key . get ( 2 ) ) ;
Buggy code:
public class SimulationManager implements InstanceAcquisitionListener , UpdateListener { private static final String TAG = "SimulationManager" ; private final Map < String , Instance > simulations ; private final Multimap < UpdateListener , String > updateListenerRegistrations ; private final Collection < InstanceAcquisitionListener > instanceListeners ; private Collection < String > existingInstanceIDs ; private InstanceProvider instanceProvider ; private Context context ; private ProfileManager profileManager ; private SimulationStorage storage ; private ViewMemory viewMemory ; public SimulationManager ( Context context , ProfileManager profileManager ) throws IOException { } public ViewMemory getViewMemory ( ) { } public Collection < String > getInstanceList ( ) { } public Collection < Instance > getInstances ( ) { } public void readAllInstances ( ) { } private void writeToFile ( Instance sim ) { } public void deleteInstance ( String instanceID ) { } @ Override public void onInstanceListAcquired ( Collection < String > instanceIDs ) { } @ Override public void onInstanceListAcquisitionFailed ( ) { } private void removeOldInstances ( Collection < String > instancesToKeep ) { } @ Override public void onInstanceAcquired ( Instance sim ) { } @ Override public void onInstanceDeleted ( String id ) { } public Instance getInstance ( String id ) { } public boolean hasInstance ( String id ) { } private void addInstance ( Instance sim ) { } private boolean removeInstance ( String id ) { } private Collection < String > accumulateProfiles ( ) { } public void updateAllInstances ( ) { instanceProvider . getAvailableInstances ( ) ; profileManager . haveProfiles ( accumulateProfiles ( ) ) ; Collection < Instance > sims ; synchronized ( simulations ) { <START_BUG> sims = simulations . values ( ) ; <END_BUG> } new de . tu_bs . wire . simwatch . net . HTTPUpdateProvider ( this , context ) . update ( sims ) ; } public boolean autoUpdate ( ) { } public void addInstanceAcquisitionListener ( InstanceAcquisitionListener listener ) { } public boolean removeInstanceAcquisitionListener ( InstanceAcquisitionListener listener ) { } public void addUpdateListener ( String instanceID , UpdateListener listener ) { } public boolean removeUpdateListener ( String instanceID , UpdateListener listener ) { } public int removeUpdateListener ( UpdateListener listener ) { } public void updateInstance ( Instance instance ) { } @ Override public void onUpdate ( Collection < String > instanceIDs ) { } @ Override public void onNoUpdates ( ) { } @ Override public void onUpdateFailed ( Collection < String > instanceIDs ) { } }

Fix:
sims = new java . util . ArrayList ( simulations . values ( ) ) ;
Buggy code:
public class SimpleUtils { private static final int BUFFER = 8192 ; private static final long ONE_KB = 1024 ; private static final BigInteger KB_BI = BigInteger . valueOf ( SimpleUtils . ONE_KB ) ; private static final BigInteger MB_BI = SimpleUtils . KB_BI . multiply ( SimpleUtils . KB_BI ) ; private static final BigInteger GB_BI = SimpleUtils . KB_BI . multiply ( SimpleUtils . MB_BI ) ; private static final BigInteger TB_BI = SimpleUtils . KB_BI . multiply ( SimpleUtils . GB_BI ) ; public static void requestMediaScanner ( final Context context , final File ... files ) { } private static void search_file ( String dir , String fileName , ArrayList < String > n ) { } public static ArrayList < String > listFiles ( String path , Context c ) { } public static void moveToDirectory ( String old , String newDir ) { } public static void copyToDirectory ( String old , String newDir ) { } public static boolean renameTarget ( String filePath , String newName ) { } public static boolean createDir ( String path , String name ) { } public static void deleteTarget ( String path ) { File target = new File ( path ) ; if ( ( target . isFile ( ) ) && ( target . canWrite ( ) ) ) { target . delete ( ) ; } else { if ( ( target . isDirectory ( ) ) && ( target . canRead ( ) ) ) { String [ ] file_list = target . list ( ) ; if ( ( file_list != null ) && ( ( file_list . length ) == 0 ) ) { target . delete ( ) ; return ; } else if ( ( file_list != null ) && ( ( file_list . length ) > 0 ) ) { for ( String aFile_list : file_list ) { File temp_f = new File ( ( ( ( target . getAbsolutePath ( ) ) + "//" ) + aFile_list ) ) ; if ( temp_f . isDirectory ( ) ) SimpleUtils . deleteTarget ( temp_f . getAbsolutePath ( ) ) ; else if ( temp_f . isFile ( ) ) { temp_f . delete ( ) ; } } } if ( target . exists ( ) ) target . delete ( ) ; } else if ( ( target . exists ( ) ) && ( ! ( target . delete ( ) ) ) ) { if ( Settings . rootAccess ( ) ) <START_BUG> RootCommands . DeleteFileRoot ( path ) ; <END_BUG> } } } public static ArrayList < String > searchInDirectory ( String dir , String fileName ) { } public static void openFile ( final Context context , final File target ) { } public static String getChecksum ( File file , String algorithm ) { } public static void savetoClipBoard ( final Context co , String dir1 ) { } public static void createShortcut ( Activity main , String path ) { } public static String formatCalculatedSize ( long ls ) { } public static long getDirectorySize ( File directory ) { } private static boolean isSymlink ( File file ) throws IOException { } private static long sizeOf ( File file ) { } public static String getExtension ( String name ) { } public static boolean isSupportedArchive ( File file ) { } No newline ; at end ; of file ; }

Fix:
com . dnielfe . manager . utils . RootCommands . DeleteFileRoot ( path ) ;
Buggy code:
public class MainMenuTablet extends BaseActivity { @ Override public void onCreate ( final Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setRequestedOrientation ( SCREEN_ORIENTATION_LANDSCAPE ) ; setContentView ( activity_tablet ) ; final Bundle bundle = getIntent ( ) . getExtras ( ) ; <START_BUG> final MenuBarFrag menubar = new MenuBarFrag ( this ) ; <END_BUG> final BaseContentFrag frag = ( ( bundle != null ) && ( ( bundle . getInt ( "loadFrag" ) ) == ( Enums . ONLINE_LIST ) ) ) ? new GameListOnlineFrag ( ) : new MainMenuFrag ( ) ; frag . setMenuBarFrag ( menubar ) ; getSupportFragmentManager ( ) . beginTransaction ( ) . replace ( topbar01 , menubar ) . replace ( botbar01 , new BotBarFrag ( ) ) . replace ( topbar02 , new TopBarFrag ( ) ) . replace ( botbar02 , new BotBarFrag ( ) ) . replace ( topbar03 , new TopBarFrag ( ) ) . replace ( botbar03 , new BotBarFrag ( ) ) . replace ( panel01 , frag , frag . getBTag ( ) ) . commit ( ) ; } @ Override protected void onActivityResult ( final int requestCode , final int resultCode , final Intent data ) { } }

Fix:
final MenuBarFrag menubar = MenuBarFrag . newInstance ( true ) ;
Buggy code:
public class SingletonComponent extends SessionBeanComponent implements LockableComponent { private static final Logger logger = Logger . getLogger ( SingletonComponent . class ) ; private SingletonComponentInstance singletonComponentInstance ; private boolean initOnStartup ; private LockType beanLevelLockType ; private Map < EJBBusinessMethod , LockType > methodLockTypes ; private Map < EJBBusinessMethod , AccessTimeout > methodAccessTimeouts ; public SingletonComponent ( final EJBComponentCreateService ejbComponentCreateService ) { } @ Override public synchronized ComponentInstance createInstance ( ) { if ( ( this . singletonComponentInstance ) != null ) { throw new IllegalStateException ( ( "A<seq2seq4repair_space>singleton<seq2seq4repair_space>component<seq2seq4repair_space>instance<seq2seq4repair_space>has<seq2seq4repair_space>already<seq2seq4repair_space>been<seq2seq4repair_space>created<seq2seq4repair_space>for<seq2seq4repair_space>bean:<seq2seq4repair_space>" + ( this . getComponentName ( ) ) ) ) ; } <START_BUG> return super . createInstance ( ) ; <END_BUG> } @ Override protected BasicComponentInstance constructComponentInstance ( ) { } synchronized ComponentInstance getComponentInstance ( ) { } @ Override public void start ( ) { } @ Override public void stop ( final StopContext stopContext ) { } @ Override public LockType getLockType ( Method method ) { } @ Override public AccessTimeout getAccessTimeout ( Method method ) { } @ Override public AccessTimeout getDefaultAccessTimeout ( ) { } private synchronized void destroySingletonInstance ( ) { } @ Override public Object invoke ( Serializable sessionId , Map < String , Object > contextData , Class < ? > invokedBusinessInterface , Method beanMethod , Object [ ] args ) throws Exception { } }

Fix:
return new SingletonComponentInstance ( this ) ;
Buggy code:
public class utilMain implements PrivilegedAction { private static Class [ ] CONN_PARAM = new Class [ ] { Integer . TYPE } ; private static Object [ ] CONN_ARG = new Object [ ] { new Integer ( JDBC30Translation . CLOSE_CURSORS_AT_COMMIT ) } ; StatementFinder [ ] commandGrabber ; UCode_CharStream charStream ; ijTokenManager ijTokMgr ; ij ijParser ; ConnectionEnv [ ] connEnv ; int currCE ; private int numConnections ; private boolean fileInput ; private boolean initialFileInput ; private boolean mtUse ; private boolean firstRun = true ; private LocalizedOutput out = null ; private Properties connAttributeDefaults ; private Hashtable ignoreErrors ; protected boolean isJCC ; public static final int BUFFEREDFILESIZE = 2048 ; Stack oldGrabbers = new Stack ( ) ; LocalizedResource langUtil = LocalizedResource . getInstance ( ) ; public utilMain ( int numConnections , LocalizedOutput out ) throws ijFatalException { } public utilMain ( int numConnections , LocalizedOutput out , Hashtable ignoreErrors ) throws ijFatalException { } public void go ( LocalizedInput [ ] in , LocalizedOutput out , Properties connAttributeDefaults ) throws ijFatalException { } private void displayResult ( LocalizedOutput out , ijResult result , Connection conn ) throws SQLException { } private void doCatch ( String command ) { } public void handleSQLException ( LocalizedOutput out , SQLException e ) throws ijFatalException { } private void doTrace ( Throwable t ) { } void newInput ( String fileName ) { } void newResourceInput ( String resourceName ) { InputStream is = util . getResourceAsStream ( resourceName ) ; if ( is == null ) throw ijException . resourceNotFound ( ) ; oldGrabbers . push ( commandGrabber [ currCE ] ) ; <START_BUG> commandGrabber [ currCE ] = new StatementFinder ( langUtil . getNewInput ( new BufferedInputStream ( is , utilMain . BUFFEREDFILESIZE ) ) ) ; <END_BUG> fileInput = true ; } static void doPrompt ( boolean newStatement , LocalizedOutput out , String tag ) { } void setMtUse ( boolean b ) { } public utilMain getUtilMain ( ) { } public Connection setHoldability ( Connection conn , int holdType ) throws SQLException { } public int getHoldability ( Connection conn ) throws SQLException { } public Statement createStatement ( Connection conn , int scrollType , int holdType ) throws SQLException { } public ijResult absolute ( ResultSet rs , int row ) throws SQLException { } public ijResult relative ( ResultSet rs , int row ) throws SQLException { } public ijResult beforeFirst ( ResultSet rs ) throws SQLException { } public ijResult first ( ResultSet rs ) throws SQLException { } public ijResult afterLast ( ResultSet rs ) throws SQLException { } public ijResult last ( ResultSet rs ) throws SQLException { } public ijResult previous ( ResultSet rs ) throws SQLException { } public int getCurrentRowNumber ( ResultSet rs ) throws SQLException { } public Properties getConnAttributeDefaults ( ) { } public final Object run ( ) { } }

Fix:
commandGrabber [ currCE ] = new StatementFinder ( langUtil . getNewEncodedInput ( new BufferedInputStream ( is , utilMain . BUFFEREDFILESIZE ) , "UTF8" ) ) ;
Buggy code:
final class MergeDocIDRemapper { int [ ] starts ; int [ ] newStarts ; int [ ] [ ] docMaps ; int minDocID ; int maxDocID ; int docShift ; public MergeDocIDRemapper ( SegmentInfos infos , int [ ] [ ] docMaps , int [ ] delCounts , MergePolicy . OneMerge merge , int mergedDocCount ) { } public int remap ( int oldDocID ) { if ( oldDocID < ( minDocID ) ) return oldDocID ; else if ( oldDocID >= ( maxDocID ) ) return oldDocID - ( docShift ) ; else { int lo = 0 ; int hi = ( docMaps . length ) - 1 ; while ( hi >= lo ) { <START_BUG> int mid = ( lo + hi ) > > 1 ; <END_BUG> int midValue = starts [ mid ] ; if ( oldDocID < midValue ) hi = mid - 1 ; else if ( oldDocID > midValue ) lo = mid + 1 ; else { while ( ( ( mid + 1 ) < ( docMaps . length ) ) && ( ( starts [ ( mid + 1 ) ] ) == midValue ) ) { mid ++ ; } if ( ( docMaps [ mid ] ) != null ) return ( newStarts [ mid ] ) + ( docMaps [ mid ] [ ( oldDocID - ( starts [ mid ] ) ) ] ) ; else return ( ( newStarts [ mid ] ) + oldDocID ) - ( starts [ mid ] ) ; } } if ( ( docMaps [ hi ] ) != null ) return ( newStarts [ hi ] ) + ( docMaps [ hi ] [ ( oldDocID - ( starts [ hi ] ) ) ] ) ; else return ( ( newStarts [ hi ] ) + oldDocID ) - ( starts [ hi ] ) ; } } }

Fix:
int mid = ( lo + hi ) > > > 1 ;
Buggy code:
public class BodyFilter extends AbstractFilter { public BodyFilter ( ) { } public Object [ ] getAttributes ( ) { } public boolean process ( Object [ ] args , Folder folder , Object uid , WorkerStatusController worker ) throws Exception { String body = folder . getMessageSource ( uid , worker ) ; int condition = FilterCriteria . getCriteria ( ( ( String ) ( args [ 0 ] ) ) ) ; <START_BUG> String bodyText = ( ( String ) ( args [ 0 ] ) ) ; <END_BUG> boolean result = false ; switch ( condition ) { case FilterCriteria . CONTAINS : { if ( ( body . indexOf ( bodyText ) ) != ( - 1 ) ) result = true ; break ; } case FilterCriteria . CONTAINS_NOT : { if ( ( body . indexOf ( bodyText ) ) == ( - 1 ) ) result = true ; break ; } } return result ; } }

Fix:
String bodyText = ( ( String ) ( args [ 1 ] ) ) ;
Buggy code:
abstract class StringFunction extends AbstractVal { private final Val _val ; private ClassMetaData _meta = null ; public StringFunction ( Val val ) { } public Val getValue ( ) { } public ClassMetaData getMetaData ( ) { } public void setMetaData ( ClassMetaData meta ) { } public Class getType ( ) { } public void setImplicitType ( Class type ) { } public ExpState initialize ( Select sel , ExpContext ctx , int flags ) { } public void select ( Select sel , ExpContext ctx , ExpState state , boolean pks ) { } public void selectColumns ( Select sel , ExpContext ctx , ExpState state , boolean pks ) { } public void groupBy ( Select sel , ExpContext ctx , ExpState state ) { } public void orderBy ( Select sel , ExpContext ctx , ExpState state , boolean asc ) { <START_BUG> sel . orderBy ( newSQLBuffer ( sel , ctx , state ) , asc , false ) ; <END_BUG> } private SQLBuffer newSQLBuffer ( Select sel , ExpContext ctx , ExpState state ) { } public Object load ( ExpContext ctx , ExpState state , Result res ) throws SQLException { } public void calculateValue ( Select sel , ExpContext ctx , ExpState state , Val other , ExpState otherState ) { } public int length ( Select sel , ExpContext ctx , ExpState state ) { } public void acceptVisit ( ExpressionVisitor visitor ) { } }

Fix:
sel . orderBy ( newSQLBuffer ( sel , ctx , state ) , asc , false , getSelectAs ( ) ) ;
Buggy code:
public class Echo extends WicketExamplePage { private String message = "[type<seq2seq4repair_space>your<seq2seq4repair_space>message<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>world<seq2seq4repair_space>here]" ; public Echo ( ) { } public String getMessage ( ) { } <START_BUG> public void setMessage ( String message ) { <END_BUG> this . message = message ; } }

Fix:
public void setMessage ( final String message ) {
Buggy code:
@ ThreadSafe public class ConcurrentTaskExecutor extends AbstractExecutorService implements ExecutorFactory { private static final Set < ConcurrentTaskExecutor > EXECUTORS = Factories . collect ( ) . createSet ( ) ; private static final int INITIALIZING = 0 ; private static final int STARTING = 1 ; private static final int RUNNING = 2 ; private static final int STOPPING = 3 ; private static final int TERMINATED = 4 ; private final String name ; private final List < TaskExecutor > workerSet = Lists . newCopyOnWriteArrayList ( ) ; private final AtomicInteger count = new AtomicInteger ( ) ; private final StampedLock lock = new StampedLock ( ) ; private int scaleIdx = 0 ; private volatile int state = ConcurrentTaskExecutor . INITIALIZING ; private ConcurrentTaskExecutor ( int startingThreadCount , String name ) { } public static ConcurrentTaskExecutor create ( int startingThreadCount , String name ) { } @ InternalUseOnly public static Collection < ConcurrentTaskExecutor > executors ( ) { } private ConcurrentTaskExecutor . Worker addWorker ( boolean expire ) { } public TaskExecutor nextWorker ( ) { } @ Override public TaskExecutor scaledThread ( ) { <START_BUG> for ( TaskExecutor ex : workers ) { <END_BUG> ConcurrentTaskExecutor . Worker w = ( ( ConcurrentTaskExecutor . Worker ) ( ex ) ) ; if ( ! ( w . isHeld ( ) ) ) { return w ; } } return addWorker ( true ) ; } @ Override public List < TaskExecutor > threadList ( ) { } @ Override public void shutdown ( ) { } @ Override public List < Runnable > shutdownNow ( ) { } @ Override public boolean isShutdown ( ) { } @ Override public boolean isTerminated ( ) { } @ Override public boolean awaitTermination ( long l , TimeUnit timeUnit ) throws InterruptedException { } @ Override public < T > Future < T > submit ( Callable < T > task ) { } @ Override public void execute ( @ Nonnull Runnable runnable ) { } private class Worker extends Thread implements TaskExecutor { final ArrayDeque < Runnable > tasks = new ArrayDeque < > ( ) ; final StampedLock lock = new StampedLock ( ) ; public Worker ( int index ) { } @ Override public void run ( ) { } private Runnable nextTask ( ) throws InterruptedException { } boolean isHeld ( ) { } boolean tryAdd ( Runnable task ) { } @ Override public void addTask ( Runnable task ) { } @ Override public < V > Future < V > submitTask ( Callable < V > task ) { } @ Override public void interrupt ( ) { } @ Override public Thread asThread ( ) { } } private class ExpiringWorker extends ConcurrentTaskExecutor . Worker { public ExpiringWorker ( int index ) { } @ Override public void addTask ( Runnable task ) { } @ Override boolean tryAdd ( Runnable task ) { } private boolean isEmpty ( ) { } private Runnable hintExit ( ) { } } }

Fix:
for ( TaskExecutor ex : workerSet ) {
Buggy code:
class BoardStorageModel implements Serializable { private static final long serialVersionUID = 1L ; private UUID worldId ; private int blockX ; private int blockY ; private int blockZ ; int stepX ; int stepZ ; ArrayList < DonationStorageModel > donations ; public BoardStorageModel ( Block block , int stepX , int stepZ , BoardModel model ) { } private void initialize ( Block block , int stepX , int stepZ , BoardModel model ) { } public BoardStorageModel ( BoardView view , BoardModel model ) { } public Block getBlock ( ) { } public int getStepX ( ) { } public int getStepZ ( ) { } public ArrayList < DonationStorageModel > getDonations ( ) { } public BoardView getView ( ) { } public BoardModel getModel ( int numberOfDays , int numberOfLevels ) { BoardModel model = new BoardModel ( numberOfDays , numberOfLevels ) ; for ( DonationStorageModel storageDonation : getDonations ( ) ) { int day = storageDonation . getDay ( ) ; int level = storageDonation . getLevel ( ) ; if ( ( storageDonation . getPlayer ( ) ) != null ) { <START_BUG> model . markOnlyThis ( day , level , storageDonation . getIsEmpty ( ) , storageDonation . getPlayer ( ) ) ; <END_BUG> } } return model ; } }

Fix:
model . markOnlyThis ( day , level , storageDonation . getPlayer ( ) ) ;
Buggy code:
final class IRCConnectWizardPage extends WizardPage { private Text connectText ; private Text passwordText ; private String uriString ; IRCConnectWizardPage ( ) { } IRCConnectWizardPage ( String uri ) { } public void createControl ( Composite parent ) { parent . setLayout ( new GridLayout ( ) ) ; GridData fillData = new GridData ( SWT . FILL , SWT . CENTER , true , false ) ; GridData endData = new GridData ( SWT . FILL , SWT . CENTER , true , false , 2 , 1 ) ; Label label = new Label ( parent , SWT . LEFT ) ; label . setText ( "Connect<seq2seq4repair_space>ID:" ) ; connectText = new Text ( parent , ( ( SWT . SINGLE ) | ( SWT . BORDER ) ) ) ; connectText . setLayoutData ( fillData ) ; connectText . addModifyListener ( new ModifyListener ( ) { public void modifyText ( ModifyEvent e ) { if ( ! ( connectText . getText ( ) . equals ( "" ) ) ) { updateStatus ( null ) ; } else { updateStatus ( "A<seq2seq4repair_space>connect<seq2seq4repair_space>ID<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>specified." ) ; } } } ) ; label = new Label ( parent , SWT . RIGHT ) ; <START_BUG> label . setText ( "irc:////<user>@<ircserver>[//<#channel>]" ) ; <END_BUG> label . setLayoutData ( endData ) ; label = new Label ( parent , SWT . LEFT ) ; label . setText ( "Password:" ) ; passwordText = new Text ( parent , ( ( ( SWT . SINGLE ) | ( SWT . PASSWORD ) ) | ( SWT . BORDER ) ) ) ; passwordText . setLayoutData ( fillData ) ; label = new Label ( parent , ( ( SWT . RIGHT ) | ( SWT . WRAP ) ) ) ; label . setText ( "This<seq2seq4repair_space>password<seq2seq4repair_space>is<seq2seq4repair_space>for<seq2seq4repair_space>password-protected<seq2seq4repair_space>IRC<seq2seq4repair_space>servers." ) ; label . setLayoutData ( endData ) ; if ( ( uriString ) != null ) { connectText . setText ( uriString ) ; passwordText . setFocus ( ) ; } else { connectText . setText ( "irc:////" ) ; connectText . setSelection ( 6 ) ; } setControl ( parent ) ; } String getConnectID ( ) { } String getPassword ( ) { } private void updateStatus ( String message ) { } }

Fix:
label . setText ( "irc:////[<user>@]<ircserver[:port]>[//<channel>,<channel2>,...]" ) ;
Buggy code:
public class DiscoveryStartup { protected static final String DISCOVERYVIEW_ID = "org.eclipse.ecf.example.collab.discoveryview" ; public static final String DISCOVERY_CONTAINER = "ecf.discovery.jmdns" ; public static final String PROP_PROTOCOL_NAME = "protocol" ; public static final String PROP_CONTAINER_TYPE_NAME = "containertype" ; public static final String PROP_CONTAINER_TYPE_VALUE = CollabClient . GENERIC_CONTAINER_CLIENT_NAME ; public static final String PROP_PW_REQ_NAME = "pwrequired" ; public static final String PROP_PW_REQ_VALUE = "false" ; public static final String PROP_DEF_USER_NAME = "defaultuser" ; public static final String PROP_DEF_USER_VALUE = "guest" ; public static final String PROP_PATH_NAME = "path" ; public static final int SVC_DEF_WEIGHT = 0 ; public static final int SVC_DEF_PRIORITY = 0 ; static IDiscoveryContainer discovery = null ; static IContainer socontainer = null ; protected DiscoveryView discoveryView = null ; public DiscoveryStartup ( ) throws Exception { } protected IDiscoveryContainer getDiscoveryContainer ( ) { } protected IContainer getContainer ( ) { } public void dispose ( ) { } protected boolean isActive ( ) { } protected void setupDiscovery ( ) throws Exception { try { <START_BUG> DiscoveryStartup . socontainer = ContainerFactory . getDefault ( ) . makeContainer ( DiscoveryStartup . DISCOVERY_CONTAINER ) ; <END_BUG> DiscoveryStartup . discovery = ( ( IDiscoveryContainer ) ( DiscoveryStartup . socontainer . getAdapter ( IDiscoveryContainer . class ) ) ) ; if ( ( DiscoveryStartup . discovery ) != null ) { DiscoveryStartup . socontainer . connect ( null , null ) ; } else { dispose ( ) ; ClientPlugin . log ( "No<seq2seq4repair_space>discovery<seq2seq4repair_space>container<seq2seq4repair_space>available" ) ; } } catch ( ContainerInstantiationException e1 ) { DiscoveryStartup . socontainer = null ; DiscoveryStartup . discovery = null ; ClientPlugin . log ( "No<seq2seq4repair_space>discovery<seq2seq4repair_space>container<seq2seq4repair_space>available" , e1 ) ; return ; } catch ( Exception e ) { dispose ( ) ; throw e ; } } protected void connectToServiceFromInfo ( IServiceInfo svcInfo ) { } public static void unregisterServerType ( ) { } public static void registerService ( URI uri ) { } public static void unregisterServer ( ISharedObjectContainer container ) { } public static void registerServiceTypes ( ) { } }

Fix:
DiscoveryStartup . socontainer = ContainerFactory . getDefault ( ) . createContainer ( DiscoveryStartup . DISCOVERY_CONTAINER ) ;
Buggy code:
public class Guard extends CitizensNPC { private boolean isAggressive = true ; private boolean isAttacking = false ; private boolean returning = false ; private GuardState guardState = GuardState . NULL ; private final FlagList flags = new FlagList ( ) ; private double radius = 10 ; public boolean isBodyguard ( ) { } public void setBodyguard ( ) { } public boolean isBouncer ( ) { } public void setBouncer ( ) { } public void clear ( ) { } public boolean isAggressive ( ) { } public void setAggressive ( boolean state ) { } public GuardState getGuardState ( ) { } public void setGuardState ( GuardState guardState ) { } public FlagList getFlags ( ) { } public double getProtectionRadius ( ) { } public double getHalvedProtectionRadius ( ) { } public void setProtectionRadius ( double radius ) { } public void setAttacking ( boolean attacking ) { } public boolean isAttacking ( ) { } @ Override public void onDamage ( EntityDamageEvent event ) { if ( event instanceof EntityDamageByEntityEvent ) { EntityDamageByEntityEvent ev = ( ( EntityDamageByEntityEvent ) ( event ) ) ; <START_BUG> HumanNPC npc = ( ( HumanNPC ) ( event . getEntity ( ) ) ) ; <END_BUG> boolean owner = isOwner ( ev . getDamager ( ) , npc ) ; if ( owner ) event . setCancelled ( true ) ; if ( ( ( isAggressive ( ) ) && ( ! owner ) ) && ( ( ev . getDamager ( ) ) instanceof LivingEntity ) ) { target ( ( ( LivingEntity ) ( ev . getDamager ( ) ) ) , npc ) ; } } } private boolean isOwner ( Entity damager , HumanNPC npc ) { } @ Override public void onDeath ( EntityDeathEvent event ) { } public void target ( LivingEntity entity , HumanNPC npc ) { } @ Override public CitizensNPCType getType ( ) { } public void setReturning ( boolean returning ) { } public boolean isReturning ( ) { } No newline ; at end ; of file ; }

Fix:
HumanNPC npc = NPCManager . get ( event . getEntity ( ) ) ;
Buggy code:
@ WebServlet ( "//web//mostrar_comentario.jsp" ) public class MostrarComentario extends HttpServlet { private static final long serialVersionUID = 1L ; private static Facade facade = new Facade ( ) ; public MostrarComentario ( ) { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { Blog b = ( ( Blog ) ( request . getSession ( true ) . getAttribute ( "blogMostrar" ) ) ) ; String pId = request . getParameter ( "postId" ) ; List < Integer > idsComentarios = null ; List < ComentarioNormal > comentarios = null ; int index ; int id ; int postId = Integer . parseInt ( pId ) ; Postagem p = null ; try { index = 0 ; idsComentarios = new ArrayList < Integer > ( ) ; while ( true ) { id = MostrarComentario . facade . getComment ( postId , index ) ; if ( ! ( idsComentarios . contains ( id ) ) ) { idsComentarios . add ( id ) ; index ++ ; } } } catch ( Exception e ) { comentarios = new ArrayList < ComentarioNormal > ( ) ; for ( Integer idComentario : idsComentarios ) { String autor = "" ; String texto = "" ; try { autor = MostrarComentario . facade . getCommentAuthor ( idComentario ) ; texto = MostrarComentario . facade . getCommentText ( idComentario ) ; Usuario u = new Usuario ( ) ; u . setLogin ( autor ) ; u . setNome ( MostrarComentario . facade . getProfileInformation ( u . getLogin ( ) , "nome_exibicao" ) ) ; ComentarioNormal c = new ComentarioNormal ( ) ; c . setCodigo ( idComentario ) ; c . setConteudo ( texto ) ; p = new Postagem ( ) ; p . setCodigo ( postId ) ; p . setTitulo ( MostrarComentario . facade . getPostInformation ( postId , "titulo" ) ) ; p . setConteudo ( MostrarComentario . facade . getPostInformation ( postId , "texto" ) ) ; String data_criacao = MostrarComentario . facade . getPostInformation ( postId , "data_criacao" ) ; String [ ] st = data_criacao . split ( "//" ) ; p . setData ( Date . valueOf ( ( ( ( ( ( st [ 2 ] ) + "-" ) + ( st [ 1 ] ) ) + "-" ) + ( st [ 0 ] ) ) ) ) ; p . setBlog ( b ) ; c . setPostagem ( p ) ; c . setUsuario ( u ) ; comentarios . add ( c ) ; } catch ( Exception e1 ) { } } } request . getSession ( true ) . setAttribute ( "comentariosMostrar" , comentarios ) ; <START_BUG> request . setAttribute ( "p" , p ) ; <END_BUG> response . sendRedirect ( "post_mostrar.jsp" ) ; } }

Fix:
request . getSession ( ) . setAttribute ( "p" , p ) ;
Buggy code:
public class UploadProgressBar extends Panel { private static final Logger log = LoggerFactory . getLogger ( UploadProgressBar . class ) ; public static final String RESOURCE_STARTING = "UploadProgressBar.starting" ; public static final class ComponentInitializer implements IInitializer { public void init ( final Application application ) { } @ Override public String toString ( ) { } public void destroy ( final Application application ) { } } private static final ResourceReference JS = new PackageResourceReference ( UploadProgressBar . class , "progressbar.js" ) ; private static final ResourceReference CSS = new PackageResourceReference ( UploadProgressBar . class , "UploadProgressBar.css" ) ; private static final String RESOURCE_NAME = UploadProgressBar . class . getName ( ) ; private static final long serialVersionUID = 1L ; private final Form < ? > form ; private final WebMarkupContainer statusDiv ; private final WebMarkupContainer barDiv ; private final FileUploadField uploadField ; public UploadProgressBar ( final String id , final Form < ? > form ) { } public UploadProgressBar ( final String id , final Form < ? > form , final FileUploadField uploadField ) { } @ Override protected void onInitialize ( ) { } protected ResourceReference getCss ( ) { } @ Override public void renderHead ( final IHeaderResponse response ) { super . renderHead ( response ) ; response . renderJavaScriptReference ( INSTANCE ) ; response . renderJavaScriptReference ( WicketAjaxReference . INSTANCE ) ; response . renderJavaScriptReference ( UploadProgressBar . JS ) ; ResourceReference css = getCss ( ) ; if ( css != null ) { response . renderCSSReference ( css ) ; } ResourceReference ref = new SharedResourceReference ( UploadProgressBar . RESOURCE_NAME ) ; final String uploadFieldId = ( ( uploadField ) == null ) ? "" : uploadField . getMarkupId ( ) ; final String status = new StringResourceModel ( "UploadProgressBar.starting" , this , ( ( IModel < ? > ) ( null ) ) , "Upload<seq2seq4repair_space>starting..." ) . getString ( ) ; <START_BUG> CharSequence url = urlFor ( ref , null ) ; <END_BUG> StringBuilder builder = new StringBuilder ( 128 ) ; Formatter formatter = new Formatter ( builder ) ; formatter . format ( "new<seq2seq4repair_space>Wicket.WUPB('%s',<seq2seq4repair_space>'%s',<seq2seq4repair_space>'%s',<seq2seq4repair_space>'%s',<seq2seq4repair_space>'%s',<seq2seq4repair_space>'%s').bind('%s')" , getMarkupId ( ) , statusDiv . getMarkupId ( ) , barDiv . getMarkupId ( ) , url , uploadFieldId , status , getCallbackForm ( ) . getMarkupId ( ) ) ; response . renderOnDomReadyJavaScript ( builder . toString ( ) ) ; } private Form < ? > getCallbackForm ( ) { } }

Fix:
CharSequence url = urlFor ( ref , UploadStatusResource . newParameter ( getPage ( ) . getId ( ) ) ) ;
Buggy code:
public abstract class TileMachine extends TileBase implements ISynchronizedContainer , IRedstoneModeConfig { protected boolean connected = false ; protected RedstoneMode redstoneMode = RedstoneMode . IGNORE ; protected TileController controller ; private Block block ; private Set < String > visited = new HashSet < String > ( ) ; public TileController getController ( ) { } public void searchController ( World world ) { visited . clear ( ) ; TileController newController = ControllerSearcher . search ( worldObj , pos , visited ) ; if ( ( controller ) == null ) { <START_BUG> if ( ( newController != null ) && ( redstoneMode . isEnabled ( worldObj , pos ) ) ) { <END_BUG> onConnected ( world , newController ) ; } } else { if ( newController == null ) { onDisconnected ( world ) ; } } } @ Override public void update ( ) { } public void onConnected ( World world , TileController controller ) { } public void onDisconnected ( World world ) { } public boolean isConnected ( ) { } public void setConnected ( boolean connected ) { } @ Override public RedstoneMode getRedstoneMode ( ) { } @ Override public void setRedstoneMode ( RedstoneMode mode ) { } @ Override public BlockPos getMachinePos ( ) { } @ Override public void receiveContainerData ( ByteBuf buf ) { } @ Override public void sendContainerData ( ByteBuf buf ) { } @ Override public void readFromNBT ( NBTTagCompound nbt ) { } @ Override public void writeToNBT ( NBTTagCompound nbt ) { } public abstract int getEnergyUsage ( ) { } public abstract void updateMachine ( ) { } }

Fix:
if ( ( ( newController != null ) && ( newController . canRun ( ) ) ) && ( redstoneMode . isEnabled ( worldObj , pos ) ) ) {
Buggy code:
public class DatesPage extends WicketExamplePage { private final class LocaleChoiceRenderer extends ChoiceRenderer < Locale > { public LocaleChoiceRenderer ( ) { } @ Override public Object getDisplayValue ( Locale locale ) { } } private final class LocaleDropDownChoice extends DropDownChoice < Locale > { public LocaleDropDownChoice ( String id ) { } @ Override <START_BUG> public void onSelectionChanged ( Object newSelection ) { <END_BUG> } @ Override protected boolean wantOnSelectionChangedNotifications ( ) { } } private static final Locale LOCALE_EN = new Locale ( "en" ) ; private static final List < Locale > LOCALES ; private final Date date = new Date ( ) ; private Locale selectedLocale = DatesPage . LOCALE_EN ; public DatesPage ( ) { } public final Locale getSelectedLocale ( ) { } public final void setSelectedLocale ( Locale selectedLocale ) { } }

Fix:
public void onSelectionChanged ( Locale newSelection ) {
Buggy code:
public class SpanStreamUDPPacketHandlerFactory < T extends DatagramPacket > implements PacketHandlerFactory < T > { private final Logger logger = LoggerFactory . getLogger ( this . getClass ( ) ) ; private final DeserializerFactory < HeaderTBaseDeserializer > deserializerFactory = new ThreadLocalHeaderTBaseDeserializerFactory < HeaderTBaseDeserializer > ( new HeaderTBaseDeserializerFactory ( ) ) ; private final DispatchHandler dispatchHandler ; @ SuppressWarnings ( "unused" ) private final TBaseFilter < SocketAddress > filter ; private final PacketHandler < T > dispatchPacket = new DispatchPacket ( ) ; public SpanStreamUDPPacketHandlerFactory ( DispatchHandler dispatchHandler , TBaseFilter < SocketAddress > filter ) { } @ Override public PacketHandler < T > createPacketHandler ( ) { } private class DispatchPacket implements PacketHandler < T > { private DispatchPacket ( ) { } @ Override public void receive ( DatagramPacket packet ) { } } private byte [ ] getComponentData ( ByteBuffer buffer , HeaderTBaseDeserializer deserializer ) { } private List < TSpanEvent > getSpanEventList ( List < TBase < ? , ? > > tbaseList ) { if ( ( tbaseList == null ) || ( ( tbaseList . size ( ) ) == 0 ) ) { return new ArrayList < TSpanEvent > ( 0 ) ; } int spanEventListSize = ( tbaseList . size ( ) ) - 1 ; List < TSpanEvent > spanEventList = new ArrayList < TSpanEvent > ( spanEventListSize ) ; for ( int i = 0 ; i < spanEventListSize ; i ++ ) { <START_BUG> TBase < ? , ? > tBase = spanEventList . get ( i ) ; <END_BUG> if ( tBase instanceof TSpanEvent ) { spanEventList . add ( ( ( TSpanEvent ) ( tBase ) ) ) ; } } return spanEventList ; } }

Fix:
TBase < ? , ? > tBase = tbaseList . get ( i ) ;
Buggy code:
public class JobProgressManager extends JobChangeAdapter implements IProgressProvider { private ArrayList providers = new ArrayList ( ) ; private static JobProgressManager singleton ; private Map jobs = Collections . synchronizedMap ( new HashMap ( ) ) ; boolean debug = false ; public static JobProgressManager getInstance ( ) { } private class JobMonitor implements IProgressMonitor { Job job ; boolean cancelled = false ; JobMonitor ( Job newJob ) { } public void beginTask ( String taskName , int totalWork ) { } public void done ( ) { } public void internalWorked ( double work ) { } public boolean isCanceled ( ) { } public void setCanceled ( boolean value ) { } public void setTaskName ( String taskName ) { } public void subTask ( String name ) { } public void worked ( int work ) { } } JobProgressManager ( ) { } public IProgressMonitor createMonitor ( Job job ) { } void addProvider ( ProgressContentProvider provider ) { } void removeProvider ( ProgressContentProvider provider ) { } public void scheduled ( IJobChangeEvent event ) { } public void aboutToRun ( IJobChangeEvent event ) { } public void done ( IJobChangeEvent event ) { JobInfo info = getJobInfo ( event . getJob ( ) ) ; <START_BUG> if ( ( event . getResult ( ) . getCode ( ) ) == ( IStatus . ERROR ) ) { <END_BUG> info . setError ( event . getResult ( ) ) ; } else jobs . remove ( event . getJob ( ) ) ; if ( ! ( isNonDisplayableJob ( event . getJob ( ) ) ) ) remove ( info ) ; } JobInfo getJobInfo ( Job job ) { } public void refresh ( JobInfo info ) { } public void refreshAll ( ) { } public void remove ( JobInfo info ) { } public void add ( JobInfo info ) { } boolean isNonDisplayableJob ( Job job ) { } private boolean isNeverDisplayedJob ( Job job ) { } public Object [ ] getJobs ( ) { } void clearJob ( Job job ) { } }

Fix:
if ( ( event . getResult ( ) . getSeverity ( ) ) == ( IStatus . ERROR ) ) {