nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ScanFilterAndProjectOperator implements SourceOperator , Closeable { private static final int ROWS_PER_PAGE = 16384 ; private final OperatorContext operatorContext ; private final PlanNodeId planNodeId ; private final PageSourceProvider pageSourceProvider ; private final List < Type > types ; private final List < ColumnHandle > columns ; private final PageBuilder pageBuilder ; private final CursorProcessor cursorProcessor ; private final PageProcessor pageProcessor ; @ GuardedBy ( "this" ) private RecordCursor cursor ; @ GuardedBy ( "this" ) private ConnectorPageSource pageSource ; private Page currentPage ; private int currentPosition ; private boolean finishing ; private long completedBytes ; private long readTimeNanos ; protected ScanFilterAndProjectOperator ( OperatorContext operatorContext , PlanNodeId sourceId , PageSourceProvider pageSourceProvider , CursorProcessor cursorProcessor , PageProcessor pageProcessor , Iterable < ColumnHandle > columns , Iterable < Type > types ) { } @ Override public OperatorContext getOperatorContext ( ) { } @ Override public PlanNodeId getSourceId ( ) { } @ Override public synchronized void addSplit ( Split split ) { } @ Override public synchronized void noMoreSplits ( ) { } @ Override public final List < Type > getTypes ( ) { } @ Override public final void finish ( ) { } @ Override public void close ( ) { } @ Override public final boolean isFinished ( ) { } @ Override public final boolean needsInput ( ) { } @ Override public final void addInput ( Page page ) { } @ Override public Page getOutput ( ) { } public static class ScanFilterAndProjectOperatorFactory implements SourceOperatorFactory { private final int operatorId ; private final CursorProcessor cursorProcessor ; private final PageProcessor pageProcessor ; private final PlanNodeId sourceId ; private final PageSourceProvider pageSourceProvider ; private final List < ColumnHandle > columns ; private final List < Type > types ; private boolean closed ; public ScanFilterAndProjectOperatorFactory ( int operatorId , PlanNodeId sourceId , PageSourceProvider pageSourceProvider , CursorProcessor cursorProcessor , PageProcessor pageProcessor , Iterable < ColumnHandle > columns , List < Type > types ) { } @ Override public PlanNodeId getSourceId ( ) { } @ Override public List < Type > getTypes ( ) { } @ Override public SourceOperator createOperator ( DriverContext driverContext ) { Preconditions . checkState ( ( ! ( closed ) ) , "Factory<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>closed" ) ; <START_BUG> OperatorContext operatorContext = driverContext . addOperatorContext ( operatorId , FilterAndProjectOperator . class . getSimpleName ( ) ) ; <END_BUG> return new ScanFilterAndProjectOperator ( operatorContext , sourceId , pageSourceProvider , cursorProcessor , pageProcessor , columns , types ) ; } @ Override public void close ( ) { } } }

Fix:
OperatorContext operatorContext = driverContext . addOperatorContext ( operatorId , ScanFilterAndProjectOperator . class . getSimpleName ( ) ) ;
Buggy code:
public abstract class AggPrelBase extends AggregateRelBase implements Prel { protected static enum OperatorPhase { PHASE_1of1 , PHASE_1of2 , PHASE_2of2 ; } protected AggPrelBase . OperatorPhase operPhase = AggPrelBase . OperatorPhase . PHASE_1of1 ; protected List < NamedExpression > keys = Lists . newArrayList ( ) ; protected List < NamedExpression > aggExprs = Lists . newArrayList ( ) ; protected List < AggregateCall > phase2AggCallList = Lists . newArrayList ( ) ; public class SqlSumCountAggFunction extends SqlAggFunction { private final RelDataType type ; public SqlSumCountAggFunction ( RelDataType type ) { } public List < RelDataType > getParameterTypes ( RelDataTypeFactory typeFactory ) { } public RelDataType getType ( ) { } public RelDataType getReturnType ( RelDataTypeFactory typeFactory ) { } } public AggPrelBase ( RelOptCluster cluster , RelTraitSet traits , RelNode child , BitSet groupSet , List < AggregateCall > aggCalls , AggPrelBase . OperatorPhase phase ) throws InvalidRelException { } public AggPrelBase . OperatorPhase getOperatorPhase ( ) { } public List < NamedExpression > getKeys ( ) { } public List < NamedExpression > getAggExprs ( ) { } public List < AggregateCall > getPhase2AggCalls ( ) { } protected void createKeysAndExprs ( ) { } protected LogicalExpression toDrill ( AggregateCall call , List < String > fn ) { List < LogicalExpression > args = Lists . newArrayList ( ) ; for ( Integer i : call . getArgList ( ) ) { <START_BUG> args . add ( new FieldReference ( fn . get ( i ) ) ) ; <END_BUG> } if ( args . isEmpty ( ) ) { args . add ( new ValueExpressions . LongExpression ( 1L ) ) ; } LogicalExpression expr = new org . apache . drill . common . expression . FunctionCall ( call . getAggregation ( ) . getName ( ) . toLowerCase ( ) , args , ExpressionPosition . UNKNOWN ) ; return expr ; } @ Override public Iterator < Prel > iterator ( ) { } @ Override public < T , X , E extends Throwable > T accept ( PrelVisitor < T , X , E > logicalVisitor , X value ) throws E { } @ Override public boolean needsFinalColumnReordering ( ) { } }

Fix:
args . add ( FieldReference . getWithQuotedRef ( fn . get ( i ) ) ) ;
Buggy code:
public class UserInputChecker { private static final Logger logger = LoggerFactory . getLogger ( UserInputChecker . class ) ; public static String USERNAME_PATTERN = "[a-z0-9_-]{3,20}" ; public static String PASSWORD_PATTERN = ".{4,50}" ; public static String FIRST_OR_LAST_NAME_PATTERN = ".{1,50}" ; public static String EMAIL_PATTERN = ".{3,320}" ; public static String ORCID_PATTERN = "[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}" ; public static void checkEmailBlackListed ( String email ) throws InvalidUserInputException { } public static void checkEmail ( String email ) throws InvalidUserInputException { } public static void checkValidApplication ( String application ) throws InvalidUserInputException { } public static void checkFirstOrLastName ( String name ) throws InvalidUserInputException { } public static void checkUsername ( String username ) throws InvalidUserInputException { } public static void checkOrcid ( String orcid ) throws InvalidUserInputException { <START_BUG> if ( ( orcid != null ) && ( ! ( Pattern . matches ( UserInputChecker . ORCID_PATTERN , orcid ) ) ) ) { <END_BUG> UserInputChecker . logger . debug ( ( "ORCID<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>match<seq2seq4repair_space>pattern:<seq2seq4repair_space>" + orcid ) ) ; throw new InvalidUserInputException ( "ORCID<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>valid!" ) ; } } public static void checkPassword ( String pw ) throws InvalidUserInputException { } public static void checkCollectionName ( String collName ) throws InvalidUserInputException { } public static void main ( String [ ] args ) { } }

