nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class ComplexFormatAbstractTest extends TestCase { ComplexFormat complexFormat = null ; ComplexFormat complexFormatJ = null ; protected abstract Locale getLocale ( ) { } protected abstract char getDecimalCharacter ( ) { } protected void setUp ( ) throws Exception { } public void testSimpleNoDecimals ( ) { } public void testSimpleWithDecimals ( ) { } public void testSimpleWithDecimalsTrunc ( ) { } public void testNegativeReal ( ) { } public void testNegativeImaginary ( ) { } public void testNegativeBoth ( ) { } public void testZeroReal ( ) { } public void testZeroImaginary ( ) { } public void testDifferentImaginaryChar ( ) { } public void testStaticFormatComplex ( ) { } public void testNan ( ) { } public void testPositiveInfinity ( ) { } public void testNegativeInfinity ( ) { } public void testParseSimpleNoDecimals ( ) { } public void testParseSimpleWithDecimals ( ) { } public void testParseSimpleWithDecimalsTrunc ( ) { } public void testParseNegativeReal ( ) { } public void testParseNegativeImaginary ( ) { } public void testParseNegativeBoth ( ) { } public void testParseZeroReal ( ) { } public void testParseZeroImaginary ( ) { } public void testParseDifferentImaginaryChar ( ) { } public void testParseNan ( ) { } public void testParsePositiveInfinity ( ) { } public void testPaseNegativeInfinity ( ) { } public void testConstructorSingleFormat ( ) { } public void testGetImaginaryFormat ( ) { } public void testSetImaginaryFormatNull ( ) { } public void testSetRealFormatNull ( ) { } public void testGetRealFormat ( ) { } public void testSetImaginaryCharacterNull ( ) { } public void testSetImaginaryCharacterEmpty ( ) { } public void testFormatNumber ( ) { ComplexFormat cf = ComplexFormat . getInstance ( getLocale ( ) ) ; <START_BUG> Double pi = Double . valueOf ( Math . PI ) ; <END_BUG> String text = cf . format ( pi ) ; assertEquals ( ( ( "3" + ( getDecimalCharacter ( ) ) ) + "14" ) , text ) ; } public void testFormatObject ( ) { } public void testForgottenImaginaryCharacter ( ) { } }

Fix:
Double pi = new Double ( Math . PI ) ;
Buggy code:
public class DroneInterfaces { public enum DroneEventsType { ORIENTATION , SPEED , BATTERY , GUIDEDPOINT , NAVIGATION , ATTITUDE , RADIO , RC_IN , RC_OUT , ARMING , AUTOPILOT_WARNING , MODE , STATE , MISSION_UPDATE , MISSION_RECEIVED , TYPE , HOME , GPS , GPS_FIX , GPS_COUNT , PARAMETER , CALIBRATION_IMU , CALIBRATION_TIMEOUT , HEARTBEAT_TIMEOUT , HEARTBEAT_FIRST , HEARTBEAT_RESTORED , DISCONNECTED , CONNECTED , CONNECTING , CHECKING_VEHICLE_LINK , CONNECTION_FAILED , MISSION_SENT , ARMING_STARTED , INVALID_POLYGON , MISSION_WP_UPDATE , FOLLOW_START , FOLLOW_STOP , FOLLOW_UPDATE , FOLLOW_CHANGE_TYPE , PARAMETERS_DOWNLOADED , WARNING_400FT_EXCEEDED , WARNING_SIGNAL_WEAK , FIRMWARE , WARNING_NO_GPS , MAGNETOMETER , FOOTPRINT ; } public interface OnDroneListener { public void onDroneEvent ( DroneInterfaces . DroneEventsType event , Drone drone ) { } } public interface OnParameterManagerListener { public void onBeginReceivingParameters ( ) { } public void onParameterReceived ( Parameter parameter , int index , int count ) { } <START_BUG> public void onEndReceivingParameters ( List < Parameter > parameter ) ; <END_BUG> } public interface OnWaypointManagerListener { public void onBeginWaypointEvent ( WaypointManager . WaypointEvent_Type wpEvent ) { } public void onWaypointEvent ( WaypointManager . WaypointEvent_Type wpEvent , int index , int count ) { } public void onEndWaypointEvent ( WaypointManager . WaypointEvent_Type wpEvent ) { } } public interface OnTimeout { public void notifyTimeOut ( int timeOutCount ) { } } public interface Clock { long elapsedRealtime ( ) { } } public interface Handler { void removeCallbacks ( Runnable thread ) { } void post ( Runnable thread ) { } void postDelayed ( Runnable thread , long timeout ) { } } }

Fix:
public void onEndReceivingParameters ( ) ;
Buggy code:
public class ToolBar extends JToolBar { ResourceBundle toolbarLabels ; GridBagConstraints gridbagConstraints ; GridBagLayout gridbagLayout ; int i ; XmlElement rootElement ; AbstractFrameController frameController ; public ToolBar ( XmlElement rootElement , AbstractFrameController controller ) { } public boolean getVisible ( ) { <START_BUG> return new Boolean ( rootElement . getAttribute ( "visible" ) ) . booleanValue ( ) ; <END_BUG> } private void createButtons ( ) { } public void addButton ( BasicAction action ) { } }

Fix:
return Boolean . valueOf ( rootElement . getAttribute ( "visible" ) ) . booleanValue ( ) ;
Buggy code:
class DeltaDecoder extends CoderBase { DeltaDecoder ( ) { } @ Override InputStream decode ( final InputStream in , long uncompressedLength , final Coder coder , byte [ ] password ) throws IOException { } @ Override OutputStream encode ( final OutputStream out , final Object options ) throws IOException { } @ Override byte [ ] getOptionsAsProperties ( Object options ) { } @ Override Object getOptionsFromCoder ( Coder coder , InputStream in ) { <START_BUG> return Integer . valueOf ( getOptionsFromCoder ( coder ) ) ; <END_BUG> } private int getOptionsFromCoder ( Coder coder ) { } }

