nus-yam/ex-repair huggingface dataset:
Buggy code:
public class DataSourceLogs { private static final Localizer _loc = Localizer . forPackage ( DataSourceLogs . class ) ; private Log _jdbcLog = null ; private Log _sqlLog = null ; public DataSourceLogs ( ) { } public Log getJDBCLog ( ) { } public void setJDBCLog ( Log log ) { } public boolean isJDBCEnabled ( ) { } public Log getSQLLog ( ) { } public void setSQLLog ( Log log ) { } public boolean isSQLEnabled ( ) { } public void logJDBC ( String msg , Connection conn ) { } public void logJDBC ( String msg , long startTime , Connection conn ) { } public void logSQL ( String msg , Connection conn ) { } public void logSQL ( String msg , long startTime , Connection conn ) { } private static void log ( String msg , Connection conn , Log log ) { } private static void log ( String msg , Connection conn , Log log , long startTime ) { if ( ( log == null ) || ( ! ( log . isTraceEnabled ( ) ) ) ) return ; long totalTime = - 1 ; if ( startTime != ( - 1 ) ) totalTime = ( System . currentTimeMillis ( ) ) - startTime ; <START_BUG> StringBuffer buf = new StringBuffer ( ( 25 + ( msg . length ( ) ) ) ) ; <END_BUG> buf . append ( "<t<seq2seq4repair_space>" ) . append ( Thread . currentThread ( ) . hashCode ( ) ) ; if ( conn != null ) buf . append ( ",<seq2seq4repair_space>" ) . append ( conn ) ; buf . append ( "><seq2seq4repair_space>" ) ; if ( totalTime != ( - 1 ) ) buf . append ( "[" ) . append ( totalTime ) . append ( "<seq2seq4repair_space>ms]<seq2seq4repair_space>" ) ; buf . append ( msg ) ; log . trace ( DataSourceLogs . _loc . get ( "datasource-trace-data" , buf . toString ( ) ) ) ; } }

Fix:
StringBuilder buf = new StringBuilder ( ( 25 + ( msg . length ( ) ) ) ) ;
Buggy code:
public class TestSWAU { Task zencas ; Task zeidonSystem ; View mFASrc ; ObjectEngine oe ; @ Before public void setUp ( ) throws Exception { } @ Test public void testIntegrityRules ( ) { } @ Test public void testSAProfIncludeMealPlan ( ) { } private class SwauVmlTester extends VmlObjectOperations { public SwauVmlTester ( View view ) { } public int testIntegrityRules ( View ViewToWindow ) { zVIEW mSAProfT = new zVIEW ( ) ; int RESULT = 0 ; ActivateOI_FromFile ( mSAProfT , "mSAProf" , ViewToWindow , ( ( zeidonSystem . getObjectEngine ( ) . getHomeDirectory ( ) ) + "//SWAU//mSAProfT.json" ) , zSINGLE ) ; RESULT = CommitObjectInstance ( mSAProfT ) ; DropObjectInstance ( mSAProfT ) ; ActivateOI_FromFile ( mSAProfT , "mSAProf" , ViewToWindow , ( ( zeidonSystem . getObjectEngine ( ) . getHomeDirectory ( ) ) + "//SWAU//mSAProfTWStud.json" ) , zSINGLE ) ; RESULT = ExcludeEntity ( mSAProfT , "Student" , zREPOS_AFTER ) ; try { RESULT = CommitObjectInstance ( mSAProfT ) ; <START_BUG> Assert . assertEquals ( "Commit<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>throw<seq2seq4repair_space>error<seq2seq4repair_space>with<seq2seq4repair_space>missing<seq2seq4repair_space>child" , 1 , 0 ) ; <END_BUG> } catch ( ZeidonException e ) { } DropObjectInstance ( mSAProfT ) ; return 0 ; } public int testSAProfIncludeMealPlan ( View ViewToWindow ) { } } }