Fix:
if ( ( ( orcid != null ) && ( ! ( orcid . isEmpty ( ) ) ) ) && ( ! ( Pattern . matches ( UserInputChecker . ORCID_PATTERN , orcid ) ) ) ) {
Buggy code:
public class ApplicationSettingsTest extends TestCase { WicketTester tester ; protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } public void testFrameworkVersion ( ) { } public void testExceptionOnMissingResourceDefaultValue ( ) throws Exception { } public void testExceptionOnMissingResourceSetsCorrectly ( ) throws Exception { } public void testUseDefaultOnMissingResourceDefaultValue ( ) throws Exception { } public void testUseDefaultOnMissingResourceSetsCorrectly ( ) throws Exception { } public void testDefaultStringResourceLoaderSetup ( ) { } public void testOverrideStringResourceLoaderSetup ( ) { Application dummy = tester . getApplication ( ) ; Settings settings = new Settings ( dummy ) ; settings . addStringResourceLoader ( new BundleStringResourceLoader ( "wicket.resource.DummyResources" ) ) ; <START_BUG> settings . addStringResourceLoader ( new ComponentStringResourceLoader ( dummy ) ) ; <END_BUG> List loaders = settings . getStringResourceLoaders ( ) ; Assert . assertEquals ( "There<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>2<seq2seq4repair_space>overridden<seq2seq4repair_space>loaders" , 2 , loaders . size ( ) ) ; Assert . assertTrue ( "First<seq2seq4repair_space>loader<seq2seq4repair_space>one<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>the<seq2seq4repair_space>bundle<seq2seq4repair_space>one" , ( ( loaders . get ( 0 ) ) instanceof BundleStringResourceLoader ) ) ; Assert . assertTrue ( "Second<seq2seq4repair_space>loader<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>the<seq2seq4repair_space>component<seq2seq4repair_space>one" , ( ( loaders . get ( 1 ) ) instanceof ComponentStringResourceLoader ) ) ; } public void testLocalizer ( ) { } }

