nus-yam/ex-repair huggingface dataset:
Buggy code:
@ Deprecated public class SortableDoubleField extends FieldType { @ Override protected void init ( IndexSchema schema , Map < String , String > args ) { } @ Override public SortField getSortField ( SchemaField field , boolean reverse ) { } @ Override public ValueSource getValueSource ( SchemaField field , QParser qparser ) { } @ Override public String toInternal ( String val ) { } @ Override public String toExternal ( IndexableField f ) { } @ Override public Double toObject ( IndexableField f ) { } @ Override public String indexedToReadable ( String indexedForm ) { } @ Override public CharsRef indexedToReadable ( BytesRef input , CharsRef charsRef ) { input . utf8ToChars ( charsRef ) ; final char [ ] indexedToReadable = indexedToReadable ( charsRef . toString ( ) ) . toCharArray ( ) ; <START_BUG> charsRef . copy ( indexedToReadable , 0 , indexedToReadable . length ) ; <END_BUG> return charsRef ; } @ Override public void write ( TextResponseWriter writer , String name , IndexableField f ) throws IOException { } }

Fix:
charsRef . copyChars ( indexedToReadable , 0 , indexedToReadable . length ) ;
Buggy code:
public class QosSetupManager implements VertexAssignmentListener { private static final Log LOG = LogFactory . getLog ( QosSetupManager . class ) ; private ExecutionGraph executionGraph ; private ConcurrentHashMap < InstanceConnectionInfo , AbstractInstance > taskManagers ; private JobID jobID ; private List < JobGraphLatencyConstraint > constraints ; private HashMap < LatencyConstraintID , QosGraph > qosGraphs ; private HashSet < JobVertexID > constrainedJobVertices ; private HashSet < ExecutionVertexID > verticesWithPendingAllocation ; private volatile ElasticTaskQosAutoScalingThread autoscalingThread ; private QosSetup qosSetup ; public QosSetupManager ( JobID jobID , List < JobGraphLatencyConstraint > constraints ) { } private HashMap < LatencyConstraintID , QosGraph > createQosGraphs ( ) { } public void registerOnExecutionGraph ( ExecutionGraph executionGraph ) { } private void attachAssignmentListenersToExecutionGraph ( ) { } private void attachAssignmentListenersToReachableVertices ( ExecutionVertex vertex , Set < ExecutionVertexID > visited ) { } public void shutdown ( ) { } public JobID getJobID ( ) { } public List < JobGraphLatencyConstraint > getConstraints ( ) { } public void rewriteJobGraph ( JobGraph jobGraph ) { } private HashSet < JobVertexID > computeJobVerticesToRewrite ( ) { } private void rewriteOutputVerticesWhereNecessary ( JobGraph jobGraph ) { } private void rewriteInputVerticesWhereNecessary ( JobGraph jobGraph ) { } private void rewriteTaskVerticesWhereNecessary ( JobGraph jobGraph ) { } @ Override public synchronized void vertexAssignmentChanged ( ExecutionVertexID id , AllocatedResource newAllocatedResource ) { } private void computeAndDistributeQosSetup ( ) throws IOException , InterruptedException { } private void distributeQosSetup ( ) throws IOException , InterruptedException { } private void ensureElasticTaskAutoScalerIsRunning ( ) { } private synchronized void ensureElasticTaskAutoScalerIsRunningSynchronized ( ) { if ( ( this . autoscalingThread ) == null ) { <START_BUG> this . autoscalingThread = new ElasticTaskQosAutoScalingThread ( executionGraph , qosGraphs , qosSetup . getQosManagerIDs ( ) ) ; <END_BUG> } } public void handleMessage ( AbstractSerializableQosMessage qosMessage ) { } }

