nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TestCustomNorms extends LuceneTestCase { final String floatTestField = "normsTestFloat" ; final String exceptionTestField = "normsTestExcp" ; public void testFloatNorms ( ) throws IOException { Directory dir = newDirectory ( ) ; IndexWriterConfig config = newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) ; Similarity provider = new TestCustomNorms . MySimProvider ( ) ; config . setSimilarity ( provider ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , dir , config ) ; final LineFileDocs docs = new LineFileDocs ( random ( ) ) ; int num = atLeast ( 100 ) ; for ( int i = 0 ; i < num ; i ++ ) { Document doc = docs . nextDoc ( ) ; float nextFloat = random ( ) . nextFloat ( ) ; Field f = new org . apache . lucene . document . TextField ( floatTestField , ( "" + nextFloat ) , Store . YES ) ; f . setBoost ( nextFloat ) ; doc . add ( f ) ; writer . addDocument ( doc ) ; doc . removeField ( floatTestField ) ; if ( rarely ( ) ) { writer . commit ( ) ; } } writer . commit ( ) ; writer . close ( ) ; AtomicReader open = SlowCompositeReaderWrapper . wrap ( DirectoryReader . open ( dir ) ) ; <START_BUG> NumericDocValues norms = open . simpleNormValues ( floatTestField ) ; <END_BUG> assertNotNull ( norms ) ; for ( int i = 0 ; i < ( open . maxDoc ( ) ) ; i ++ ) { StoredDocument document = open . document ( i ) ; float expected = Float . parseFloat ( document . get ( floatTestField ) ) ; assertEquals ( expected , Float . intBitsToFloat ( ( ( int ) ( norms . get ( i ) ) ) ) , 0.0F ) ; } open . close ( ) ; dir . close ( ) ; docs . close ( ) ; } public class MySimProvider extends PerFieldSimilarityWrapper { Similarity delegate = new DefaultSimilarity ( ) ; @ Override public float queryNorm ( float sumOfSquaredWeights ) { } @ Override public Similarity get ( String field ) { } @ Override public float coord ( int overlap , int maxOverlap ) { } } public static class FloatEncodingBoostSimilarity extends Similarity { @ Override public long computeNorm ( FieldInvertState state ) { } @ Override public SimWeight computeWeight ( float queryBoost , CollectionStatistics collectionStats , TermStatistics ... termStats ) { } @ Override public ExactSimScorer exactSimScorer ( SimWeight weight , AtomicReaderContext context ) throws IOException { } @ Override public SloppySimScorer sloppySimScorer ( SimWeight weight , AtomicReaderContext context ) throws IOException { } } }

Fix:
NumericDocValues norms = open . getNormValues ( floatTestField ) ;
Buggy code:
public class Remove implements Command { private static Set commands = new HashSet ( ) ; public Remove ( ) { } public Set getActionNames ( ) { } public void doAction ( ActionEvent e ) { } public static void removeNode ( JMeterTreeNode node ) { GuiPackage . getInstance ( ) . getTreeModel ( ) . removeNodeFromParent ( node ) ; <START_BUG> GuiPackage . getInstance ( ) . removeNode ( node . createTestElement ( ) ) ; <END_BUG> } }

Fix:
GuiPackage . getInstance ( ) . removeNode ( node . getTestElement ( ) ) ;
Buggy code:
public class SceneSelectorScene extends Scene { public static final SceneID ID = SceneID . SCENESELECTOR ; private static final int MARGIN = 20 ; private List < Button > buttons ; private Player player ; public SceneSelectorScene ( Player player ) { } @ Override public void init ( GameContainer container , StateBasedGame game ) throws SlickException { } @ Override public void update ( GameContainer container , StateBasedGame game , int delta ) throws SlickException { } private class ButtonListener implements ComponentListener { @ Override public void componentActivated ( AbstractComponent component ) { } private void warnBecauseNoParty ( ) { } } public Party makeRandomParty ( ) { Random random = new Random ( ) ; ArrayList < Person > people = new ArrayList < Person > ( ) ; people . add ( new Person ( "Alice" ) ) ; people . add ( new Person ( "Bob" ) ) ; people . add ( new Person ( "Carl" ) ) ; people . add ( new Person ( "Diane" ) ) ; for ( Person person : people ) { ArrayList < Person . Skill > personSkill = new ArrayList < Person . Skill > ( ) ; person . setProfession ( Profession . values ( ) [ random . nextInt ( Profession . values ( ) . length ) ] ) ; int skillPoints = 0 ; Person . Skill tempSkill = Skill . values ( ) [ random . nextInt ( Skill . values ( ) . length ) ] ; while ( ( ( tempSkill != ( Skill . NONE ) ) && ( ( personSkill . size ( ) ) < 3 ) ) && ( ( skillPoints + ( tempSkill . getCost ( ) ) ) < 120 ) ) { if ( ! ( personSkill . contains ( tempSkill ) ) ) { personSkill . add ( tempSkill ) ; skillPoints += tempSkill . getCost ( ) ; } tempSkill = Skill . values ( ) [ random . nextInt ( Skill . values ( ) . length ) ] ; } for ( Person . Skill skill : personSkill ) { person . addSkill ( skill ) ; } addRandomItems ( person ) ; person . decreaseHealth ( random . nextInt ( 100 ) ) ; } Vehicle vehicle = new Wagon ( ) ; addRandomItems ( vehicle ) ; List < Animal > animalList = new ArrayList < Animal > ( ) ; for ( int i = 0 ; i < 4 ; i ++ ) { Animal animal = new Animal ( ITEM_TYPE . OX ) ; animalList . add ( animal ) ; } Party . Pace pace = Pace . values ( ) [ random . nextInt ( Pace . values ( ) . length ) ] ; Party . Rations rations = Rations . values ( ) [ random . nextInt ( Rations . values ( ) . length ) ] ; Party party = new Party ( pace , rations , people ) ; party . setVehicle ( vehicle ) ; <START_BUG> party . addAnimals ( animal ) ; <END_BUG> return party ; } public void addRandomItems ( Inventoried inventoried ) { } @ Override public int getID ( ) { } }