Fix:
return getOptionsFromCoder ( coder ) ;
Buggy code:
public class ProductFragment extends Fragment { private static final String ARG_PARAM1 = "param1" ; private static final String ARG_PARAM2 = "param2" ; private String mParam1 ; private String mParam2 ; private Menu menu ; private MenuItem m_add ; private MenuItem m_save ; private MenuItem m_edit ; private ArrayList < Like > categoriesList = new ArrayList < Like > ( ) ; private ArrayList < Product > productList = new ArrayList < Product > ( ) ; private Context mContext ; private FrameLayout f_viewFrame ; private FrameLayout f_editFrame ; private ListView l_productListView ; private ImageView i_productImage ; private ImageView i_addProductImage ; private TextView t_productNameLabel ; private TextView t_addProductLabel ; private TextView t_productDesc ; private TextView t_productCategory ; private TextView t_productCategoryLabel ; private Spinner s_productCategory ; private EditText e_productName ; private EditText e_productDesc ; private String savedPath ; private ContextWrapper cw ; private ProductFragment . OnFragmentInteractionListener mListener ; public ProductFragment ( ) { } public static ProductFragment newInstance ( String param1 , String param2 ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onCreateOptionsMenu ( Menu menu , MenuInflater inflater ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } public void onButtonPressed ( Uri uri ) { } @ Override public void onActivityResult ( int requestCode , int resultCode , Intent data ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public void onDetach ( ) { } private void getProducts ( ) { } public void productListLongClick ( AdapterView < ? > arg0 , final View arg1 , int position , long arg3 ) { } public void productListClick ( AdapterView < ? > adapterView , View view , int Position , long id ) { } public void getCategories ( ) { } public void saveProduct ( final String name , final int categoryID , final String image , final String desc , final Bitmap bitmap ) { } public String base64 ( Drawable d ) { Bitmap b = ( ( android . graphics . drawable . BitmapDrawable ) ( d ) ) . getBitmap ( ) ; b = Bitmap . createScaledBitmap ( b , 200 , 200 , false ) ; ByteArrayOutputStream stream = new ByteArrayOutputStream ( ) ; <START_BUG> b . compress ( JPEG , 100 , stream ) ; <END_BUG> byte [ ] bitmapdata = stream . toByteArray ( ) ; return Base64 . encodeToString ( bitmapdata , 1 ) ; } public interface OnFragmentInteractionListener { public void onProductInteraction ( Uri uri ) { } } }

Fix:
b . compress ( PNG , 100 , stream ) ;
Buggy code:
public class EntityHandler { @ SubscribeEvent public void onEntityConstructed ( EntityEvent . EntityConstructing event ) { <START_BUG> if ( ( ( event . entity ) instanceof EntityLiving ) && ( ColorProperties . isValidMob ( ( ( EntityLivingBase ) ( event . entity ) ) ) ) ) { <END_BUG> ColorProperties . setPropsToEntity ( ( ( EntityLivingBase ) ( event . entity ) ) ) ; if ( ( ConfigurationHandler . spawnRandom ) && ( ( Math . random ( ) ) > ( ConfigurationHandler . spawnRate ) ) ) ColorProperties . setEntityColors ( new ColorObject ( false ) , ( ( EntityLivingBase ) ( event . entity ) ) ) ; } } @ SubscribeEvent public void onEntityTracked ( PlayerEvent . StartTracking event ) { } @ SubscribeEvent public void onMobDeath ( LivingDropsEvent event ) { } No newline ; at end ; of file ; }

Fix:
if ( ( event . entity ) instanceof EntityLiving ) {
Buggy code:
public class GetBinaryFileHandlerTest { public GetBinaryFileHandlerTest ( ) { } @ Test public void testExtractBucket ( ) { System . out . println ( "testExtractBucket" ) ; <START_BUG> assertEquals ( "mybucket" , GetBinaryFileHandler . extractBucketName ( "mybucket.files" ) ) ; <END_BUG> } }

Fix:
assertEquals ( "mybucket" , GetFileHandler . extractBucketName ( "mybucket.files" ) ) ;
Buggy code:
@ Repository ( "cqmCriterionDAO" ) public class CQMCriterionDAOImpl extends BaseDAOImpl implements CQMCriterionDAO { @ Override public CQMCriterionDTO create ( CQMCriterionDTO dto ) throws EntityCreationException , EntityRetrievalException { } @ Override public void update ( CQMCriterionDTO dto ) throws EntityCreationException , EntityRetrievalException { } @ Override public void delete ( Long criterionId ) { } @ Override public List < CQMCriterionDTO > findAll ( ) { } @ Override public CQMCriterionDTO getById ( Long criterionId ) throws EntityRetrievalException { } @ Override public CQMCriterionDTO getCMSByNumber ( String number ) { } @ Override public CQMCriterionDTO getCMSByNumberAndVersion ( String number , String version ) { } @ Override public CQMCriterionDTO getNQFByNumber ( String number ) { } private void create ( CQMCriterionEntity entity ) { } private void update ( CQMCriterionEntity entity ) { } private List < CQMCriterionEntity > getAllEntities ( ) { } private CQMCriterionEntity getEntityById ( Long id ) throws EntityRetrievalException { } @ Override public CQMCriterionEntity getNQFEntityByNumber ( String number ) { CQMCriterionEntity entity = null ; <START_BUG> Query query = entityManager . createQuery ( "from<seq2seq4repair_space>CQMCriterionEntity<seq2seq4repair_space>where<seq2seq4repair_space>(NOT<seq2seq4repair_space>deleted<seq2seq4repair_space>=<seq2seq4repair_space>true)<seq2seq4repair_space>AND<seq2seq4repair_space>(number<seq2seq4repair_space>=<seq2seq4repair_space>:number)<seq2seq4repair_space>" , CQMCriterionEntity . class ) ; <END_BUG> query . setParameter ( "number" , number ) ; List < CQMCriterionEntity > result = query . getResultList ( ) ; if ( ( result . size ( ) ) > 0 ) { entity = result . get ( 0 ) ; } return entity ; } @ Override public CQMCriterionEntity getCMSEntityByNumber ( String number ) { } @ Override public CQMCriterionEntity getCMSEntityByNumberAndVersion ( String number , String version ) { } }

Fix:
Query query = entityManager . createQuery ( "from<seq2seq4repair_space>CQMCriterionEntity<seq2seq4repair_space>where<seq2seq4repair_space>(NOT<seq2seq4repair_space>deleted<seq2seq4repair_space>=<seq2seq4repair_space>true)<seq2seq4repair_space>AND<seq2seq4repair_space>(nqf_number<seq2seq4repair_space>=<seq2seq4repair_space>:number)<seq2seq4repair_space>" , CQMCriterionEntity . class ) ;
Buggy code:
public class JavaRun implements IAjcRun { JavaRun . Spec spec ; private Sandbox sandbox ; public JavaRun ( JavaRun . Spec spec ) { } public boolean setupAjcRun ( Sandbox sandbox , Validator validator ) { } public boolean run ( IRunStatus status ) throws ClassNotFoundException , IllegalAccessException , NoSuchMethodException , InvocationTargetException { } protected void setupTester ( File baseDir , ClassLoader loader , IMessageHandler handler ) { } protected void setupTester ( File baseDir , IMessageHandler handler ) { } public String toString ( ) { } public static class Spec extends AbstractRunSpec { public static final String XMLNAME = "run" ; private static final XMLNames NAMES = new XMLNames ( XMLNames . DEFAULT , "" , "" , null , null , "" , null , false , false , true ) ; protected String className ; protected String javaVersion ; protected boolean skipTester ; public Spec ( ) { } public void setJavaVersion ( String version ) { } public void setClassName ( String className ) { } public void setSkipTester ( boolean skip ) { } public void addDirChanges ( DirChanges . Spec spec ) { } public IRunIterator makeRunIterator ( Sandbox sandbox , Validator validator ) { } public void writeXml ( XMLWriter out ) { <START_BUG> String attr = out . makeAttribute ( "class" , className ) ; <END_BUG> out . startElement ( xmlElementName , attr , false ) ; if ( skipTester ) { out . printAttribute ( "skipTester" , "true" ) ; } if ( null != ( javaVersion ) ) { out . printAttribute ( "vm" , javaVersion ) ; } super . writeAttributes ( out ) ; out . endAttributes ( ) ; if ( ! ( LangUtil . isEmpty ( dirChanges ) ) ) { DirChanges . Spec . writeXml ( out , dirChanges ) ; } List messages = getMessages ( ) ; if ( 0 < ( messages . size ( ) ) ) { SoftMessage . writeXml ( out , messages ) ; } out . endElement ( xmlElementName ) ; } public String toLongString ( ) { } public String toString ( ) { } protected boolean doAdoptParentValues ( RT parentRuntime , IMessageHandler handler ) { } } }

Fix:
String attr = XMLWriter . makeAttribute ( "class" , className ) ;
Buggy code:
public class ProfiloUtenteProtocollo { private final Protocollo protocollo ; private final Utente autenticato ; private final Ufficio sportello ; private Ufficio attribuzionePrincipale = null ; private ArrayList attribuzioni = new ArrayList ( ) ; private ArrayList ufficiUtente = new ArrayList ( ) ; private ArrayList ufficiRicercaUtente = new ArrayList ( ) ; private ArrayList ufficiRiservatoUtente = new ArrayList ( ) ; private ArrayList ufficiVisualizzaUtente = new ArrayList ( ) ; private ArrayList ufficiConsolidaUtente = new ArrayList ( ) ; public ProfiloUtenteProtocollo ( Protocollo protocollo , Utente autenticato ) { } public Boolean inSportelloOAttribuzione ( ) { } public Boolean inSportelloOAttribuzionePrincipale ( ) { } public Boolean inSportelloOAttribuzioneR ( ) { List intersezione = new ArrayList ( attribuzioni ) ; <START_BUG> intersezione . retainAll ( ufficiUtente ) ; <END_BUG> return ( ufficiRiservatoUtente . contains ( sportello ) ) || ( ( intersezione . size ( ) ) > 0 ) ; } public Boolean inSportelloOAttribuzioneV ( ) { } public Boolean inSportelloOAttribuzionePrincipaleR ( ) { } public Boolean inSportelloOAttribuzionePrincipaleV ( ) { } public Boolean inAttribuzionePrincipaleC ( ) { } public Boolean neSportelloNeAttribuzione ( ) { } }

Fix:
intersezione . retainAll ( ufficiRiservatoUtente ) ;
Buggy code:
public class LogFilePatternReceiverBeanInfo extends SimpleBeanInfo { public PropertyDescriptor [ ] getPropertyDescriptors ( ) { try { <START_BUG> return new PropertyDescriptor [ ] { new PropertyDescriptor ( "fileName" , LogFilePatternReceiver . class ) , new PropertyDescriptor ( "timestampFormat" , LogFilePatternReceiver . class ) , new PropertyDescriptor ( "logFormat" , LogFilePatternReceiver . class ) , new PropertyDescriptor ( "name" , LogFilePatternReceiver . class ) , new PropertyDescriptor ( "tailing" , LogFilePatternReceiver . class ) , new PropertyDescriptor ( "filterExpression" , LogFilePatternReceiver . class ) } ; <END_BUG> } catch ( Exception e ) { } return null ; } }

Fix:
return new PropertyDescriptor [ ] { new PropertyDescriptor ( "fileURL" , LogFilePatternReceiver . class ) , new PropertyDescriptor ( "timestampFormat" , LogFilePatternReceiver . class ) , new PropertyDescriptor ( "logFormat" , LogFilePatternReceiver . class ) , new PropertyDescriptor ( "name" , LogFilePatternReceiver . class ) , new PropertyDescriptor ( "tailing" , LogFilePatternReceiver . class ) , new PropertyDescriptor ( "filterExpression" , LogFilePatternReceiver . class ) } ;
Buggy code:
public class GoalTimeoutAspect extends GoalAspect < GoalManagementEvent > { private final TimeoutRule moveTimeoutRule ; private final TimeoutRule totalTimeoutRule ; private final SystemNotificationService notificationService ; public GoalTimeoutAspect ( TimeoutRule moveTimeoutRule , TimeoutRule totalTimeoutRule , SystemNotificationService notificationService ) { } @ Override protected void doEvent ( GoalManagementEvent event ) { String goalKey = event . getBody ( ) . getGoalKey ( ) ; GoalContext context = event . getBody ( ) . getContext ( ) ; if ( event instanceof GoalStartedEvent ) { context . getPlayerContexts ( ) . forEach ( ( c ) -> { long startTime = ( System . currentTimeMillis ( ) ) + 5000 ; long deadline = totalTimeoutRule . getTimeoutCalculator ( ) . calculate ( startTime ) ; long breachTime = moveTimeoutRule . getTimeoutCalculator ( ) . calculate ( startTime ) ; BreachPunishment punishment = null ; if ( breachTime < deadline ) { punishment = moveTimeoutRule . getPunishment ( ) ; } else { punishment = totalTimeoutRule . getPunishment ( ) ; breachTime = deadline ; } c . getClock ( ) . start ( startTime , breachTime , deadline , punishment ) ; notificationService . send ( new SystemAddJobScheduleEvent ( goalKey , toKey ( c . getPlayer ( ) ) , new SystemGoalTimeoutEvent ( goalKey ) , new DateTime ( breachTime ) ) ) ; } ) ; } else if ( event instanceof GoalEndedEvent ) { context . getPlayerContexts ( ) . forEach ( ( c ) -> { c . getClock ( ) . stop ( ) ; notificationService . send ( new SystemRemoveJobScheduleEvent ( goalKey , toKey ( c . getPlayer ( ) ) ) ) ; } ) ; } else <START_BUG> if ( event instanceof GoalChangedStatusEvent ) { <END_BUG> context . getPlayerContexts ( ) . forEach ( ( c ) -> { c . getClock ( ) . stop ( ) ; long startTime = ( System . currentTimeMillis ( ) ) + 5000 ; long deadline = totalTimeoutRule . getTimeoutCalculator ( ) . calculate ( startTime , c . getClock ( ) . getTimeSpent ( ) ) ; long breachTime = moveTimeoutRule . getTimeoutCalculator ( ) . calculate ( startTime , c . getClock ( ) . getTimeSpent ( ) ) ; BreachPunishment punishment = null ; if ( breachTime < deadline ) { punishment = moveTimeoutRule . getPunishment ( ) ; } else { punishment = totalTimeoutRule . getPunishment ( ) ; breachTime = deadline ; } c . getClock ( ) . start ( startTime , breachTime , deadline , punishment ) ; notificationService . send ( new SystemAddJobScheduleEvent ( goalKey , toKey ( c . getPlayer ( ) ) , new SystemGoalTimeoutEvent ( goalKey ) , new DateTime ( breachTime ) ) ) ; } ) ; } } private String toKey ( String player ) { } }

Fix:
if ( ( event instanceof GoalChangedStatusEvent ) || ( event instanceof GoalChangedStatusUpdateMissedEvent ) ) {
Buggy code:
public class PropertiesFactory implements IPropertiesFactory { private static final Logger log = LoggerFactory . getLogger ( PropertiesFactory . class ) ; private final List < IPropertiesChangeListener > afterReloadListeners = new ArrayList < IPropertiesChangeListener > ( ) ; private final Map < String , Properties > propertiesCache = newPropertiesCache ( ) ; private final Application application ; private final List < IPropertiesLoader > propertiesLoader ; public PropertiesFactory ( final Application application ) { } public List < IPropertiesLoader > getPropertiesLoaders ( ) { } protected Map < String , Properties > newPropertiesCache ( ) { } public void addListener ( final IPropertiesChangeListener listener ) { } public final void clearCache ( ) { } public Properties load ( final Class < ? > clazz , final String path ) { } private ValueMap loadFromLoader ( final IPropertiesLoader loader , final IResourceStream resourceStream ) { } private void addToWatcher ( final String path , final IResourceStream resourceStream , final IModificationWatcher watcher ) { watcher . add ( resourceStream , new IChangeListener ( ) { public void onChange ( ) { PropertiesFactory . log . info ( ( ( "A<seq2seq4repair_space>properties<seq2seq4repair_space>files<seq2seq4repair_space>has<seq2seq4repair_space>changed.<seq2seq4repair_space>Removing<seq2seq4repair_space>all<seq2seq4repair_space>entries<seq2seq4repair_space>" + "from<seq2seq4repair_space>the<seq2seq4repair_space>cache.<seq2seq4repair_space>Resource:<seq2seq4repair_space>" ) + resourceStream ) ) ; clearCache ( ) ; for ( IPropertiesChangeListener listener : afterReloadListeners ) { try { listener . propertiesChanged ( path ) ; <START_BUG> } catch ( Throwable ex ) { <END_BUG> PropertiesFactory . log . error ( ( "PropertiesReloadListener<seq2seq4repair_space>has<seq2seq4repair_space>thrown<seq2seq4repair_space>an<seq2seq4repair_space>exception:<seq2seq4repair_space>" + ( ex . getMessage ( ) ) ) ) ; } } } } ) ; } protected final Map < String , Properties > getCache ( ) { } }

Fix:
} catch ( Exception ex ) {
Buggy code:
public class LexStream implements TerminalTokens { public static final int IS_AFTER_JUMP = 1 ; public static final int LBRACE_MISSING = 2 ; public class Token { int kind ; char [ ] name ; int start ; int end ; int line ; int flags ; public String toString ( ) { } } private int tokenCacheIndex ; private int tokenCacheEOFIndex ; private LexStream . Token [ ] tokenCache ; private int currentIndex = - 1 ; private Scanner scanner ; private int [ ] intervalStartToSkip ; private int [ ] intervalEndToSkip ; private int [ ] intervalFlagsToSkip ; private int previousInterval = - 1 ; public LexStream ( int size , Scanner scanner , int [ ] intervalStartToSkip , int [ ] intervalEndToSkip , int [ ] intervalFlagsToSkip , int firstToken , int init , int eof ) { } private void readTokenFromScanner ( ) { int length = tokenCache . length ; boolean tokenNotFound = true ; while ( tokenNotFound ) { try { int tokenKind = scanner . getNextToken ( ) ; if ( tokenKind != ( TerminalTokens . TokenNameEOF ) ) { int start = scanner . getCurrentTokenStartPosition ( ) ; int end = scanner . getCurrentTokenEndPosition ( ) ; if ( ! ( Util . isInInterval ( start , end , intervalStartToSkip , intervalEndToSkip ) ) ) { LexStream . Token token = new LexStream . Token ( ) ; token . kind = tokenKind ; token . name = scanner . getCurrentTokenSource ( ) ; token . start = start ; token . end = end ; token . line = scanner . getLineNumber ( end ) ; int pInterval = Util . getPreviousInterval ( start , end , intervalStartToSkip , intervalEndToSkip ) ; <START_BUG> if ( pInterval != ( previousInterval ) ) { <END_BUG> token . flags = LexStream . IS_AFTER_JUMP ; if ( ( ( intervalFlagsToSkip [ pInterval ] ) & ( Util . LBRACE_MISSING ) ) != 0 ) { token . flags |= LexStream . LBRACE_MISSING ; } } previousInterval = pInterval ; tokenCache [ ( ( ++ ( tokenCacheIndex ) ) % length ) ] = token ; tokenNotFound = false ; } } else { int start = scanner . getCurrentTokenStartPosition ( ) ; int end = scanner . getCurrentTokenEndPosition ( ) ; LexStream . Token token = new LexStream . Token ( ) ; token . kind = tokenKind ; token . name = CharOperation . NO_CHAR ; token . start = start ; token . end = end ; token . line = scanner . getLineNumber ( end ) ; tokenCache [ ( ( ++ ( tokenCacheIndex ) ) % length ) ] = token ; tokenCacheEOFIndex = tokenCacheIndex ; tokenNotFound = false ; } } catch ( InvalidInputException e ) { } } } public LexStream . Token token ( int index ) { } public int getToken ( ) { } public int previous ( int tokenIndex ) { } public int next ( int tokenIndex ) { } public boolean afterEol ( int i ) { } public void reset ( ) { } public void reset ( int i ) { } public int badtoken ( ) { } public int kind ( int tokenIndex ) { } public char [ ] name ( int tokenIndex ) { } public int line ( int tokenIndex ) { } public int start ( int tokenIndex ) { } public int end ( int tokenIndex ) { } public int flags ( int tokenIndex ) { } public boolean isInsideStream ( int index ) { } public String toString ( ) { } }

Fix:
if ( ( pInterval != ( previousInterval ) ) && ( ( ( intervalFlagsToSkip [ ( ( previousInterval ) + 1 ) ] ) & ( Util . IGNORE ) ) == 0 ) ) {
Buggy code:
public class TestRollingUpdates extends LuceneTestCase { @ Test public void testRollingUpdates ( ) throws Exception { final MockDirectoryWrapper dir = newDirectory ( ) ; dir . setCheckIndexOnClose ( false ) ; <START_BUG> final LineFileDocs docs = new LineFileDocs ( random ) ; <END_BUG> if ( ( ! ( "Lucene3x" . equals ( Codec . getDefault ( ) . getName ( ) ) ) ) && ( random . nextBoolean ( ) ) ) { Codec . setDefault ( _TestUtil . alwaysPostingsFormat ( new org . apache . lucene . codecs . memory . MemoryPostingsFormat ( random . nextBoolean ( ) ) ) ) ; } final IndexWriter w = new IndexWriter ( dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ) ) ) ; final int SIZE = atLeast ( 20 ) ; int id = 0 ; IndexReader r = null ; final int numUpdates = ( ( int ) ( SIZE * ( 2 + ( TEST_NIGHTLY ? 200 * ( random . nextDouble ( ) ) : 5 * ( random . nextDouble ( ) ) ) ) ) ) ; if ( VERBOSE ) { System . out . println ( ( "TEST:<seq2seq4repair_space>numUpdates=" + numUpdates ) ) ; } for ( int docIter = 0 ; docIter < numUpdates ; docIter ++ ) { final Document doc = docs . nextDoc ( ) ; final String myID = "" + id ; if ( id == ( SIZE - 1 ) ) { id = 0 ; } else { id ++ ; } ( ( Field ) ( doc . getField ( "docid" ) ) ) . setStringValue ( myID ) ; w . updateDocument ( new Term ( "docid" , myID ) , doc ) ; if ( ( docIter >= SIZE ) && ( ( random . nextInt ( 50 ) ) == 17 ) ) { if ( r != null ) { r . close ( ) ; } final boolean applyDeletions = random . nextBoolean ( ) ; r = w . getReader ( applyDeletions ) ; assertTrue ( ( ( ( ( ( "applyDeletions=" + applyDeletions ) + "<seq2seq4repair_space>r.numDocs()=" ) + ( r . numDocs ( ) ) ) + "<seq2seq4repair_space>vs<seq2seq4repair_space>SIZE=" ) + SIZE ) , ( ( ! applyDeletions ) || ( ( r . numDocs ( ) ) == SIZE ) ) ) ; } } if ( r != null ) { r . close ( ) ; } w . commit ( ) ; assertEquals ( SIZE , w . numDocs ( ) ) ; w . close ( ) ; docs . close ( ) ; _TestUtil . checkIndex ( dir ) ; dir . close ( ) ; } public void testUpdateSameDoc ( ) throws Exception { } static class IndexingThread extends Thread { final LineFileDocs docs ; final IndexWriter writer ; final int num ; public IndexingThread ( LineFileDocs docs , IndexWriter writer , int num ) { } public void run ( ) { } } }

Fix:
final LineFileDocs docs = new LineFileDocs ( random , defaultCodecSupportsDocValues ( ) ) ;
Buggy code:
public class JvmSyncPump implements SyncPump { PeerMode peerMode ; JvmSyncPumpSender sender = null ; JvmSyncPumpReceiver receiver = null ; Logger logger = Logger . getLogger ( JvmSyncPump . class . getName ( ) ) ; public JvmSyncPump ( PeerMode peerMode , JvmSyncPumpSender sender , JvmSyncPumpReceiver receiver ) { } @ Override public void beginPump ( ) { } @ Override public boolean isPumping ( ) { <START_BUG> return ( sender . isRunning ( ) . get ( ) ) && ( receiver . isRunning ( ) . get ( ) ) ; <END_BUG> } }

Fix:
return ( sender . isRunning ( ) . get ( ) ) || ( receiver . isRunning ( ) . get ( ) ) ;
Buggy code:
public class JasonsBigTheme extends MetalTheme { private final ColorUIResource primary1 = new ColorUIResource ( 102 , 102 , 153 ) ; private final ColorUIResource primary2 = new ColorUIResource ( 153 , 153 , 204 ) ; private final ColorUIResource primary3 = new ColorUIResource ( 204 , 204 , 255 ) ; private final ColorUIResource secondary1 = new ColorUIResource ( 102 , 102 , 102 ) ; private final ColorUIResource secondary2 = new ColorUIResource ( 153 , 153 , 153 ) ; private final ColorUIResource secondary3 = new ColorUIResource ( 204 , 204 , 204 ) ; private final FontUIResource controlFont = new FontUIResource ( "SansSerif" , Font . PLAIN , 14 ) ; private final FontUIResource systemFont = new FontUIResource ( "Dialog" , Font . PLAIN , 14 ) ; private final FontUIResource windowTitleFont = new FontUIResource ( "SansSerif" , Font . BOLD , 14 ) ; private final FontUIResource userFont = new FontUIResource ( "SansSerif" , Font . PLAIN , 14 ) ; private final FontUIResource smallFont = new FontUIResource ( "Dialog" , Font . PLAIN , 12 ) ; public String getName ( ) { <START_BUG> return "JasonsBig" ; <END_BUG> } protected ColorUIResource getPrimary1 ( ) { } protected ColorUIResource getPrimary2 ( ) { } protected ColorUIResource getPrimary3 ( ) { } protected ColorUIResource getSecondary1 ( ) { } protected ColorUIResource getSecondary2 ( ) { } protected ColorUIResource getSecondary3 ( ) { } public FontUIResource getControlTextFont ( ) { } public FontUIResource getSystemTextFont ( ) { } public FontUIResource getUserTextFont ( ) { } public FontUIResource getMenuTextFont ( ) { } public FontUIResource getEmphasisTextFont ( ) { } public FontUIResource getSubTextFont ( ) { } public FontUIResource getWindowTitleFont ( ) { } }

Fix:
return "Large<seq2seq4repair_space>Fonts" ;
Buggy code:
public class AjaxFallbackHeadersToolbar extends HeadersToolbar { private static final long serialVersionUID = 1L ; public AjaxFallbackHeadersToolbar ( final String id , DataTable < ? > table , ISortStateLocator stateLocator ) { } @ Override protected WebMarkupContainer newSortableHeader ( String borderId , String property , ISortStateLocator locator ) { return new AjaxFallbackOrderByBorder ( borderId , property , locator , getAjaxCallDecorator ( ) ) { private static final long serialVersionUID = 1L ; @ Override protected void onAjaxClick ( AjaxRequestTarget target ) { <START_BUG> target . addComponent ( getTable ( ) ) ; <END_BUG> } @ Override protected void onSortChanged ( ) { super . onSortChanged ( ) ; getTable ( ) . setCurrentPage ( 0 ) ; } } ; } protected IAjaxCallDecorator getAjaxCallDecorator ( ) { } }

Fix:
target . add ( getTable ( ) ) ;
Buggy code:
@ LuaPeripheral ( "computer_crafter" ) public class TileComputerCrafter extends TileInventory implements IHasGui { public InventoryCrafting craftingInv = new InventoryCrafting ( new Container ( ) { @ Override public boolean canInteractWith ( EntityPlayer player ) { } } , 3 , 3 ) ; final CraftingManager manager = CraftingManager . getInstance ( ) ; public TileComputerCrafter ( ) { } @ Override public String getInventoryName ( ) { } @ LuaFunction public int getInventorySize ( ) { } @ LuaFunction ( "getStackInSlot" ) public ItemStack stackInSlot ( int slot ) { } @ Override public void readFromNBT ( NBTTagCompound tag ) { } @ Override public void writeToNBT ( NBTTagCompound tag ) { } @ Override public GuiType getGuiId ( ) { } @ LuaFunction public boolean isRecipeValid ( ) { } @ LuaFunction public ItemStack getCraftingSlot ( int slot ) throws LuaException { -- slot ; <START_BUG> if ( ( slot >= 0 ) || ( slot <= ( craftingInv . getSizeInventory ( ) ) ) ) { <END_BUG> return craftingInv . getStackInSlot ( slot ) ; } return null ; } @ LuaFunction @ MultiReturn public Object [ ] setCraftingSlot ( int slot , ItemStack stack ) { } @ LuaFunction public Object [ ] clearCraftingSlot ( int slot ) { } @ LuaFunction public void clearCraftingGrid ( ) { } @ LuaFunction @ MultiReturn public Object [ ] craft ( ) { } public void doCraft ( ) throws Exception { } }

Fix:
if ( ( slot >= 0 ) && ( slot < ( craftingInv . getSizeInventory ( ) ) ) ) {
Buggy code:
public class MvcAsyncTask < V > { private final Callable < V > callable ; private final Long timeout ; private final String executorName ; private final AsyncTaskExecutor executor ; private Callable < V > timeoutCallback ; private Runnable completionCallback ; private BeanFactory beanFactory ; public MvcAsyncTask ( Callable < V > callable ) { } public MvcAsyncTask ( long timeout , Callable < V > callable ) { } public MvcAsyncTask ( Long timeout , String executorName , Callable < V > callable ) { } public MvcAsyncTask ( Long timeout , AsyncTaskExecutor executor , Callable < V > callable ) { } private MvcAsyncTask ( Long timeout , AsyncTaskExecutor executor , String executorName , Callable < V > callable ) { } public Callable < ? > getCallable ( ) { } public Long getTimeout ( ) { } public AsyncTaskExecutor getExecutor ( ) { } public void setBeanFactory ( BeanFactory beanFactory ) { } public void onTimeout ( Callable < V > callback ) { } public void onCompletion ( Runnable callback ) { } CallableProcessingInterceptor getInterceptor ( ) { return new CallableProcessingInterceptorAdapter ( ) { @ Override <START_BUG> public < T > Object afterTimeout ( NativeWebRequest request , Callable < T > task ) throws Exception { <END_BUG> return ( timeoutCallback ) != null ? timeoutCallback . call ( ) : CallableProcessingInterceptor . RESULT_NONE ; } @ Override public < T > void afterCompletion ( NativeWebRequest request , Callable < T > task ) throws Exception { if ( ( completionCallback ) != null ) { completionCallback . run ( ) ; } } } ; } }

Fix:
public < T > Object handleTimeout ( NativeWebRequest request , Callable < T > task ) throws Exception {
Buggy code:
public abstract class Resource implements IResourceListener { private static Log log = LogFactory . getLog ( Resource . class ) ; protected IResourceStream resourceStream ; private boolean cacheable ; protected Resource ( ) { } public abstract IResourceStream getResourceStream ( ) { } public boolean isCacheable ( ) { } public final void onResourceRequested ( ) { final RequestCycle cycle = RequestCycle . get ( ) ; cycle . setResponsePage ( ( ( Page ) ( null ) ) ) ; init ( ) ; final Response response = cycle . getResponse ( ) ; response . setContentType ( resourceStream . getContentType ( ) ) ; response . setContentLength ( ( ( int ) ( resourceStream . length ( ) ) ) ) ; <START_BUG> if ( cacheable ) { <END_BUG> response . setLastModifiedTime ( resourceStream . lastModifiedTime ( ) ) ; } respond ( response ) ; } public final void setCacheable ( boolean cacheable ) { } protected void invalidate ( ) { } private final void init ( ) { } private final void respond ( final Response response ) { } }

Fix:
if ( isCacheable ( ) ) {
Buggy code:
public class MenuHandler { public interface Listener { void onUpdateFlash ( String mode ) { } Camera getCamera ( ) { } void onUpdateThumbnailSide ( int side ) { } } private static final String PREF_FLASH_MODE = "flash_mode" ; private static final String PREF_PICTURE_SIZE = "picture_size" ; private static final String PREF_THUMBNAIL_LOCATION = "thumbnail_location" ; private final PreferenceHelper ph ; private final ProtectManager protectmanager ; private final StorageCapacityManager scm ; private final MenuHandler . Listener listener ; MenuHandler ( Context context , MenuHandler . Listener listener , StorageCapacityManager . Listener scmlistener ) { } private boolean isProtectAvailable ( Context context ) { <START_BUG> return ( protectmanager . getCount ( ) ) < ( scm . get ( context ) ) ; <END_BUG> } MenuItem itemProtect = null ; private void setProtectStatus ( Context context , String filename ) { } public void initialize ( Context context , Menu menu , String filename ) { } private static void copy ( FileInputStream src , FileOutputStream dest ) throws IOException { } private void registAndroidDB ( Context context , String path ) { } private String export ( Context context , String filename ) { } private void sendMail ( Context context , String filename ) { } public boolean onOptionsItemSelected ( Context context , String filename , MenuItem menuitem ) { } private void selectFlashMode ( final Context context ) { } public String getFlashMode ( Context context ) { } private void selectPictureSize ( final Context context ) { } public Point getPictureSize ( Context context ) { } public Size getMinimumSize ( Size [ ] sizes ) { } private static final int THUMBNAIL_RIGHT = 0 ; private static final int THUMBNAIL_LEFT = 1 ; private void selectThumbnailSide ( final Context context ) { } public boolean getThumbnailSide ( Context context ) { } }

Fix:
return ( protectmanager . getCount ( ) ) < ( ( scm . get ( context ) ) - 1 ) ;
Buggy code:
public class PredicatedSortedMap < K , V > extends PredicatedMap < K , V > implements SortedMap < K , V > { private static final long serialVersionUID = 3359846175935304332L ; <START_BUG> public static < K , V > SortedMap < K , V > predicatedSortedMap ( SortedMap < K , V > map , Predicate < ? super K > keyPredicate , Predicate < ? super V > valuePredicate ) { <END_BUG> return new PredicatedSortedMap < K , V > ( map , keyPredicate , valuePredicate ) ; } protected PredicatedSortedMap ( SortedMap < K , V > map , Predicate < ? super K > keyPredicate , Predicate < ? super V > valuePredicate ) { } protected SortedMap < K , V > getSortedMap ( ) { } public K firstKey ( ) { } public K lastKey ( ) { } public Comparator < ? super K > comparator ( ) { } public SortedMap < K , V > subMap ( K fromKey , K toKey ) { } public SortedMap < K , V > headMap ( K toKey ) { } public SortedMap < K , V > tailMap ( K fromKey ) { } }

Fix:
public static < K , V > PredicatedSortedMap < K , V > predicatedSortedMap ( SortedMap < K , V > map , Predicate < ? super K > keyPredicate , Predicate < ? super V > valuePredicate ) {
Buggy code:
public class WorkerAnt extends Thread { private Task task ; private Object notify ; private volatile boolean finished = false ; private volatile BuildException buildException ; private volatile Throwable exception ; public static final String ERROR_NO_TASK = "No<seq2seq4repair_space>task<seq2seq4repair_space>defined" ; public WorkerAnt ( Task task , Object notify ) { } public WorkerAnt ( Task task ) { } public synchronized BuildException getBuildException ( ) { } public synchronized Throwable getException ( ) { } public Task getTask ( ) { } public synchronized boolean isFinished ( ) { } public void waitUntilFinished ( long timeout ) throws InterruptedException { synchronized ( notify ) { <START_BUG> while ( ! ( finished ) ) { <END_BUG> notify . wait ( timeout ) ; } } } public void rethrowAnyBuildException ( ) { } private synchronized void caught ( Throwable thrown ) { } public void run ( ) { } }

Fix:
if ( ! ( finished ) ) {
Buggy code:
public class EventDetailActivity extends ActionBarActivity { public static String TEST_EVENT_ID = "yorLShkZPR" ; private PhotosAdapter photosAdapter ; private String eventID ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onStart ( ) { } @ Override protected void onResume ( ) { } private void loadPhotosFromParse ( String eventID ) { } private void uploadPhotosToParse ( String eventID ) { ParseQuery query = new ParseQuery ( "Photo" ) ; query . whereEqualTo ( EVENT_ID_KEY , eventID ) ; query . whereEqualTo ( IS_SAVED_INCLOUD_KEY , false ) ; query . fromLocalDatastore ( ) ; query . findInBackground ( new com . parse . FindCallback < Photo > ( ) { @ Override public void done ( List < Photo > photos , ParseException e ) { for ( final Photo photo : photos ) { <START_BUG> final String uriString = photo . getLocaUIRString ( ) ; <END_BUG> String timeStamp = new SimpleDateFormat ( "yyyyMMdd_HHmmss" ) . format ( new Date ( ) ) ; final ParseFile photoFile = new ParseFile ( ( ( "IMG" + timeStamp ) + ".jpg" ) , photo . getBytesData ( getApplicationContext ( ) ) ) ; photoFile . saveInBackground ( new SaveCallback ( ) { @ Override public void done ( ParseException e ) { if ( e == null ) { photo . clearLocalURI ( ) ; photo . setContent ( photoFile ) ; photo . upLoadedToCloud ( ) ; photo . saveInBackground ( new SaveCallback ( ) { @ Override public void done ( ParseException e ) { if ( e == null ) { Log . d ( "parse" , "uploaded<seq2seq4repair_space>a<seq2seq4repair_space>photo" ) ; } else { Log . e ( "parse" , "cannot<seq2seq4repair_space>upload<seq2seq4repair_space>the<seq2seq4repair_space>photo" ) ; photo . setLocalURI ( uriString ) ; photo . savedLocally ( ) ; } } } ) ; } else { Log . e ( "parse" , "cannot<seq2seq4repair_space>save<seq2seq4repair_space>ParseFile" ) ; } } } ) ; } } } ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
final String uriString = photo . getLocaURIString ( ) ;
Buggy code:
public class ASkyBlock extends JavaPlugin { private static ASkyBlock plugin ; private static World islandWorld = null ; private static World netherWorld = null ; private boolean newIsland = false ; private File playersFolder ; private Challenges challenges ; private HashMap < String , Locale > availableLocales = new HashMap < String , Locale > ( ) ; private PlayerCache players ; private Listener warpSignsListener ; private Listener lavaListener ; private Biomes biomes ; private GridManager grid ; private boolean debug = false ; private boolean calculatingLevel = false ; private Update updateCheck = null ; public static World getIslandWorld ( ) { } public static ASkyBlock getPlugin ( ) { } @ Override public void onDisable ( ) { } @ Override public void onEnable ( ) { } public void checkUpdates ( ) { } public void checkUpdatesNotify ( Player p ) { } public void deletePlayerIsland ( final UUID player , boolean removeBlocks ) { } public Biomes getBiomes ( ) { } public Challenges getChallenges ( ) { } @ Override public ChunkGenerator getDefaultWorldGenerator ( final String worldName , final String id ) { } public GridManager getGrid ( ) { } public PlayerCache getPlayers ( ) { } public File getPlayersFolder ( ) { } public Update getUpdateCheck ( ) { } public void setUpdateCheck ( Update updateCheck ) { } public boolean isCalculatingLevel ( ) { } public boolean isNewIsland ( ) { } public void loadPluginConfig ( ) { } public void registerEvents ( ) { } public void resetPlayer ( Player player ) { } public void restartEvents ( ) { } public void setCalculatingLevel ( boolean calculatingLevel ) { } public void setNewIsland ( boolean newIsland ) { } public void unregisterEvents ( ) { } public static World getNetherWorld ( ) { <START_BUG> if ( ( ASkyBlock . netherWorld ) == null ) { <END_BUG> if ( ( ASkyBlock . plugin . getServer ( ) . getWorld ( ( ( Settings . worldName ) + "_nether" ) ) ) == null ) { Bukkit . getLogger ( ) . info ( ( ( "Creating<seq2seq4repair_space>" + ( ASkyBlock . plugin . getName ( ) ) ) + "'s<seq2seq4repair_space>Nether..." ) ) ; } if ( ! ( Settings . newNether ) ) { ASkyBlock . netherWorld = WorldCreator . name ( ( ( Settings . worldName ) + "_nether" ) ) . type ( NORMAL ) . environment ( NETHER ) . createWorld ( ) ; } else { ASkyBlock . netherWorld = WorldCreator . name ( ( ( Settings . worldName ) + "_nether" ) ) . type ( FLAT ) . generator ( new ChunkGeneratorWorld ( ) ) . environment ( NETHER ) . createWorld ( ) ; } ASkyBlock . netherWorld . setMonsterSpawnLimit ( monsterSpawnLimit ) ; ASkyBlock . netherWorld . setAnimalSpawnLimit ( animalSpawnLimit ) ; } return ASkyBlock . netherWorld ; } public Locale myLocale ( UUID player ) { } public Locale myLocale ( ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( ASkyBlock . netherWorld ) == null ) && ( Settings . createNether ) ) {
Buggy code:
public final class FloatRange extends Range implements Serializable { private static final long serialVersionUID = 71849363892750L ; private final float min ; private final float max ; private transient Float minObject = null ; private transient Float maxObject = null ; private transient int hashCode = 0 ; private transient String toString = null ; public FloatRange ( float number ) { } public FloatRange ( Number number ) { } public FloatRange ( float number1 , float number2 ) { } public FloatRange ( Number number1 , Number number2 ) { } @ Override public Number getMinimumNumber ( ) { } @ Override public long getMinimumLong ( ) { } @ Override public int getMinimumInteger ( ) { } @ Override public double getMinimumDouble ( ) { } @ Override public float getMinimumFloat ( ) { } @ Override public Number getMaximumNumber ( ) { } @ Override public long getMaximumLong ( ) { } @ Override public int getMaximumInteger ( ) { } @ Override public double getMaximumDouble ( ) { } @ Override public float getMaximumFloat ( ) { } @ Override public boolean containsNumber ( Number number ) { } @ Override public boolean containsFloat ( float value ) { } @ Override public boolean containsRange ( Range range ) { } @ Override public boolean overlapsRange ( Range range ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { if ( ( toString ) == null ) { <START_BUG> StringBuffer buf = new StringBuffer ( 32 ) ; <END_BUG> buf . append ( "Range[" ) ; buf . append ( min ) ; buf . append ( ',' ) ; buf . append ( max ) ; buf . append ( ']' ) ; toString = buf . toString ( ) ; } return toString ; } }

Fix:
StringBuilder buf = new StringBuilder ( 32 ) ;
Buggy code:
public class SensorPort implements I2CPort , LegacySensorPort , ListenerCaller { private int iPortId ; private short iNumListeners = 0 ; private SensorPortListener [ ] iListeners ; private int iPreviousValue ; private int type ; private int mode ; private static final byte [ ] powerType = new byte [ ] { 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 2 } ; private static final byte [ ] adType = new byte [ ] { - 1 , - 1 , - 1 , - 1 , - 1 , 1 , 0 , 1 , 2 , - 1 , - 1 , - 1 } ; public static final SensorPort S1 = new SensorPort ( 0 ) ; public static final SensorPort S2 = new SensorPort ( 1 ) ; public static final SensorPort S3 = new SensorPort ( 2 ) ; public static final SensorPort S4 = new SensorPort ( 3 ) ; public static final SensorPort [ ] PORTS = new SensorPort [ ] { SensorPort . S1 , SensorPort . S2 , SensorPort . S3 , SensorPort . S4 } ; public final int readRawValue ( ) { <START_BUG> return SensorPort . readSensorValue ( iPortId ) ; <END_BUG> } public final boolean readBooleanValue ( ) { } private SensorPort ( int aId ) { } public final int getId ( ) { } public synchronized void addSensorPortListener ( SensorPortListener aListener ) { } public final void activate ( ) { } public final void passivate ( ) { } public int getMode ( ) { } public int getType ( ) { } public void setTypeAndMode ( int type , int mode ) { } public void setType ( int type ) { } public void setMode ( int mode ) { } public int readValue ( ) { } static native int readSensorValue ( int aPortId ) { } private void setADType ( int type ) { } private void setPowerType ( int type ) { } static native void setADTypeById ( int aPortId , int aADType ) { } static native void setPowerTypeById ( int aPortId , int aPortType ) { } public synchronized void callListeners ( ) { } public static native void i2cEnableById ( int aPortId ) { } public static native void i2cDisableById ( int aPortId ) { } public static native int i2cBusyById ( int aPortId ) { } public static native int i2cStartById ( int aPortId , int address , int internalAddress , int numInternalBytes , byte [ ] buffer , int numBytes , int transferType ) { } public void i2cEnable ( ) { } public void i2cDisable ( ) { } public int i2cBusy ( ) { } public int i2cStart ( int address , int internalAddress , int numInternalBytes , byte [ ] buffer , int numBytes , int transferType ) { } }

Fix:
return 512 ;
Buggy code:
public final class TransactionHelper { private static final Uri CONTENT_URI = MoneyAppContentProvider . CONTENT_URI_TRANSACTION ; private TransactionHelper ( ) { } public static int addTransaction ( Transaction transaction , ContentResolver contentResolver ) { } public static Transaction getTransaction ( int id , ContentResolver contentResolver ) { } private static Transaction getTransaction ( Cursor cursor ) { Transaction transaction = new Transaction ( ) ; transaction . setId ( cursor . getInt ( cursor . getColumnIndex ( COLUMN_ID ) ) ) ; transaction . setDate ( cursor . getString ( cursor . getColumnIndex ( COLUMN_DATE ) ) ) ; <START_BUG> transaction . setDate ( cursor . getString ( cursor . getColumnIndex ( COLUMN_TIME ) ) ) ; <END_BUG> transaction . setName ( cursor . getString ( cursor . getColumnIndex ( COLUMN_NAME ) ) ) ; transaction . setAmount ( cursor . getInt ( cursor . getColumnIndex ( COLUMN_AMOUNT ) ) ) ; transaction . setCategory ( new comp3710 . csse . eng . auburn . edu . moneyapp . database . classes . Category ( cursor . getString ( cursor . getColumnIndex ( COLUMN_CATEGORY_NAME ) ) ) ) ; transaction . setType ( cursor . getString ( cursor . getColumnIndex ( COLUMN_TYPE ) ) ) ; return transaction ; } public static ArrayList < Transaction > getAllTransactions ( ContentResolver contentResolver ) { } public static ArrayList < Transaction > getRecentTransactions ( int numberOfTransactions , ContentResolver contentResolver ) { } public static boolean deleteTransaction ( int id , ContentResolver contentResolver ) { } public static boolean deleteTransaction ( Transaction transaction , ContentResolver contentResolver ) { } public static int updateTransaction ( Transaction transaction , ContentResolver contentResolver ) { } }

Fix:
transaction . setTime ( cursor . getString ( cursor . getColumnIndex ( COLUMN_TIME ) ) ) ;