Fix:
this . autoscalingThread = new ElasticTaskQosAutoScalingThread ( executionGraph , qosGraphs , qosSetup . getQosManagerIDsByConstraint ( ) ) ;
Buggy code:
public class FilterToolbar extends JPanel implements ActionListener , ItemListener , ISelectionListener { public JButton clearButton ; private JButton searchButton ; private ComboMenu criteriaComboMenu ; private JLabel label ; private JTextField textField ; private TableController tableController ; private IFolder sourceFolder ; private String selectedItem ; private boolean active ; String [ ] strs = new String [ ] { "subject_contains" , "from_contains" , "to_contains" , "cc_contains" , "bcc_contains" , "body_contains" , "separator" , "unread_messages" , "flagged_messages" , "high_priority" , "spam_message" , "separator" , "custom_search" } ; private IFolder selectedFolder ; public FilterToolbar ( TableController headerTableViewer ) { } private ComboMenu createComboMenu ( ) { } public void initComponents ( ) { } public void layoutComponents ( ) { <START_BUG> setBorder ( BorderFactory . createEmptyBorder ( 1 , 0 , 1 , 0 ) ) ; <END_BUG> FormLayout l = new FormLayout ( "default,<seq2seq4repair_space>3dlu,<seq2seq4repair_space>fill:default:grow,<seq2seq4repair_space>3dlu,<seq2seq4repair_space>default,<seq2seq4repair_space>3dlu,<seq2seq4repair_space>default" , "fill:default:grow" ) ; PanelBuilder b = new PanelBuilder ( this , l ) ; CellConstraints c = new CellConstraints ( ) ; b . add ( criteriaComboMenu , c . xy ( 1 , 1 ) ) ; b . add ( textField , c . xy ( 3 , 1 ) ) ; b . add ( searchButton , c . xy ( 5 , 1 ) ) ; b . add ( clearButton , c . xy ( 7 , 1 ) ) ; } private void update ( ) throws Exception { } private int getIndex ( String name ) { } public void actionPerformed ( ActionEvent e ) { } private void resetToolbar ( ) { } private void executeSearch ( ) { } private VirtualFolder prepareSearchFolder ( FilterCriteria c , IFolder folder ) { } private FilterCriteria createFilterCriteria ( int index ) { } public void setPattern ( String pattern ) { } class MyKeyListener implements KeyListener { public void keyTyped ( KeyEvent e ) { } public void keyPressed ( KeyEvent e ) { } public void keyReleased ( KeyEvent e ) { } } class MyDocumentListener implements DocumentListener { public void insertUpdate ( DocumentEvent e ) { } public void removeUpdate ( DocumentEvent e ) { } public void changedUpdate ( DocumentEvent e ) { } public void update ( ) { } } public void itemStateChanged ( ItemEvent event ) { } private void executeCustomSearch ( ) { } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
setBorder ( BorderFactory . createEmptyBorder ( 1 , 1 , 1 , 1 ) ) ;
Buggy code:
public class DucEncrypt { private String prompt ; private char [ ] abc = "aabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ" . toCharArray ( ) ; private ArrayList < Integer > encrypt = new ArrayList < Integer > ( ) ; private Scanner in = new Scanner ( System . in ) ; public String ePrompt ( ) { } public void encrypt ( String word ) { char [ ] beforeEncrypt = word . toCharArray ( ) ; for ( int i = 0 ; i < ( beforeEncrypt . length ) ; i ++ ) { for ( int j = 1 ; j < ( abc . length ) ; j ++ ) { if ( ( beforeEncrypt [ i ] ) == ( abc [ j ] ) ) { <START_BUG> encrypt . add ( ( j << 4 ) ) ; <END_BUG> } } } } public void eDisplay ( ) { } No newline ; at end ; of file ; }

Fix:
encrypt . add ( j ) ;
Buggy code:
public class GameManager { private Scanner scan ; private final int HEIGHT = 6 ; private final int WIDTH = 7 ; private Board board ; public boolean isWin = false ; public GameManager ( Scanner scan ) { } public void turn ( int player ) { } private void celebrate ( int winner ) { for ( int i = 0 ; i < 10 ; i ++ ) { <START_BUG> System . out . println ( ( ( "—<seq2seq4repair_space>Player<seq2seq4repair_space>" + winner ) + "<seq2seq4repair_space>wins!<seq2seq4repair_space>—" ) ) ; <END_BUG> pause ( 0.15 ) ; System . out . println ( ( ( "\\<seq2seq4repair_space>Player<seq2seq4repair_space>" + winner ) + "<seq2seq4repair_space>wins!<seq2seq4repair_space>//" ) ) ; pause ( 0.15 ) ; System . out . println ( ( ( "|<seq2seq4repair_space>Player<seq2seq4repair_space>" + winner ) + "<seq2seq4repair_space>wins!<seq2seq4repair_space>|" ) ) ; pause ( 0.15 ) ; System . out . println ( ( ( "//<seq2seq4repair_space>Player<seq2seq4repair_space>" + winner ) + "<seq2seq4repair_space>wins!<seq2seq4repair_space>\\" ) ) ; pause ( 0.15 ) ; } } private void pause ( double seconds ) { } }

Fix:
System . out . println ( ( ( "-<seq2seq4repair_space>Player<seq2seq4repair_space>" + winner ) + "<seq2seq4repair_space>wins!<seq2seq4repair_space>-" ) ) ;
Buggy code:
public class TestDetach extends SingleEMFTestCase { private OpenJPAEntityManager em ; private DMCustomer root ; public void setUp ( ) { } public void testDetachCascadeIsSet ( ) { MetaDataRepository repos = emf . getConfiguration ( ) . getMetaDataRepositoryInstance ( ) ; ClassMetaData meta = repos . getCachedMetaData ( DMCustomer . class ) ; <START_BUG> assertEquals ( CASCADE_IMMEDIATE , meta . getField ( "firstName" ) . getCascadeDetach ( ) ) ; <END_BUG> assertEquals ( CASCADE_IMMEDIATE , meta . getField ( "customerInventories" ) . getElement ( ) . getCascadeDetach ( ) ) ; meta = repos . getCachedMetaData ( DMCustomerInventory . class ) ; assertEquals ( CASCADE_NONE , meta . getField ( "customer" ) . getCascadeDetach ( ) ) ; assertEquals ( CASCADE_NONE , meta . getField ( "item" ) . getCascadeDetach ( ) ) ; } public void testDetachRemovesEntityAndCascadedRelationFromContext ( ) { } public void testDetachingDirtyEntityDoesNotImplicitlyFlush ( ) { } public void testDetachingNewEntityIsIgnored ( ) { } public void testDetachingDetachedEntityIsIgnored ( ) { } public void testFlushingBeforeDetachingSavesChange ( ) { } public void testManagedEntityContinuesToReferDetachedEntities ( ) { } DMCustomer createData ( ) { } void assertDetached ( Object pc ) { } void assertNotDetached ( Object pc ) { } }

Fix:
assertEquals ( CASCADE_NONE , meta . getField ( "firstName" ) . getCascadeDetach ( ) ) ;
Buggy code:
public class AnimationManager { private static AnimationManager singleton ; boolean animated = false ; private IJobProgressManagerListener listener ; IAnimationProcessor animationProcessor ; public static AnimationManager getInstance ( ) { } static Color getItemBackgroundColor ( Control control ) { } AnimationManager ( ) { } void addItem ( final AnimationItem item ) { } boolean isAnimated ( ) { } void setAnimated ( final boolean bool ) { } void dispose ( ) { } private IJobProgressManagerListener getProgressListener ( ) { } private void animationStarted ( ) { <START_BUG> UIJob animationStartJob = new WorkbenchJob ( ProgressMessages . getString ( "AnimationManager.AnimationStart" ) ) { <END_BUG> public IStatus runInUIThread ( IProgressMonitor monitor ) { animationProcessor . animationStarted ( ) ; return Status . OK_STATUS ; } } ; animationStartJob . setSystem ( true ) ; animationStartJob . schedule ( ) ; } private void animationFinished ( ) { } int getPreferredWidth ( ) { } }

Fix:
WorkbenchJob animationStartJob = new WorkbenchJob ( ProgressMessages . getString ( "AnimationManager.AnimationStart" ) ) {
Buggy code:
public class PageParser { private static Logger log = LoggerFactory . getLogger ( PageParser . class ) ; public static Set < String > getLinks ( StringBuilder sb , String urlContext ) { } public static Page getPage ( StringBuilder sb ) { } private static String getTitle ( StringBuilder sb ) { } public static String normaliseUri ( String context , String partURI ) { if ( ( null == partURI ) || ( partURI . contains ( "javascript:" ) ) ) { return null ; } URI uri ; try { uri = new URI ( context ) ; return uri . resolve ( partURI ) . toString ( ) ; } catch ( Exception e ) { <START_BUG> PageParser . log . equals ( ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>" + partURI ) ) ; <END_BUG> } return null ; } }

Fix:
PageParser . log . error ( ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>" + partURI ) ) ;
Buggy code:
public class EngineXMetadata { private String theClassName ; private boolean valid = true ; private List < String > classes = new ArrayList < String > ( ) ; List < EngineXMethodMetadata > methods = new ArrayList < EngineXMethodMetadata > ( ) ; private byte [ ] classbytes ; private boolean derived = false ; private String classLoaderName ; public void setClassName ( String name ) { } public List < String > getClasses ( ) { } public String getClassName ( ) { } public boolean isValidEngineXClass ( ) { } public void setInvalid ( ) { } public void addClassesEntry ( String value ) { } public void setInvalid ( String string ) { } public List < EngineXMethodMetadata > getMethods ( ) { } public void addMethod ( EngineXMethodMetadata method ) { } public void addBytes ( byte [ ] enginexclass ) { } public byte [ ] getClassBytes ( ) { } public String getExternalClassName ( ) { } public boolean mayMatch ( Class < ? > theclass ) { } public boolean mayMatchClassHierarchy ( String className , Class < ? > superclass , Class < ? > [ ] interfaces ) { if ( ! ( getDerived ( ) ) ) { return mayMatchClassName ( className ) ; } <START_BUG> boolean result = mayMatchClassHierarchy ( superclass ) ; <END_BUG> if ( result ) return true ; for ( Class < ? > iface : interfaces ) { if ( mayMatchClass ( iface ) ) { return true ; } } return false ; } private boolean mayMatchClassHierarchy ( Class < ? > theclass ) { } private boolean mayMatchMethods ( Class < ? > theclass ) { } private boolean mayMatchClass ( Class < ? > theclass ) { } public boolean mayMatchClassName ( String classname ) { } public boolean getDerived ( ) { } public void setDerived ( boolean value ) { } XClassLoaderPolicy classLoaderPolicy = XClassLoaderPolicy . BOOT ; private boolean useRegex ; private HashSet < String > excludedClasses = new HashSet < String > ( ) ; public XClassLoaderPolicy getClassLoaderPolicy ( ) { } public void setClassLoaderPolicy ( XClassLoaderPolicy classLoaderPolicy ) { } public void setClassLoaderName ( String name ) { } public String getClassLoaderName ( ) { } public void setUseRegex ( boolean value ) { } public boolean getUseRegEx ( ) { } @ Override public String toString ( ) { } public EngineXMethodMetadata getMethod ( String methodName ) { } public void addExcludedClass ( String exclude ) { } public Set < String > getExcludedClasses ( ) { } public boolean excludesClass ( String classname ) { } }

Fix:
boolean result = ( mayMatchClassName ( className ) ) || ( mayMatchClassHierarchy ( superclass ) ) ;
Buggy code:
public class SkullOfTheFallen extends Item implements CraftableItem , CustomItem , EventAwareContent { public SkullOfTheFallen ( ) { } @ Override public void registerRecipes ( ) { } @ Override public String getID ( ) { } @ Subscribe public void onRightClick ( PlayerInteractBlockEvent event ) { <START_BUG> if ( ( event . getGame ( ) . getPlatform ( ) . getType ( ) ) == ( Type . CLIENT ) ) <END_BUG> return ; if ( ( event . getInteractionType ( ) ) == ( EntityInteractionTypes . USE ) ) { if ( ( ( ( ( event . getBlock ( ) . getX ( ) ) == 0 ) && ( ( event . getBlock ( ) . getY ( ) ) == 0 ) ) && ( ( event . getBlock ( ) . getZ ( ) ) == 0 ) ) && ( ( event . getBlock ( ) . getBlockType ( ) ) == ( BlockTypes . LOG ) ) ) { return ; } Player player = event . getEntity ( ) ; Optional < ItemStack > optHeldItem = player . getItemInHand ( ) ; if ( optHeldItem . isPresent ( ) ) { if ( this . equals ( optHeldItem . get ( ) . getItem ( ) ) ) { Location pLoc = player . getLocation ( ) ; Optional < WorldService > optWorldService = event . getGame ( ) . getServiceManager ( ) . provide ( WorldService . class ) ; if ( optWorldService . isPresent ( ) ) { WorldService worldService = optWorldService . get ( ) ; WildernessWorldWrapper wrapper = ( ( WildernessWorldWrapper ) ( worldService . getEffectWrapper ( "Wilderness" ) ) ) ; if ( wrapper . isApplicable ( pLoc . getExtent ( ) ) ) { int level = wrapper . getLevel ( pLoc ) ; Text levelText = Texts . builder ( ) . color ( YELLOW ) . append ( Texts . of ( ( "Wilderness<seq2seq4repair_space>level:<seq2seq4repair_space>" + level ) ) ) . build ( ) ; Text damageText = Texts . builder ( ) . color ( YELLOW ) . append ( Texts . of ( ( "Mob<seq2seq4repair_space>damage:<seq2seq4repair_space>+" + ( wrapper . getDamageMod ( level ) ) ) ) ) . build ( ) ; Text healthText = Texts . builder ( ) . color ( YELLOW ) . append ( Texts . of ( ( "Mob<seq2seq4repair_space>health:<seq2seq4repair_space>x" + ( wrapper . getHealthMod ( level ) ) ) ) ) . build ( ) ; Text oreText = Texts . builder ( ) . color ( YELLOW ) . append ( Texts . of ( ( "Ore<seq2seq4repair_space>modifier:<seq2seq4repair_space>x" + ( wrapper . getOreMod ( level ) ) ) ) ) . build ( ) ; player . sendMessage ( levelText , damageText , healthText , oreText ) ; } else { Text notWildernessText = Texts . builder ( ) . color ( RED ) . append ( Texts . of ( "You're<seq2seq4repair_space>not<seq2seq4repair_space>in<seq2seq4repair_space>a<seq2seq4repair_space>Wilderness<seq2seq4repair_space>world!" ) ) . build ( ) ; player . sendMessage ( notWildernessText ) ; } } } } } } }

Fix:
if ( event . getGame ( ) . getPlatform ( ) . getExecutionType ( ) . isClient ( ) )
Buggy code:
public class Diamond extends BetterActor { private Force force = new Force ( ) ; public void act ( ) { } public Diamond ( ) { } private void checkForPlayer ( ) { Actor player = ( ( Actor ) ( getOneObjectAtOffset ( 0 , 0 , Player . class ) ) ) ; <START_BUG> if ( player != null ) { <END_BUG> Scorekeeper . incrementDiamonds ( ) ; Greenfoot . playSound ( "smw_coin.wav" ) ; getWorld ( ) . removeObject ( this ) ; } } private void diamondMovement ( ) { } }

Fix:
if ( ( player != null ) && ( ! ( player instanceof Health ) ) ) {
Buggy code:
public class Signin2Test extends TestCase { public void testSignIn2 ( ) { if ( 1 == 1 ) { return ; } WicketTester tester = new WicketTester ( new SignIn2Application ( ) ) ; tester . startPage ( Home . class ) ; tester . assertRenderedPage ( SignIn2 . class ) ; FormTester formTester = tester . newFormTester ( "signInPanel:signInForm" ) ; formTester . setValue ( "username" , "wicket" ) ; formTester . setValue ( "password" , "wicket" ) ; formTester . setValue ( "rememberMeRow:rememberMe" , "true" ) ; formTester . submit ( ) ; tester . assertRenderedPage ( Home . class ) ; <START_BUG> Collection < Cookie > cookies = tester . getServletResponse ( ) . getCookies ( ) ; <END_BUG> for ( Cookie cookie : cookies ) { if ( "signInPanel.signInForm.username" . equals ( cookie . getName ( ) ) ) { assertEquals ( "wicket" , cookie . getValue ( ) ) ; } } tester . startPage ( SignOut . class ) ; tester . assertRenderedPage ( SignOut . class ) ; tester . startPage ( Home . class ) ; tester . assertRenderedPage ( SignIn2 . class ) ; } }

Fix:
Collection < Cookie > cookies = tester . getLastResponse ( ) . getCookies ( ) ;
Buggy code:
public class SimpleUserContextFactory implements ContextFactory { public Principals getPrincipals ( HttpServletRequest request ) { <START_BUG> return new Principals ( "test_user" , 0 , "test_device" , 0 ) ; <END_BUG> } }

Fix:
return new Principals ( "test_user" , "test_device" , 0 , 0 ) ;
Buggy code:
public class TestGermanMinimalStemFilter extends BaseTokenStreamTestCase { private Analyzer analyzer = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } ; public void testExamples ( ) throws IOException { } public void testVocabulary ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , analyzer , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , analyzer , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class OperatorInstanceof extends Operator { public OperatorInstanceof ( int pos , SpelNodeImpl ... operands ) { } @ Override public BooleanTypedValue getValueInternal ( ExpressionState state ) throws EvaluationException { TypedValue left = getLeftOperand ( ) . getValueInternal ( state ) ; TypedValue right = getRightOperand ( ) . getValueInternal ( state ) ; Object leftValue = left . getValue ( ) ; Object rightValue = right . getValue ( ) ; if ( leftValue == null ) { <START_BUG> return BooleanTypedValue . False ; <END_BUG> } if ( ( rightValue == null ) || ( ! ( rightValue instanceof Class < ? > ) ) ) { throw new org . springframework . expression . spel . SpelEvaluationException ( getRightOperand ( ) . getStartPosition ( ) , SpelMessage . INSTANCEOF_OPERATOR_NEEDS_CLASS_OPERAND , ( rightValue == null ? "null" : rightValue . getClass ( ) . getName ( ) ) ) ; } Class < ? > rightClass = ( ( Class < ? > ) ( rightValue ) ) ; return BooleanTypedValue . forValue ( rightClass . isAssignableFrom ( leftValue . getClass ( ) ) ) ; } }

Fix:
return BooleanTypedValue . FALSE ;
Buggy code:
public class StatusAPI extends Checkable < StatusAPI > { @ Override StatusAPI build ( ) { } public RamdRequestHandler getStatus ( RamdRequest request ) throws Exception { } private static RamdRequestHandler __handler = null ; public static RamdRequestHandler handler ( ) throws Exception { if ( ( StatusAPI . __handler ) == null ) { synchronized ( StatusAPI . class ) { if ( ( StatusAPI . __handler ) == null ) <START_BUG> StatusAPI . __handler = RamdRequestHandler . build ( "Status" , "Get<seq2seq4repair_space>current<seq2seq4repair_space>system<seq2seq4repair_space>status<seq2seq4repair_space>of<seq2seq4repair_space>this<seq2seq4repair_space>Ramd<seq2seq4repair_space>node" , StatusAPI . class , "getStatus" , new Class [ ] { RamdRequestHandler . class , RamdRequest . class } ) ; <END_BUG> } } return StatusAPI . __handler ; } }

Fix:
StatusAPI . __handler = RamdRequestHandler . build ( "Status" , "Get<seq2seq4repair_space>current<seq2seq4repair_space>system<seq2seq4repair_space>status<seq2seq4repair_space>of<seq2seq4repair_space>this<seq2seq4repair_space>Ramd<seq2seq4repair_space>node" , StatusAPI . class , "getStatus" , new Class [ ] { RamdRequest . class } ) ;
Buggy code:
@ RunWith ( Parameterized . class ) public class CSVFileParserTest { private static final File BASE = new File ( "src//test//resources//CSVFileParser" ) ; private final BufferedReader testData ; private final String testName ; public CSVFileParserTest ( final File file ) throws FileNotFoundException { } private String readTestData ( ) throws IOException { } @ Parameters public static Collection < Object [ ] > generateData ( ) { } @ Test public void testCSVFile ( ) throws Exception { String line = readTestData ( ) ; assertNotNull ( "file<seq2seq4repair_space>must<seq2seq4repair_space>contain<seq2seq4repair_space>config<seq2seq4repair_space>line" , line ) ; final String [ ] split = line . split ( "<seq2seq4repair_space>" ) ; assertTrue ( ( ( testName ) + "<seq2seq4repair_space>require<seq2seq4repair_space>1<seq2seq4repair_space>param" ) , ( ( split . length ) >= 1 ) ) ; final BufferedReader csvFile = new BufferedReader ( new FileReader ( new File ( CSVFileParserTest . BASE , split [ 0 ] ) ) ) ; <START_BUG> CSVFormatBuilder builder = CSVFormat . newFormat ( ',' ) . withQuoteChar ( '"' ) ; <END_BUG> CSVFormat fmt = builder . build ( ) ; boolean checkComments = false ; for ( int i = 1 ; i < ( split . length ) ; i ++ ) { final String option = split [ i ] ; final String [ ] option_parts = option . split ( "=" , 2 ) ; if ( "IgnoreEmpty" . equalsIgnoreCase ( option_parts [ 0 ] ) ) { fmt = builder . withIgnoreEmptyLines ( Boolean . parseBoolean ( option_parts [ 1 ] ) ) . build ( ) ; } else if ( "IgnoreSpaces" . equalsIgnoreCase ( option_parts [ 0 ] ) ) { fmt = builder . withIgnoreSurroundingSpaces ( Boolean . parseBoolean ( option_parts [ 1 ] ) ) . build ( ) ; } else if ( "CommentStart" . equalsIgnoreCase ( option_parts [ 0 ] ) ) { fmt = builder . withCommentStart ( option_parts [ 1 ] . charAt ( 0 ) ) . build ( ) ; } else if ( "CheckComments" . equalsIgnoreCase ( option_parts [ 0 ] ) ) { checkComments = true ; } else { fail ( ( ( ( testName ) + "<seq2seq4repair_space>unexpected<seq2seq4repair_space>option:<seq2seq4repair_space>" ) + option ) ) ; } } line = readTestData ( ) ; assertEquals ( ( ( testName ) + "<seq2seq4repair_space>Expected<seq2seq4repair_space>format<seq2seq4repair_space>" ) , line , fmt . toString ( ) ) ; for ( final CSVRecord rec : fmt . parse ( csvFile ) ) { String parsed = rec . toString ( ) ; if ( checkComments ) { final String comment = rec . getComment ( ) . replace ( "\n" , "\\n" ) ; if ( comment != null ) { parsed += "#" + comment ; } } final int count = rec . size ( ) ; assertEquals ( testName , readTestData ( ) , ( ( count + ":" ) + parsed ) ) ; } } }

Fix:
CSVFormatBuilder builder = CSVFormat . newBuilder ( ',' ) . withQuoteChar ( '"' ) ;
Buggy code:
@ EActivity ( layout . activity_abs_file_manager ) @ OptionsMenu ( menu . font_file_selector ) public class FontFileSelectorActivity extends AbsFileManagerActivity { private static final String TAG = FontFileSelectorActivity . class . getSimpleName ( ) ; public static final String RESULT_INTENT_FILENAME = "filename" ; private static final String [ ] FONT_EXT_LIST = new String [ ] { ".ttf" , ".otf" } ; @ Pref Preferences_ preferences ; @ Bean FontFileSelectorActivityState state ; @ Override @ AfterViews protected void afterViewsAbsFileManagerActivity ( ) { } private boolean isValidFontFile ( String path ) { } @ Override protected void loadContents ( ) { } @ Override @ ItemClick ( id . list ) protected void onListItemClick ( int position ) { String path = listAdapter . getItem ( position ) ; if ( isDirectory ( path ) ) { super . onListItemClick ( position ) ; return ; } if ( ! ( isValidFontFile ( path ) ) ) { <START_BUG> activityHelper . showToast ( getResources ( ) . getString ( message_validation_file_ext , Joiner . on ( "," ) . join ( FontFileSelectorActivity . FONT_EXT_LIST ) ) ) ; <END_BUG> return ; } Intent intent = getIntent ( ) ; intent . putExtra ( RESULT_INTENT_PATH , currentFullPath ) ; intent . putExtra ( FontFileSelectorActivity . RESULT_INTENT_FILENAME , path ) ; setResult ( RESULT_OK , intent ) ; finish ( ) ; } @ OptionsItem ( R . id . action_help ) void onActionHelp ( ) { } }

Fix:
activityHelper . showToast ( getResources ( ) . getString ( message_validation_file_ext , Joiner . on ( "<seq2seq4repair_space>or<seq2seq4repair_space>" ) . join ( FontFileSelectorActivity . FONT_EXT_LIST ) ) ) ;
Buggy code:
public class BatchAligner < S extends Sequence < S > > { final BatchAlignerParameters < S > parameters ; final List < S > references = new ArrayList < > ( ) ; public BatchAligner ( BatchAlignerParameters < S > parameters ) { } public int addReference ( S ref ) { } public S get ( int index ) { } public BatchAlignmentResult < S > align ( final S sequence ) { ArrayList < BatchAlignmentHit < S > > alignments = new ArrayList < > ( references . size ( ) ) ; <START_BUG> for ( int i = 0 ; i < ( alignments . size ( ) ) ; i ++ ) <END_BUG> alignments . add ( alignSingle ( i , sequence ) ) ; Collections . sort ( alignments , new BatchAligner . HitComparator ( ) ) ; float topScore = alignments . get ( 0 ) . getAlignment ( ) . getScore ( ) ; float scoreThreshold = Math . max ( ( topScore * ( parameters . getRelativeMinScore ( ) ) ) , parameters . getAbsoluteMinScore ( ) ) ; for ( int i = 0 ; i < ( alignments . size ( ) ) ; i ++ ) if ( ( i == ( parameters . getMaxHits ( ) ) ) || ( ( alignments . get ( i ) . getAlignment ( ) . getScore ( ) ) < scoreThreshold ) ) return new BatchAlignmentResult ( new ArrayList ( alignments . subList ( 0 , i ) ) ) ; return new BatchAlignmentResult ( alignments ) ; } BatchAlignmentHit < S > alignSingle ( int referenceId , S query ) { } private static class HitComparator implements Comparator < BatchAlignmentHit > { @ Override public int compare ( BatchAlignmentHit o1 , BatchAlignmentHit o2 ) { } } }

Fix:
for ( int i = 0 ; i < ( references . size ( ) ) ; i ++ )
Buggy code:
public class ShotBoard extends Board { private int hits ; private int misses ; public ShotBoard ( ) { } public int getHits ( ) { } public void setHits ( int hits ) { } public int getMisses ( ) { } public void setMisses ( int misses ) { } private void getHitMiss ( ) { } public void availableShots ( ) { } public Point fireShotAI ( ) { } @ Override public void display ( ) { String marker ; System . out . print ( "<seq2seq4repair_space>0123456789\n------------\n" ) ; for ( int i = 0 ; i < ( getRows ( ) ) ; i ++ ) { <START_BUG> System . out . print ( getColStr ( i ) ) ; <END_BUG> for ( int j = 0 ; j < ( getCols ( ) ) ; j ++ ) { switch ( checkLocation ( i , j ) ) { case 1 : marker = "H" ; break ; case 2 : marker = "M" ; break ; case 3 : marker = "S" ; break ; default : marker = "0" ; } System . out . print ( marker ) ; } System . out . println ( ) ; } } }

Fix:
System . out . print ( ( ( getColStr ( i ) ) + "<seq2seq4repair_space>" ) ) ;
Buggy code:
public class XMPPID extends BaseID implements IChatID { private static final long serialVersionUID = 3257289140701049140L ; public static final char USER_HOST_DELIMITER = '@' ; URI uri ; String username ; String hostname ; protected static String fixEscape ( String src ) { } public XMPPID ( Namespace namespace , String unamehost ) throws URISyntaxException { } protected int namespaceCompareTo ( BaseID o ) { } protected boolean namespaceEquals ( BaseID o ) { } protected String namespaceGetName ( ) { } protected int namespaceHashCode ( ) { } protected URI namespaceToURI ( ) throws URISyntaxException { } public String getUsername ( ) { } public String getHostname ( ) { } public String getUsernameAtHost ( ) { } public String toString ( ) { } public Object getAdapter ( Class clazz ) { <START_BUG> if ( clazz . equals ( IChatID . class ) ) { <END_BUG> return this ; } else return super . getAdapter ( clazz ) ; } }

Fix:
if ( clazz . isInstance ( this ) ) {
Buggy code:
public class Cvs extends Task { private Commandline cmd = new Commandline ( ) ; private String cvsRoot ; private String pack ; private String command = "checkout" ; private boolean quiet = false ; private boolean noexec = false ; private File dest ; private File output ; private File error ; public void execute ( ) throws BuildException { Commandline toExecute = new Commandline ( ) ; toExecute . setExecutable ( "cvs" ) ; if ( ( cvsRoot ) != null ) { toExecute . createArgument ( ) . setValue ( "-d" ) ; toExecute . createArgument ( ) . setValue ( cvsRoot ) ; } if ( noexec ) { toExecute . createArgument ( ) . setValue ( "-n" ) ; } if ( quiet ) { toExecute . createArgument ( ) . setValue ( "-q" ) ; } toExecute . createArgument ( ) . setLine ( command ) ; toExecute . addArguments ( cmd . getCommandline ( ) ) ; if ( ( pack ) != null ) { <START_BUG> toExecute . createArgument ( ) . setValue ( pack ) ; <END_BUG> } ExecuteStreamHandler streamhandler = null ; OutputStream outputstream = null ; OutputStream errorstream = null ; if ( ( ( error ) == null ) && ( ( output ) == null ) ) { streamhandler = new LogStreamHandler ( this , Project . MSG_INFO , Project . MSG_WARN ) ; } else { if ( ( output ) != null ) { try { outputstream = new PrintStream ( new BufferedOutputStream ( new FileOutputStream ( output ) ) ) ; } catch ( IOException e ) { throw new BuildException ( e , location ) ; } } else { outputstream = new LogOutputStream ( this , Project . MSG_INFO ) ; } if ( ( error ) != null ) { try { errorstream = new PrintStream ( new BufferedOutputStream ( new FileOutputStream ( error ) ) ) ; } catch ( IOException e ) { throw new BuildException ( e , location ) ; } } else { errorstream = new LogOutputStream ( this , Project . MSG_WARN ) ; } streamhandler = new PumpStreamHandler ( outputstream , errorstream ) ; } Execute exe = new Execute ( streamhandler , null ) ; exe . setAntRun ( project ) ; if ( ( dest ) == null ) dest = project . getBaseDir ( ) ; exe . setWorkingDirectory ( dest ) ; exe . setCommandline ( toExecute . getCommandline ( ) ) ; try { exe . execute ( ) ; } catch ( IOException e ) { throw new BuildException ( e , location ) ; } finally { if ( ( output ) != null ) { try { outputstream . close ( ) ; } catch ( IOException e ) { } } if ( ( error ) != null ) { try { errorstream . close ( ) ; } catch ( IOException e ) { } } } } public void setCvsRoot ( String root ) { } public void setDest ( File dest ) { } public void setPackage ( String p ) { } public void setTag ( String p ) { } public void setDate ( String p ) { } public void setCommand ( String c ) { } public void setQuiet ( boolean q ) { } public void setNoexec ( boolean ne ) { } public void setOutput ( File output ) { } public void setError ( File error ) { } }

Fix:
toExecute . createArgument ( ) . setLine ( pack ) ;
Buggy code:
public class SynchronizedStatement extends Statement { public Expression expression ; public Block block ; public BlockScope scope ; boolean blockExit ; public LocalVariableBinding synchroVariable ; static final char [ ] SecretLocalDeclarationName = "<seq2seq4repair_space>syncValue" . toCharArray ( ) ; public SynchronizedStatement ( Expression expression , Block statement , int s , int e ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( ( bits ) & ( IsReachableMASK ) ) == 0 ) { return ; } int pc = codeStream . position ; expression . generateCode ( scope , codeStream , true ) ; if ( block . isEmptyBlock ( ) ) { if ( ( ( synchroVariable . type ) == ( LongBinding ) ) || ( ( synchroVariable . type ) == ( DoubleBinding ) ) ) { codeStream . dup2 ( ) ; } else { codeStream . dup ( ) ; } codeStream . monitorenter ( ) ; codeStream . monitorexit ( ) ; } else { codeStream . store ( synchroVariable , true ) ; codeStream . monitorenter ( ) ; ExceptionLabel anyExceptionHandler = new ExceptionLabel ( codeStream , null ) ; block . generateCode ( scope , codeStream ) ; Label endLabel = new Label ( codeStream ) ; if ( ! ( blockExit ) ) { codeStream . load ( synchroVariable ) ; codeStream . monitorexit ( ) ; codeStream . goto_ ( endLabel ) ; } anyExceptionHandler . placeEnd ( ) ; anyExceptionHandler . place ( ) ; codeStream . incrStackSize ( 1 ) ; codeStream . load ( synchroVariable ) ; codeStream . monitorexit ( ) ; codeStream . athrow ( ) ; if ( ! ( blockExit ) ) { endLabel . place ( ) ; } } if ( ( scope ) != currentScope ) { codeStream . exitUserScope ( scope ) ; } <START_BUG> codeStream . recordPositionsFrom ( pc , this ) ; <END_BUG> } public void resolve ( BlockScope upperScope ) { } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
codeStream . recordPositionsFrom ( pc , this . sourceStart ) ;
Buggy code:
public class Factions1X implements SupportBase { List < Factions1XCommandSkeleton > commands = new ArrayList < Factions1XCommandSkeleton > ( ) ; List < String > helpLines = new ArrayList < String > ( ) ; public Factions1X ( HashMap < String , String > settings ) { } public void add ( List < String > aliases , Boolean requiresFactionsEnabled , Boolean requiresIsPlayer , Boolean requiresInFaction , Boolean requiresIsLeader , String permission , String permissionDeniedMessage , String desc , String executingCommand ) { Factions1XCommandSkeleton command = new Factions1XCommandSkeleton ( aliases , requiresFactionsEnabled , requiresIsPlayer , requiresInFaction , requiresIsLeader , permission , permissionDeniedMessage , desc , executingCommand ) ; commands . add ( command ) ; cmdBase . addSubCommand ( ( ( FCommand ) ( command ) ) ) ; <START_BUG> helpLines . add ( command . getUseageTemplate ( true ) ) ; <END_BUG> } @ Override public void unregister ( ) { } @ Override public void finishCall ( ) { } }

Fix:
helpLines . add ( command . getUseageTemplate ( ) ) ;
Buggy code:
public class DefaultDeployer extends AbstractLogEnabled implements Serviceable , Deployer { private static final Resources REZ = ResourceManager . getPackageResources ( DefaultDeployer . class ) ; private ConverterRegistry m_converterRegistry ; private TypeManager m_typeManager ; private RoleManager m_roleManager ; private ClassLoaderManager m_classLoaderManager ; private final Map m_classLoaderDeployers = new HashMap ( ) ; public void service ( final ServiceManager serviceManager ) throws ServiceException { } public Deployer createChildDeployer ( final ServiceManager componentManager ) throws ServiceException { } public TypeDeployer createDeployer ( final ClassLoader loader ) throws DeploymentException { } public TypeDeployer createDeployer ( final File file ) throws DeploymentException { try { <START_BUG> final ClassLoader classLoader = m_classLoaderManager . createClassLoader ( file ) ; <END_BUG> return createDeployment ( classLoader , file . toURL ( ) ) ; } catch ( final Exception e ) { final String message = DefaultDeployer . REZ . getString ( "deploy-from-file.error" , file ) ; throw new DeploymentException ( message , e ) ; } } private Deployment createDeployment ( final ClassLoader loader , final URL jarUrl ) throws Exception { } public void deployService ( final Deployment deployment , final ServiceDefinition definition ) throws Exception { } public void deployType ( final Deployment deployment , final TypeDefinition typeDef ) throws Exception { } private void handleType ( final Deployment deployment , final String roleName , final String typeName , final String className ) throws Exception { } private void handleConverter ( final Deployment deployment , final String className , final String source , final String destination ) throws Exception { } public void deployRole ( final Deployment deployment , final RoleDefinition roleDef ) throws Exception { } private RoleInfo getRole ( final String roleShorthand ) throws DeploymentException { } }

Fix:
final ClassLoader classLoader = m_classLoaderManager . getClassLoader ( file ) ;
Buggy code:
public abstract class CreateTypeMemberOperation extends CreateElementInCUOperation { protected String source = null ; protected String alteredName ; protected ASTNode createdNode ; public CreateTypeMemberOperation ( IJavaElement parentElement , String source , boolean force ) { } protected StructuralPropertyDescriptor getChildPropertyDescriptor ( ASTNode parent ) { } protected ASTNode generateElementAST ( ASTRewrite rewriter , IDocument document , ICompilationUnit cu ) throws JavaModelException { } private String removeIndentAndNewLines ( String code , IDocument document , ICompilationUnit cu ) { IJavaProject project = cu . getJavaProject ( ) ; Map options = project . getOptions ( true ) ; int tabWidth ; try { <START_BUG> tabWidth = Integer . parseInt ( ( ( String ) ( options . get ( DefaultCodeFormatterConstants . FORMATTER_INDENTATION_SIZE ) ) ) ) ; <END_BUG> } catch ( NumberFormatException e ) { tabWidth = 4 ; } int indent = Indents . computeIndent ( code , tabWidth ) ; int firstNonWhiteSpace = - 1 ; int length = code . length ( ) ; while ( firstNonWhiteSpace < ( length - 1 ) ) if ( ! ( Character . isWhitespace ( code . charAt ( ( ++ firstNonWhiteSpace ) ) ) ) ) break ; int lastNonWhiteSpace = length ; while ( lastNonWhiteSpace > 0 ) if ( ! ( Character . isWhitespace ( code . charAt ( ( -- lastNonWhiteSpace ) ) ) ) ) break ; String lineDelimiter = TextUtilities . getDefaultLineDelimiter ( document ) ; return Indents . changeIndent ( code . substring ( firstNonWhiteSpace , ( lastNonWhiteSpace + 1 ) ) , indent , tabWidth , "" , lineDelimiter ) ; } protected abstract SimpleName rename ( ASTNode node , SimpleName newName ) { } protected String generateSyntaxIncorrectAST ( ) { } protected IType getType ( ) { } protected void setAlteredName ( String newName ) { } public IJavaModelStatus verify ( ) { } protected IJavaModelStatus verifyNameCollision ( ) { } }

Fix:
tabWidth = Integer . parseInt ( ( ( String ) ( options . get ( DefaultCodeFormatterConstants . FORMATTER_TAB_SIZE ) ) ) ) ;
Buggy code:
public final class ExtensionContextImpl implements ExtensionContext { private final ModelNodeRegistration profileRegistration ; private final ModelNodeRegistration deploymentOverrideRegistration ; private final SubsystemXmlWriterRegistry writerRegistry ; public ExtensionContextImpl ( final ModelNodeRegistration profileRegistration , final ModelNodeRegistration deploymentOverrideRegistration , final SubsystemXmlWriterRegistry writerRegistry ) { } @ Override public SubsystemRegistration registerSubsystem ( final String name ) throws IllegalArgumentException { if ( name == null ) { throw new IllegalArgumentException ( "name<seq2seq4repair_space>is<seq2seq4repair_space>null" ) ; } return new SubsystemRegistration ( ) { @ Override public ModelNodeRegistration registerSubsystemModel ( final DescriptionProvider descriptionProvider ) { if ( descriptionProvider == null ) { throw new IllegalArgumentException ( "descriptionProvider<seq2seq4repair_space>is<seq2seq4repair_space>null" ) ; } return profileRegistration . registerSubModel ( new PathElement ( "subsystem" , name ) , descriptionProvider ) ; } @ Override public ModelNodeRegistration registerDeploymentModel ( final DescriptionProvider descriptionProvider ) { if ( descriptionProvider == null ) { throw new IllegalArgumentException ( "descriptionProvider<seq2seq4repair_space>is<seq2seq4repair_space>null" ) ; } <START_BUG> return deploymentOverrideRegistration . registerSubModel ( new PathElement ( "configuration" , name ) , descriptionProvider ) ; <END_BUG> } @ Override public void registerXMLElementWriter ( XMLElementWriter < SubsystemMarshallingContext > writer ) { writerRegistry . registerSubsystemWriter ( name , writer ) ; } } ; } }

Fix:
return deploymentOverrideRegistration . registerSubModel ( new PathElement ( "subsystem" , name ) , descriptionProvider ) ;
Buggy code:
public class SpawnParticlePacket implements IMessage { public static class Handler implements IMessageHandler < SpawnParticlePacket , IMessage > { @ Override public IMessage onMessage ( SpawnParticlePacket message , MessageContext ctx ) { if ( message . type . equals ( "blood_eat" ) ) { Class [ ] paramtype = new Class [ ] { ItemStack . class , Integer . TYPE } ; ItemStack is = new ItemStack ( Item . getItemById ( 260 ) ) ; <START_BUG> Reflection . callMethod ( EntityPlayer . class , Minecraft . getMinecraft ( ) . thePlayer , "updateItemUse" , paramtype , new Object [ ] { is , message . amount } ) ; <END_BUG> return null ; } WorldClient world = Minecraft . getMinecraft ( ) . theWorld ; world . spawnParticle ( message . type , message . x , message . y , message . z , message . velX , message . velY , message . velZ ) ; for ( int i = 1 ; i < ( message . amount ) ; i ++ ) { Random ran = world . rand ; double x = ( message . x ) + ( ran . nextGaussian ( ) ) ; double y = ( message . y ) + ( ran . nextGaussian ( ) ) ; double z = ( message . z ) + ( ran . nextGaussian ( ) ) ; world . spawnParticle ( message . type , x , y , z , ran . nextDouble ( ) , ran . nextGaussian ( ) , ran . nextGaussian ( ) ) ; } return null ; } } private String type ; private double x ; private double y ; private double z ; private double velX ; private double velY ; private double velZ ; private int amount ; public SpawnParticlePacket ( ) { } public SpawnParticlePacket ( String ptype , double px , double py , double pz , double pvelx , double pvely , double pvelz , int pamount ) { } @ Override public void fromBytes ( ByteBuf buf ) { } @ Override public void toBytes ( ByteBuf buf ) { } }

Fix:
Reflection . callMethod ( EntityPlayer . class , ( ( EntityPlayer ) ( Minecraft . getMinecraft ( ) . thePlayer ) ) , "updateItemUse" , paramtype , new Object [ ] { is , message . amount } ) ;
Buggy code:
public class Logic { private static final String MESSAGE_DELETE = "Task<seq2seq4repair_space>%1$s<seq2seq4repair_space>deleted!" ; private static final String MESSAGE_ADD = "Task<seq2seq4repair_space>\"%1$s\"<seq2seq4repair_space>added!" ; private static final String MESSAGE_CLEAR = "all<seq2seq4repair_space>content<seq2seq4repair_space>deleted" ; private static final String ERROR_SEARCH = "Exception<seq2seq4repair_space>in<seq2seq4repair_space>search<seq2seq4repair_space>method" ; private static final String ERROR_ADD = "Exception<seq2seq4repair_space>in<seq2seq4repair_space>add<seq2seq4repair_space>method" ; private static final String ERROR_CLEAR = "Exception<seq2seq4repair_space>in<seq2seq4repair_space>clear<seq2seq4repair_space>method" ; private List < Done > tasks ; private DoneStorage inMemStorage ; private CommandParser cmdParser ; public Logic ( ) { } public void addTask ( String userCommand ) { } private void updateTaskID ( ) { } public boolean isExistingTask ( int deleteIndex ) { } public String deleteTask ( int deleteIndex ) { } public List < Done > getTasks ( ) { } public CommandType getCmdType ( String usercommand ) { } public String getCmdContent ( String usercommand ) { } public Done getTask ( String usercommand ) { } public List < Done > searchTask ( String searchString ) { } public void undo ( ) { } private void addTag ( String tagString ) { } public void clearTasks ( ) { } public void markDone ( ) { } public void setReminder ( String date ) { } public void storeTo ( String jsonName ) { <START_BUG> JSONStorage jsonPref = JSONStorage . getInstance ( ) ; <END_BUG> jsonPref . setJsonNameToPref ( jsonName ) ; } No newline ; at end ; of file ; }

Fix:
JSONStorage jsonPref = new JSONStorage ( ) ;
Buggy code:
public class ViewLabelProvider extends LabelProvider implements IColorProvider { private HashMap images ; Image cacheImage ( ImageDescriptor desc ) { } public void dispose ( ) { } public Image getImage ( Object element ) { } public String getText ( Object element ) { } public Color getForeground ( Object element ) { } public Color getBackground ( Object element ) { <START_BUG> if ( WorkbenchActivityHelper . filterItem ( element ) ) { <END_BUG> return WorkbenchActivityHelper . getFilterColor ( ) ; } return null ; } }

Fix:
if ( ( element instanceof ViewDescriptor ) && ( WorkbenchActivityHelper . filterItem ( element ) ) ) {
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class BatchTestCase extends AbstractCliTestBase { private static WebArchive [ ] wars = new WebArchive [ 3 ] ; private static File [ ] warFiles = new File [ 3 ] ; @ ArquillianResource URL url ; @ Deployment public static Archive < ? > getDeployment ( ) { } @ BeforeClass public static void before ( ) throws Exception { } @ AfterClass public static void after ( ) throws Exception { } @ Test public void testRunBatch ( ) throws Exception { } @ Test public void testRollbackBatch ( ) throws Exception { cli . sendLine ( "batch" ) ; cli . sendLine ( ( "deploy<seq2seq4repair_space>" + ( BatchTestCase . warFiles [ 0 ] . getAbsolutePath ( ) ) ) ) ; cli . sendLine ( ( "deploy<seq2seq4repair_space>" + ( BatchTestCase . warFiles [ 2 ] . getAbsolutePath ( ) ) ) ) ; assertTrue ( checkUndeployed ( ( ( getBaseURL ( url ) ) + "deployment0//SimpleServlet" ) ) ) ; assertTrue ( checkUndeployed ( ( ( getBaseURL ( url ) ) + "deployment2//SimpleServlet" ) ) ) ; cli . sendLine ( "run-batch" , true ) ; String line = cli . readOutput ( ) ; <START_BUG> assertTrue ( "Batch<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>fail." , line . contains ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>execute<seq2seq4repair_space>batch" ) ) ; <END_BUG> assertTrue ( checkUndeployed ( ( ( getBaseURL ( url ) ) + "deployment0//SimpleServlet" ) ) ) ; assertTrue ( checkUndeployed ( ( ( getBaseURL ( url ) ) + "deployment2//SimpleServlet" ) ) ) ; cli . sendLine ( "discard-batch" ) ; cli . sendLine ( ( "deploy<seq2seq4repair_space>" + ( BatchTestCase . warFiles [ 0 ] . getAbsolutePath ( ) ) ) ) ; String response = HttpRequest . get ( ( ( getBaseURL ( url ) ) + "deployment0//SimpleServlet" ) , 1000 , 10 , TimeUnit . SECONDS ) ; assertTrue ( ( "Invalid<seq2seq4repair_space>response:<seq2seq4repair_space>" + response ) , ( ( response . indexOf ( "SimpleServlet" ) ) >= 0 ) ) ; cli . sendLine ( "undeploy<seq2seq4repair_space>deployment0.war" ) ; assertTrue ( checkUndeployed ( ( ( getBaseURL ( url ) ) + "deployment0//SimpleServlet" ) ) ) ; } }

Fix:
assertTrue ( "Batch<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>fail." , line . contains ( "Composite<seq2seq4repair_space>operation<seq2seq4repair_space>failed<seq2seq4repair_space>and<seq2seq4repair_space>was<seq2seq4repair_space>rolled<seq2seq4repair_space>back" ) ) ;