Fix:
party . addAnimals ( animalList ) ;
Buggy code:
public class NumberFireJsonPageScraper { public List < NumberFireNbaTeamModel > getNumberFireNbaTeamModels ( Document document ) { } public List < Map < String , String > > getProjectionAttributeMapList ( Document document ) { } public List < Map < String , String > > getProjectionAttributeMapList ( Document document , String key ) { } private List < Map < String , String > > getAllJsonArrayObjectsKeyToValueMap ( JSONArray allObjects ) { } private List < Map < String , String > > getAllJsonObjectsKeyToValueMap ( JSONObject allObjects ) { } private Map < String , String > parseProjectionGroup ( JSONObject projectionGroup ) { Map < String , String > projectionMap = new java . util . LinkedHashMap ( projectionGroup . keySet ( ) . size ( ) ) ; for ( int mapKeyIndex = 0 ; mapKeyIndex < ( projectionGroup . names ( ) . length ( ) ) ; mapKeyIndex ++ ) { String keyString = projectionGroup . names ( ) . getString ( mapKeyIndex ) ; <START_BUG> String valueString = projectionGroup . getString ( keyString ) ; <END_BUG> projectionMap . put ( keyString , valueString ) ; } return projectionMap ; } private String findProjectionJavascript ( Elements scriptElements ) { } private String extractJustTheJsonFromJavascript ( String javascriptJson ) { } }

Fix:
String valueString = String . valueOf ( projectionGroup . get ( keyString ) ) ;
Buggy code:
public class Semaphore { protected long notifications ; protected Thread operation ; protected Runnable runnable ; public Semaphore ( Runnable runnable ) { } public synchronized boolean acquire ( long delay ) throws InterruptedException { if ( Thread . interrupted ( ) ) throw new InterruptedException ( ) ; long start = System . currentTimeMillis ( ) ; long timeLeft = delay ; while ( true ) { if ( ( notifications ) > 0 ) { ( notifications ) -- ; return true ; } <START_BUG> if ( timeLeft < 0 ) <END_BUG> return false ; wait ( timeLeft ) ; timeLeft = ( start + delay ) - ( System . currentTimeMillis ( ) ) ; } } public boolean equals ( Object obj ) { } public Thread getOperationThread ( ) { } public Runnable getRunnable ( ) { } public int hashCode ( ) { } public synchronized void release ( ) { } public void setOperationThread ( Thread operation ) { } public String toString ( ) { } }

Fix:
if ( timeLeft <= 0 )
Buggy code:
public class Canvas extends Composite { Caret caret ; Canvas ( ) { } public Canvas ( Composite parent , int style ) { } void clearArea ( int x , int y , int width , int height ) { } public Caret getCaret ( ) { } void releaseChildren ( boolean destroy ) { if ( ( caret ) != null ) { <START_BUG> caret . releaseChildren ( false ) ; <END_BUG> caret = null ; } super . releaseChildren ( destroy ) ; } public void scroll ( int destX , int destY , int x , int y , int width , int height , boolean all ) { } public void setCaret ( Caret caret ) { } public void setFont ( Font font ) { } LRESULT WM_INPUTLANGCHANGE ( int wParam , int lParam ) { } LRESULT WM_KILLFOCUS ( int wParam , int lParam ) { } LRESULT WM_SETFOCUS ( int wParam , int lParam ) { } LRESULT WM_SIZE ( int wParam , int lParam ) { } LRESULT WM_WINDOWPOSCHANGED ( int wParam , int lParam ) { } LRESULT WM_WINDOWPOSCHANGING ( int wParam , int lParam ) { } }

Fix:
caret . release ( false ) ;
Buggy code:
public class ProjectDAO extends BaseDAO { public int getTotal ( ) { } public long create ( final Project project ) { <START_BUG> this . simplePrepareStatTransactionExecute ( sqlManager . getSQL ( "ProjectDAO//CreateProject" ) , project . name , project . description , project . data ) ; <END_BUG> return project . id ; } public long update ( final Project project ) { } public long delete ( final long projectId ) { } public List < Project > getAllShortProject ( ) { } public Project getProject ( long projectId ) { } public List < Project > getAllProject ( ) { } }

Fix:
this . simplePrepareStatTransactionExecute ( sqlManager . getSQL ( "ProjectDAO//CreateProject" ) , project . id , project . name , project . description , project . data ) ;
Buggy code:
public class CompilerRunner { public static String run ( File inputFile , File outputFile ) { String inputString ; try { inputString = new String ( Files . readAllBytes ( inputFile . toPath ( ) ) ) ; } catch ( IOException e ) { String errorLog = ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>file<seq2seq4repair_space>(" + ( inputFile . getName ( ) ) ) + "):<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ; System . out . println ( errorLog ) ; e . printStackTrace ( ) ; return errorLog ; } Prepocessor pp = new Prepocessor ( ) ; Compiler co = new Compiler ( ) ; Map < String , CommandSpec > dict = new HashMap < String , CommandSpec > ( ) ; dict . put ( "add" , new CommandSpec ( "0000" , false ) ) ; dict . put ( "sub" , new CommandSpec ( "0001" , false ) ) ; dict . put ( "ld" , new CommandSpec ( "0010" , true ) ) ; <START_BUG> dict . put ( "xchg" , new CommandSpec ( "0011" , true ) ) ; <END_BUG> co . setCommandSet ( dict ) ; List < Token > tokens = pp . preprocess ( inputString ) ; String outputString ; try { outputString = co . compile ( tokens ) ; } catch ( CommandNotFound | AddressExpected | CommandExpected | AddressIncorrect | LabelUndefined e ) { System . out . println ( e . getMessage ( ) ) ; e . printStackTrace ( ) ; return e . getMessage ( ) ; } PrintWriter outputWriter ; try { outputWriter = new PrintWriter ( outputFile ) ; } catch ( FileNotFoundException e ) { String errorLog = ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>write<seq2seq4repair_space>file<seq2seq4repair_space>(" + ( outputFile . getName ( ) ) ) + "):<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ; System . out . println ( errorLog ) ; e . printStackTrace ( ) ; return errorLog ; } outputWriter . write ( outputString ) ; outputWriter . close ( ) ; System . out . println ( outputString ) ; outputWriter . print ( outputString ) ; String successLog = ( "Successfully<seq2seq4repair_space>compiled<seq2seq4repair_space>" + ( co . getBytes ( ) ) ) + "<seq2seq4repair_space>bytes" ; System . out . println ( successLog ) ; return successLog ; } }

