nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CoderComperator < T > extends TypeComparator < T > { private T reference = null ; private Coder < T > coder ; private transient InspectableByteArrayOutputStream byteBuffer1 ; private transient InspectableByteArrayOutputStream byteBuffer2 ; public CoderComperator ( Coder < T > coder ) { } private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { } @ Override public int hash ( T record ) { } @ Override public void setReference ( T toCompare ) { } @ Override public boolean equalToReference ( T candidate ) { } @ Override public int compareToReference ( TypeComparator < T > other ) { } @ Override public int compare ( T first , T second ) { try { byteBuffer1 . reset ( ) ; byteBuffer2 . reset ( ) ; coder . encode ( first , byteBuffer1 , OUTER ) ; coder . encode ( second , byteBuffer2 , OUTER ) ; byte [ ] arr = byteBuffer1 . getBuffer ( ) ; byte [ ] arrOther = byteBuffer2 . getBuffer ( ) ; if ( ( byteBuffer1 . size ( ) ) != ( byteBuffer2 . size ( ) ) ) { <START_BUG> return ( arr . length ) - ( arrOther . length ) ; <END_BUG> } int len = byteBuffer1 . size ( ) ; for ( int i = 0 ; i < len ; i ++ ) { if ( ( arr [ i ] ) != ( arrOther [ i ] ) ) { return ( arr [ i ] ) - ( arrOther [ i ] ) ; } } return 0 ; } catch ( IOException e ) { throw new RuntimeException ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>compare<seq2seq4repair_space>reference." , e ) ; } } @ Override public int compareSerialized ( DataInputView firstSource , DataInputView secondSource ) throws IOException { } @ Override public boolean supportsNormalizedKey ( ) { } @ Override public boolean supportsSerializationWithKeyNormalization ( ) { } @ Override public int getNormalizeKeyLen ( ) { } @ Override public boolean isNormalizedKeyPrefixOnly ( int keyBytes ) { } @ Override public void putNormalizedKey ( T record , MemorySegment target , int offset , int numBytes ) { } @ Override public void writeWithKeyNormalization ( T record , DataOutputView target ) throws IOException { } @ Override public T readWithKeyDenormalization ( T reuse , DataInputView source ) throws IOException { } @ Override public boolean invertNormalizedKey ( ) { } @ Override public TypeComparator < T > duplicate ( ) { } @ Override public int extractKeys ( Object record , Object [ ] target , int index ) { } @ Override public TypeComparator [ ] getFlatComparators ( ) { } }

Fix:
return ( byteBuffer1 . size ( ) ) - ( byteBuffer2 . size ( ) ) ;
Buggy code:
public abstract class Form extends WebMarkupContainer implements IFormSubmitListener { private static Log log = LogFactory . getLog ( Form . class ) ; private final IFeedback feedback ; private static class Count { int count ; } private static final class DefaultFormValidationStrategy implements IFormValidationStrategy { private static final Form . DefaultFormValidationStrategy instance = new Form . DefaultFormValidationStrategy ( ) ; private static final Log log = LogFactory . getLog ( Form . DefaultFormValidationStrategy . class ) ; private static Form . DefaultFormValidationStrategy getInstance ( ) { } public void validate ( final Form form ) { } } public Form ( final String id ) { } public Form ( final String id , final IFeedback feedback ) { } public Form ( final String id , IModel model , final IFeedback feedback ) { } public IFormValidationStrategy getValidationStrategy ( ) { } public final void loadPersistentFormComponentValues ( ) { } public void onFormSubmitted ( ) { } public void removePersistentFormComponentValues ( final boolean disablePersistence ) { } public void setVersioned ( final boolean isVersioned ) { } protected IValuePersister getValuePersister ( ) { } protected void onComponentTag ( final ComponentTag tag ) { checkComponentTag ( tag , "form" ) ; super . onComponentTag ( tag ) ; tag . put ( "method" , "POST" ) ; <START_BUG> String url = getRequestCycle ( ) . urlFor ( this , IFormSubmitListener . class ) ; <END_BUG> url = url . replaceAll ( "&" , "&amp;" ) ; tag . put ( "action" , url ) ; } protected void onError ( ) { } protected void internalOnModelChanged ( ) { } protected abstract void onSubmit ( ) { } protected void onValidate ( ) { } protected final void validate ( ) { } protected void visitFormComponents ( final FormComponent . IVisitor visitor ) { } private void addFeedback ( ) { } private int countButtons ( ) { } private Button findSubmittingButton ( ) { } private boolean hasError ( ) { } private void invalid ( ) { } private void persistFormComponentData ( ) { } private void updateFormComponentModels ( ) { } }

Fix:
String url = getPage ( ) . urlFor ( this , IFormSubmitListener . class ) ;
Buggy code:
public class BuildModuleTest extends TestCase { private static boolean printInfoMessages = false ; private static boolean printedMessage ; private static final String [ ] SKIPS = new String [ ] { "aspectjtools" , "ajdoc" , "aspectj5rt" } ; private static final String SKIP_MESSAGE = "BuildModuleTest:<seq2seq4repair_space>Define<seq2seq4repair_space>\"run.build.tests\"<seq2seq4repair_space>as<seq2seq4repair_space>a<seq2seq4repair_space>system<seq2seq4repair_space>" + "property<seq2seq4repair_space>to<seq2seq4repair_space>run<seq2seq4repair_space>tests<seq2seq4repair_space>to<seq2seq4repair_space>build<seq2seq4repair_space>" ; private static final String BUILD_CONFIG ; ArrayList tempFiles = new ArrayList ( ) ; private File jarDir ; boolean building ; public BuildModuleTest ( String name ) { } protected void tearDown ( ) throws Exception { } public void testBuild ( ) { } public void testAsm ( ) { } public void testRuntime ( ) { } public void testAspectj5rt ( ) { } public void testAjbrowser ( ) { } public void testAjdt ( ) { } public void testTestingDrivers ( ) { } public void testAspectjtools ( ) { } void checkBuildProduct ( File productDir , File baseDir , File distDir , File jarDir ) { } File getAntJar ( ) { } File getJarDir ( ) { } BuildModule getTask ( String module ) { BuildModule task = new BuildModule ( ) ; Project project = new Project ( ) ; task . setProject ( project ) ; File jarDir = getJarDir ( ) ; assertTrue ( ( ( jarDir . canWrite ( ) ) || ( jarDir . mkdirs ( ) ) ) ) ; tempFiles . add ( jarDir ) ; <START_BUG> File moduleDir = new File ( ( "..//" + module ) ) ; <END_BUG> assertTrue ( moduleDir . canRead ( ) ) ; task . setModuledir ( new org . apache . tools . ant . types . Path ( project , moduleDir . getAbsolutePath ( ) ) ) ; task . setJardir ( new org . apache . tools . ant . types . Path ( project , jarDir . getAbsolutePath ( ) ) ) ; task . setFailonerror ( true ) ; if ( null != ( BuildModuleTest . BUILD_CONFIG ) ) { task . setBuildConfig ( BuildModuleTest . BUILD_CONFIG ) ; } return task ; } void checkBuild ( String module ) { } void checkBuild ( String module , String classname , String [ ] args ) { } boolean shouldBuild ( String target ) { } void checkBuild ( String module , String classname , String [ ] args , boolean addAnt ) { } void checkJavac ( ) { } }

Fix:
File moduleDir = new File ( Util . path ( ".." , module ) ) ;
Buggy code:
public class ImportWizardLauncher { public ImportWizardLauncher ( ) { } public void launchWizard ( ) { final ImportPluginHandler pluginHandler ; try { pluginHandler = ( ( ImportPluginHandler ) ( pluginManager . getHandler ( "org.columba.mail.import" ) ) ) ; } catch ( PluginHandlerNotFoundException ex ) { NotifyDialog d = new NotifyDialog ( ) ; d . showDialog ( ex ) ; return ; } DataModel data = new DataModel ( ) ; data . registerDataLookup ( "Plugin.handler" , new DataLookup ( ) { public Object lookupData ( ) { return pluginHandler ; } } ) ; WizardModel model = new DefaultWizardModel ( new Step [ ] { new PluginStep ( data ) , new LocationStep ( data ) } ) ; model . addWizardModelListener ( new MailboxImporter ( data ) ) ; <START_BUG> Wizard wizard = new Wizard ( model , MailResourceLoader . getString ( "dialog" , "mailboximport" , "title" ) , ImageLoader . getSmallImageIcon ( "stock_preferences.png" ) ) ; <END_BUG> wizard . setSize ( 500 , 400 ) ; wizard . setLocationRelativeTo ( null ) ; wizard . setVisible ( true ) ; } }

Fix:
Wizard wizard = new Wizard ( model , MailResourceLoader . getString ( "dialog" , "mailboximport" , "title" ) , ImageLoader . getSmallImageIcon ( "stock_convert.png" ) ) ;
Buggy code:
public class map { public int x = 0 ; public int y = 0 ; public void getCurrentPosition ( ) { } public void movement ( String move ) { <START_BUG> switch ( moveInput ) { <END_BUG> case "north" : ( y ) ++ ; case "east" : ( x ) ++ ; case "south" : ( v ) -- ; case "west" : ( x ) -- ; } } }

Fix:
switch ( move ) {
Buggy code:
public class TestCachingTokenFilter extends BaseTokenStreamTestCase { private String [ ] tokens = new String [ ] { "term1" , "term2" , "term3" , "term2" } ; public void testCaching ( ) throws IOException { Directory dir = new RAMDirectory ( ) ; IndexWriter writer = new IndexWriter ( dir , new SimpleAnalyzer ( ) , MaxFieldLength . LIMITED ) ; Document doc = new Document ( ) ; TokenStream stream = new TokenStream ( ) { private int index = 0 ; private TermAttribute termAtt = ( ( TermAttribute ) ( addAttribute ( TermAttribute . class ) ) ) ; private OffsetAttribute offsetAtt = ( ( OffsetAttribute ) ( addAttribute ( OffsetAttribute . class ) ) ) ; public boolean incrementToken ( ) throws IOException { if ( ( index ) == ( tokens . length ) ) { return false ; } else { termAtt . setTermBuffer ( tokens [ ( ( index ) ++ ) ] ) ; offsetAtt . setOffset ( 0 , 0 ) ; return true ; } } } ; stream = new CachingTokenFilter ( stream ) ; doc . add ( new org . apache . lucene . document . Field ( "preanalyzed" , stream , TermVector . NO ) ) ; checkTokens ( stream ) ; stream . reset ( ) ; checkTokens ( stream ) ; writer . addDocument ( doc ) ; writer . close ( ) ; <START_BUG> IndexReader reader = IndexReader . open ( dir ) ; <END_BUG> TermPositions termPositions = reader . termPositions ( new Term ( "preanalyzed" , "term1" ) ) ; assertTrue ( termPositions . next ( ) ) ; assertEquals ( 1 , termPositions . freq ( ) ) ; assertEquals ( 0 , termPositions . nextPosition ( ) ) ; termPositions . seek ( new Term ( "preanalyzed" , "term2" ) ) ; assertTrue ( termPositions . next ( ) ) ; assertEquals ( 2 , termPositions . freq ( ) ) ; assertEquals ( 1 , termPositions . nextPosition ( ) ) ; assertEquals ( 3 , termPositions . nextPosition ( ) ) ; termPositions . seek ( new Term ( "preanalyzed" , "term3" ) ) ; assertTrue ( termPositions . next ( ) ) ; assertEquals ( 1 , termPositions . freq ( ) ) ; assertEquals ( 2 , termPositions . nextPosition ( ) ) ; reader . close ( ) ; stream . reset ( ) ; checkTokens ( stream ) ; } private void checkTokens ( TokenStream stream ) throws IOException { } }

Fix:
IndexReader reader = IndexReader . open ( dir , true ) ;
Buggy code:
public class Play extends GameState { private GameStage gStage ; private Player main_player ; private Laser laser ; private Bullet bullet ; private Missile missile ; private Enemy enemy ; private int timer ; public static Hashtable < Integer , Boolean > key_events ; public static OrthographicCamera cam ; public static int [ ] relevant_inputs = new int [ ] { Keys . Q , Keys . W , Keys . E , Keys . R , Keys . UP , Keys . LEFT , Keys . RIGHT , Keys . T } ; public Play ( GameStateManager gsm ) { } @ Override public void init ( ) { Play . cam = new OrthographicCamera ( MainGame . WIDTH , MainGame . HEIGHT ) ; ScreenViewport viewport = new ScreenViewport ( Play . cam ) ; gStage = new GameStage ( viewport ) ; <START_BUG> laser = new Laser ( 0 , 0 , 270 , gStage ) ; <END_BUG> bullet = new Bullet ( 100 , ( - 200 ) , 0 , gStage ) ; missile = new Missile ( 100 , 100 , 0 , gStage ) ; enemy = new entities . ship . Enemies . MissileDroid ( 500 , 500 , gStage ) ; Play . key_events = new Hashtable < Integer , Boolean > ( ) ; for ( int input : Play . relevant_inputs ) { Play . key_events . put ( input , false ) ; } Actor test = new TestActor ( ) ; test . setX ( 0 ) ; test . setY ( 0 ) ; gStage . addActor ( missile ) ; gStage . addActor ( ( main_player = new Player ( 200 , 100 , gStage ) ) ) ; gStage . addActor ( enemy ) ; gStage . getPlayer ( ) . updateCamera ( ) ; } @ Override public void update ( float dt ) { } @ Override public void draw ( ) { } @ Override public void handleInput ( ) { } @ Override public void dispose ( ) { } public void spawnBullet ( ) { } @ Override public void pause ( ) { } @ Override public void resume ( ) { } }

Fix:
laser = new Laser ( 0 , 0 , 270 , gStage , 60 ) ;
Buggy code:
public class AlexEntityManager { public static void mainRegistry ( ) { } public static void registerEntity ( Class entityClass , String name ) { int entityID = EntityRegistry . findGlobalUniqueEntityId ( ) ; long seed = name . hashCode ( ) ; Random rand = new Random ( seed ) ; int primaryColor = ( rand . nextInt ( ) ) * 16777215 ; int secondaryColor = ( rand . nextInt ( ) ) * 16777215 ; EntityRegistry . registerGlobalEntityID ( entityClass , name , entityID ) ; <START_BUG> EntityRegistry . registerModEntity ( entityClass , name , entityID , instance , 64 , 1 , true ) ; <END_BUG> entityEggs . put ( Integer . valueOf ( entityID ) , new EntityList . EntityEggInfo ( entityID , primaryColor , secondaryColor ) ) ; } public static void intitializeEntities ( ) { } }

Fix:
EntityRegistry . registerModEntity ( entityClass , name , entityID , instance , 512 , 1 , true ) ;
Buggy code:
public interface ValueStore { <START_BUG> public void addValue ( Field field , String value ) throws Exception ; <END_BUG> }

Fix:
public void addValue ( Field field , IDValue value ) throws Exception ;
Buggy code:
public class SelectClauseFinderValidator extends Validator { @ Override public boolean isValid ( Database database , Options options ) { ArrayList < Table > tables = database . getTables ( ) ; for ( Table table : tables ) { ArrayList < Finder > finders = table . getFinders ( ) ; for ( Finder finder : finders ) { String selectClause = finder . getSelectClause ( ) ; if ( null != selectClause ) { if ( ! ( selectClause . toLowerCase ( ) . contains ( "select" ) ) ) { addWarnMessage ( ( ( ( ( "Finder<seq2seq4repair_space>'" + ( table . getName ( ) ) ) + "." ) + ( finder . getName ( ) ) ) + "'<seq2seq4repair_space>has<seq2seq4repair_space>a<seq2seq4repair_space>selectClause<seq2seq4repair_space>that<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>start<seq2seq4repair_space>with<seq2seq4repair_space>'select',<seq2seq4repair_space>so<seq2seq4repair_space>I<seq2seq4repair_space>am<seq2seq4repair_space>going<seq2seq4repair_space>to<seq2seq4repair_space>add<seq2seq4repair_space>one." ) ) ; <START_BUG> finder . setWhereClause ( ( "<seq2seq4repair_space>select<seq2seq4repair_space>" + selectClause ) ) ; <END_BUG> } } } } return isValid ; } }

Fix:
finder . setSelectClause ( ( "<seq2seq4repair_space>select<seq2seq4repair_space>" + selectClause ) ) ;
Buggy code:
public class PDTTA extends PDFA { private static final long serialVersionUID = 3017416753740710943L ; private static transient Logger logger = LoggerFactory . getLogger ( PDTTA . class ) ; Map < ZeroProbTransition , Distribution > transitionDistributions = null ; public Map < ZeroProbTransition , Distribution > getTransitionDistributions ( ) { } public void setTransitionDistributions ( Map < ZeroProbTransition , Distribution > transitionDistributions ) { } @ Override protected boolean restoreConsistency ( ) { <START_BUG> return ( super . restoreConsistency ( ) ) | ( deleteIrrelevantTransitions ( ) ) ; <END_BUG> } @ Override protected boolean isConsistent ( ) { } private boolean deleteIrrelevantTransitions ( ) { } @ Override protected void changeTransitionProbability ( Transition transition , double newProbability ) { } public void changeTransitionProbability ( Transition transition , double newProbability , boolean bindTimeInformation ) { } protected PDTTA ( ) { } public PDTTA ( PDFA pdfa , Map < ZeroProbTransition , Distribution > transitionDistributions ) throws IOException { } protected void bindTransitionDistribution ( Transition newTransition , Distribution d ) { } protected Distribution removeTimedTransition ( Transition t ) { } @ Override protected boolean removeTransition ( Transition t ) { } public Distribution removeTimedTransition ( Transition t , boolean removeTimeDistribution ) { } @ Override public TimedWord sampleSequence ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } protected TDoubleList computeTimeLikelihoods ( TimedWord ts ) { } @ Override public Pair < TDoubleList , TDoubleList > calculateProbabilities ( TimedWord s ) { } }

Fix:
return ( deleteIrrelevantTransitions ( ) ) | ( super . restoreConsistency ( ) ) ;
Buggy code:
@ Slf4j public class SATFCParallelSolverBundle extends ASolverBundle { private final ISolver fUHFSolver ; private final ISolver fVHFSolver ; public SATFCParallelSolverBundle ( String aClaspLibraryPath , IStationManager aStationManager , IConstraintManager aConstraintManager , String aResultFile , boolean presolve , boolean decompose , boolean underconstrained , String serverURL ) { } private ISolver getClaspSolver ( SATCompressor aSATCompressor , String aConfig , Clasp3Library library ) { } public static class ClaspLibraryGenerator { private final String libraryPath ; private int numClasps ; public ClaspLibraryGenerator ( String libraryPath ) { } public Clasp3Library createClaspLibrary ( ) { File origFile = new File ( libraryPath ) ; try { <START_BUG> File copy = File . createTempFile ( ( ( ( Files . getNameWithoutExtension ( libraryPath ) ) + "." ) + ( ++ ( numClasps ) ) ) , Files . getFileExtension ( libraryPath ) ) ; <END_BUG> Clasp3Library libCopy = ( ( Clasp3Library ) ( Native . loadLibrary ( copy . getPath ( ) , Clasp3Library . class ) ) ) ; Files . copy ( origFile , copy ) ; return libCopy ; } catch ( IOException e ) { throw new RuntimeException ( "Couldn't<seq2seq4repair_space>create<seq2seq4repair_space>a<seq2seq4repair_space>copy<seq2seq4repair_space>of<seq2seq4repair_space>clasp!!!" ) ; } } } @ Override public ISolver getSolver ( StationPackingInstance aInstance ) { } @ Override public void close ( ) { } }

Fix:
File copy = File . createTempFile ( ( ( ( Files . getNameWithoutExtension ( libraryPath ) ) + "_" ) + ( ++ ( numClasps ) ) ) , Files . getFileExtension ( libraryPath ) ) ;
Buggy code:
public final class ContactFacade implements IContactFacade { private static final Logger LOG = Logger . getLogger ( "org.columba.addressbook.facade" ) ; public void addContact ( String uid , IContactItem contactItem ) throws StoreException { } private ContactModel createContactModel ( IContactItem contactItem ) { } public void addContacts ( String uid , IContactItem [ ] contactItems ) throws StoreException { } public void addContacts ( IContactItem [ ] contactItems ) throws StoreException { } public void addContact ( IContactItem contactItem ) throws StoreException { } private void checkContactItemValidity ( IContactItem contactItem ) { } public List < IHeaderItem > getAllHeaderItems ( String folderId , boolean flattenGroupItems ) throws StoreException { if ( folderId == null ) throw new IllegalArgumentException ( "folderId<seq2seq4repair_space>==<seq2seq4repair_space>null" ) ; Vector < IHeaderItem > v = new Vector < IHeaderItem > ( ) ; AddressbookTreeModel model = AddressbookTreeModel . getInstance ( ) ; IFolder f = model . getFolder ( folderId ) ; if ( f == null ) return v ; if ( ! ( f instanceof IContactFolder ) ) return v ; IContactFolder folder = ( ( IContactFolder ) ( f ) ) ; try { Iterator < IContactModelPartial > it = folder . getHeaderItemList ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { IContactModelPartial itemPartial = it . next ( ) ; IContactItem item = createContactItem ( itemPartial ) ; v . add ( item ) ; } List < IGroupItem > groupList = getAllGroups ( folderId ) ; if ( flattenGroupItems ) { Iterator < IGroupItem > it2 = groupList . iterator ( ) ; while ( it2 . hasNext ( ) ) { IGroupItem groupItem = it2 . next ( ) ; <START_BUG> List < IContactItem > l = groupItem . getAllContacts ( ) ; <END_BUG> v . addAll ( l ) ; } } else { v . addAll ( groupList ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } return v ; } public List < IContactItem > getAllContacts ( String folderId ) { } public List < IGroupItem > getAllGroups ( String folderId ) { } public String findByEmailAddress ( String folderId , String emailAddress ) throws StoreException { } public String findByName ( String folderId , String name ) throws IllegalArgumentException , StoreException { } private IContactItem createContactItem ( IContactModelPartial itemPartial ) { } public IContactItem getContactItem ( String folderId , String contactId ) throws IllegalArgumentException , StoreException { } }

Fix:
List < IContactItem > l = groupItem . getContacts ( ) ;
Buggy code:
public class ListMultipleChoicePage extends WicketExamplePage { private static final List < String > SITES = Arrays . asList ( new String [ ] { "The<seq2seq4repair_space>Server<seq2seq4repair_space>Side" , "Java<seq2seq4repair_space>Lobby" , "Java.Net" } ) ; private static final List < String > MANY_CHOICES = Arrays . asList ( new String [ ] { "Choice1" , "Choice2" , "Choice3" , "Choice4" , "Choice5" , "Choice6" , "Choice7" , "Choice8" , "Choice9" } ) ; public ListMultipleChoicePage ( ) { } private static class Input implements Serializable { public List < String > sites = new ArrayList < String > ( ) ; public List < String > choices = new ArrayList < String > ( ) ; public Input ( ) { } @ Override public String toString ( ) { } <START_BUG> private String listAsString ( List list ) { <END_BUG> StringBuffer b = new StringBuffer ( ) ; for ( Iterator i = list . iterator ( ) ; i . hasNext ( ) ; ) { b . append ( i . next ( ) ) ; if ( i . hasNext ( ) ) { b . append ( ",<seq2seq4repair_space>" ) ; } } return b . toString ( ) ; } } @ Override protected void explain ( ) { } }

Fix:
private String listAsString ( final List list ) {
Buggy code:
public class YProductB implements AbstractProductB { @ Override public String methodB ( ) { <START_BUG> return "Implementación<seq2seq4repair_space>Y<seq2seq4repair_space>del<seq2seq4repair_space>producto<seq2seq4repair_space>B" ; <END_BUG> } }

Fix:
return "Implementaci_n<seq2seq4repair_space>Y<seq2seq4repair_space>del<seq2seq4repair_space>producto<seq2seq4repair_space>B" ;
Buggy code:
public class ShellBolt implements IBolt { public static Logger LOG = LoggerFactory . getLogger ( ShellBolt . class ) ; Process _subprocess ; OutputCollector _collector ; Map < String , Tuple > _inputs = new ConcurrentHashMap < String , Tuple > ( ) ; private String [ ] _command ; private ShellProcess _process ; private volatile boolean _running = true ; private volatile Throwable _exception ; private LinkedBlockingQueue _pendingWrites = new LinkedBlockingQueue ( ) ; private Random _rand ; private Thread _readerThread ; private Thread _writerThread ; private TopologyContext _context ; public ShellBolt ( ShellComponent component ) { } public ShellBolt ( String ... command ) { } public void prepare ( Map stormConf , TopologyContext context , final OutputCollector collector ) { } public void execute ( Tuple input ) { } public void cleanup ( ) { } private void handleAck ( Object id ) { } private void handleFail ( Object id ) { } private void handleError ( String msg ) { } private void handleEmit ( ShellMsg shellMsg ) throws InterruptedException { } private void handleMetrics ( ShellMsg shellMsg ) { String name = shellMsg . getMetricName ( ) ; if ( name . isEmpty ( ) ) { throw new RuntimeException ( "Receive<seq2seq4repair_space>Metrics<seq2seq4repair_space>name<seq2seq4repair_space>is<seq2seq4repair_space>empty" ) ; } IMetric iMetric = _context . getRegisteredMetricByName ( name ) ; if ( iMetric == null ) { <START_BUG> throw new RuntimeException ( ( ( "Not<seq2seq4repair_space>find<seq2seq4repair_space>metric<seq2seq4repair_space>by<seq2seq4repair_space>name[" + name ) + "]<seq2seq4repair_space>" ) ) ; <END_BUG> } if ( ! ( iMetric instanceof IShellMetric ) ) { throw new RuntimeException ( ( ( "Metric[" + name ) + "]<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>IShellMetric,<seq2seq4repair_space>can<seq2seq4repair_space>not<seq2seq4repair_space>call<seq2seq4repair_space>by<seq2seq4repair_space>RPC" ) ) ; } IShellMetric iShellMetric = ( ( IShellMetric ) ( iMetric ) ) ; Object paramsObj = shellMsg . getMetricParams ( ) ; try { iShellMetric . updateMetricFromRPC ( paramsObj ) ; } catch ( RuntimeException re ) { throw re ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } private void die ( Throwable exception ) { } }

Fix:
throw new RuntimeException ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>metric<seq2seq4repair_space>by<seq2seq4repair_space>name[" + name ) + "]<seq2seq4repair_space>" ) ) ;
Buggy code:
public class RuleListArrayAdapter extends BaseAdapter { private final Context context ; private int resource ; private HashMap < Number , String > rules ; private String [ ] keys ; public RuleListArrayAdapter ( Context context , int resource , HashMap < Number , String > theRules ) { } public int getCount ( ) { } @ Override public String getItem ( int position ) { <START_BUG> return rules . get ( keys [ position ] ) ; <END_BUG> } @ Override public long getItemId ( int arg0 ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { } }

Fix:
return rules . get ( NumberUtils . getEnumNumberFromString ( keys [ position ] ) ) . toString ( ) ;
Buggy code:
public class TestMultiFieldQueryParser extends LuceneTestCase { public void testStopwordsParsing ( ) throws Exception { } private void assertStopQueryEquals ( String qtxt , String expectedRes ) throws Exception { } public void testSimple ( ) throws Exception { } public void testBoostsSimple ( ) throws Exception { } public void testStaticMethod1 ( ) throws ParseException { } public void testStaticMethod2 ( ) throws ParseException { } public void testStaticMethod2Old ( ) throws ParseException { } public void testStaticMethod3 ( ) throws ParseException { } public void testStaticMethod3Old ( ) throws ParseException { } public void testAnalyzerReturningNull ( ) throws ParseException { } public void testStopWordSearching ( ) throws Exception { Analyzer analyzer = new MockAnalyzer ( random ( ) ) ; Directory ramDir = newDirectory ( ) ; IndexWriter iw = new IndexWriter ( ramDir , newIndexWriterConfig ( TEST_VERSION_CURRENT , analyzer ) ) ; Document doc = new Document ( ) ; doc . add ( newTextField ( "body" , "blah<seq2seq4repair_space>the<seq2seq4repair_space>footest<seq2seq4repair_space>blah" , NO ) ) ; iw . addDocument ( doc ) ; <START_BUG> iw . close ( ) ; <END_BUG> MultiFieldQueryParser mfqp = new MultiFieldQueryParser ( TEST_VERSION_CURRENT , new String [ ] { "body" } , analyzer ) ; mfqp . setDefaultOperator ( AND ) ; Query q = mfqp . parse ( "the<seq2seq4repair_space>footest" ) ; IndexReader ir = DirectoryReader . open ( ramDir ) ; IndexSearcher is = newSearcher ( ir ) ; ScoreDoc [ ] hits = is . search ( q , null , 1000 ) . scoreDocs ; assertEquals ( 1 , hits . length ) ; ir . close ( ) ; ramDir . close ( ) ; } private static class AnalyzerReturningNull extends Analyzer { MockAnalyzer stdAnalyzer = new MockAnalyzer ( random ( ) ) ; public AnalyzerReturningNull ( ) { } @ Override protected Reader initReader ( String fieldName , Reader reader ) { } @ Override public TokenStreamComponents createComponents ( String fieldName ) { } } public void testSimpleRegex ( ) throws ParseException { } }

Fix:
iw . shutdown ( ) ;
Buggy code:
public class Simulator { private static final int HP_HUMANS = 100 ; private static final int HP_VAMPIRES = 150 ; private static final int HP_ZOMBIES = 30 ; private int nbHumans = 800 ; private int nbVampires = 50 ; private int nbZombies = 200 ; private int nbMadZombies = 70 ; private static final int DEFAULT_WIDTH = 100 ; private static final int DEFAULT_DEPTH = 100 ; private static final double HUMAN_CREATION_PROBABILITY = 4 ; private static final double VAMPIRE_CREATION_PROBABILITY = 3 ; private static final double ZOMBIE_CREATION_PROBABILITY = 3 ; private static final double MADZOMBIE_CREATION_PROBABILITY = 6 ; private Field field ; private int step ; private SimulatorView view ; private List < ShotGun > shotguns ; private List < LiquidNitrogen > nitrogens ; private List < WoodenStake > stakes ; private ArrayList < Character > characterList ; public void init ( ) { } public void runLongSimulation ( ) { } public void simulate ( int numSteps ) { } public void nextTurn ( ) { } public void simulateOneStep ( ) { } public int nbHumansAlive ( ) { } public int nbZombiesAlive ( ) { } public static void main ( String [ ] args ) { } public static boolean GenerateRandomBoolean ( ) { } public void reset ( ) { } public void dropObject ( ) { Random rand = new Random ( ) ; Random rand2 = new Random ( ) ; List < Location > free = field . getFreeLocations ( ) ; for ( Location next : free ) { <START_BUG> if ( ( rand . nextInt ( 100 ) ) < 4 ) { <END_BUG> switch ( rand2 . nextInt ( 4 ) ) { case 0 : new Food ( field , next ) ; break ; case 1 : new Ammo ( field , next , 5 ) ; break ; case 2 : new ShotGun ( 5 , 100 , field , next ) ; break ; case 3 : break ; } } } } private void populate ( ) { } }

Fix:
if ( ( rand . nextInt ( 50 ) ) < 4 ) {
Buggy code:
public class Key implements Serializable { private static final long serialVersionUID = - 3532632476298869674L ; private int normalizedKeyNumber ; private String normalizedKeyFlag ; private String musicalKeyString ; public Key ( ) { } public Key ( String keyString ) throws IllegalArgumentException { } private void normalizeKey ( String keyString ) throws IllegalArgumentException , NumberFormatException { this . musicalKeyString = keyString ; switch ( keyString ) { case "A" : normalizedKeyNumber = 11 ; normalizedKeyFlag = "B" ; break ; case "Bb" : normalizedKeyNumber = 6 ; normalizedKeyFlag = "B" ; break ; case "B" : normalizedKeyNumber = 1 ; normalizedKeyFlag = "B" ; break ; case "C" : normalizedKeyNumber = 8 ; normalizedKeyFlag = "B" ; break ; <START_BUG> case "Dd" : <END_BUG> normalizedKeyNumber = 3 ; normalizedKeyFlag = "B" ; break ; case "D" : normalizedKeyNumber = 10 ; normalizedKeyFlag = "B" ; break ; case "Eb" : normalizedKeyNumber = 5 ; normalizedKeyFlag = "B" ; break ; case "E" : normalizedKeyNumber = 12 ; normalizedKeyFlag = "B" ; break ; case "F" : normalizedKeyNumber = 7 ; normalizedKeyFlag = "B" ; break ; case "Gb" : normalizedKeyNumber = 2 ; normalizedKeyFlag = "B" ; break ; case "G" : normalizedKeyNumber = 9 ; normalizedKeyFlag = "B" ; break ; case "Ab" : normalizedKeyNumber = 4 ; normalizedKeyFlag = "B" ; break ; case "Am" : normalizedKeyNumber = 8 ; normalizedKeyFlag = "A" ; break ; case "Bbm" : normalizedKeyNumber = 3 ; normalizedKeyFlag = "A" ; break ; case "Bm" : normalizedKeyNumber = 10 ; normalizedKeyFlag = "A" ; break ; case "Cm" : normalizedKeyNumber = 5 ; normalizedKeyFlag = "A" ; break ; case "Dbm" : normalizedKeyNumber = 12 ; normalizedKeyFlag = "A" ; break ; case "Dm" : normalizedKeyNumber = 7 ; normalizedKeyFlag = "A" ; break ; case "Ebm" : normalizedKeyNumber = 2 ; normalizedKeyFlag = "A" ; break ; case "Em" : normalizedKeyNumber = 9 ; normalizedKeyFlag = "A" ; break ; case "Fm" : normalizedKeyNumber = 4 ; normalizedKeyFlag = "A" ; break ; case "Gbm" : normalizedKeyNumber = 11 ; normalizedKeyFlag = "A" ; break ; case "Gm" : normalizedKeyNumber = 6 ; normalizedKeyFlag = "A" ; break ; case "Abm" : normalizedKeyNumber = 1 ; normalizedKeyFlag = "A" ; break ; default : boolean foundNormalizedKey = setNormalizedString ( keyString ) ; if ( ! foundNormalizedKey ) { throw new IllegalArgumentException ( "Key<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>detected" ) ; } } } private boolean setNormalizedString ( String keyString ) throws NumberFormatException { } public String getMusicalKeyString ( ) { } public void setMusicalKeyString ( String mk ) { } public String getNormalizedKeyString ( ) { } public String getNormalizedKeyFlag ( ) { } public int getNormalizedKeyNumber ( ) { } public void setNormalizedKeyFlag ( String nk ) { } public void setNormalizedKeyNumber ( int nk ) { } public ArrayList < String > getNeighborKeys ( ) { } public String toString ( ) { } }

Fix:
case "Db" :
Buggy code:
class ClassLoadingMXBeanAttributeHandler extends AbstractPlatformMBeanAttributeHandler { static final ClassLoadingMXBeanAttributeHandler INSTANCE = new ClassLoadingMXBeanAttributeHandler ( ) ; private ClassLoadingMXBeanAttributeHandler ( ) { } @ Override protected void executeReadAttribute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final String name = operation . require ( NAME ) . asString ( ) ; <START_BUG> if ( OBJECT_NAME . getName ( ) . equals ( name ) ) { <END_BUG> context . getResult ( ) . set ( ManagementFactory . CLASS_LOADING_MXBEAN_NAME ) ; } else if ( TOTAL_LOADED_CLASS_COUNT . equals ( name ) ) { context . getResult ( ) . set ( ManagementFactory . getClassLoadingMXBean ( ) . getTotalLoadedClassCount ( ) ) ; } else if ( LOADED_CLASS_COUNT . equals ( name ) ) { context . getResult ( ) . set ( ManagementFactory . getClassLoadingMXBean ( ) . getLoadedClassCount ( ) ) ; } else if ( UNLOADED_CLASS_COUNT . equals ( name ) ) { context . getResult ( ) . set ( ManagementFactory . getClassLoadingMXBean ( ) . getUnloadedClassCount ( ) ) ; } else if ( VERBOSE . equals ( name ) ) { context . getResult ( ) . set ( ManagementFactory . getClassLoadingMXBean ( ) . isVerbose ( ) ) ; } else if ( ( ClassLoadingResourceDefinition . CLASSLOADING_METRICS . contains ( name ) ) || ( ClassLoadingResourceDefinition . CLASSLOADING_READ_WRITE_ATTRIBUTES . contains ( name ) ) ) { throw ROOT_LOGGER . badReadAttributeImpl ( name ) ; } else { throw unknownAttribute ( operation ) ; } } @ Override protected void executeWriteAttribute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } }

Fix:
if ( ( ( PlatformMBeanUtil . JVM_MAJOR_VERSION ) > 6 ) && ( OBJECT_NAME . getName ( ) . equals ( name ) ) ) {
Buggy code:
@ Path ( application = "cms" , value = "storageItemField" ) public class StorageItemField extends PageServlet { private static final Logger LOGGER = LoggerFactory . getLogger ( StorageItemField . class ) ; public static void processField ( ToolPageContext page ) throws IOException , ServletException { } public static String createStorageItemPath ( String label , String fileName ) { } static String createStoragePathPrefix ( ) { } static String getStorageSetting ( Optional < ObjectField > field ) { String storageSetting = null ; if ( field . isPresent ( ) ) { String fieldStorageSetting = field . get ( ) . as ( com . psddev . cms . db . ToolUi . class ) . getStorageSetting ( ) ; if ( ! ( StringUtils . isBlank ( fieldStorageSetting ) ) ) { <START_BUG> storageSetting = Settings . get ( String . class , ( ( ( StorageItem . SETTING_PREFIX ) + "//" ) + fieldStorageSetting ) ) ; <END_BUG> } } if ( StringUtils . isBlank ( storageSetting ) ) { storageSetting = Settings . get ( String . class , DEFAULT_STORAGE_SETTING ) ; } return storageSetting ; } @ Override protected String getPermissionId ( ) { } @ Override protected void doService ( ToolPageContext page ) throws IOException , ServletException { } }

Fix:
storageSetting = Settings . get ( String . class , fieldStorageSetting ) ;
Buggy code:
public class UserAnalyzer { private static Jedis jedis = new Jedis ( WikiController . REDIS_HOST , WikiController . REDIS_PORT ) ; private static List < String > getUserNames ( ) { } public static void analyze ( ) { List < String > user_list = UserAnalyzer . getUserNames ( ) ; ActorSystem system = ActorSystem . create ( "WikiNationExtractionSystem" ) ; final ActorRef listener = system . actorOf ( Props . create ( ResultListener . class , user_list . size ( ) ) , "listener" ) ; <START_BUG> ActorRef master = system . actorOf ( Props . create ( NationExtractionRunner . class , 20 , 10000 , listener , user_list ) , "master" ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
ActorRef master = system . actorOf ( Props . create ( NationExtractionRunner . class , 10 , 100000 , listener , user_list ) , "master" ) ;
Buggy code:
public class MethodData extends ItemData { Method method ; public MethodData ( Method method , String str ) { } public static String [ ] getAllFlags ( ) { <START_BUG> return new String [ ] { FLAG_NO_GEN , FLAG_ADDRESS , FLAG_CONST , FLAG_STRUCT , FLAG_DYNAMIC , FLAG_JNI , FLAG_CPP , FLAG_NEW , FLAG_DELETE , FLAG_GCNEW , FLAG_GCOBJECT , FLAG_SETTER , FLAG_GETTER , FLAG_ADDER } ; <END_BUG> } public Method getMethod ( ) { } public String getAccessor ( ) { } public String getExclude ( ) { } public void setAccessor ( String str ) { } public void setExclude ( String str ) { } }

Fix:
return new String [ ] { FLAG_NO_GEN , FLAG_ADDRESS , FLAG_CONST , FLAG_DYNAMIC , FLAG_JNI , FLAG_CPP , FLAG_NEW , FLAG_DELETE , FLAG_GCNEW , FLAG_GCOBJECT , FLAG_SETTER , FLAG_GETTER , FLAG_ADDER } ;
Buggy code:
public class CBayesNormalizedWeightDriver { private static final Logger log = LoggerFactory . getLogger ( CBayesNormalizedWeightDriver . class ) ; private CBayesNormalizedWeightDriver ( ) { } public static void main ( String [ ] args ) throws IOException { } public static void runJob ( String input , String output ) throws IOException { JobClient client = new JobClient ( ) ; JobConf conf = new JobConf ( CBayesNormalizedWeightDriver . class ) ; conf . setOutputKeyClass ( Text . class ) ; conf . setOutputValueClass ( DoubleWritable . class ) ; FileInputFormat . addInputPath ( conf , new Path ( ( output + "//trainer-theta" ) ) ) ; Path outPath = new Path ( ( output + "//trainer-weight" ) ) ; FileOutputFormat . setOutputPath ( conf , outPath ) ; conf . setNumMapTasks ( 100 ) ; conf . setMapperClass ( CBayesNormalizedWeightMapper . class ) ; conf . setInputFormat ( SequenceFileInputFormat . class ) ; conf . setCombinerClass ( CBayesNormalizedWeightReducer . class ) ; conf . setReducerClass ( CBayesNormalizedWeightReducer . class ) ; conf . setOutputFormat ( SequenceFileOutputFormat . class ) ; conf . set ( "io.serializations" , "org.apache.hadoop.io.serializer.JavaSerialization,org.apache.hadoop.io.serializer.WritableSerialization" ) ; <START_BUG> FileSystem dfs = FileSystem . get ( conf ) ; <END_BUG> if ( dfs . exists ( outPath ) ) dfs . delete ( outPath , true ) ; Path thetaNormalizationsFiles = new Path ( ( output + "//trainer-thetaNormalizer//part*" ) ) ; Map < String , Double > thetaNormalizer = SequenceFileModelReader . readLabelSums ( dfs , thetaNormalizationsFiles , conf ) ; double perLabelWeightSumNormalisationFactor = Double . MAX_VALUE ; for ( Map . Entry < String , Double > stringDoubleEntry1 : thetaNormalizer . entrySet ( ) ) { double Sigma_W_ij = stringDoubleEntry1 . getValue ( ) ; if ( perLabelWeightSumNormalisationFactor > ( Math . abs ( Sigma_W_ij ) ) ) { perLabelWeightSumNormalisationFactor = Math . abs ( Sigma_W_ij ) ; } } for ( Map . Entry < String , Double > stringDoubleEntry : thetaNormalizer . entrySet ( ) ) { double Sigma_W_ij = stringDoubleEntry . getValue ( ) ; thetaNormalizer . put ( stringDoubleEntry . getKey ( ) , ( Sigma_W_ij // perLabelWeightSumNormalisationFactor ) ) ; } DefaultStringifier < Map < String , Double > > mapStringifier = new DefaultStringifier < Map < String , Double > > ( conf , GenericsUtil . getClass ( thetaNormalizer ) ) ; String thetaNormalizationsString = mapStringifier . toString ( thetaNormalizer ) ; Map < String , Double > c = mapStringifier . fromString ( thetaNormalizationsString ) ; CBayesNormalizedWeightDriver . log . info ( "{}" , c ) ; conf . set ( "cnaivebayes.thetaNormalizations" , thetaNormalizationsString ) ; client . setConf ( conf ) ; JobClient . runJob ( conf ) ; } }

Fix:
FileSystem dfs = FileSystem . get ( outPath . toUri ( ) , conf ) ;
Buggy code:
public class CollectionPropsInjectorHandlerTest { public CollectionPropsInjectorHandlerTest ( ) { } @ BeforeClass public static void setUpClass ( ) { } @ AfterClass public static void tearDownClass ( ) { } @ Before public void setUp ( ) { } @ After public void tearDown ( ) { } @ Test public void testCheckCollectionPut ( ) { } @ Test public void testCheckCollectionFilesPost ( ) { System . out . println ( "testCheckCollectionFilesPost" ) ; RequestContext context = createContext ( "//db//fs.files" , "POST" ) ; assertEquals ( context . getType ( ) , FILES_BUCKET ) ; assertEquals ( context . getMethod ( ) , POST ) ; <START_BUG> assertEquals ( false , CollectionPropsInjectorHandler . checkCollection ( context ) ) ; <END_BUG> } @ Test public void testCheckCollectionRoot ( ) { } private RequestContext createContext ( String requestPath , String httpMethod ) { } }

Fix:
assertEquals ( true , CollectionPropsInjectorHandler . checkCollection ( context ) ) ;
Buggy code:
public class PlainJUnitResultFormatter implements JUnitResultFormatter { private static final double ONE_SECOND = 1000.0 ; private NumberFormat nf = NumberFormat . getInstance ( ) ; private Hashtable testStarts = new Hashtable ( ) ; private OutputStream out ; private StringWriter inner ; private BufferedWriter wri ; private Hashtable failed = new Hashtable ( ) ; private String systemOutput = null ; private String systemError = null ; public PlainJUnitResultFormatter ( ) { } public void setOutput ( OutputStream out ) { } public void setSystemOutput ( String out ) { } public void setSystemError ( String err ) { } public void startTestSuite ( JUnitTest suite ) throws BuildException { } public void endTestSuite ( JUnitTest suite ) throws BuildException { } public void startTest ( Test t ) { } 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 ) { synchronized ( wri ) { if ( test != null ) { endTest ( test ) ; failed . put ( test , Boolean . TRUE ) ; } try { wri . write ( type ) ; wri . newLine ( ) ; <START_BUG> wri . write ( t . getMessage ( ) ) ; <END_BUG> wri . newLine ( ) ; String strace = JUnitTestRunner . getFilteredTrace ( t ) ; wri . write ( strace ) ; wri . newLine ( ) ; } catch ( IOException ex ) { throw new BuildException ( ex ) ; } } } }

Fix:
wri . write ( String . valueOf ( t . getMessage ( ) ) ) ;
Buggy code:
public class Snippet327 { static final String PREAMBLE = "SNIPPET327LINK" ; public static void main ( String [ ] args ) { } static String createPage ( int index ) { <START_BUG> return ( ( ( ( ( ( "<html><body>This<seq2seq4repair_space>is<seq2seq4repair_space>page<seq2seq4repair_space>" + index ) + "<p><a<seq2seq4repair_space>href=\"#" ) + ( Snippet327 . PREAMBLE ) ) + ( ++ index ) ) + "\">Go<seq2seq4repair_space>to<seq2seq4repair_space>page<seq2seq4repair_space>" ) + index ) + "<//a><//body><//html>" ; <END_BUG> } }

Fix:
return ( ( ( ( ( ( "<html><body>This<seq2seq4repair_space>is<seq2seq4repair_space>page<seq2seq4repair_space>" + index ) + "<p><a<seq2seq4repair_space>href=\"" ) + ( Snippet327 . PREAMBLE ) ) + ( ++ index ) ) + "\">Go<seq2seq4repair_space>to<seq2seq4repair_space>page<seq2seq4repair_space>" ) + index ) + "<//a><//body><//html>" ;
Buggy code:
public class MainActivity extends CommonFragmentActivity { private LayoutInflater inflater ; private Context context ; private final int COMPOSE_TAB_INDEX = 2 ; private Class [ ] fragmentArray = new Class [ ] { FeedFragment . class , FollowFragment . class , null , MessageFragment . class , ProfileFragment . class } ; private int [ ] mImageViewArray = new int [ ] { drawable . tab_home_btn , drawable . tab_find_btn , - 1 , drawable . tab_message_btn , drawable . tab_myself_btn } ; private String [ ] mTextViewArray = new String [ ] { "首页" , "关注的" , "发表" , "消息" , "我" } ; private FragmentTabHost mTabHost ; private PopupWindow mPopupWindow ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void initComposeWindow ( ) { } private void dismissPopupAndRestoreTab ( ) { } private void animPanelHolderExitAndDismissPopUp ( ) { } private void animPanelHolder ( ) { View ivPanelHolder = mPopupWindow . getContentView ( ) . findViewById ( panel_holder ) ; <START_BUG> TranslateAnimation t = new TranslateAnimation ( Animation . RELATIVE_TO_SELF , 0 , Animation . RELATIVE_TO_SELF , 0 , Animation . RELATIVE_TO_SELF , 0.3F , Animation . RELATIVE_TO_SELF , 0 ) ; <END_BUG> t . setInterpolator ( AnimationUtils . loadInterpolator ( context , overshoot ) ) ; t . setDuration ( 300 ) ; t . setFillAfter ( true ) ; ivPanelHolder . startAnimation ( t ) ; } private void animRotateCancelBtn ( ) { } private View getIndicatorView ( String name , int iconId ) { } private void showToast ( ) { } }

Fix:
TranslateAnimation t = new TranslateAnimation ( Animation . RELATIVE_TO_SELF , 0 , Animation . RELATIVE_TO_SELF , 0 , Animation . RELATIVE_TO_SELF , 0.5F , Animation . RELATIVE_TO_SELF , 0 ) ;
Buggy code:
public class PeriodInstanceKeyedGenerator { private static final int MAXIMUM_SIZE = 100000 ; public static final ResourceId PERIOD_START_DATE_ID = ResourceId . valueOf ( "_period_start_date" ) ; public static final ResourceId PERIOD_END_DATE_ID = ResourceId . valueOf ( "_period_end_date" ) ; public enum Direction { BACK , FORWARD ; } public interface Formatter { String format ( String pattern , Date date ) { } } private final ResourceId classId ; private final PeriodInstanceKeyedGenerator . Formatter formatter ; private final DayOfWeekProvider dayOfWeekProvider ; private List < FormInstance > lastGeneratedList ; private PeriodValue lastPeriod ; private int lastCount = 1 ; public PeriodInstanceKeyedGenerator ( ResourceId classId ) { } public PeriodInstanceKeyedGenerator ( ResourceId classId , PeriodInstanceKeyedGenerator . Formatter formatter ) { } public PeriodInstanceKeyedGenerator ( ResourceId classId , PeriodInstanceKeyedGenerator . Formatter formatter , CalendarUtils . DayOfWeekProvider dayOfWeekProvider ) { } public List < FormInstance > generate ( PeriodValue period , Date startDate , PeriodInstanceKeyedGenerator . Direction direction , int count ) { } private List < FormInstance > generate ( PeriodValue period , Date startDate , PeriodInstanceKeyedGenerator . Direction direction , int count , boolean saveState ) { } public List < FormInstance > next ( ) { assertState ( ) ; int size = lastGeneratedList . size ( ) ; FormInstance lastInstance = lastGeneratedList . get ( ( size - 1 ) ) ; DateRange lastDateRange = PeriodInstanceKeyedGenerator . getDateRangeFromInstance ( lastInstance ) ; <START_BUG> Date point = lastDateRange . midDate ( ) ; <END_BUG> List < FormInstance > next = generate ( lastPeriod , point , PeriodInstanceKeyedGenerator . Direction . FORWARD , 1 , false ) ; lastGeneratedList . remove ( 0 ) ; lastGeneratedList . add ( ( size - 1 ) , next . get ( 0 ) ) ; return lastGeneratedList ; } public List < FormInstance > fullNext ( ) { } public List < FormInstance > previous ( ) { } public List < FormInstance > fullPrevious ( ) { } private void assertState ( ) { } public static DateRange getDateRangeFromInstance ( FormInstance instance ) { } private FormInstance createInstance ( DateRange range , PeriodValue period , PeriodInstanceKeyedGenerator . Direction direction ) { } private String getLabel ( DateRange range , PeriodValue period , PeriodInstanceKeyedGenerator . Direction direction ) { } private Date getDateForLabel ( DateRange range , PeriodValue period ) { } private String format ( Date date , PeriodValue period ) { } private DateRange generateDateRange ( PeriodValue period , Date point , PeriodInstanceKeyedGenerator . Direction direction ) { } }

Fix:
Date point = ( DAILY . getPeriod ( ) . equals ( lastPeriod ) ) ? lastDateRange . getEnd ( ) : lastDateRange . midDate ( ) ;