Fix:
settings . addStringResourceLoader ( new ComponentStringResourceLoader ( ) ) ;
Buggy code:
public class SuperConstructorInvocation extends Statement { private Expression optionalExpression = null ; private ASTNode . NodeList arguments = new ASTNode . NodeList ( true , Expression . class ) ; SuperConstructorInvocation ( AST ast ) { } public int getNodeType ( ) { } ASTNode clone ( AST target ) { SuperConstructorInvocation result = new SuperConstructorInvocation ( target ) ; result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <START_BUG> result . setLeadingComment ( getLeadingComment ( ) ) ; <END_BUG> result . setExpression ( ( ( Expression ) ( ASTNode . copySubtree ( target , getExpression ( ) ) ) ) ) ; result . arguments ( ) . addAll ( ASTNode . copySubtrees ( target , arguments ( ) ) ) ; return result ; } public boolean subtreeMatch ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Expression getExpression ( ) { } public void setExpression ( Expression expression ) { } public List arguments ( ) { } public IMethodBinding resolveConstructorBinding ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . copyLeadingComment ( this ) ;
Buggy code:
public class SubProtocolWebSocketHandlerTests { private SubProtocolWebSocketHandler webSocketHandler ; private TestWebSocketSession session ; @ Mock SubProtocolHandler stompHandler ; @ Mock SubProtocolHandler mqttHandler ; @ Mock SubProtocolHandler defaultHandler ; @ Mock MessageChannel inClientChannel ; @ Mock SubscribableChannel outClientChannel ; @ Before public void setup ( ) { } @ Test public void subProtocolMatch ( ) throws Exception { } @ Test public void subProtocolDefaultHandlerOnly ( ) throws Exception { } @ Test ( expected = IllegalStateException . class ) public void subProtocolNoMatch ( ) throws Exception { } @ Test public void nullSubProtocol ( ) throws Exception { } @ Test public void emptySubProtocol ( ) throws Exception { this . session . setAcceptedProtocol ( "" ) ; <START_BUG> this . webSocketHandler . setDefaultProtocolHandler ( defaultHandler ) ; <END_BUG> this . webSocketHandler . afterConnectionEstablished ( session ) ; verify ( this . defaultHandler ) . afterSessionStarted ( isA ( ConcurrentWebSocketSessionDecorator . class ) , eq ( this . inClientChannel ) ) ; verify ( this . stompHandler , times ( 0 ) ) . afterSessionStarted ( session , this . inClientChannel ) ; verify ( this . mqttHandler , times ( 0 ) ) . afterSessionStarted ( session , this . inClientChannel ) ; } @ Test public void noSubProtocolOneHandler ( ) throws Exception { } @ Test ( expected = IllegalStateException . class ) public void noSubProtocolTwoHandlers ( ) throws Exception { } @ Test ( expected = IllegalStateException . class ) public void noSubProtocolNoDefaultHandler ( ) throws Exception { } @ Test public void checkSession ( ) throws Exception { } }

Fix:
this . webSocketHandler . setDefaultProtocolHandler ( this . defaultHandler ) ;
Buggy code:
public class SubSystemAdapter extends DefaultBlockAdapter { private static final String DATE_FORMAT = "EEE<seq2seq4repair_space>MMM<seq2seq4repair_space>dd<seq2seq4repair_space>HH:mm:ss<seq2seq4repair_space>yyyy" ; private static ReferencingImportFilter referencingFilter = new ReferencingImportFilter ( ) ; @ Override public Block getBlock ( Importer traverser ) { } @ Override public void process ( Importer traverser , SimulinkReference parentSimRef , Block blockToProcess ) { } private SimulinkModel traverseReferencedLibrary ( final Importer traverser , String libraryName , MatlabCommandFactory commandFactory , ImportMode importMode ) { Map < String , SimulinkModel > libraryRegistry = traverser . getReferencedLibraries ( ) ; if ( ( libraryRegistry . get ( libraryName ) ) != null ) { return libraryRegistry . get ( libraryName ) ; } ModelObject referencedLibrary = new ModelObject ( libraryName , commandFactory . getCommandEvaluator ( ) ) ; Importer referencedLibraryTraverser = new Importer ( referencedLibrary ) ; <START_BUG> referencedLibraryTraverser . addFilters ( traverser . getFilters ( ) ) ; <END_BUG> referencedLibraryTraverser . getReferencedLibraries ( ) . putAll ( libraryRegistry ) ; Set < String > librariesBeingImported = traverser . getLibrariesBeingImported ( ) ; referencedLibraryTraverser . getLibrariesBeingImported ( ) . addAll ( librariesBeingImported ) ; String referencesFolderPath = ( ( ( traverser . getDefaultSavePath ( ) ) + ( File . separator ) ) + ( traverser . getReferencesFolderName ( ) ) ) + ( Importer . REFERENCES_FOLDER_SUFFIX ) ; String referencedLibPath = ( ( referencesFolderPath + ( File . separator ) ) + libraryName ) + ".simulink" ; SimulinkModel actualLibrary = checkLibrary ( libraryName , commandFactory , referencedLibPath , traverser . getLogger ( ) ) ; if ( actualLibrary == null ) { try { referencedLibraryTraverser . setDefaultSavePath ( traverser . getDefaultSavePath ( ) ) ; referencedLibraryTraverser . setReferencesFolderName ( traverser . getReferencesFolderName ( ) ) ; referencedLibraryTraverser . traverseAndCreateEMFModel ( importMode ) ; actualLibrary = referencedLibraryTraverser . getSimulinkModel ( ) ; } catch ( SimulinkApiException e ) { traverser . getLogger ( ) . error ( ( "Error<seq2seq4repair_space>during<seq2seq4repair_space>importing<seq2seq4repair_space>the<seq2seq4repair_space>library<seq2seq4repair_space>" + libraryName ) , e ) ; } } librariesBeingImported . remove ( libraryName ) ; libraryRegistry . putAll ( referencedLibraryTraverser . getReferencedLibraries ( ) ) ; libraryRegistry . put ( actualLibrary . getSimulinkRef ( ) . getFQN ( ) , actualLibrary ) ; return actualLibrary ; } private SimulinkModel checkLibrary ( String libraryName , MatlabCommandFactory commandFactory , String referencedLibPath , ISimulinkAPILogger logger ) { } }

Fix:
referencedLibraryTraverser . registerFilters ( traverser . getFilters ( ) ) ;
Buggy code:
public class BSFSampler extends BSFTestElement implements Sampler { private static final long serialVersionUID = 240L ; private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String FILENAME = "BSFSampler.filename" ; private static final String SCRIPT = "BSFSampler.query" ; private static final String LANGUAGE = "BSFSampler.language" ; private static final String PARAMETERS = "BSFSampler.parameters" ; public BSFSampler ( ) { } @ Override public String getFilename ( ) { } @ Override public void setFilename ( String newFilename ) { } @ Override public String getScript ( ) { } @ Override public void setScript ( String newScript ) { } @ Override public String getParameters ( ) { } @ Override public void setParameters ( String newScript ) { } @ Override public String getScriptLanguage ( ) { } @ Override public void setScriptLanguage ( String lang ) { } public String getLabel ( ) { } public SampleResult sample ( Entry e ) { final String label = getLabel ( ) ; final String request = getScript ( ) ; final String fileName = getFilename ( ) ; BSFSampler . log . debug ( ( ( label + "<seq2seq4repair_space>" ) + fileName ) ) ; SampleResult res = new SampleResult ( ) ; res . setSampleLabel ( label ) ; FileInputStream is = null ; BSFEngine bsfEngine = null ; BSFManager mgr = new BSFManager ( ) ; res . setResponseCode ( "200" ) ; res . setResponseMessage ( "OK" ) ; res . setSuccessful ( true ) ; res . setDataType ( TEXT ) ; res . sampleStart ( ) ; try { initManager ( mgr ) ; mgr . declareBean ( "SampleResult" , res , res . getClass ( ) ) ; bsfEngine = mgr . loadScriptingEngine ( getScriptLanguage ( ) ) ; Object bsfOut = null ; if ( ( fileName . length ( ) ) > 0 ) { res . setSamplerData ( ( "File:<seq2seq4repair_space>" + fileName ) ) ; is = new FileInputStream ( fileName ) ; bsfOut = bsfEngine . eval ( fileName , 0 , 0 , IOUtils . toString ( is ) ) ; } else { res . setSamplerData ( request ) ; bsfOut = bsfEngine . eval ( "script" , 0 , 0 , request ) ; } if ( bsfOut != null ) { <START_BUG> res . setResponseData ( bsfOut . toString ( ) . getBytes ( ) ) ; <END_BUG> } } catch ( BSFException ex ) { BSFSampler . log . warn ( "BSF<seq2seq4repair_space>error" , ex ) ; res . setSuccessful ( false ) ; res . setResponseCode ( "500" ) ; res . setResponseMessage ( ex . toString ( ) ) ; } catch ( Exception ex ) { BSFSampler . log . warn ( "Problem<seq2seq4repair_space>evaluating<seq2seq4repair_space>the<seq2seq4repair_space>script" , ex ) ; res . setSuccessful ( false ) ; res . setResponseCode ( "500" ) ; res . setResponseMessage ( ex . toString ( ) ) ; } finally { res . sampleEnd ( ) ; IOUtils . closeQuietly ( is ) ; mgr . terminate ( ) ; } return res ; } }

Fix:
res . setResponseData ( bsfOut . toString ( ) , null ) ;
Buggy code:
public class Spat extends gentools { static void GenerateAll ( ) { } static AxoObject Create_pan ( ) { } static AxoObject Create_pantilde ( ) { } static AxoObject Create_panm ( ) { } static AxoObject Create_panmtilde ( ) { AxoObject o = new AxoObject ( "pan<seq2seq4repair_space>m" , "stereo<seq2seq4repair_space>balance<seq2seq4repair_space>(panorama)<seq2seq4repair_space>with<seq2seq4repair_space>modulation<seq2seq4repair_space>input" ) ; o . inlets . add ( new InletFrac32Buffer ( "i1" , "input" ) ) ; o . inlets . add ( new InletFrac32 ( "c" , "pan<seq2seq4repair_space>control" ) ) ; o . outlets . add ( new OutletFrac32Buffer ( "left" , "output" ) ) ; o . outlets . add ( new OutletFrac32Buffer ( "right" , "output" ) ) ; <START_BUG> o . sSRateCode = "%left%<seq2seq4repair_space>=<seq2seq4repair_space>___SMMUL((1<<29)-(c<<2),%i1%)<<2;" + "%right%<seq2seq4repair_space>=<seq2seq4repair_space>___SMMUL((1<<29)+(%c%<<2),%i1%)<<2;" ; <END_BUG> return o ; } }

Fix:
o . sSRateCode = "%left%<seq2seq4repair_space>=<seq2seq4repair_space>___SMMUL((1<<29)-(%c%<<2),%i1%)<<2;" + "%right%<seq2seq4repair_space>=<seq2seq4repair_space>___SMMUL((1<<29)+(%c%<<2),%i1%)<<2;" ;
Buggy code:
public class FriendFoodBoxItemListAdapter extends FirebaseListAdapter < FoodBoxItem > { String userNameToExclude ; public FriendFoodBoxItemListAdapter ( Query mRef , Activity activity , int layout , String aInUserNameToExclude ) { } @ Override protected void populateView ( View v , FoodBoxItem item , String key ) { String userName = item . getUserName ( ) ; String itemName = item . getFoodName ( ) ; Date expiryDate = new Date ( item . getExpirationDate ( ) ) ; v . setVisibility ( VISIBLE ) ; String expiryDateFormatted = expiryDateDisplay . format ( expiryDate ) ; long daysAway = ( ( expiryDate . getTime ( ) ) - ( System . currentTimeMillis ( ) ) ) // ( ( ( 24 * 60 ) * 60 ) * 1000 ) ; TextView friendNameView = ( ( TextView ) ( v . findViewById ( friend_friendName ) ) ) ; friendNameView . setText ( userName ) ; TextView itemNameView = ( ( TextView ) ( v . findViewById ( friend_foodName ) ) ) ; itemNameView . setText ( itemName ) ; TextView expiryDateView = ( ( TextView ) ( v . findViewById ( friend_expirationDate ) ) ) ; if ( daysAway == 0 ) { expiryDateView . setText ( String . format ( "%s<seq2seq4repair_space>(today!)" , expiryDateFormatted ) ) ; } else if ( daysAway == 1 ) { expiryDateView . setText ( String . format ( "%s<seq2seq4repair_space>(%d<seq2seq4repair_space>day)" , expiryDateFormatted , daysAway ) ) ; } else { expiryDateView . setText ( String . format ( "%s<seq2seq4repair_space>(%d<seq2seq4repair_space>days)" , expiryDateFormatted , daysAway ) ) ; } TextView itemKey = ( ( TextView ) ( v . findViewById ( friend_itemKey ) ) ) ; itemKey . setText ( key ) ; v . setVisibility ( VISIBLE ) ; v . setLayoutParams ( new AbsListView . LayoutParams ( ( - 1 ) , ( - 2 ) ) ) ; <START_BUG> if ( ! ( item . getIsPublic ( ) ) ) { <END_BUG> v . setVisibility ( GONE ) ; v . setLayoutParams ( new AbsListView . LayoutParams ( ( - 1 ) , 1 ) ) ; } } }

Fix:
if ( userName . equals ( userNameToExclude ) ) {
Buggy code:
public class BeadActivity extends Activity { ImageView mImageView ; private final String TAG = "BeadStore" ; private BeadBaseAdapter mAdapter ; private ArrayList < String > history ; private final String KEY = this . getClass ( ) . getName ( ) ; ListView listView ; @ Override protected void onCreate ( Bundle savedInstanceState ) { Log . i ( TAG , "on<seq2seq4repair_space>create" ) ; super . onCreate ( savedInstanceState ) ; setContentView ( bead_search ) ; final ArrayList < BeadInfo > beadInfoBunch = new ArrayList < BeadInfo > ( ) ; View header = ( ( View ) ( getLayoutInflater ( ) . inflate ( bead_list_header , null ) ) ) ; listView = ( ( ListView ) ( findViewById ( list ) ) ) ; listView . addHeaderView ( header ) ; mAdapter = new BeadBaseAdapter ( this . getApplicationContext ( ) , beadInfoBunch ) ; beadInfoBunch . add ( 0 , new BeadInfo ( "00100" ) ) ; beadInfoBunch . add ( 0 , new BeadInfo ( "abc" ) ) ; beadInfoBunch . add ( 0 , new BeadInfo ( "10050-1" ) ) ; beadInfoBunch . add ( 0 , new BeadInfo ( "38135" ) ) ; mAdapter . notifyDataSetChanged ( ) ; listView . setAdapter ( mAdapter ) ; Button btn = ( ( Button ) ( findViewById ( btnBeadFind ) ) ) ; btn . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { InputMethodManager imm = ( ( InputMethodManager ) ( getSystemService ( INPUT_METHOD_SERVICE ) ) ) ; imm . hideSoftInputFromWindow ( v . getWindowToken ( ) , 0 ) ; if ( ( mAdapter ) != null ) { EditText inputField = ( ( EditText ) ( findViewById ( beadColor ) ) ) ; String colorCode = inputField . getEditableText ( ) . toString ( ) . trim ( ) ; String colorCodeSanitized = Bead . canonicalColorCode ( colorCode ) ; if ( ! ( colorCodeSanitized . isEmpty ( ) ) ) { Log . i ( TAG , ( "Inserting<seq2seq4repair_space>" + colorCodeSanitized ) ) ; <START_BUG> beadInfoBunch . add ( 0 , new BeadInfo ( colorCodeSanitized ) ) ; <END_BUG> mAdapter . notifyDataSetChanged ( ) ; saveIntoHistory ( colorCodeSanitized ) ; } inputField . getEditableText ( ) . clear ( ) ; } } } ) ; } private void saveIntoHistory ( String s ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override protected void onStart ( ) { } @ Override protected void onRestart ( ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onRestoreInstanceState ( Bundle b ) { } @ Override protected void onStop ( ) { } @ Override protected void onDestroy ( ) { } @ Override public void onSaveInstanceState ( Bundle outState ) { } }

Fix:
beadInfoBunch . add ( new BeadInfo ( colorCodeSanitized ) ) ;
Buggy code:
public class GLSMultipleLinearRegressionTest extends MultipleLinearRegressionAbstractTest { private double [ ] y ; private double [ ] [ ] x ; private double [ ] [ ] omega ; @ Before public void setUp ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void cannotAddXSampleData ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void cannotAddNullYSampleData ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void cannotAddSampleDataWithSizeMismatch ( ) { } <START_BUG> @ Test ( expected = ArrayIndexOutOfBoundsException . class ) <END_BUG> public void cannotAddNullCovarianceData ( ) { createRegression ( ) . newSampleData ( new double [ ] { } , new double [ ] [ ] { } , null ) ; } @ Test ( expected = IllegalArgumentException . class ) public void cannotAddCovarianceDataWithSampleSizeMismatch ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void cannotAddCovarianceDataThatIsNotSquare ( ) { } protected GLSMultipleLinearRegression createRegression ( ) { } protected int getNumberOfRegressors ( ) { } protected int getSampleSize ( ) { } }

Fix:
@ Test ( expected = IllegalArgumentException . class )
Buggy code:
public class Text extends Scrollable { boolean doubleClick ; public static final int LIMIT ; public static final String DELIMITER ; public Text ( Composite parent , int style ) { } public void addModifyListener ( ModifyListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } public void addVerifyListener ( VerifyListener listener ) { } public void append ( String string ) { } static int checkStyle ( int style ) { } public void clearSelection ( ) { } public void copy ( ) { } void createHandle ( ) { } void createWidget ( ) { } public void cut ( ) { } public int getCaretLineNumber ( ) { } public Point getCaretLocation ( ) { } public int getCaretPosition ( ) { } public int getCharCount ( ) { } public boolean getDoubleClickEnabled ( ) { } public char getEchoChar ( ) { } public boolean getEditable ( ) { } public int getLineCount ( ) { } public String getLineDelimiter ( ) { } public int getLineHeight ( ) { } public int getOrientation ( ) { } public Point getSelection ( ) { } public int getSelectionCount ( ) { } public String getSelectionText ( ) { } public int getTabs ( ) { } public String getText ( ) { } public String getText ( int start , int end ) { } public int getTextLimit ( ) { } public int getTopIndex ( ) { } public int getTopPixel ( ) { } void HandleKeyDown ( int sender , int e ) { super . HandleKeyDown ( sender , e ) ; <START_BUG> if ( isDisposed ( ) ) <END_BUG> return ; if ( ( ( style ) & ( SWT . SINGLE ) ) != 0 ) { int key = OS . KeyEventArgs_Key ( e ) ; if ( key == ( OS . Key_Return ) ) postEvent ( DefaultSelection ) ; } } void HandlePreviewExecutedRoutedEvent ( int sender , int e ) { } void HandlePreviewTextInput ( int sender , int e ) { } void HandleTextChanged ( int sender , int e ) { } void hookEvents ( ) { } public void insert ( String string ) { } public void paste ( ) { } public void removeModifyListener ( ModifyListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void removeVerifyListener ( VerifyListener listener ) { } public void selectAll ( ) { } public void setDoubleClickEnabled ( boolean doubleClick ) { } public void setEchoChar ( char echo ) { } public void setEditable ( boolean editable ) { } void setFont ( int font , double size ) { } public void setOrientation ( int orientation ) { } public void setSelection ( int start ) { } public void setSelection ( int start , int end ) { } public void setSelection ( Point selection ) { } public void setTabs ( int tabs ) { } public void setText ( String string ) { } public void setTextLimit ( int limit ) { } public void setTopIndex ( int index ) { } public void showSelection ( ) { } int traversalCode ( int key , int event ) { } String verifyText ( String text ) { } }

Fix:
if ( ! ( checkEvent ( e ) ) )
Buggy code:
public final class HttpHelper { private static final Logger LOG = LoggerFactory . getLogger ( HttpHelper . class ) ; private HttpHelper ( ) { } @ SuppressWarnings ( "deprecation" ) public static void setCharsetFromContentType ( String contentType , Exchange exchange ) { } public static String getCharsetFromContentType ( String contentType ) { } public static void writeObjectToServletResponse ( ServletResponse response , Object target ) throws IOException { } public static void writeObjectToStream ( OutputStream stream , Object target ) throws IOException { } public static Object deserializeJavaObjectFromStream ( InputStream is ) throws IOException , ClassNotFoundException { } public static Object readResponseBodyFromServletRequest ( HttpServletRequest request , Exchange exchange ) throws IOException { } public static Object readResponseBodyFromInputStream ( InputStream is , Exchange exchange ) throws IOException { } public static String createURL ( Exchange exchange , HttpEndpoint endpoint ) { } public static URI createURI ( Exchange exchange , String url , HttpEndpoint endpoint ) throws URISyntaxException { URI uri = new URI ( url ) ; String queryString = exchange . getIn ( ) . getHeader ( HTTP_QUERY , String . class ) ; if ( queryString == null ) { queryString = endpoint . getHttpUri ( ) . getRawQuery ( ) ; } if ( queryString == null ) { <START_BUG> queryString = uri . getQuery ( ) ; <END_BUG> } if ( queryString != null ) { queryString = UnsafeUriCharactersEncoder . encodeHttpURI ( queryString ) ; uri = URISupport . createURIWithQuery ( uri , queryString ) ; } return uri ; } public static HttpMethods createMethod ( Exchange exchange , HttpEndpoint endpoint , boolean hasPayload ) throws URISyntaxException { } @ SuppressWarnings ( "unchecked" ) public static void appendHeader ( Map < String , Object > headers , String key , Object value ) { } public static Object extractHttpParameterValue ( String value ) { } public static String urlRewrite ( Exchange exchange , String url , HttpEndpoint endpoint , Producer producer ) throws Exception { } }

Fix:
queryString = uri . getRawQuery ( ) ;
Buggy code:
@ RestController public class ResetPasswordController { @ Autowired private LoginDAO loginDao ; @ RequestMapping ( value = "//lostPassword" , method = RequestMethod . POST ) public ModelAndView lostPassword ( @ RequestParam ( "email" ) String email , @ RequestParam ( "username" ) String username , HttpServletRequest request ) { ModelAndView mav = new ModelAndView ( ) ; int flag = 0 ; User user = loginDao . getUser ( username , flag ) ; if ( user == null ) { <START_BUG> mav . setViewName ( "redirect:login?error=invalidUser" ) ; <END_BUG> } else if ( ! ( user . getEmail ( ) . equals ( email ) ) ) { mav . setViewName ( "redirect:login?passwordemail" ) ; } else { String token = UUID . randomUUID ( ) . toString ( ) ; String url = ( ( ( "https:////" + ( request . getServerName ( ) ) ) + ":" ) + ( request . getServerPort ( ) ) ) + ( request . getContextPath ( ) ) ; String tokenUrl = ( ( ( url + "//changePassword?username=" ) + ( user . getUserName ( ) ) ) + "&token=" ) + token ; user . setToken ( token ) ; loginDao . updateUser ( user ) ; MailClient mailClient = new MailClient ( ) ; String receiver = user . getEmail ( ) ; String msg = ( "To<seq2seq4repair_space>reset<seq2seq4repair_space>your<seq2seq4repair_space>password<seq2seq4repair_space>on<seq2seq4repair_space>Student<seq2seq4repair_space>Capture,<seq2seq4repair_space>please<seq2seq4repair_space>" + "follow<seq2seq4repair_space>this<seq2seq4repair_space>link:\n" ) + tokenUrl ; mailClient . send ( receiver , "studentcapture@cs.umu.se" , "Reset<seq2seq4repair_space>Password" , msg ) ; mav . setViewName ( "redirect:login?passwordemail" ) ; } return mav ; } @ RequestMapping ( value = "//changePassword" , method = RequestMethod . POST ) public ModelAndView resetPassword ( @ RequestParam ( "username" ) String username , @ RequestParam ( "token" ) String token , @ RequestParam ( "password" ) String password ) { } private String encryptPassword ( String password ) { } }

Fix:
mav . setViewName ( "redirect:login?error=invaliduser" ) ;
Buggy code:
public class MParse extends AbstractMetamataTask { private File target = null ; private boolean verbose = false ; private boolean debugparser = false ; private boolean debugscanner = false ; private boolean cleanup = false ; public void setTarget ( File target ) { } public void setVerbose ( boolean flag ) { } public void setDebugscanner ( boolean flag ) { } public void setDebugparser ( boolean flag ) { } public void setCleanup ( boolean value ) { } public MParse ( ) { } public void execute ( ) throws BuildException { } protected ExecuteStreamHandler createStreamHandler ( ) { } protected void setUp ( ) throws BuildException { } protected void _execute ( ExecuteStreamHandler handler ) throws BuildException { String pathname = target . getAbsolutePath ( ) ; int pos = ( pathname . length ( ) ) - ( ".jj" . length ( ) ) ; pathname = ( pathname . substring ( 0 , pos ) ) + ".java" ; File javaFile = new File ( pathname ) ; if ( ( javaFile . exists ( ) ) && ( ( target . lastModified ( ) ) < ( javaFile . lastModified ( ) ) ) ) { getProject ( ) . log ( ( ( "Target<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>build<seq2seq4repair_space>-<seq2seq4repair_space>skipping<seq2seq4repair_space>(" + ( target ) ) + ")" ) ) ; return ; } final Execute process = new Execute ( handler ) ; log ( cmdl . describeCommand ( ) , MSG_VERBOSE ) ; process . setCommandline ( cmdl . getCommandline ( ) ) ; try { <START_BUG> if ( ( process . execute ( ) ) != 0 ) { <END_BUG> throw new BuildException ( "Metamata<seq2seq4repair_space>task<seq2seq4repair_space>failed." ) ; } } catch ( IOException e ) { throw new BuildException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>launch<seq2seq4repair_space>Metamata<seq2seq4repair_space>task:<seq2seq4repair_space>" , e ) ; } } protected void cleanUp ( ) { } protected File [ ] getMetamataLibs ( ) { } protected void checkOptions ( ) throws BuildException { } protected Vector getOptions ( ) { } protected void generateOptionsFile ( File tofile , String [ ] options ) throws BuildException { } }

Fix:
if ( Execute . isFailure ( process . execute ( ) ) ) {
Buggy code:
public class EvaluationContextWrapper implements IEvaluationContext { protected EvaluationContext context ; protected JavaProject project ; public EvaluationContextWrapper ( EvaluationContext context , JavaProject project ) { } public IGlobalVariable [ ] allVariables ( ) { } protected void checkBuilderState ( ) throws JavaModelException { } public void codeComplete ( String codeSnippet , int position , ICompletionRequestor requestor ) throws JavaModelException { } public IJavaElement [ ] codeSelect ( String codeSnippet , int offset , int length ) throws JavaModelException { } public void deleteVariable ( IGlobalVariable variable ) { } public void evaluateCodeSnippet ( String codeSnippet , String [ ] localVariableTypeNames , String [ ] localVariableNames , int [ ] localVariableModifiers , IType declaringType , boolean isStatic , boolean isConstructorCall , ICodeSnippetRequestor requestor , IProgressMonitor progressMonitor ) throws JavaModelException { } public void evaluateCodeSnippet ( String codeSnippet , ICodeSnippetRequestor requestor , IProgressMonitor progressMonitor ) throws JavaModelException { } public void evaluateVariable ( IGlobalVariable variable , ICodeSnippetRequestor requestor , IProgressMonitor progressMonitor ) throws JavaModelException { } protected INameEnvironment getBuildNameEnvironment ( ) throws JavaModelException { if ( USING_NEW_BUILDER ) { <START_BUG> return new NameEnvironment ( getProject ( ) , false ) ; <END_BUG> } else { IProject project = getProject ( ) . getProject ( ) ; StateImpl state = ( ( StateImpl ) ( JavaModelManager . getJavaModelManager ( ) . getLastBuiltState ( project , null ) ) ) ; if ( state == null ) return null ; BuilderEnvironment env = new BuilderEnvironment ( new org . eclipse . jdt . internal . core . builder . impl . BatchImageBuilder ( state ) ) ; IPackage defaultPackage = state . getDevelopmentContext ( ) . getImage ( ) . getPackageHandle ( ( ( PackageImpl . DEFAULT_PACKAGE_PREFIX ) + ( project . getName ( ) ) ) , true ) ; env . setDefaultPackage ( defaultPackage ) ; return env ; } } public String [ ] getImports ( ) { } public EvaluationContext getInfrastructureEvaluationContext ( ) { } protected IRequestor getInfrastructureEvaluationRequestor ( ICodeSnippetRequestor requestor ) { } public String getPackageName ( ) { } protected IProblemFactory getProblemFactory ( ) throws JavaModelException { } public IJavaProject getProject ( ) { } protected void handleInstallException ( InstallException e ) throws JavaModelException { } public IGlobalVariable newVariable ( String typeName , String name , String initializer ) { } public void setImports ( String [ ] imports ) { } public void setPackageName ( String packageName ) { } public void validateImports ( ICodeSnippetRequestor requestor ) throws JavaModelException { } public void codeComplete ( String codeSnippet , int position , final ICodeCompletionRequestor requestor ) throws JavaModelException { } }

Fix:
return new NameEnvironment ( getProject ( ) ) ;
Buggy code:
public class AbstractFolderTst extends TestCase { protected AbstractMessageFolder sourceFolder ; protected AbstractMessageFolder destFolder ; private Set folders ; private static int folderId = 0 ; private MailboxTstFactory factory ; public AbstractFolderTst ( String test ) { } public AbstractFolderTst ( MailboxTstFactory factory , String test ) { } protected void setUp ( ) throws Exception { File file = new File ( "test_config" ) ; file . mkdir ( ) ; new Config ( file ) ; Logging . DEBUG = true ; Logging . createDefaultHandler ( ) ; new MailMain ( ) . init ( ) ; new AddressbookMain ( ) . init ( ) ; <START_BUG> PluginManager . getInstance ( ) . initCorePlugins ( ) ; <END_BUG> folders = new HashSet ( ) ; sourceFolder = factory . createFolder ( ( ( AbstractFolderTst . folderId ) ++ ) ) ; folders . add ( sourceFolder ) ; destFolder = factory . createFolder ( ( ( AbstractFolderTst . folderId ) ++ ) ) ; folders . add ( destFolder ) ; } public AbstractMessageFolder createFolder ( ) { } protected void tearDown ( ) throws Exception { } public AbstractMessageFolder getSourceFolder ( ) { } public AbstractMessageFolder getDestFolder ( ) { } }

Fix:
PluginManager . getInstance ( ) . initExternalPlugins ( ) ;
Buggy code:
class LatencyMonitor extends UntypedActor { private static class Probe implements Serializable { private static final long serialVersionUID = 1L ; final long id ; final long now ; Probe ( long id ) { } } private ActorRef operator ; private ActorRef inputRouter ; private ActorRef subOperator ; private final int probePeriod ; private final int reactionTime ; private class Probes { private boolean [ ] probes ; private int queueSize ; private long oldestId = 0 ; private long newestId = 0 ; Probes ( int size ) { } void fill ( LatencyMonitor . Probe probe ) { } boolean timeout ( ) { <START_BUG> if ( ( ( newestId ) - ( oldestId ) ) <= ( queueSize ) ) <END_BUG> return false ; assert ( ( newestId ) - ( oldestId ) ) == ( queueSize ) ; return ! ( probes [ id ( ( ( oldestId ) ++ ) ) ] ) ; } LatencyMonitor . Probe newProbe ( ) { } void clear ( ) { } private int id ( long longId ) { } } private LatencyMonitor . Probes probes ; private static final String INVOKE = "INVOKE" ; private static final String TICK = "TICK" ; private Cancellable timer ; private int timeoutTime = 0 ; private Logger logger ; static Props props ( final ActorRef operator , final Bolt bolt ) { } static void invoke ( ActorRef latencyMonitor , ActorContext context ) { } static boolean isProbe ( Object msg ) { } LatencyMonitor ( ActorRef operator , Bolt bolt ) { } private Procedure < Object > SUSPEND = new Procedure < Object > ( ) { @ Override public void apply ( Object msg ) { } } ; @ Override public void onReceive ( Object msg ) throws Exception { } @ Override public void postStop ( ) { } }

Fix:
if ( ( ( newestId ) - ( oldestId ) ) < ( queueSize ) )
Buggy code:
class ProgressFloatingWindow extends AssociatedWindow { ProgressViewer viewer ; WorkbenchWindow window ; final int borderSize = 1 ; ProgressFloatingWindow ( WorkbenchWindow workbenchWindow , Control associatedControl ) { } protected Layout getLayout ( ) { } protected void configureShell ( Shell newShell ) { } protected Control createContents ( Composite root ) { <START_BUG> viewer = new ProgressViewer ( root , SWT . NONE , 5 ) { <END_BUG> protected void doUpdateItem ( Widget widget , Object element , boolean fullMap ) { super . doUpdateItem ( widget , element , fullMap ) ; moveShell ( getShell ( ) , ALWAYS_VISIBLE ) ; } } ; viewer . setUseHashlookup ( true ) ; viewer . setSorter ( ProgressManagerUtil . getProgressViewerSorter ( ) ) ; Control control = viewer . getControl ( ) ; setBackground ( control ) ; FormData tableData = new FormData ( ) ; tableData . left = new FormAttachment ( 0 ) ; tableData . right = new FormAttachment ( 100 ) ; tableData . top = new FormAttachment ( 0 ) ; tableData . bottom = new FormAttachment ( 100 ) ; Point preferredSize = viewer . getSizeHints ( ) ; tableData . width = preferredSize . x ; tableData . height = preferredSize . y ; viewer . getControl ( ) . setLayoutData ( tableData ) ; initContentProvider ( ) ; viewer . setLabelProvider ( viewerLabelProvider ( ) ) ; root . addListener ( Traverse , new Listener ( ) { public void handleEvent ( Event event ) { if ( ( event . detail ) == ( SWT . TRAVERSE_ESCAPE ) ) { event . doit = false ; } } } ) ; return viewer . getControl ( ) ; } private LabelProvider viewerLabelProvider ( ) { } protected void initContentProvider ( ) { } public int open ( ) { } private void setBackground ( Control control ) { } }

Fix:
viewer = new ProgressViewer ( root , SWT . NONE , 5 , 72 ) {
Buggy code:
public class UMLIncludeBaseComboBoxModel extends UMLComboBoxModel2 { public UMLIncludeBaseComboBoxModel ( ) { } protected void buildModelList ( ) { } protected Object getSelectedModelElement ( ) { } <START_BUG> protected boolean isValidElement ( MBase element ) { <END_BUG> return ( element instanceof MUseCase ) && ( ( ( ( MUseCase ) ( element ) ) . getNamespace ( ) ) == ( ( ( ru . novosoft . uml . behavior . use_cases . MInclude ) ( getTarget ( ) ) ) . getNamespace ( ) ) ) ; } }

Fix:
protected boolean isValidElement ( Object element ) {
Buggy code:
public class SiriXmlSerializer { private JAXBContext context = null ; public SiriXmlSerializer ( ) { } public String getXml ( Siri siri ) throws Exception { Marshaller marshaller = context . createMarshaller ( ) ; <START_BUG> marshaller . setProperty ( Marshaller . JAXB_FORMATTED_OUTPUT , true ) ; <END_BUG> marshaller . setEventHandler ( new ValidationEventHandler ( ) { public boolean handleEvent ( ValidationEvent event ) { throw new RuntimeException ( event . getMessage ( ) , event . getLinkedException ( ) ) ; } } ) ; DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; dbf . setNamespaceAware ( true ) ; Writer output = new StringWriter ( ) ; marshaller . marshal ( siri , output ) ; String outputAsString = output . toString ( ) ; outputAsString = outputAsString . replaceAll ( "<ns5:" , "<" ) ; outputAsString = outputAsString . replaceAll ( "<//ns5:" , "<//" ) ; outputAsString = outputAsString . replaceAll ( "xmlns:ns5" , "xmlns" ) ; outputAsString = outputAsString . replaceAll ( "<siriExtensionWrapper>" , "" ) ; outputAsString = outputAsString . replaceAll ( "<//siriExtensionWrapper>" , "" ) ; return outputAsString ; } public Siri fromXml ( String xml ) throws JAXBException { } No newline ; at end ; of file ; }

Fix:
marshaller . setProperty ( Marshaller . JAXB_FORMATTED_OUTPUT , false ) ;
Buggy code:
public class LoginContinued extends SherlockActivity { TextView createAccount ; Spinner education ; Spinner experience ; Spinner confidence_plant ; Spinner confidence_wavyleaf ; @ Override protected void onCreate ( Bundle bundle ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } protected void init ( ) { } protected void submit ( ) { } protected void uploadData ( ) { JSONObject json = new JSONObject ( ) ; try { SharedPreferences sp = PreferenceManager . getDefaultSharedPreferences ( getBaseContext ( ) ) ; json . put ( ARG_NAME , sp . getString ( KEY_NAME , "null" ) ) ; json . put ( ARG_BIRTH_YEAR , sp . getString ( KEY_BIRTHYEAR , "null" ) ) ; json . put ( ARG_EDUCATION , education . getSelectedItem ( ) ) ; json . put ( ARG_OUTDOOR_EXPERIENCE , experience . getSelectedItem ( ) ) ; json . put ( ARG_GENERAL_PLANT_ID , confidence_plant . getSelectedItem ( ) ) ; json . put ( ARG_WAVYLEAF_ID , confidence_wavyleaf . getSelectedItem ( ) ) ; json . put ( ARG_EMAIL , sp . getString ( KEY_EMAIL , "null" ) ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } <START_BUG> new UploadData ( this , UploadData . TASK_SUBMIT_USER ) . execute ( json ) ; <END_BUG> } }

Fix:
new UploadData ( this , Task . SUBMIT_USER ) . execute ( json ) ;
Buggy code:
public abstract class ChangeClasspathOperation extends JavaModelOperation { protected boolean canChangeResources ; public ChangeClasspathOperation ( IJavaElement [ ] elements , boolean canChangeResources ) { } protected boolean canModifyRoots ( ) { } protected void classpathChanged ( ClasspathChange change ) throws JavaModelException { JavaProject project = change . project ; project . resetCaches ( ) ; if ( this . canChangeResources ) { if ( ( isTopLevelOperation ( ) ) && ( ! ( ResourcesPlugin . getWorkspace ( ) . isTreeLocked ( ) ) ) ) { new ClasspathValidation ( project ) . validate ( ) ; } new ProjectReferenceChange ( project , change . oldResolvedClasspath ) . updateProjectReferencesIfNecessary ( ) ; new ExternalFolderChange ( project , change . oldResolvedClasspath ) . updateExternalFoldersIfNecessary ( true , null ) ; } else { DeltaProcessingState state = JavaModelManager . getDeltaState ( ) ; JavaElementDelta delta = new JavaElementDelta ( getJavaModel ( ) ) ; <START_BUG> int result = change . generateDelta ( delta ) ; <END_BUG> if ( ( result & ( ClasspathChange . HAS_DELTA ) ) != 0 ) { addDelta ( delta ) ; state . rootsAreStale = true ; change . requestIndexing ( ) ; state . addClasspathValidation ( project ) ; } if ( ( result & ( ClasspathChange . HAS_PROJECT_CHANGE ) ) != 0 ) { state . addProjectReferenceChange ( project , change . oldResolvedClasspath ) ; } if ( ( result & ( ClasspathChange . HAS_LIBRARY_CHANGE ) ) != 0 ) { state . addExternalFolderChange ( project , change . oldResolvedClasspath ) ; } } } protected ISchedulingRule getSchedulingRule ( ) { } public boolean isReadOnly ( ) { } }

Fix:
int result = change . generateDelta ( delta , true ) ;
Buggy code:
public class WriteSpearmanFromRandom { private static final File KMER_DIST_DIRECTORY = new File ( "//nobackup//afodor_research//af_broad//randomKMerMatrices" ) ; public static final int EXPECTED_NUM_LINES = 340 ; private static List < Float > getValsOrNull ( File f ) throws Exception { List < Float > vals = new ArrayList < Float > ( ) ; BufferedReader reader = new BufferedReader ( new FileReader ( f ) ) ; reader . readLine ( ) ; int numRead = 0 ; for ( String s = reader . readLine ( ) ; s != null ; s = reader . readLine ( ) ) { StringTokenizer sToken = new StringTokenizer ( s ) ; sToken . nextToken ( ) ; while ( sToken . hasMoreTokens ( ) ) vals . add ( Float . parseFloat ( sToken . nextToken ( ) ) ) ; numRead ++ ; } reader . close ( ) ; <START_BUG> if ( numRead != ( WriteSpearmanFromRandom . EXPECTED_NUM_LINES ) ) { <END_BUG> System . out . println ( ( ( numRead + "<seq2seq4repair_space>skipping<seq2seq4repair_space>" ) + ( f . getAbsolutePath ( ) ) ) ) ; return null ; } return vals ; } public static void main ( String [ ] args ) throws Exception { } No newline ; at end ; of file ; }

Fix:
if ( numRead != ( ( WriteSpearmanFromRandom . EXPECTED_NUM_LINES ) - 1 ) ) {