Fix:
dict . put ( "xchg" , new CommandSpec ( "0011" , false ) ) ;
Buggy code:
public abstract class AppenderSkeleton implements Appender , OptionHandler { protected Layout layout ; protected String name ; protected Priority threshold ; protected ErrorHandler errorHandler = new OnlyOnceErrorHandler ( ) ; protected Filter headFilter ; protected Filter tailFilter ; protected boolean closed = false ; public void activateOptions ( ) { } public void addFilter ( Filter newFilter ) { } protected abstract void append ( LoggingEvent event ) { } public void clearFilters ( ) { } public void finalize ( ) { } public ErrorHandler getErrorHandler ( ) { } public Filter getFilter ( ) { } public final Filter getFirstFilter ( ) { } public Layout getLayout ( ) { } public final String getName ( ) { } public Priority getThreshold ( ) { } public boolean isAsSevereAsThreshold ( Priority priority ) { } public synchronized void doAppend ( LoggingEvent event ) { } public synchronized void setErrorHandler ( ErrorHandler eh ) { } public void setLayout ( Layout layout ) { } public void setName ( String name ) { } <START_BUG> public void setThreshold ( Level threshold ) { <END_BUG> this . threshold = threshold ; } }

Fix:
public void setThreshold ( Priority threshold ) {
Buggy code:
public class NoRotationPolicy implements FileRotationPolicy { @ Override <START_BUG> public boolean mark ( Tuple tuple , byte [ ] data ) { <END_BUG> return false ; } @ Override public void reset ( ) { } }

Fix:
public boolean mark ( Tuple tuple , long offset ) {
Buggy code:
public final class FeedbackMessages implements IClusterable { private static final Logger log = LoggerFactory . getLogger ( FeedbackMessages . class ) ; private static final long serialVersionUID = 1L ; private List < FeedbackMessage > messages = null ; public FeedbackMessages ( ) { } public final void add ( Component < ? > reporter , String message , int level ) { } public final int clear ( ) { } public final int clear ( final IFeedbackMessageFilter filter ) { } public final void debug ( Component < ? > reporter , String message ) { } public final void error ( Component < ? > reporter , Serializable message ) { } public final void fatal ( Component < ? > reporter , String message ) { } public final boolean hasErrorMessageFor ( Component < ? > component ) { } public final boolean hasMessage ( final IFeedbackMessageFilter filter ) { } public final boolean hasMessageFor ( Component < ? > component ) { } public final boolean hasMessageFor ( Component < ? > component , int level ) { } public final void info ( Component < ? > reporter , String message ) { } public final boolean isEmpty ( ) { } public final Iterator < FeedbackMessage > iterator ( ) { } public final FeedbackMessage messageForComponent ( final Component < ? > component ) { } public final List < FeedbackMessage > messages ( final IFeedbackMessageFilter filter ) { if ( ( messages . size ( ) ) == 0 ) { <START_BUG> return Collections . EMPTY_LIST ; <END_BUG> } final List < FeedbackMessage > list = new ArrayList < FeedbackMessage > ( ) ; for ( final Iterator < FeedbackMessage > iterator = messages . iterator ( ) ; iterator . hasNext ( ) ; ) { final FeedbackMessage message = iterator . next ( ) ; if ( ( filter == null ) || ( filter . accept ( message ) ) ) { list . add ( message ) ; } } return list ; } public final int size ( ) { } public final int size ( final IFeedbackMessageFilter filter ) { } @ Override public String toString ( ) { } public final void trimToSize ( ) { } public final void warn ( Component < ? > reporter , String message ) { } final void add ( FeedbackMessage message ) { } }

Fix:
return Collections . emptyList ( ) ;
Buggy code:
public class ShowFAQAction extends FrameAction { public ShowFAQAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { URLController c = new URLController ( ) ; try { <START_BUG> c . open ( new URL ( "http:////columba.sourceforge.net//index.php?page=faq" ) ) ; <END_BUG> } catch ( MalformedURLException mue ) { } } }

Fix:
c . open ( new URL ( "http:////columba.sourceforge.net//faq_user.php" ) ) ;
Buggy code:
class SourceMethod extends Member implements IMethod { protected String [ ] fParameterTypes ; protected static final String [ ] fgEmptyList = new String [ ] { } ; protected SourceMethod ( JavaElement parent , String name , String [ ] parameterTypes ) { } public boolean equals ( Object o ) { } protected boolean equalsDOMNode ( IDOMNode node ) { } public int getElementType ( ) { } public String [ ] getExceptionTypes ( ) throws JavaModelException { } public String getHandleMemento ( ) { } protected char getHandleMementoDelimiter ( ) { } public int getNumberOfParameters ( ) { } public String [ ] getParameterNames ( ) throws JavaModelException { } public String [ ] getParameterTypes ( ) { } public String [ ] getTypeParameterSignatures ( ) throws JavaModelException { } public IJavaElement getPrimaryElement ( boolean checkOwner ) { } public String getReturnType ( ) throws JavaModelException { } public String getSignature ( ) throws JavaModelException { } public int hashCode ( ) { int hash = super . hashCode ( ) ; for ( int i = 0 , length = fParameterTypes . length ; i < length ; i ++ ) { <START_BUG> hash = Util . combineHashCodes ( fParameterTypes [ i ] . hashCode ( ) , hash ) ; <END_BUG> } return hash ; } public boolean isConstructor ( ) throws JavaModelException { } public boolean isMainMethod ( ) throws JavaModelException { } public boolean isSimilar ( IMethod method ) { } public String readableName ( ) { } protected boolean signatureEquals ( IDOMMethod method ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } protected void toStringName ( StringBuffer buffer ) { } }

Fix:
hash = Util . combineHashCodes ( hash , fParameterTypes [ i ] . hashCode ( ) ) ;
Buggy code:
public class DormandPrince54IntegratorTest extends TestCase { public DormandPrince54IntegratorTest ( String name ) { } public void testDimensionCheck ( ) { } public void testMinStep ( ) throws DerivativeException , IntegratorException { } public void testSmallLastStep ( ) throws DerivativeException , IntegratorException { } private static class DP54SmallLastHandler implements StepHandler { public DP54SmallLastHandler ( double minStep ) { } public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) { } public boolean wasLastSeen ( ) { } private boolean lastSeen ; private double minStep ; } public void testIncreasingTolerance ( ) throws DerivativeException , IntegratorException { } public void testSwitchingFunctions ( ) throws DerivativeException , IntegratorException { TestProblem4 pb = new TestProblem4 ( ) ; double minStep = 0 ; double maxStep = ( pb . getFinalTime ( ) ) - ( pb . getInitialTime ( ) ) ; double scalAbsoluteTolerance = 1.0E-8 ; double scalRelativeTolerance = 0.01 * scalAbsoluteTolerance ; FirstOrderIntegrator integ = new DormandPrince54Integrator ( minStep , maxStep , scalAbsoluteTolerance , scalRelativeTolerance ) ; TestProblemHandler handler = new TestProblemHandler ( pb , integ ) ; integ . setStepHandler ( handler ) ; SwitchingFunction [ ] functions = pb . getSwitchingFunctions ( ) ; for ( int l = 0 ; l < ( functions . length ) ; ++ l ) { <START_BUG> integ . addSwitchingFunction ( functions [ l ] , Double . POSITIVE_INFINITY , ( 1.0E-8 * maxStep ) ) ; <END_BUG> } integ . integrate ( pb , pb . getInitialTime ( ) , pb . getInitialState ( ) , pb . getFinalTime ( ) , new double [ pb . getDimension ( ) ] ) ; assertTrue ( ( ( handler . getMaximalValueError ( ) ) < 5.0E-6 ) ) ; assertEquals ( 0 , handler . getMaximalTimeError ( ) , 1.0E-12 ) ; assertEquals ( 12.0 , handler . getLastTime ( ) , ( 1.0E-8 * maxStep ) ) ; } public void testKepler ( ) throws DerivativeException , IntegratorException { } public void testVariableSteps ( ) throws DerivativeException , IntegratorException { } private static class KeplerHandler implements StepHandler { public KeplerHandler ( TestProblem3 pb ) { } public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) throws DerivativeException { } private int nbSteps ; private double maxError ; private TestProblem3 pb ; } private static class VariableHandler implements StepHandler { public VariableHandler ( ) { } public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) { } private boolean firstTime ; private double minStep ; private double maxStep ; } public static Test suite ( ) { } }