Fix:
Assert . fail ( "Commit<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>throw<seq2seq4repair_space>error<seq2seq4repair_space>with<seq2seq4repair_space>missing<seq2seq4repair_space>child" ) ;
Buggy code:
public class BR_EvalSource extends AbstractScalarFunction { private Double getNoiseLvl ( Double base , Double adj , Double speed , Double speedBase ) { <START_BUG> return base + ( adj * ( Math . log ( ( speed // speedBase ) ) ) ) ; <END_BUG> } private Double sumDba ( Double dBA1 , Double dBA2 ) { } private double getVPl ( double vvl , double speedmax , int type , int subtype ) throws FunctionException { } private Double GetCorrection ( double slope ) { } @ Override public Value evaluate ( DataSourceFactory dsf , Value ... args ) throws FunctionException { } @ Override public String getName ( ) { } @ Override public int getType ( int [ ] types ) { } @ Override public FunctionSignature [ ] getFunctionSignatures ( ) { } @ Override public String getDescription ( ) { } @ Override public String getSqlOrder ( ) { } No newline ; at end ; of file ; }

Fix:
return base + ( adj * ( Math . log10 ( ( speed // speedBase ) ) ) ) ;
Buggy code:
public final class DriverProcessor implements DeploymentUnitProcessor { @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final Module module = deploymentUnit . getAttachment ( MODULE ) ; final ServicesAttachment servicesAttachment = deploymentUnit . getAttachment ( SERVICES ) ; if ( ( module != null ) && ( servicesAttachment != null ) ) { final ModuleClassLoader classLoader = module . getClassLoader ( ) ; final List < String > driverNames = servicesAttachment . getServiceImplementations ( Driver . class . getName ( ) ) ; for ( String driverClassName : driverNames ) { try { final Class < ? extends Driver > driverClass = classLoader . loadClass ( driverClassName ) . asSubclass ( Driver . class ) ; final Constructor < ? extends Driver > constructor = driverClass . getConstructor ( ) ; final Driver driver = constructor . newInstance ( ) ; final int majorVersion = driver . getMajorVersion ( ) ; final int minorVersion = driver . getMinorVersion ( ) ; final boolean compliant = driver . jdbcCompliant ( ) ; if ( compliant ) { DEPLOYER_JDBC_LOGGER . deployingCompliantJdbcDriver ( driverClass , Integer . valueOf ( majorVersion ) , Integer . valueOf ( minorVersion ) ) ; } else { DEPLOYER_JDBC_LOGGER . deployingNonCompliantJdbcDriver ( driverClass , Integer . valueOf ( majorVersion ) , Integer . valueOf ( minorVersion ) ) ; } <START_BUG> String driverName = ( ( driverNames . size ( ) ) == 1 ) ? deploymentUnit . getName ( ) : ( ( ( ( ( deploymentUnit . getName ( ) ) + driverClassName ) + "_" ) + majorVersion ) + "_" ) + minorVersion ; <END_BUG> InstalledDriver driverMetadata = new InstalledDriver ( driverName , driverClass . getName ( ) , null , null , majorVersion , minorVersion , compliant ) ; DriverService driverService = new DriverService ( driverMetadata , driver ) ; phaseContext . getServiceTarget ( ) . addService ( JBOSS . append ( "jdbc-driver" , driverName . replaceAll ( "\\." , "_" ) ) , driverService ) . addDependency ( JDBC_DRIVER_REGISTRY_SERVICE , DriverRegistry . class , driverService . getDriverRegistryServiceInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ; } catch ( Exception e ) { DEPLOYER_JDBC_LOGGER . cannotInstantiateDriverClass ( driverClassName , e ) ; } } } } @ Override public void undeploy ( final DeploymentUnit context ) { } }

Fix:
String driverName = ( ( ( ( ( ( deploymentUnit . getName ( ) ) + "_" ) + driverClassName ) + "_" ) + majorVersion ) + "_" ) + minorVersion ;
Buggy code:
public class AjaxLazyLoadPanelTesterTest extends WicketTestCase { public void test ( ) { final Page dummyPanelPage = new DummyPanelPage ( new ITestPanelSource ( ) { private static final long serialVersionUID = 1L ; public Panel getTestPanel ( final String panelId ) { return new AjaxLazyLoadPanel ( panelId ) { private static final long serialVersionUID = 1L ; @ Override public Component getLazyLoadComponent ( final String markupId ) { return new Label ( markupId , "lazy<seq2seq4repair_space>panel<seq2seq4repair_space>test" ) . setRenderBodyOnly ( true ) ; } } ; } } ) ; tester . startPage ( dummyPanelPage ) ; <START_BUG> tester . assertLabel ( "panel:content" , "<img<seq2seq4repair_space>alt=\"Loading...\"<seq2seq4repair_space>src=\".//resource//org.apache.wicket.ajax.AbstractDefaultAjaxBehavior//indicator.gif\"//>" ) ; <END_BUG> AjaxLazyLoadPanelTester . executeAjaxLazyLoadPanel ( tester , dummyPanelPage ) ; tester . debugComponentTrees ( ) ; tester . assertLabel ( "panel:content" , "lazy<seq2seq4repair_space>panel<seq2seq4repair_space>test" ) ; String doc = tester . getLastResponseAsString ( ) ; assertNotNull ( doc ) ; } }

Fix:
tester . assertLabel ( "panel:content" , "<img<seq2seq4repair_space>alt=\"Loading...\"<seq2seq4repair_space>src=\"resource//org.apache.wicket.ajax.AbstractDefaultAjaxBehavior//indicator.gif\"//>" ) ;
Buggy code:
public final class Smasher extends Occupation { public Smasher ( Entity e ) { } public Smasher ( Occupation o ) { } private TwoHandedSword two_handed_sword_ = null ; private OneHandedSword one_handed_sword_ = null ; private OneHandedWeapon bullshit_weapon_one_ = null ; private TwoHandedWeapon bullshit_weapon_two_ = null ; public enum ActiveWeapon { FISTS , TWO_HANDED_SWORD , ONE_HANDED_SWORD , TWO_HANDED_BULLSHIT , ONE_HANDED_BULLSHIT ; } private Smasher . ActiveWeapon current_weapon = Smasher . ActiveWeapon . FISTS ; @ Override public void change_stats ( EntityStatsPack current_stats ) { } @ Override public int equipOneHandWeapon ( OneHandedWeapon weapon ) { } @ Override public int unEquipEverything ( ) { } @ Override public int equipTwoHandWeapon ( TwoHandedWeapon weapon ) { } @ Override public int incrementSkill ( SkillEnum skill ) { } @ Override public String getSkillNameFromNumber ( int skill_number ) { super . getSkillNameFromNumber ( skill_number ) ; switch ( skill_number ) { case 1 : return "1-H" ; case 2 : return "2-H" ; case 3 : return "Fists" ; case 4 : <START_BUG> return "" ; <END_BUG> default : System . err . println ( "Error" ) ; System . exit ( ( - 56 ) ) ; return "" ; } } @ Override public int performOccupationSkill ( int number ) { } @ Override public String toString ( ) { } }

Fix:
return "NA" ;
Buggy code:
public final class ASHelper { private ASHelper ( ) { } public static List < EJBEndpoint > getJaxwsEjbs ( final DeploymentUnit unit ) { } public static List < EJBEndpoint > getJaxrpcEjbs ( final DeploymentUnit unit ) { } public static List < POJOEndpoint > getJaxwsPojos ( final DeploymentUnit unit ) { } public static List < POJOEndpoint > getJaxrpcPojos ( final DeploymentUnit unit ) { } public static String getEndpointName ( final ServletMetaData servletMD ) { } public static String getEndpointClassName ( final ServletMetaData servletMD ) { } public static ServletMetaData getServletForName ( final JBossWebMetaData jbossWebMD , final String servletName ) { } public static < A > A getRequiredAttachment ( final DeploymentUnit unit , final AttachmentKey < A > key ) { } public static < A > A getOptionalAttachment ( final DeploymentUnit unit , final AttachmentKey < A > key ) { } public static boolean isJaxwsService ( final ClassInfo current , final CompositeIndex index ) { } public static boolean isJaxwsService ( final ClassInfo current , final Index index ) { } public static JBossWebMetaData getJBossWebMetaData ( final DeploymentUnit unit ) { final WarMetaData warMetaData = ASHelper . getOptionalAttachment ( unit , ATTACHMENT_KEY ) ; JBossWebMetaData result = null ; if ( warMetaData != null ) { result = warMetaData . getMergedJBossWebMetaData ( ) ; if ( result == null ) { <START_BUG> result = warMetaData . getJbossWebMetaData ( ) ; <END_BUG> } } else { result = ASHelper . getOptionalAttachment ( unit , JBOSSWEB_METADATA_KEY ) ; } return result ; } public static List < AnnotationInstance > getAnnotations ( final DeploymentUnit unit , final DotName annotation ) { } public static JAXWSDeployment getJaxwsDeployment ( final DeploymentUnit unit ) { } public static JAXRPCDeployment getJaxrpcDeployment ( final DeploymentUnit unit ) { } public static WSReferences getWSRefRegistry ( final DeploymentUnit unit ) { } public static String getContextRoot ( final Deployment dep , final JBossWebMetaData jbossWebMD ) { } @ SuppressWarnings ( "unchecked" ) public static < T > T getMSCService ( final ServiceName serviceName , final Class < T > clazz ) { } }

Fix:
result = warMetaData . getJBossWebMetaData ( ) ;
Buggy code:
public abstract class BaseResourceCollectionContainer extends DataType implements Cloneable , ResourceCollection { private List rc = new ArrayList ( ) ; private Collection coll = null ; private boolean cache = true ; public synchronized void setCache ( boolean b ) { } public synchronized boolean isCache ( ) { } public synchronized void clear ( ) throws BuildException { } public synchronized void add ( ResourceCollection c ) throws BuildException { } public synchronized void addAll ( Collection c ) throws BuildException { } public final synchronized Iterator iterator ( ) { } public synchronized int size ( ) { } public synchronized boolean isFilesystemOnly ( ) { if ( isReference ( ) ) { return ( ( BaseResourceCollectionContainer ) ( getCheckedRef ( ) ) ) . isFilesystemOnly ( ) ; } dieOnCircularReference ( ) ; boolean goEarly = true ; for ( Iterator i = rc . iterator ( ) ; goEarly && ( i . hasNext ( ) ) ; ) { goEarly = ( ( ResourceCollection ) ( i . next ( ) ) ) . isFilesystemOnly ( ) ; } if ( goEarly ) { return true ; } for ( Iterator i = cacheCollection ( ) . iterator ( ) ; i . hasNext ( ) ; ) { <START_BUG> if ( ! ( ( i . next ( ) ) instanceof FileResource ) ) { <END_BUG> return false ; } } return true ; } protected synchronized void dieOnCircularReference ( Stack stk , Project p ) throws BuildException { } protected final synchronized List getResourceCollections ( ) { } protected abstract Collection getCollection ( ) { } public Object clone ( ) { } public synchronized String toString ( ) { } private synchronized Collection cacheCollection ( ) { } }

Fix:
if ( ! ( ( i . next ( ) ) instanceof FileProvider ) ) {
Buggy code:
public class TestApp1 extends WebApplication { public static TestApp1 get ( ) { } private ContactsDatabase contactsDB = new ContactsDatabase ( 50 ) ; public TestApp1 ( ) { } public ContactsDatabase getContactsDB ( ) { } @ Override public Class getHomePage ( ) { } @ Override protected void init ( ) { } @ Override protected ISessionStore newSessionStore ( ) { <START_BUG> return new wicket . protocol . http . SecondLevelCacheSessionStore ( new FilePageStore ( ) ) ; <END_BUG> } }

Fix:
return new wicket . protocol . http . SecondLevelCacheSessionStore ( this , new FilePageStore ( ) ) ;
Buggy code:
public class EditorHistoryItem { private IEditorInput input ; private IEditorDescriptor descriptor ; private IMemento memento ; public EditorHistoryItem ( IEditorInput input , IEditorDescriptor descriptor ) { } public EditorHistoryItem ( IMemento memento ) { } public IEditorDescriptor getDescriptor ( ) { } public IEditorInput getInput ( ) { } public boolean isRestored ( ) { } public String getName ( ) { } public String getToolTipText ( ) { } public boolean matches ( IEditorInput input ) { } public String getFactoryId ( ) { } public IStatus restoreState ( ) { Assert . isTrue ( ( ! ( isRestored ( ) ) ) ) ; Status result = new Status ( IStatus . OK , PlatformUI . PLUGIN_ID , 0 , "" , null ) ; IMemento memento = this . memento ; this . memento = null ; String factoryId = memento . getString ( TAG_FACTORY_ID ) ; if ( factoryId == null ) { WorkbenchPlugin . log ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>restore<seq2seq4repair_space>mru<seq2seq4repair_space>list<seq2seq4repair_space>-<seq2seq4repair_space>no<seq2seq4repair_space>input<seq2seq4repair_space>factory<seq2seq4repair_space>ID." ) ; return result ; } <START_BUG> IElementFactory factory = WorkbenchPlugin . getDefault ( ) . getElementFactory ( factoryId ) ; <END_BUG> if ( factory == null ) { return result ; } IMemento persistableMemento = memento . getChild ( TAG_PERSISTABLE ) ; if ( persistableMemento == null ) { WorkbenchPlugin . log ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>restore<seq2seq4repair_space>mru<seq2seq4repair_space>list<seq2seq4repair_space>-<seq2seq4repair_space>no<seq2seq4repair_space>input<seq2seq4repair_space>element<seq2seq4repair_space>state:<seq2seq4repair_space>" + factoryId ) ) ; return result ; } IAdaptable adaptable = factory . createElement ( persistableMemento ) ; if ( ( adaptable == null ) || ( ( adaptable instanceof IEditorInput ) == false ) ) { return result ; } input = ( ( IEditorInput ) ( adaptable ) ) ; String editorId = memento . getString ( TAG_ID ) ; if ( editorId != null ) { IEditorRegistry registry = WorkbenchPlugin . getDefault ( ) . getEditorRegistry ( ) ; descriptor = registry . findEditor ( editorId ) ; } return result ; } public boolean canSave ( ) { } public IStatus saveState ( IMemento memento ) { } }

Fix:
IElementFactory factory = PlatformUI . getWorkbench ( ) . getElementFactory ( factoryId ) ;
Buggy code:
public class ElementSerializer { private final String fileName ; private final String ROW_COLOR = "\\myrowcolour" ; private final String TABLE_NEWLINE = "\\\\" ; private final boolean useRowColor ; private PrintWriter writer ; public static void main ( String [ ] args ) throws FileNotFoundException { } ElementSerializer ( boolean useColor , String fileName ) { } public void serializeToLatexTable ( ) throws FileNotFoundException { } private void writeLongTableHeader ( ) { println ( "\\begin{center}" ) ; println ( "\\begin{scriptsize}" ) ; println ( "\\begin{longtable}{p{0.13\\textwidth}|p{0.82\\textwidth}}" ) ; println ( "\\caption{Adaptability<seq2seq4repair_space>Scores}\\\\" ) ; <START_BUG> println ( "\\lanel{tab:adaptableElements}\\\\" ) ; <END_BUG> println ( "\\textbf{Property}<seq2seq4repair_space>&<seq2seq4repair_space>\\textbf{Element}" ) ; println ( "\\vspace{2pt}\\\\" ) ; println ( "\\toprule" ) ; println ( "\\endfirsthead" ) ; println ( "\\multicolumn{2}{c}" ) ; println ( "{\\tablename\\<seq2seq4repair_space>\\thetable\\<seq2seq4repair_space>--<seq2seq4repair_space>\\emph{Continued<seq2seq4repair_space>from<seq2seq4repair_space>previous<seq2seq4repair_space>page}}\\\\" ) ; println ( "\\endhead" ) ; println ( "\\multicolumn{2}{r}{\\emph{Continued<seq2seq4repair_space>on<seq2seq4repair_space>next<seq2seq4repair_space>page}}" ) ; println ( "\\endfoot" ) ; println ( "\\bottomrule" ) ; println ( "\\endlastfoot" ) ; } private void writeLongTableBody ( ) { } private void writeLongTableFooter ( ) { } private void printColor ( ) { } private void println ( String line ) { } }

Fix:
println ( "\\label{tab:adaptableElements}\\\\" ) ;
Buggy code:
public abstract class ManagementRequest < T > extends ManagementResponseHandler < T > { private final Logger log = Logger . getLogger ( "org.jboss.as.protocol" ) ; private static final AtomicInteger requestId = new AtomicInteger ( ) ; private final int currentRequestId = ManagementRequest . requestId . incrementAndGet ( ) ; private final ManagementRequest . ManagementFuture < T > future = new ManagementRequest . ManagementFuture < T > ( ) ; private final int batchId ; protected ManagementRequest ( ) { } protected ManagementRequest ( int batchId ) { } protected abstract byte getRequestCode ( ) { } protected int getCurrentRequestId ( ) { } protected int getBatchId ( ) { } public AsyncFuture < T > execute ( final ExecutorService executor , final ManagementClientChannelStrategy channelStrategy ) { <START_BUG> log . tracef ( "Scheduling<seq2seq4repair_space>request<seq2seq4repair_space>%s<seq2seq4repair_space>with<seq2seq4repair_space>future<seq2seq4repair_space>%s" , this , this ) ; <END_BUG> executor . execute ( new Runnable ( ) { @ Override public void run ( ) { try { final ManagementChannel channel = channelStrategy . getChannel ( ) ; log . tracef ( "Got<seq2seq4repair_space>channel<seq2seq4repair_space>%s<seq2seq4repair_space>from<seq2seq4repair_space>request<seq2seq4repair_space>%s" , channel , ManagementRequest . this ) ; channel . executeRequest ( ManagementRequest . this , new DelegatingResponseHandler ( channelStrategy ) ) ; } catch ( Exception e ) { log . tracef ( e , "Could<seq2seq4repair_space>not<seq2seq4repair_space>get<seq2seq4repair_space>channel<seq2seq4repair_space>for<seq2seq4repair_space>request<seq2seq4repair_space>%s,<seq2seq4repair_space>failing<seq2seq4repair_space>%s" , ManagementRequest . this , future ) ; future . failed ( e ) ; } } } ) ; return future ; } void writeRequest ( ProtocolChannel channel , FlushableDataOutput output ) throws IOException { } public T executeForResult ( final ExecutorService executor , final ManagementClientChannelStrategy channelStrategy ) throws Exception { } protected void writeRequest ( final int protocolVersion , final FlushableDataOutput output ) throws IOException { } protected CloseHandler < Channel > getRequestCloseHandler ( ) { } private final class DelegatingResponseHandler extends ManagementResponseHandler < T > { private final ManagementClientChannelStrategy clientChannelStrategy ; public DelegatingResponseHandler ( ManagementClientChannelStrategy clientChannelStrategy ) { } @ Override protected T readResponse ( DataInput input ) { } } protected void setError ( Exception e ) { } static class ManagementFuture < T > extends AsyncFutureTask < T > { protected ManagementFuture ( ) { } void done ( T result ) { } void failed ( Exception ex ) { } } }

Fix:
log . tracef ( "Scheduling<seq2seq4repair_space>request<seq2seq4repair_space>%s<seq2seq4repair_space>with<seq2seq4repair_space>future<seq2seq4repair_space>%s<seq2seq4repair_space>-<seq2seq4repair_space>%d<seq2seq4repair_space>(%d)" , this , future , getBatchId ( ) , getCurrentRequestId ( ) ) ;
Buggy code:
public class CreepersdayEntityListener extends EntityListener { private final Creepersday plugin ; public CreepersdayEntityListener ( final Creepersday plugin ) { } @ Override public void onCreatureSpawn ( CreatureSpawnEvent event ) { } @ Override public void onEntityDeath ( EntityDeathEvent event ) { super . onEntityDeath ( event ) ; Entity entity = event . getEntity ( ) ; World world = entity . getWorld ( ) ; <START_BUG> if ( plugin . shouldDisplayStats ( world ) ) { <END_BUG> if ( entity instanceof Player ) { String looser = ( ( Player ) ( entity ) ) . getName ( ) ; if ( looser != null ) { plugin . logStat ( world , looser , "deaths" ) ; } } else if ( entity instanceof Creeper ) { String killer = getKillerName ( entity ) ; if ( killer != null ) { plugin . logStat ( world , killer , "kills" ) ; } } } } private String getKillerName ( Entity entity ) { } }

Fix:
if ( ( plugin . isCreepersday ( world ) ) && ( plugin . shouldDisplayStats ( world ) ) ) {
Buggy code:
public class MainFragmentActivity extends BaseFragmentActivity implements NavigationDrawerFragment . NavigationDrawerCallbacks { private NavigationDrawerFragment mNavigationDrawerFragment ; private SharedPrefManager pref ; private static MainFragmentActivity instance ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void initActionBar ( ) { } private void moveDrawerToTop ( ) { } public int getStatusBarHeight ( ) { } public static Activity getContext ( ) { } @ Override protected void onDestroy ( ) { } public void setMenuButton ( ) { } public void lockDrawer ( ) { } public void unlockDrawer ( ) { } public void hideMenuButton ( ) { } @ Override public void onNavigationDrawerItemSelected ( int position , DrawerItem item ) { try { if ( item . getTag ( ) . equals ( "Home" ) ) { item . setBackgroundColor ( getResources ( ) . getColor ( white ) ) ; Intent homepage = new Intent ( this , HomeActivity . class ) ; homepage . addFlags ( FLAG_ACTIVITY_CLEAR_TOP ) ; startActivity ( homepage ) ; } else if ( item . getTag ( ) . equals ( "Login" ) ) { Intent login = new Intent ( this , LoginActivity . class ) ; login . addFlags ( FLAG_ACTIVITY_CLEAR_TOP ) ; startActivity ( login ) ; } else if ( item . getTag ( ) . equals ( "Logout" ) ) { pref . setLoginStatus ( "N" ) ; Intent login = new Intent ( this , HomeActivity . class ) ; login . addFlags ( FLAG_ACTIVITY_CLEAR_TOP ) ; startActivity ( login ) ; } else if ( item . getTag ( ) . equals ( "Register" ) ) { item . setBackgroundColor ( getResources ( ) . getColor ( white ) ) ; Intent register = new Intent ( this , RegisterActivity . class ) ; register . addFlags ( FLAG_ACTIVITY_CLEAR_TOP ) ; startActivity ( register ) ; } else if ( item . getTag ( ) . equals ( "Information_Update" ) ) { Intent register = new Intent ( this , UpdateProfileActivity . class ) ; register . addFlags ( FLAG_ACTIVITY_CLEAR_TOP ) ; startActivity ( register ) ; } else <START_BUG> if ( item . getTag ( ) . equals ( "Faq" ) ) { <END_BUG> Intent terms = new Intent ( this , Terms . class ) ; terms . addFlags ( FLAG_ACTIVITY_CLEAR_TOP ) ; startActivity ( terms ) ; } else if ( item . getTag ( ) . equals ( "HEADER" ) ) { } } catch ( Exception e ) { e . printStackTrace ( ) ; } } public void restoreActionBar ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
if ( item . getTag ( ) . equals ( "FAQ" ) ) {
Buggy code:
public class HttpHeaderCollection { private final Map < HttpHeaderCollection . HeaderKey , List < Object > > headers ; private static final String [ ] NO_VALUES = new String [ 0 ] ; public HttpHeaderCollection ( ) { } private void internalAdd ( String name , Object object ) { } public void setHeader ( String name , String value ) { } public void addHeader ( String name , String value ) { <START_BUG> value = Args . notEmpty ( value , "value" ) . trim ( ) ; <END_BUG> internalAdd ( name , value ) ; } public void addDateHeader ( String name , Time time ) { } public void setDateHeader ( String name , Time time ) { } public void removeHeader ( String name ) { } private String valueToString ( Object value ) { } public boolean containsHeader ( String name ) { } public Set < String > getHeaderNames ( ) { } public String [ ] getHeaderValues ( String name ) { } public String getHeader ( String name ) { } public Time getDateHeader ( String name ) { } public boolean isEmpty ( ) { } public int getCount ( ) { } public void clear ( ) { } private static class HeaderKey { private final String key ; private final String name ; private HeaderKey ( String name ) { } public String getName ( ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } } }

Fix:
value = Args . notNull ( value , "value" ) . trim ( ) ;
Buggy code:
public class ChangeLogTask extends Task { private File m_usersFile ; private Vector m_cvsUsers = new Vector ( ) ; private File m_dir ; private File m_destfile ; private Date m_start ; private Date m_stop ; private final Vector m_filesets = new Vector ( ) ; public void setDir ( final File dir ) { } public void setDestfile ( final File destfile ) { } public void setUsersfile ( final File usersFile ) { } public void addUser ( final CvsUser user ) { } public void setStart ( final Date start ) { } public void setEnd ( final Date stop ) { } public void setDaysinpast ( final int days ) { } public void addFileset ( final FileSet fileSet ) { } public void execute ( ) throws BuildException { } private void validate ( ) throws BuildException { } private void loadUserlist ( final Properties userList ) throws BuildException { } private CVSEntry [ ] filterEntrySet ( final CVSEntry [ ] entrySet ) { final Vector results = new Vector ( ) ; for ( int i = 0 ; i < ( entrySet . length ) ; i ++ ) { final CVSEntry cvsEntry = entrySet [ i ] ; final Date date = cvsEntry . getDate ( ) ; if ( ( null != ( m_start ) ) && ( m_start . after ( date ) ) ) { continue ; } if ( ( null != ( m_stop ) ) && ( m_stop . before ( date ) ) ) { continue ; } <START_BUG> results . add ( cvsEntry ) ; <END_BUG> } final CVSEntry [ ] resultArray = new CVSEntry [ results . size ( ) ] ; results . copyInto ( resultArray ) ; return resultArray ; } private void writeChangeLog ( final CVSEntry [ ] entrySet ) throws BuildException { } }

Fix:
results . addElement ( cvsEntry ) ;
Buggy code:
public abstract class AbstractReportGui extends AbstractJMeterGuiComponent { private static final long serialVersionUID = 240L ; public AbstractReportGui ( ) { } @ Override public String getLabelResource ( ) { } @ Override public void configureTestElement ( TestElement element ) { } @ Override public JPopupMenu createPopupMenu ( ) { JPopupMenu pop = new JPopupMenu ( ) ; <START_BUG> JMenu addMenu = new JMenu ( JMeterUtils . getResString ( "Add" ) ) ; <END_BUG> addMenu . add ( ReportMenuFactory . makeMenu ( CONFIG_ELEMENTS , "Add" ) ) ; addMenu . add ( ReportMenuFactory . makeMenu ( PRE_PROCESSORS , "Add" ) ) ; addMenu . add ( ReportMenuFactory . makeMenu ( POST_PROCESSORS , "Add" ) ) ; pop . add ( addMenu ) ; ReportMenuFactory . addFileMenu ( pop ) ; return pop ; } @ Override public Collection < String > getMenuCategories ( ) { } @ Override protected Container makeTitlePanel ( ) { } @ Override protected Component createTitleLabel ( ) { } }

Fix:
JMenu addMenu = new JMenu ( JMeterUtils . getResString ( "add" ) ) ;
Buggy code:
public class Response implements Serializable { private static final long serialVersionUID = 634820397523983872L ; long requestId ; Object response ; Throwable exception ; public Response ( long requestId , Object response ) { } public Response ( long requestId , Throwable exception ) { } public long getRequestId ( ) { } public Object getResponse ( ) { } public boolean hadException ( ) { } public Throwable getException ( ) { } public String toString ( ) { <START_BUG> StringBuffer buf = new StringBuffer ( "Response[" ) ; <END_BUG> buf . append ( "requestId=" ) . append ( requestId ) . append ( ";response=" ) . append ( response ) . append ( ";exception=" ) . append ( exception ) . append ( "]" ) ; return buf . toString ( ) ; } }

Fix:
final StringBuffer buf = new StringBuffer ( "Response[" ) ;
Buggy code:
public final class TransformerPredicate < T > implements Serializable , Predicate < T > { private static final long serialVersionUID = - 2407966402920578741L ; private final Transformer < ? super T , Boolean > iTransformer ; public static < T > Predicate < T > getInstance ( Transformer < ? super T , Boolean > transformer ) { } public TransformerPredicate ( Transformer < ? super T , Boolean > transformer ) { } public boolean evaluate ( T object ) { Boolean result = iTransformer . transform ( object ) ; if ( result == null ) { throw new FunctorException ( "Transformer<seq2seq4repair_space>must<seq2seq4repair_space>return<seq2seq4repair_space>an<seq2seq4repair_space>instanceof<seq2seq4repair_space>Boolean,<seq2seq4repair_space>it<seq2seq4repair_space>was<seq2seq4repair_space>a<seq2seq4repair_space>null<seq2seq4repair_space>object" ) ; } <START_BUG> return result ; <END_BUG> } public Transformer < ? super T , Boolean > getTransformer ( ) { } }

Fix:
return result . booleanValue ( ) ;
Buggy code:
public final class MapUtil { private static final double HASHMAP_DEFAULT_LOAD_FACTOR = 0.75 ; private MapUtil ( ) { } public static < K , V > Map < K , V > createHashMap ( int expectedMapSize ) { <START_BUG> int initialCapacity = ( ( int ) ( expectedMapSize * ( MapUtil . HASHMAP_DEFAULT_LOAD_FACTOR ) ) ) + 1 ; <END_BUG> return new HashMap < K , V > ( initialCapacity ) ; } }

Fix:
int initialCapacity = ( ( int ) ( expectedMapSize // ( MapUtil . HASHMAP_DEFAULT_LOAD_FACTOR ) ) ) + 1 ;
Buggy code:
@ ThreadSafe public class RangeTokenMap < V > implements ConcurrentMap < RangeToken , V > { public static < V > RangeTokenMap < V > create ( ) { } private final ConcurrentMap < Text , ConcurrentMap < RangeToken , V > > data = new org . cinchapi . vendor . jsr166e . ConcurrentHashMapV8 < Text , ConcurrentMap < RangeToken , V > > ( ) ; private ConcurrentMap < RangeToken , V > safeEmptyMap = IncrementalSortMap . create ( ) ; @ Override public void clear ( ) { } @ Override public boolean containsKey ( Object obj ) { } @ Override public boolean containsValue ( Object obj ) { } @ Override public Set < Map . Entry < RangeToken , V > > entrySet ( ) { } public Map < RangeToken , V > filter ( Text key ) { } @ Override public V get ( Object obj ) { } @ Override public boolean isEmpty ( ) { } @ Override public Set < RangeToken > keySet ( ) { } @ Override public V put ( RangeToken key , V value ) { } @ Override public void putAll ( Map < ? extends RangeToken , ? extends V > map ) { } @ Override public V putIfAbsent ( RangeToken key , V value ) { } @ Override public V remove ( Object key ) { } @ Override public boolean remove ( Object key , Object value ) { } @ Override public V replace ( RangeToken key , V value ) { } @ Override public boolean replace ( RangeToken key , V old , V nu ) { } @ Override public int size ( ) { } @ Override public Collection < V > values ( ) { } private ConcurrentMap < RangeToken , V > safeGet ( Text key ) { ConcurrentMap < RangeToken , V > filtered = data . get ( key ) ; <START_BUG> return ( data ) != null ? filtered : safeEmptyMap ; <END_BUG> } private ConcurrentMap < RangeToken , V > sureGet ( Text key ) { } }

Fix:
return filtered != null ? filtered : safeEmptyMap ;
Buggy code:
public class SnoozeActivity extends Activity { ListView listViewLow ; ListView listViewHigh ; TextView alertStatus ; Button buttonSnooze ; Button createLowAlert ; Button createHighAlert ; boolean doMgdl ; EditText snoozeValue ; final int MAX_SNOOZE = 600 ; final int ADD_ALERT = 1 ; final int EDIT_ALERT = 2 ; private static final String TAG = AlertPlayer . class . getSimpleName ( ) ; String stringTimeFromAlert ( AlertType alert ) { } HashMap < String , String > createAlertMap ( AlertType alert ) { } ArrayList < HashMap < String , String > > createAlertsMap ( boolean above ) { } class AlertsOnItemLongClickListener implements OnItemLongClickListener { public boolean onItemLongClick ( AdapterView < ? > parent , View view , int position , long id ) { } } @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void addListenerOnButton ( ) { } void displayStatus ( ) { ActiveBgAlert aba = ActiveBgAlert . getOnly ( ) ; AlertType activeBgAlert = ActiveBgAlert . alertTypegetOnly ( ) ; if ( ( aba == null ) && ( activeBgAlert != null ) ) { Log . wtf ( SnoozeActivity . TAG , "ERRRO<seq2seq4repair_space>displayStatus:<seq2seq4repair_space>aba<seq2seq4repair_space>==<seq2seq4repair_space>null,<seq2seq4repair_space>but<seq2seq4repair_space>activeBgAlert<seq2seq4repair_space>!=<seq2seq4repair_space>null<seq2seq4repair_space>exiting..." ) ; return ; } if ( ( aba != null ) && ( activeBgAlert == null ) ) { Log . wtf ( SnoozeActivity . TAG , "ERRRO<seq2seq4repair_space>displayStatus:<seq2seq4repair_space>aba<seq2seq4repair_space>!=<seq2seq4repair_space>null,<seq2seq4repair_space>but<seq2seq4repair_space>activeBgAlert<seq2seq4repair_space>==<seq2seq4repair_space>null<seq2seq4repair_space>exiting..." ) ; return ; } String status ; if ( activeBgAlert == null ) { status = "No<seq2seq4repair_space>active<seq2seq4repair_space>alert<seq2seq4repair_space>exists" ; alertStatus . setText ( status ) ; buttonSnooze . setVisibility ( GONE ) ; snoozeValue . setVisibility ( GONE ) ; } else { <START_BUG> if ( ( aba . next_alert_at ) > ( new Date ( ) . getTime ( ) ) ) { <END_BUG> status = ( ( ( ( ( "Active<seq2seq4repair_space>alert<seq2seq4repair_space>exists<seq2seq4repair_space>named<seq2seq4repair_space>\"" + ( activeBgAlert . name ) ) + "\"<seq2seq4repair_space>Alert<seq2seq4repair_space>snoozed<seq2seq4repair_space>until<seq2seq4repair_space>" ) + ( DateFormat . getTimeInstance ( DateFormat . MEDIUM ) . format ( new Date ( aba . next_alert_at ) ) ) ) + "<seq2seq4repair_space>(" ) + ( ( ( aba . next_alert_at ) - ( new Date ( ) . getTime ( ) ) ) // 60000 ) ) + "<seq2seq4repair_space>minutes<seq2seq4repair_space>left)" ; } else { status = ( "Active<seq2seq4repair_space>alert<seq2seq4repair_space>exists<seq2seq4repair_space>named<seq2seq4repair_space>\"" + ( activeBgAlert . name ) ) + "\"<seq2seq4repair_space>(not<seq2seq4repair_space>snoozed)" ; } alertStatus . setText ( status ) ; } } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } void FillLists ( ) { } No newline ; at end ; of file ; }

Fix:
if ( ! ( aba . ready_to_alarm ( ) ) ) {
Buggy code:
public abstract class AbstractJasperReportsViewTests extends AbstractJasperReportsTests { protected AbstractJasperReportsView getView ( String url ) throws Exception { } public void testCompiledReport ( ) throws Exception { } public void testUncompiledReport ( ) throws Exception { } public void testWithInvalidPath ( ) throws Exception { } public void testInvalidExtension ( ) throws Exception { } public void testContentType ( ) throws Exception { } public void testWithoutDatasource ( ) throws Exception { } public void testWithCollection ( ) throws Exception { } public void testWithMultipleCollections ( ) throws Exception { } public void testWithJRDataSourceProvider ( ) throws Exception { } public void testWithSpecificCollection ( ) throws Exception { } public void testWithArray ( ) throws Exception { } public void testWithMultipleArrays ( ) throws Exception { } public void testWithSpecificArray ( ) throws Exception { } public void testWithSubReport ( ) throws Exception { if ( ! ( canCompileReport ) ) { return ; } Map model = getModel ( ) ; model . put ( "SubReportData" , getProductData ( ) ) ; Properties subReports = new Properties ( ) ; <START_BUG> subReports . put ( "ProductsSubReport" , "org//springframework//ui//jasperreports//subReportChild.jrxml" ) ; <END_BUG> AbstractJasperReportsView view = getView ( SUB_REPORT_PARENT ) ; view . setReportDataKey ( "dataSource" ) ; view . setSubReportUrls ( subReports ) ; view . setSubReportDataKeys ( new String [ ] { "SubReportData" } ) ; view . initApplicationContext ( ) ; view . render ( model , request , response ) ; assertTrue ( ( ( response . getContentAsByteArray ( ) . length ) > 0 ) ) ; } public void testWithNonExistentSubReport ( ) throws Exception { } public void testOverrideExporterParameters ( ) throws Exception { } public void testSubReportWithUnspecifiedParentDataSource ( ) throws Exception { } public void testContentDisposition ( ) throws Exception { } public void testOverrideContentDisposition ( ) throws Exception { } public void testSetCustomHeaders ( ) throws Exception { } public void testWithJdbcDataSource ( ) throws Exception { } public void testWithJdbcDataSourceInModel ( ) throws Exception { } public void testJRDataSourceOverridesJdbcDataSource ( ) throws Exception { } private DataSource getMockJdbcDataSource ( ) throws SQLException { } public void testWithCharacterEncoding ( ) throws Exception { } protected abstract AbstractJasperReportsView getViewImplementation ( ) { } protected abstract String getDesiredContentType ( ) { } private class MockDataSourceProvider extends JRAbstractBeanDataSourceProvider { public MockDataSourceProvider ( Class clazz ) { } public JRDataSource create ( JasperReport jasperReport ) throws JRException { } public void dispose ( JRDataSource jrDataSource ) throws JRException { } } }

Fix:
subReports . put ( "ProductsSubReport" , "//org//springframework//ui//jasperreports//subReportChild.jrxml" ) ;
Buggy code:
public class ConfigurationPersisterFactory { public static ExtensibleConfigurationPersister createHostXmlConfigurationPersister ( final File configDir , final ConfigurationFile file ) { HostXml hostXml = new HostXml ( Module . getBootModuleLoader ( ) ) ; BackupXmlConfigurationPersister persister = new BackupXmlConfigurationPersister ( file , new QName ( CURRENT . getUriString ( ) , "host" ) , hostXml , hostXml ) ; <START_BUG> persister . registerAdditionalRootElement ( new QName ( DOMAIN_1_1 . getUriString ( ) , "host" ) , hostXml ) ; <END_BUG> return persister ; } public static ExtensibleConfigurationPersister createDomainXmlConfigurationPersister ( final File configDir , final ConfigurationFile file ) { } public static ExtensibleConfigurationPersister createCachedRemoteDomainXmlConfigurationPersister ( final File configDir ) { } public static ExtensibleConfigurationPersister createTransientDomainXmlConfigurationPersister ( ) { } }

Fix:
persister . registerAdditionalRootElement ( new QName ( DOMAIN_1_0 . getUriString ( ) , "host" ) , hostXml ) ;
Buggy code:
public class XMLHelper { private static final Logger LOG = Logger . getLogger ( XMLHelper . class ) ; private static final String ENCODING = "UTF-8" ; public static Document newDocument ( ) throws ParserConfigurationException { } public static Document fromXML ( String xml ) throws IOException , ParserConfigurationException , SAXException { } public static String toXML ( Document doc ) throws TransformerException { } public static String toXML ( Node node ) { StringWriter sw = new StringWriter ( ) ; try { Transformer t = TransformerFactory . newInstance ( ) . newTransformer ( ) ; t . setOutputProperty ( OutputKeys . OMIT_XML_DECLARATION , "yes" ) ; t . transform ( new DOMSource ( node ) , new StreamResult ( sw ) ) ; } catch ( TransformerException te ) { <START_BUG> XMLHelper . LOG . equals ( "nodeToString<seq2seq4repair_space>Transformer<seq2seq4repair_space>Exception" ) ; <END_BUG> } return sw . toString ( ) ; } public static String toXML ( Object obj ) throws UnsupportedEncodingException , JAXBException { } public static String toXML ( Object obj , boolean format ) throws UnsupportedEncodingException , JAXBException { } public static < T > String toXML ( Object unit , Class < T > clazz ) throws UnsupportedEncodingException , JAXBException { } public static < T > String toXML ( Object unit , Class < T > clazz , boolean format ) throws UnsupportedEncodingException , JAXBException { } public static < T > T fromXML ( String xml , Class < T > clazz ) throws UnsupportedEncodingException , JAXBException { } public static String transform ( String xml , File stylesheet ) throws TransformerException { } public static String transform ( String xml , String stylesheet ) throws TransformerException { } }

Fix:
XMLHelper . LOG . error ( "nodeToString<seq2seq4repair_space>Transformer<seq2seq4repair_space>Exception" ) ;
Buggy code:
public class ReopenEditorMenu extends ContributionItem { private IWorkbenchWindow window ; private EditorHistory history ; private boolean showSeparator ; private boolean dirty = true ; private IMenuListener menuListener = new IMenuListener ( ) { public void menuAboutToShow ( IMenuManager manager ) { } } ; private static final int MAX_TEXT_LENGTH = 40 ; private static final int MAX_MNEMONIC_SIZE = 9 ; public ReopenEditorMenu ( IWorkbenchWindow window , String id , boolean showSeparator ) { } private String calcText ( int index , EditorHistoryItem item ) { } public void fill ( final Menu menu , int index ) { if ( ( ( window . getActivePage ( ) ) == null ) || ( ( window . getActivePage ( ) . getPerspective ( ) ) == null ) ) { return ; } if ( ( getParent ( ) ) instanceof MenuManager ) { ( ( MenuManager ) ( getParent ( ) ) ) . addMenuListener ( menuListener ) ; } int itemsToShow = WorkbenchPlugin . getDefault ( ) . getPreferenceStore ( ) . getInt ( RECENT_FILES ) ; if ( itemsToShow == 0 ) { return ; } EditorHistoryItem [ ] historyItems = history . getItems ( ) ; int n = Math . min ( itemsToShow , historyItems . length ) ; if ( n <= 0 ) { return ; } if ( showSeparator ) { new MenuItem ( menu , SWT . SEPARATOR , index ) ; ++ index ; } final int [ ] menuIndex = new int [ ] { index } ; for ( int i = 0 ; i < n ; i ++ ) { final EditorHistoryItem item = historyItems [ i ] ; final int historyIndex = i ; Platform . run ( new SafeRunnable ( ) { public void run ( ) throws Exception { String text = calcText ( historyIndex , item ) ; MenuItem mi = new MenuItem ( menu , SWT . PUSH , menuIndex [ 0 ] ) ; ++ ( menuIndex [ 0 ] ) ; mi . setText ( text ) ; mi . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { open ( item ) ; } } ) ; } public void handleException ( Throwable e ) { <START_BUG> WorkbenchPlugin . log ( ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>ReopenEditorMenu.fill:<seq2seq4repair_space>" + e ) ) ; <END_BUG> } } ) ; } dirty = false ; } public boolean isDirty ( ) { } public boolean isDynamic ( ) { } private void open ( EditorHistoryItem item ) { } }

Fix:
WorkbenchPlugin . log ( getClass ( ) , "fill" , e ) ;
Buggy code:
public class Value { public static Object NO_VAL = new Object ( ) ; public static Value V_UNDEFINED = new Value ( 0 , Constants . D_UNDEFINED , Value . NO_VAL ) ; private String typeDesc ; private Object constVal ; private int numSites ; private int [ ] sites ; public int getNumSites ( ) { } public int [ ] getCreationSites ( ) { } public String getTypeDesc ( ) { } public Object getConstVal ( ) { } private Value ( int aPos , String aDesc , Object aConst ) { } private Value ( int newNumSites , int [ ] newSites , String newType , Object newConst ) { } public Value merge ( Value other ) { int [ ] newSites = new int [ ( this . numSites ) + ( other . numSites ) ] ; for ( int i = 0 ; i < ( newSites . length ) ; i ++ ) newSites [ i ] = - 1 ; int newNumSites = mergeSites ( newSites , other ) ; String newType ; try { newType = TypeDesc . mergeType ( this . typeDesc , other . typeDesc ) ; } catch ( IncompatibleTypesException e ) { newType = Constants . D_UNDEFINED ; } Object newConst = ( constVal . equals ( other . constVal ) ) ? constVal : Value . NO_VAL ; <START_BUG> if ( ( newNumSites != ( numSites ) ) || ( newType != ( typeDesc ) ) ) { <END_BUG> return new Value ( newNumSites , newSites , newType , newConst ) ; } else { return this ; } } private int mergeSites ( int [ ] newSites , Value other ) { } private int addTo ( int [ ] newSites , int site ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } public static Value make ( int pos , String desc ) { } public static Value make ( int pos , String desc , Object aConstVal ) { } public boolean isCategory2 ( ) { } public boolean isCategory1 ( ) { } @ Override public String toString ( ) { } public boolean isConstant ( ) { } public int category ( ) { } }

Fix:
if ( ( ( newNumSites != ( numSites ) ) || ( newType != ( typeDesc ) ) ) || ( newConst != ( constVal ) ) ) {
Buggy code:
@ Controller @ RequestMapping ( ( "//rest//" + ( RestConstants . VERSION_1 ) ) + "//ebola//encounter//vitals-and-symptoms" ) public class VitalsAndSymptomsObservationController { @ ResponseBody @ RequestMapping ( method = RequestMethod . GET ) public SimpleObject getAll ( @ RequestParam String patientUuid , @ RequestParam String formUuid , @ RequestParam ( required = false , defaultValue = "0" ) int top ) { SimpleObject response = new SimpleObject ( ) ; EncounterService encounterService = Context . getEncounterService ( ) ; Patient patient = Context . getPatientService ( ) . getPatientByUuid ( patientUuid ) ; EncounterType encounterType = encounterService . getEncounterTypeByUuid ( EBOLA_INPATIENT_FOLLOWUP ) ; if ( ( ! ( formUuid . equals ( EBOLA_CLINICAL_SIGNS_AND_SYMPTOMS ) ) ) && ( ! ( formUuid . equals ( EBOLA_VITALS_FORM ) ) ) ) { throw new UnsupportedOperationException ( "The<seq2seq4repair_space>form<seq2seq4repair_space>uuid<seq2seq4repair_space>can<seq2seq4repair_space>be<seq2seq4repair_space>only<seq2seq4repair_space>vital<seq2seq4repair_space>or<seq2seq4repair_space>symptoms<seq2seq4repair_space>form<seq2seq4repair_space>uuid" ) ; } Form form = Context . getFormService ( ) . getFormByUuid ( formUuid ) ; ArrayList < SimpleObject > encounters = new ArrayList < SimpleObject > ( ) ; List < Encounter > allEncounters = encounterService . getEncounters ( patient , null , null , null , Arrays . asList ( form ) , Arrays . asList ( encounterType ) , null , null , null , false ) ; Collections . reverse ( allEncounters ) ; <START_BUG> if ( top != 0 ) { <END_BUG> allEncounters = allEncounters . subList ( 0 , top ) ; } for ( Encounter encounter : allEncounters ) { ArrayList < SimpleObject > obsResult = getAllObs ( encounter ) ; SimpleObject encounterDTO = new SimpleObject ( ) . add ( "uuid" , encounter . getUuid ( ) ) . add ( "dateCreated" , encounter . getEncounterDatetime ( ) ) . add ( "obs" , obsResult ) ; encounters . add ( encounterDTO ) ; } response . add ( "encounters" , encounters ) ; return response ; } private ArrayList < SimpleObject > getAllObs ( Encounter encounter ) { } private SimpleObject getObsConceptPair ( Obs obs ) { } private Object getValue ( Obs obs ) { } }

Fix:
if ( ( top != 0 ) && ( ( allEncounters . size ( ) ) > top ) ) {