Fix:
integ . addSwitchingFunction ( functions [ l ] , Double . POSITIVE_INFINITY , ( 1.0E-8 * maxStep ) , 1000 ) ;
Buggy code:
public abstract class PageableListView < T > extends ListView < T > implements IPageable { private static final long serialVersionUID = 1L ; private int currentPage ; private int rowsPerPage ; public PageableListView ( final String id , final IModel < List < T > > model , int rowsPerPage ) { } public PageableListView ( final String id , final List < T > list , final int rowsPerPage ) { } public final int getCurrentPage ( ) { <START_BUG> while ( ( ( currentPage ) * ( rowsPerPage ) ) >= ( PageableListView . getList ( ) . size ( ) ) ) { <END_BUG> ( currentPage ) -- ; } return currentPage ; } public final int getPageCount ( ) { } public final int getRowsPerPage ( ) { } public final void setRowsPerPage ( int rowsPerPage ) { } @ Override public int getViewSize ( ) { } public final void setCurrentPage ( int currentPage ) { } @ Override public ListView < T > setStartIndex ( int startIndex ) throws UnsupportedOperationException { } @ Override public ListView < T > setViewSize ( int size ) throws UnsupportedOperationException { } private class CurrentPageChange extends Change { private static final long serialVersionUID = 1L ; private final int currentPage ; CurrentPageChange ( int currentPage ) { } @ Override public void undo ( ) { } @ Override public String toString ( ) { } } private class RowsPerPageChange extends Change { private static final long serialVersionUID = 1L ; private final int rowsPerPage ; RowsPerPageChange ( int rowsPerPage ) { } @ Override public void undo ( ) { } @ Override public String toString ( ) { } } }

Fix:
while ( ( ( currentPage ) > 0 ) && ( ( ( currentPage ) * ( rowsPerPage ) ) >= ( PageableListView . getList ( ) . size ( ) ) ) ) {
Buggy code:
public class LoginFragment extends Fragment { @ Override public void onAttach ( Activity activity ) { } @ Override public void onCreate ( Bundle state ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle state ) { View v = inflater . inflate ( fragment_login , container , false ) ; Button login = ( ( Button ) ( v . findViewById ( login_button ) ) ) ; Button signup = ( ( Button ) ( v . findViewById ( signup_button ) ) ) ; final EditText username = ( ( EditText ) ( v . findViewById ( username_edittext ) ) ) ; <START_BUG> final EditText password = ( ( EditText ) ( v . findViewById ( username_edittext ) ) ) ; <END_BUG> login . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { attemptLogin ( username . getText ( ) . toString ( ) , password . getText ( ) . toString ( ) ) ; } } ) ; signup . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { attemptSignup ( username . getText ( ) . toString ( ) , password . getText ( ) . toString ( ) ) ; } } ) ; return v ; } public void attemptLogin ( String username , String password ) { } public void attemptSignup ( String username , String password ) { } public void login ( ) { } No newline ; at end ; of file ; }

Fix:
final EditText password = ( ( EditText ) ( v . findViewById ( password_edittext ) ) ) ;
Buggy code:
class CTabFolderTab extends Tab { int lastSelectedTab = 0 ; CTabFolder tabFolder1 ; Group tabFolderGroup ; Group itemGroup ; Button topButton ; Button bottomButton ; Button flatButton ; Button closeButton ; static String [ ] CTabItems1 = new String [ ] { ControlExample . getResourceString ( "CTabItem1_0" ) , ControlExample . getResourceString ( "CTabItem1_1" ) , ControlExample . getResourceString ( "CTabItem1_2" ) } ; static final int SELECTION_FOREGROUND_COLOR = 3 ; static final int SELECTION_BACKGROUND_COLOR = 4 ; static final int ITEM_FONT = 5 ; Color selectionForegroundColor ; Color selectionBackgroundColor ; Font itemFont ; Button simpleTabButton ; Button singleTabButton ; Button imageButton ; Button showMinButton ; Button showMaxButton ; Button unselectedCloseButton ; Button unselectedImageButton ; CTabFolderTab ( ControlExample instance ) { } void createColorAndFontGroup ( ) { } void changeFontOrColor ( int index ) { } void createOtherGroup ( ) { } void createExampleGroup ( ) { } void createExampleWidgets ( ) { int style = getDefaultStyle ( ) ; if ( topButton . getSelection ( ) ) style |= SWT . TOP ; if ( bottomButton . getSelection ( ) ) style |= SWT . BOTTOM ; if ( borderButton . getSelection ( ) ) style |= SWT . BORDER ; if ( flatButton . getSelection ( ) ) style |= SWT . FLAT ; if ( closeButton . getSelection ( ) ) style |= SWT . CLOSE ; tabFolder1 = new CTabFolder ( tabFolderGroup , style ) ; for ( int i = 0 ; i < ( CTabFolderTab . CTabItems1 . length ) ; i ++ ) { CTabItem item = new CTabItem ( tabFolder1 , SWT . NONE ) ; item . setText ( CTabFolderTab . CTabItems1 [ i ] ) ; <START_BUG> Text text = new Text ( tabFolder1 , SWT . READ_ONLY ) ; <END_BUG> text . setText ( ( ( ( ControlExample . getResourceString ( "CTabItem_content" ) ) + ":<seq2seq4repair_space>" ) + i ) ) ; item . setControl ( text ) ; } tabFolder1 . addListener ( Selection , new Listener ( ) { public void handleEvent ( Event event ) { lastSelectedTab = tabFolder1 . getSelectionIndex ( ) ; } } ) ; tabFolder1 . setSelection ( lastSelectedTab ) ; } void createStyleGroup ( ) { } String [ ] getCustomEventNames ( ) { } Item [ ] getExampleWidgetItems ( ) { } Widget [ ] getExampleWidgets ( ) { } String getTabText ( ) { } void hookCustomListener ( final String eventName ) { } void resetColorsAndFonts ( ) { } void setExampleWidgetState ( ) { } void setSimpleTabs ( ) { } void setSingleTabs ( ) { } void setImages ( ) { } void setMinimizeVisible ( ) { } void setMaximizeVisible ( ) { } void setUnselectedCloseVisible ( ) { } void setUnselectedImageVisible ( ) { } void setSelectionBackground ( ) { } void setSelectionForeground ( ) { } void setItemFont ( ) { } }

Fix:
Text text = new Text ( tabFolder1 , ( ( SWT . WRAP ) | ( SWT . MULTI ) ) ) ;
Buggy code:
public class SpecificationChecker { private Integer timeout = 1 ; public final Integer getTimeout ( ) { } public final void setTimeout ( final Integer timeout ) { } private ProverCaller prover ; public final ProverCaller getProver ( ) { } public final void setProver ( final ProverCaller prover ) { } private FormulaGenerator transformer ; public final FormulaGenerator getTransformer ( ) { } public final void setTransformer ( final FormulaGenerator transformer ) { } private ProverResult checkResult ; public final ProverResult getCheckResult ( ) { } private final DistributorProverEventListener listener = new DistributorProverEventListener ( ) ; public final boolean addProverEventListener ( final IProverEventListener listener ) { } public final boolean removeProverEventListener ( final IProverEventListener listener ) { } public SpecificationChecker ( ) { } public SpecificationChecker ( final FormulaGenerator transformer ) { } public SpecificationChecker ( final ProverCaller prover ) { } public final Validity checkFormula ( final Expression formula , final Map < VariableDeclaration , Value > environment ) { } public final Validity checkFormula ( final Expression formula , final Map < VariableDeclaration , Value > environment , final List < Expression > axioms ) { } private Validity getValidity ( final Expression formula ) { final Negation negation = AstNodeCreatorHelper . createNegation ( formula ) ; try { this . checkResult = this . prover . checkFormula ( negation , this . timeout ) ; <START_BUG> } catch ( Exception e ) { <END_BUG> this . checkResult = new ProverResult ( e . getMessage ( ) ) { @ Override public FormulaSatisfiability getSatisfiability ( ) { return FormulaSatisfiability . UNKOWN ; } } ; } Validity validity = Validity . UNKNOWN ; if ( ( this . checkResult ) != null ) { switch ( this . checkResult . getSatisfiability ( ) ) { case SATISFIABLE : validity = Validity . INVALID ; break ; case UNSATISFIABLE : validity = Validity . VALID ; break ; default : validity = Validity . UNKNOWN ; } } return validity ; } public final Validity checkProgram ( final Program program ) { } }

Fix:
} catch ( ProverCallerException e ) {
Buggy code:
class TakmiSampleFixer implements SampleFixer { private TaxonomyReader taxonomyReader ; private IndexReader indexReader ; private FacetSearchParams searchParams ; public TakmiSampleFixer ( IndexReader indexReader , TaxonomyReader taxonomyReader , FacetSearchParams searchParams ) { } public void fixResult ( ScoredDocIDs origDocIds , FacetResult fres ) throws IOException { } private void fixResultNode ( FacetResultNode facetResNode , ScoredDocIDs docIds ) throws IOException { } private void recount ( FacetResultNode fresNode , ScoredDocIDs docIds ) throws IOException { CategoryPath catPath = fresNode . getLabel ( taxonomyReader ) ; Term drillDownTerm = DrillDown . term ( searchParams , catPath ) ; Bits liveDocs = MultiFields . getLiveDocs ( indexReader ) ; <START_BUG> int updatedCount = TakmiSampleFixer . countIntersection ( MultiFields . getTermDocsEnum ( indexReader , liveDocs , drillDownTerm . field ( ) , drillDownTerm . bytes ( ) , false ) , docIds . iterator ( ) ) ; <END_BUG> fresNode . setValue ( updatedCount ) ; } private static int countIntersection ( DocsEnum p1 , ScoredDocIDsIterator p2 ) throws IOException { } private static boolean advance ( ScoredDocIDsIterator iterator , int targetDoc ) { } }

Fix:
int updatedCount = TakmiSampleFixer . countIntersection ( MultiFields . getTermDocsEnum ( indexReader , liveDocs , drillDownTerm . field ( ) , drillDownTerm . bytes ( ) , 0 ) , docIds . iterator ( ) ) ;
Buggy code:
public class EditorPane extends PartPane { private EditorStack workbook ; public EditorPane ( IEditorReference ref , WorkbenchPage page , EditorStack workbook ) { } protected void createTitleBar ( ) { } public void doHide ( ) { } public IEditorReference getEditorReference ( ) { } int getStyle ( ) { } public EditorStack getWorkbook ( ) { } public void requestActivation ( ) { } public void setWorkbook ( EditorStack editorWorkbook ) { } void shellActivated ( ) { } void shellDeactivated ( ) { } public void setFocus ( ) { } public void showFocus ( boolean inFocus ) { } protected void addPinEditorItem ( Menu parent ) { IPreferenceStore store = WorkbenchPlugin . getDefault ( ) . getPreferenceStore ( ) ; <START_BUG> boolean reuseEditor = ( store . getBoolean ( REUSE_EDITORS_BOOLEAN ) ) || ( ( ( org . eclipse . ui . internal . tweaklets . TabBehaviour ) ( org . eclipse . ui . internal . tweaklets . Tweaklets . get ( org . eclipse . ui . internal . tweaklets . TabBehaviour . class ) ) ) . alwaysShowPinAction ( ) ) ; <END_BUG> if ( ! reuseEditor ) { return ; } final WorkbenchPartReference ref = ( ( WorkbenchPartReference ) ( getPartReference ( ) ) ) ; final MenuItem item = new MenuItem ( parent , SWT . CHECK ) ; item . setText ( EditorPane_pinEditor ) ; item . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { IWorkbenchPart part = getPartReference ( ) . getPart ( true ) ; if ( part == null ) { item . setSelection ( false ) ; item . setEnabled ( false ) ; } else { ref . setPinned ( item . getSelection ( ) ) ; } } } ) ; item . setEnabled ( true ) ; item . setSelection ( ref . isPinned ( ) ) ; } public void updateTitles ( ) { } public void testInvariants ( ) { } public String getName ( ) { } public Control getToolBar ( ) { } public boolean isCloseable ( ) { } }

Fix:
boolean reuseEditor = ( store . getBoolean ( REUSE_EDITORS_BOOLEAN ) ) || ( ( ( org . eclipse . ui . internal . tweaklets . TabBehaviour ) ( org . eclipse . ui . internal . tweaklets . Tweaklets . get ( TabBehaviour . KEY ) ) ) . alwaysShowPinAction ( ) ) ;
Buggy code:
public interface ServiceOrderService { <START_BUG> public boolean save ( ServiceOrder serviceOrder ) throws Exception ; <END_BUG> public ServiceOrder selectByID ( String serviceOrderID ) { } public List < ServiceOrder > selectByCriteria ( String name , String startDate , String endDate , String type , String serialNo , Integer rows , Integer page , String orderBy , String orderType ) { } public boolean edit ( ServiceOrder serviceOrder ) throws Exception { } public boolean delete ( String serviceOrderID , Integer employeeID ) throws Exception { } public List < ServiceOrder > selectNewSOByCriteria ( String name , String date , String type , Integer rows , Integer page , String orderBy , String orderType ) { } public List < ServiceOrder > selectSOForCloseByCriteria ( String name , String startDate , String endDate , String type , String serialNo , Integer rows , Integer page , String orderBy , String orderType ) { } }

Fix:
public String save ( ServiceOrder serviceOrder ) throws Exception ;
Buggy code:
public class SaveMessageCommand extends FolderCommand { protected Folder folder ; protected HeaderInterface [ ] headerList = new HeaderInterface [ 1 ] ; public SaveMessageCommand ( FrameController frameController , DefaultCommandReference [ ] references ) { } public void updateGUI ( ) throws Exception { } public void execute ( Worker worker ) throws Exception { ComposerCommandReference [ ] r = ( ( ComposerCommandReference [ ] ) ( getReferences ( ) ) ) ; ComposerController composerController = r [ 0 ] . getComposerController ( ) ; AccountItem item = composerController . getModel ( ) . getAccountItem ( ) ; <START_BUG> SendableMessage message = composerController . composerInterface . messageComposer . compose ( ) ; <END_BUG> folder = ( ( Folder ) ( r [ 0 ] . getFolder ( ) ) ) ; Object uid = folder . addMessage ( message , worker ) ; headerList [ 0 ] = folder . getMessageHeader ( uid , worker ) ; } }

Fix:
SendableMessage message = composerController . composerInterface . messageComposer . compose ( worker ) ;
Buggy code:
public class GroupAdapter extends BaseAdapter { private List < ImageBean > list ; private Point mPoint = new Point ( 0 , 0 ) ; private GridView mGridView ; protected LayoutInflater mInflater ; @ Override public int getCount ( ) { } @ Override public Object getItem ( int position ) { } public void resetList ( ) { } @ Override public long getItemId ( int position ) { } public GroupAdapter ( Context context , List < ImageBean > list , GridView mGridView ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { final GroupAdapter . ViewHolder viewHolder ; ImageBean mImageBean = list . get ( position ) ; String path = mImageBean . getTopImagePath ( ) ; if ( convertView == null ) { viewHolder = new GroupAdapter . ViewHolder ( ) ; convertView = mInflater . inflate ( grid_group_item , null ) ; viewHolder . mImageView = ( ( MyImageView ) ( convertView . findViewById ( group_image ) ) ) ; viewHolder . mTextViewTitle = ( ( TextView ) ( convertView . findViewById ( group_title ) ) ) ; viewHolder . mTextViewCounts = ( ( TextView ) ( convertView . findViewById ( group_count ) ) ) ; viewHolder . mImageView . setOnMeasureListener ( new OnMeasureListener ( ) { @ Override public void onMeasureSize ( int width , int height ) { mPoint . set ( width , height ) ; } } ) ; convertView . setTag ( viewHolder ) ; } else { viewHolder = ( ( GroupAdapter . ViewHolder ) ( convertView . getTag ( ) ) ) ; viewHolder . mImageView . setImageResource ( friends_sends_pictures_no ) ; } viewHolder . mTextViewTitle . setText ( mImageBean . getFolderName ( ) ) ; viewHolder . mTextViewCounts . setText ( Integer . toString ( mImageBean . getImageCounts ( ) ) ) ; viewHolder . mImageView . setTag ( path ) ; Bitmap bitmap = null ; if ( ( ImageProcess . checkFileType ( path ) ) == ( FileType . IMAGE ) ) { <START_BUG> bitmap = NativeImageLoader . getInstance ( "group" ) . loadNativeImage ( path , mPoint , new NativeImageCallBack ( ) { <END_BUG> @ Override public void onImageLoader ( Bitmap bitmap , String path ) { ImageView mImageView = ( ( ImageView ) ( mGridView . findViewWithTag ( path ) ) ) ; if ( ( bitmap != null ) && ( mImageView != null ) ) { mImageView . setImageBitmap ( bitmap ) ; } } } ) ; } else if ( ( ImageProcess . checkFileType ( path ) ) == ( FileType . VIDEO ) ) { bitmap = ThumbnailUtils . createVideoThumbnail ( path , MINI_KIND ) ; } if ( bitmap != null ) { viewHolder . mImageView . setImageBitmap ( bitmap ) ; } else { viewHolder . mImageView . setImageResource ( friends_sends_pictures_no ) ; } return convertView ; } public static class ViewHolder { public MyImageView mImageView ; public TextView mTextViewTitle ; public TextView mTextViewCounts ; } }

Fix:
bitmap = NativeImageLoader . getInstance ( "group" ) . loadNativeImage ( path , new Point ( 150 , 150 ) , new NativeImageCallBack ( ) {
Buggy code:
public class WorkbenchFieldDecorationSupport { private static int FIELD_DECORATION_WIDTH = 8 ; private static int FIELD_DECORATION_HEIGHT = 8 ; public static void initializeFieldDecorations ( ) { } private static void declareDecorations ( FieldDecorationRegistry registry ) { <START_BUG> registry . addFieldDecoration ( CONTENT_ASSIST_CUE , new org . eclipse . jface . fieldassist . FieldDecoration ( WorkbenchImages . getImage ( IMG_DEC_CONTENTPROPOSAL ) , WorkbenchMessages . ContentAssist_Cue_Description ) ) ; <END_BUG> } }

Fix:
registry . addFieldDecoration ( CONTENT_ASSIST_CUE , new org . eclipse . jface . fieldassist . FieldDecoration ( WorkbenchImages . getImage ( IMG_DEC_CONTENT_PROPOSAL ) , WorkbenchMessages . ContentAssist_Cue_Description ) ) ;
Buggy code:
public class DataflowResumeActivityBuilder extends ActivityBuilder { public Activity build ( ) { } @ Singleton public static class DataflowResumeActivityStepBuilder implements ActivityStepBuilder { @ Override public List < ActivityStep > build ( Activity activity , Injector container ) throws Exception { } } @ Singleton public static class BroadcastResumeWorkerStepExecutor implements ActivityStepExecutor { @ Inject private DataflowService service ; @ Override public void execute ( ActivityExecutionContext ctx , Activity activity , ActivityStep step ) throws Exception { DataflowRegistry dflRegistry = service . getDataflowRegistry ( ) ; <START_BUG> Node workerNodes = dflRegistry . getAllWorkersNode ( ) ; <END_BUG> List < String > workers = workerNodes . getChildren ( ) ; WaitingNodeEventListener waitingListener = new com . neverwinterdp . registry . event . WaitingRandomNodeEventListener ( dflRegistry . getRegistry ( ) ) ; for ( int i = 0 ; i < ( workers . size ( ) ) ; i ++ ) { String path = ( ( ( workerNodes . getPath ( ) ) + "//" ) + ( workers . get ( i ) ) ) + "//status" ; waitingListener . add ( path , RUNNING ) ; } dflRegistry . broadcastWorkerEvent ( RESUME ) ; waitingListener . waitForEvents ( ( 30 * 1000 ) ) ; if ( ( waitingListener . getUndetectNodeEventCount ( ) ) > 0 ) { throw new Exception ( ( ( "Cannot<seq2seq4repair_space>detect<seq2seq4repair_space>the<seq2seq4repair_space>RUNNING<seq2seq4repair_space>status<seq2seq4repair_space>for<seq2seq4repair_space>" + ( waitingListener . getUndetectNodeEventCount ( ) ) ) + "<seq2seq4repair_space>workers" ) ) ; } } } @ Singleton public static class SetRunningDataflowStatusStepExecutor implements ActivityStepExecutor { @ Inject private DataflowService service ; @ Override public void execute ( ActivityExecutionContext ctx , Activity activity , ActivityStep step ) throws Exception { DataflowRegistry dflRegistry = service . getDataflowRegistry ( ) ; dflRegistry . setStatus ( DataflowLifecycleStatus . RUNNING ) ; } } }

Fix:
Node workerNodes = dflRegistry . getActiveWorkersNode ( ) ;
Buggy code:
public class DefaultWeavingContext implements IWeavingContext { protected ClassLoader loader ; private String shortName ; public DefaultWeavingContext ( ClassLoader loader ) { } public Enumeration getResources ( String name ) throws IOException { } public String getBundleIdFromURL ( URL url ) { } public String getClassLoaderName ( ) { <START_BUG> return ( loader ) != null ? ( ( loader . getClass ( ) . getName ( ) ) + "@" ) + ( loader . hashCode ( ) ) : "null" ; <END_BUG> } public String getFile ( URL url ) { } public String getId ( ) { } public String getSuffix ( ) { } public boolean isLocallyDefined ( String classname ) { } }

Fix:
return ( loader ) != null ? ( ( loader . getClass ( ) . getName ( ) ) + "@" ) + ( Integer . toHexString ( loader . hashCode ( ) ) ) : "null" ;
Buggy code:
public class KafkaInputPlugin implements InputPlugin { private Logger logger = Exec . getLogger ( KafkaInputPlugin . class ) ; public interface PluginTask extends Task { @ Config ( "zookeepers" ) String getZookeepers ( ) { } @ Config ( "topic" ) String getTopic ( ) { } @ Config ( "group.id" ) String getGroupId ( ) { } @ Config ( "zookeeper.session.timeout.ms" ) String getZookeeperSessionTimeoutMs ( ) { } @ Config ( "zookeeper.sync.time.ms" ) String getZookeeperSyncTimeMs ( ) { } @ Config ( "auto.commit.interval.ms" ) String getAutoCommitIntervalMs ( ) { } @ Config ( "auto.offset.reset" ) String getAutoOffsetReset ( ) { } @ Config ( "ignore.lines" ) @ ConfigDefault ( "0" ) String getIgnoreLines ( ) { } @ Config ( "data.format" ) @ ConfigDefault ( "null" ) String getDataFormat ( ) { } @ Config ( "data.column.enclosedChar" ) @ ConfigDefault ( "" ) String getEnclosedChar ( ) { } @ Config ( "data.columns" ) SchemaConfig getColumns ( ) { } @ Config ( "preview.sampling.count" ) @ ConfigDefault ( "10" ) int getPreviewSamplingCount ( ) { } @ Config ( "thread.count" ) @ ConfigDefault ( "1" ) int getThreadCount ( ) { } @ ConfigInject BufferAllocator getBufferAllocator ( ) { } } public interface GuessTask extends Task { @ Config ( "zookeepers" ) String getZookeepers ( ) { } @ Config ( "topic" ) String getTopic ( ) { } @ Config ( "zookeeper.session.timeout.ms" ) String getZookeeperSessionTimeoutMs ( ) { } @ Config ( "zookeeper.sync.time.ms" ) String getZookeeperSyncTimeMs ( ) { } @ Config ( "auto.offset.reset" ) String getAutoOffsetReset ( ) { } @ Config ( "ignore.lines" ) @ ConfigDefault ( "0" ) String getIgnoreLines ( ) { } @ Config ( "data.format" ) String getDataFormat ( ) { } @ Config ( "data.column.enclosedChar" ) @ ConfigDefault ( "" ) String getEnclosedChar ( ) { } } @ Override public ConfigDiff transaction ( ConfigSource config , InputPlugin . Control control ) { } @ Override public ConfigDiff resume ( TaskSource taskSource , Schema schema , int taskCount , InputPlugin . Control control ) { } @ Override public void cleanup ( TaskSource taskSource , Schema schema , int i , List < TaskReport > list ) { } @ Override public TaskReport run ( TaskSource taskSource , Schema schema , int taskIndex , PageOutput output ) { } @ Override public ConfigDiff guess ( ConfigSource config ) { } private ConsumerConfig getConsumerConfig ( KafkaInputPlugin . PluginTask task ) { } private List < KafkaStream < byte [ ] , byte [ ] > > getStreams ( KafkaInputPlugin . PluginTask task , ConsumerConnector consumer ) { HashMap < String , Integer > topicCountMap = new HashMap < String , Integer > ( ) ; <START_BUG> topicCountMap . put ( task . getTopic ( ) , 1 ) ; <END_BUG> Map < String , List < KafkaStream < byte [ ] , byte [ ] > > > consumerMap = consumer . createMessageStreams ( topicCountMap ) ; return consumerMap . get ( task . getTopic ( ) ) ; } private void shutdown ( ConsumerConnector consumer , ExecutorService executor ) { } }

Fix:
topicCountMap . put ( task . getTopic ( ) , task . getThreadCount ( ) ) ;
Buggy code:
public class TrackSchemeStyleIOExample { public static void main ( final String [ ] args ) { final TrackSchemeStyle style = TrackSchemeStyle . modernStyle ( ) ; final Yaml yaml = TrackSchemeStyleIOExample . createYaml ( ) ; final String dump = yaml . dump ( style ) ; System . out . println ( dump ) ; <START_BUG> final Object load = yaml . load ( dump ) ; <END_BUG> final String dump2 = yaml . dump ( load ) ; System . out . println ( dump2 ) ; } static class TrackSchemeStyleRepresenter extends WorkaroundRepresenter { public TrackSchemeStyleRepresenter ( ) { } } static class TrackschemeStyleConstructor extends WorkaroundConstructor { public TrackschemeStyleConstructor ( ) { } } static Yaml createYaml ( ) { } }

Fix:
final TrackSchemeStyle load = yaml . loadAs ( dump , TrackSchemeStyle . class ) ;
Buggy code:
public class XMLJUnitResultFormatter implements JUnitResultFormatter , XMLConstants { private static DocumentBuilder getDocumentBuilder ( ) { } private Document doc ; private Element rootElement ; private Hashtable testElements = new Hashtable ( ) ; private Hashtable testStarts = new Hashtable ( ) ; private OutputStream out ; public XMLJUnitResultFormatter ( ) { } public void setOutput ( OutputStream out ) { } public void setSystemOutput ( String out ) { } public void setSystemError ( String out ) { } public void startTestSuite ( JUnitTest suite ) { } public void endTestSuite ( JUnitTest suite ) throws BuildException { } public void startTest ( Test t ) { testStarts . put ( t , new Long ( System . currentTimeMillis ( ) ) ) ; Element currentTest = doc . createElement ( TESTCASE ) ; <START_BUG> currentTest . setAttribute ( ATTR_NAME , JUnitVersionHelper . getTestCaseName ( ( ( TestCase ) ( t ) ) ) ) ; <END_BUG> rootElement . appendChild ( currentTest ) ; testElements . put ( t , currentTest ) ; } public void endTest ( Test test ) { } public void addFailure ( Test test , Throwable t ) { } public void addFailure ( Test test , AssertionFailedError t ) { } public void addError ( Test test , Throwable t ) { } private void formatError ( String type , Test test , Throwable t ) { } private void formatOutput ( String type , String output ) { } }

Fix:
currentTest . setAttribute ( ATTR_NAME , JUnitVersionHelper . getTestCaseName ( t ) ) ;
Buggy code:
public class WelcomeActivity extends Activity { @ SuppressWarnings ( "unused" ) private static final String TAG = "WelcomeActivity" ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; requestWindowFeature ( FEATURE_NO_TITLE ) ; SharedPreferences prefs = this . getSharedPreferences ( PREFS_LAIQIAN_DEFAULT , MODE_PRIVATE ) ; boolean isFirstStartUp = prefs . getBoolean ( IS_FIRST_STARTUP , true ) ; if ( ! isFirstStartUp ) { redirectToMainActivity ( ) ; return ; } uploadUserContacts ( ) ; downloadUserContacts ( ) ; Editor editor = prefs . edit ( ) ; editor . putBoolean ( IS_FIRST_STARTUP , false ) ; <START_BUG> editor . putString ( UID , "20" ) ; <END_BUG> editor . putString ( AUTHOR_NAME , "nan" ) ; editor . commit ( ) ; final View view = View . inflate ( this , welcome_layout , null ) ; setContentView ( view ) ; AlphaAnimation animation = new AlphaAnimation ( 0.3F , 1.0F ) ; animation . setDuration ( 2000 ) ; view . startAnimation ( animation ) ; animation . setAnimationListener ( new AnimationListener ( ) { @ Override public void onAnimationEnd ( Animation arg0 ) { redirectToMainActivity ( ) ; } @ Override public void onAnimationRepeat ( Animation animation ) { } @ Override public void onAnimationStart ( Animation animation ) { } } ) ; } private void redirectToMainActivity ( ) { } private void uploadUserContacts ( ) { } private void downloadUserContacts ( ) { } }

Fix:
editor . putString ( UID , "3" ) ;