nus-yam/ex-repair huggingface dataset:
Buggy code:
public class FonctionnalitiesRequest { public static int addFonctionnality ( String name , String description , int avancement , Date deadLine ) { String sql = "Insert<seq2seq4repair_space>into<seq2seq4repair_space>fonctionnalities(name,<seq2seq4repair_space>description,<seq2seq4repair_space>avancement,<seq2seq4repair_space>deadLine)<seq2seq4repair_space>values<seq2seq4repair_space>(?,?,?,?);" ; try { PreparedStatement stmt = DataBase . getConnection ( ) . prepareStatement ( sql ) ; stmt . setString ( 1 , name ) ; stmt . setString ( 2 , description ) ; stmt . setInt ( 3 , avancement ) ; stmt . setDate ( 4 , deadLine ) ; stmt . executeUpdate ( ) ; stmt . close ( ) ; Statement stmt2 = DataBase . getConnection ( ) . createStatement ( ) ; <START_BUG> ResultSet rs = stmt2 . executeQuery ( "select<seq2seq4repair_space>last_insert_rowid();" ) ; <END_BUG> return rs . getInt ( 1 ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; System . err . println ( sql ) ; return - 1 ; } } public static List < Fonctionnality > getAllfonctionnalities ( ) { } public static Fonctionnality getFonctionnality ( int id ) { } }

Fix:
ResultSet rs = stmt2 . executeQuery ( "select<seq2seq4repair_space>*<seq2seq4repair_space>from<seq2seq4repair_space>fonctionnalities;" ) ;
Buggy code:
public class CORSResponseFilter implements ContainerResponseFilter { public void filter ( ContainerRequestContext requestContext , ContainerResponseContext responseContext ) throws IOException { MultivaluedMap < String , Object > headers = responseContext . getHeaders ( ) ; <START_BUG> headers . add ( "Access-Control-Allow-Origin" , "http:////localhost:8080" ) ; <END_BUG> headers . add ( "Access-Control-Allow-Methods" , "GET,<seq2seq4repair_space>POST,<seq2seq4repair_space>DELETE,<seq2seq4repair_space>PUT" ) ; headers . add ( "Access-Control-Allow-Headers" , "X-Requested-With,<seq2seq4repair_space>Content-Type,<seq2seq4repair_space>X-Codingpedia" ) ; } }

Fix:
headers . add ( "Access-Control-Allow-Origin" , "*" ) ;
Buggy code:
public class CommandlineJava implements Cloneable { private Commandline vmCommand = new Commandline ( ) ; private Commandline javaCommand = new Commandline ( ) ; private CommandlineJava . SysProperties sysProperties = new CommandlineJava . SysProperties ( ) ; private Path classpath = null ; private String maxMemory = null ; private boolean executeJar = false ; private String vmVersion ; public CommandlineJava ( ) { } public void setClassname ( String classname ) { } public void setJar ( String jarpathname ) { } public void setMaxmemory ( String max ) { } public void setSystemProperties ( ) throws TaskException { } public void setVm ( String vm ) { } public void setVmversion ( String value ) { } public String getClassname ( ) { } public Path getClasspath ( ) { } public String [ ] getCommandline ( ) throws TaskException { } public String getJar ( ) { } public Commandline getJavaCommand ( ) { } public CommandlineJava . SysProperties getSystemProperties ( ) { } public Commandline getVmCommand ( ) { } public String getVmversion ( ) { } public void addSysproperty ( EnvironmentVariable sysp ) { } public void clearJavaArgs ( ) { } public Object clone ( ) { } public Argument createArgument ( ) { } public Path createClasspath ( Project p ) { if ( ( classpath ) == null ) { <START_BUG> classpath = new Path ( p ) ; <END_BUG> } return classpath ; } public Argument createVmArgument ( ) { } public void restoreSystemProperties ( ) throws TaskException { } public int size ( ) throws TaskException { } public String toString ( ) { } private Commandline getActualVMCommand ( ) { } private String getJavaExecutableName ( ) { } public static class SysProperties extends EnvironmentData implements Cloneable { Properties sys = null ; public void setSystem ( ) throws TaskException { } public String [ ] getJavaVariables ( ) throws TaskException { } public Object clone ( ) { } public void restoreSystem ( ) throws TaskException { } public int size ( ) { } } }

Fix:
classpath = new Path ( ) ;
Buggy code:
public class DefaultSession extends AuthenticatedWebSession { private static final long serialVersionUID = 49008854703353216L ; @ SpringBean SystemusersService u ; public DefaultSession ( Request request ) { } @ Override protected boolean authenticate ( String username , String passwordhash ) { boolean retval = false ; <START_BUG> Systemusers s = u . getuserbyCredentials ( username , username ) ; <END_BUG> if ( s != null ) if ( ( s . getLocked ( ) ) != 'Y' ) retval = true ; return retval ; } @ Override public Roles getRoles ( ) { } }

Fix:
Systemusers s = u . getuserbyCredentials ( username , passwordhash ) ;
Buggy code:
public class ViewLabelProvider extends LabelProvider implements IColorProvider { private HashMap images ; private final IWorkbenchWindow window ; private final Color dimmedForeground ; public ViewLabelProvider ( IWorkbenchWindow window , Color dimmedForeground ) { } Image cacheImage ( ImageDescriptor desc ) { } public void dispose ( ) { } public Image getImage ( Object element ) { } public String getText ( Object element ) { } public Color getBackground ( Object element ) { } public Color getForeground ( Object element ) { if ( element instanceof IViewDescriptor ) { IWorkbenchPage activePage = window . getActivePage ( ) ; if ( activePage != null ) { <START_BUG> if ( ( activePage . findView ( ( ( IViewDescriptor ) ( element ) ) . getId ( ) ) ) != null ) { <END_BUG> return dimmedForeground ; } } } return null ; } }

Fix:
if ( ( activePage . findViewReference ( ( ( IViewDescriptor ) ( element ) ) . getId ( ) ) ) != null ) {
Buggy code:
public class MainActivity extends ActionBarActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; if ( savedInstanceState == null ) { <START_BUG> getSupportFragmentManager ( ) . beginTransaction ( ) . add ( container , new MainActivity . PlaceholderFragment ( ) ) . commit ( ) ; <END_BUG> } } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public static class PlaceholderFragment extends Fragment { public PlaceholderFragment ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } } }

Fix:
getSupportFragmentManager ( ) . beginTransaction ( ) . add ( container , new AppListFragment ( ) ) . commit ( ) ;
Buggy code:
interface IStreamComplete { <START_BUG> public void onStreamCompletion ( InetAddress from , PendingFile pendingFile , CompletedFileStatus streamStatus ) throws IOException ; <END_BUG> }

Fix:
public void onStreamCompletion ( InetAddress from , PendingFile pendingFile , FileStatus streamStatus ) throws IOException ;
Buggy code:
public class PackageResource extends WebResource { private static final long serialVersionUID = 1L ; private static Map resourceMap = new HashMap ( ) ; public final String absolutePath ; private Locale locale ; final String style ; final Class scope ; public static void bind ( Application application , Class scope , String name , Locale locale , String style ) { } public static void bind ( Application application , Class scope , String name ) { } public static PackageResource get ( final Class scope , final String path ) { } public static PackageResource get ( final Class scope , final String path , final Locale locale , final String style ) { } private PackageResource ( final Class scope , final String path , final Locale locale , final String style ) { } public IResourceStream getResourceStream ( ) { <START_BUG> IResourceStream resourceStream = Application . get ( ) . getResourceStreamLocator ( ) . locate ( scope . getClassLoader ( ) , absolutePath , style , locale , null ) ; <END_BUG> if ( resourceStream == null ) { throw new WicketRuntimeException ( ( ( ( ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>package<seq2seq4repair_space>resource<seq2seq4repair_space>[path<seq2seq4repair_space>=<seq2seq4repair_space>" + ( absolutePath ) ) + ",<seq2seq4repair_space>style<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( style ) ) + ",<seq2seq4repair_space>locale<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( locale ) ) + "]" ) ) ; } this . locale = resourceStream . getLocale ( ) ; return resourceStream ; } public Locale getLocale ( ) { } public String getAbsolutePath ( ) { } }

Fix:
IResourceStream resourceStream = Application . get ( ) . getResourceSettings ( ) . getResourceStreamLocator ( ) . locate ( scope . getClassLoader ( ) , absolutePath , style , locale , null ) ;
Buggy code:
final class ConfigurationClass { private final AnnotationMetadata metadata ; private final Resource resource ; private String beanName ; private final Set < ConfigurationClassMethod > methods = new LinkedHashSet < ConfigurationClassMethod > ( ) ; private final Map < String , Integer > overloadedMethodMap = new LinkedHashMap < String , Integer > ( ) ; public ConfigurationClass ( MetadataReader metadataReader , String beanName ) { } public ConfigurationClass ( Class clazz , String beanName ) { } public AnnotationMetadata getMetadata ( ) { } public Resource getResource ( ) { } public String getSimpleName ( ) { } public void setBeanName ( String beanName ) { } public String getBeanName ( ) { } public ConfigurationClass addMethod ( ConfigurationClassMethod method ) { } public Set < ConfigurationClassMethod > getConfigurationMethods ( ) { } public void validate ( ProblemReporter problemReporter ) { for ( Map . Entry < String , Integer > entry : this . overloadedMethodMap . entrySet ( ) ) { String methodName = entry . getKey ( ) ; int count = entry . getValue ( ) ; if ( count > 1 ) { problemReporter . error ( new ConfigurationClass . OverloadedMethodProblem ( methodName , count ) ) ; } } <START_BUG> if ( getMetadata ( ) . hasAnnotation ( Configuration . class . getName ( ) ) ) { <END_BUG> if ( getMetadata ( ) . isFinal ( ) ) { problemReporter . error ( new ConfigurationClass . FinalConfigurationProblem ( ) ) ; } for ( ConfigurationClassMethod method : this . methods ) { method . validate ( problemReporter ) ; } } } @ Override public boolean equals ( Object other ) { } @ Override public int hashCode ( ) { } private class FinalConfigurationProblem extends Problem { public FinalConfigurationProblem ( ) { } } private class OverloadedMethodProblem extends Problem { public OverloadedMethodProblem ( String methodName , int count ) { } } }

Fix:
if ( getMetadata ( ) . isAnnotated ( Configuration . class . getName ( ) ) ) {
Buggy code:
public class VStackWidget extends VDDTabSheet { public static final String CLASSNAME = "v-stackwidget" ; public static final String CLICK_EVENT_IDENTIFIER = "click" ; ApplicationConnection client ; String id ; Element tabs ; Element scroller ; String originalScrollerMarginLeftAttribute ; Element buttonPanel ; ComplexPanel tabBar ; Integer dockSide ; Element dockZone1 ; Element dockZone2 ; Element dockZone3 ; Element dockZone4 ; Element dockZoneContainer ; final String E4_ELEMENT_TYPE = "e4ElementType" ; Element maximizeButton ; Element minimizeButton ; int state ; private static final int MINIMIZED = - 1 ; private static final int NORMAL = 0 ; private static final int MAXIMIZED = 1 ; private boolean minmaxEnabled = true ; private String baseURL ; private Element toolbarElement ; private Map < Element , String > overflowRewritedElements ; public VStackWidget ( ) { } public boolean isMinmaxEnabled ( ) { } public void setMinmaxEnabled ( boolean minmaxEnabled ) { } @ Override public void iLayout ( ) { } public void processPartToolbar ( ) { } private void updateLocationOfButtonPanel ( ) { } public int getState ( ) { } public void setState ( int state ) { } @ Override public void onBrowserEvent ( Event event ) { } @ Override public void deEmphasis ( ) { } @ Override <START_BUG> public void emphasis ( Element element , VDragEvent event ) { <END_BUG> super . emphasis ( element , event ) ; } @ Override public boolean postDropHook ( VDragEvent drag ) { } @ Override protected void postOverHook ( VDragEvent drag ) { } @ Override public void postLeaveHook ( VDragEvent drag ) { } protected boolean isDockZoneExists ( ) { } protected void removeDockZone ( ) { } public boolean updateRegion ( VDragEvent event ) { } @ Override public void updateDropDetails ( VDragEvent event ) { } private VAbstractOrderedLayout findOuterArea ( Widget w ) { } private void updateLocationOfPartToolbar ( ) { } private boolean hasSpace ( Element toolbarElement ) { } private void changeLocationOfPartToolbar ( Widget selectedWidget , List pathToToolbar ) { } private void updateGeometry ( ) { } void restoreLocationOfPartToolbar ( ) { } private List findToolbarElement ( Element rootElement , int n ) { } }

Fix:
public void emphasis ( com . google . gwt . dom . client . Element element , VDragEvent event ) {
Buggy code:
public class AccountNewValidator implements Validator { private final AccountService accountService ; private static final Pattern username = Pattern . compile ( "[a-z0-9]+" ) ; public AccountNewValidator ( AccountService accountService ) { } @ Override public boolean supports ( Class < ? > type ) { } @ Override public void validate ( Object o , Errors errors ) { ValidationUtils . rejectIfEmptyOrWhitespace ( errors , "account.username" , "account.validator.username" ) ; ValidationUtils . rejectIfEmptyOrWhitespace ( errors , "passwd1" , "account.validator.password" ) ; ValidationUtils . rejectIfEmptyOrWhitespace ( errors , "passwd2" , "account.validator.password" ) ; AccountWrapper wrapper = ( ( AccountWrapper ) ( o ) ) ; if ( wrapper . isCustomer ( ) ) { ValidationUtils . rejectIfEmptyOrWhitespace ( errors , "account.customer.name" , "customer.validator.name" ) ; } if ( ! ( ( errors . hasFieldErrors ( "passwd1" ) ) && ( errors . hasFieldErrors ( "passwd2" ) ) ) ) { if ( ! ( StringUtils . equals ( wrapper . getPasswd1 ( ) , wrapper . getPasswd2 ( ) ) ) ) { errors . rejectValue ( "passwd2" , "account.validator.password.mismatch" ) ; } else if ( ( ( wrapper . getPasswd1 ( ) . length ( ) ) < 5 ) || ( ( wrapper . getPasswd1 ( ) . length ( ) ) > 32 ) ) { errors . rejectValue ( "passwd2" , "account.validator.password.length" ) ; } } if ( ! ( errors . hasFieldErrors ( "account.username" ) ) ) { Matcher matcher = AccountNewValidator . username . matcher ( wrapper . getAccount ( ) . getUsername ( ) ) ; if ( ! ( matcher . matches ( ) ) ) { errors . rejectValue ( "account.username" , "account.validator.username.format" ) ; } else if ( ( accountService . getAccountByUsername ( wrapper . getAccount ( ) . getUsername ( ) ) ) != null ) { <START_BUG> errors . rejectValue ( "username" , "account.validator.username.used" ) ; <END_BUG> } } } }

Fix:
errors . rejectValue ( "account.username" , "account.validator.username.used" ) ;
Buggy code:
public class TestCacheModeUnspecified extends AbstractCacheModeTestCase { private static OpenJPAEntityManagerFactorySPI emf = null ; private static Cache cache = null ; private static List < String > sql = new ArrayList < String > ( ) ; private static JDBCListener listener ; private static Class < ? > [ ] expectedInCache = persistentTypes ; private static Class < ? > [ ] expectedNotInCache = new Class < ? > [ ] { } ; @ Override public OpenJPAEntityManagerFactorySPI getEntityManagerFactory ( ) { if ( ( TestCacheModeUnspecified . emf ) == null ) { <START_BUG> TestCacheModeUnspecified . emf = createEntityManagerFactory ( "cache-mode-unspecified" ) ; <END_BUG> assertNotNull ( TestCacheModeUnspecified . emf ) ; TestCacheModeUnspecified . cache = TestCacheModeUnspecified . emf . getCache ( ) ; assertNotNull ( TestCacheModeUnspecified . cache ) ; } return TestCacheModeUnspecified . emf ; } public JDBCListener getListener ( ) { } public List < String > getSql ( ) { } public void testCacheables ( ) { } public void testUncacheables ( ) { } public void testUnspecified ( ) { } @ Override protected Class < ? > [ ] getExpectedInCache ( ) { } @ Override protected Class < ? > [ ] getExpectedNotInCache ( ) { } }

Fix:
TestCacheModeUnspecified . emf = createEntityManagerFactory ( "cache-mode-unspecified" , null ) ;
Buggy code:
public class CharacterLiteral extends Expression { private static final String SPECIALS = "\b\t\n\f\r\"\'\\" ; private static final String QUOTED_SPECIALS = "btnfr\"\'\\" ; private String escapedValue = "\'X\'" ; CharacterLiteral ( AST ast ) { } ASTNode clone ( AST target ) { } public boolean subtreeMatch ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public String getEscapedValue ( ) { } public void setEscapedValue ( String value ) { if ( value == null ) { throw new IllegalArgumentException ( ) ; } Scanner scanner = getAST ( ) . scanner ; char [ ] source = value . toCharArray ( ) ; <START_BUG> scanner . setSourceBuffer ( source ) ; <END_BUG> scanner . resetTo ( 0 , source . length ) ; try { int tokenType = scanner . getNextToken ( ) ; switch ( tokenType ) { case Scanner . TokenNameCharacterLiteral : break ; default : throw new IllegalArgumentException ( ) ; } } catch ( InvalidInputException e ) { throw new IllegalArgumentException ( ) ; } modifying ( ) ; this . escapedValue = value ; } public char charValue ( ) { } public void setCharValue ( char value ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
scanner . setSource ( source ) ;
Buggy code:
public class CCCheckout extends ClearCase { public static final String FLAG_RESERVED = "-reserved" ; public static final String FLAG_UNRESERVED = "-unreserved" ; public static final String FLAG_OUT = "-out" ; public static final String FLAG_NODATA = "-ndata" ; public static final String FLAG_BRANCH = "-branch" ; public static final String FLAG_VERSION = "-version" ; public static final String FLAG_NOWARN = "-nwarn" ; public static final String FLAG_COMMENT = "-c" ; public static final String FLAG_COMMENTFILE = "-cfile" ; public static final String FLAG_NOCOMMENT = "-nc" ; private boolean m_Reserved = true ; private String m_Out = null ; private boolean m_Ndata = false ; private String m_Branch = null ; private boolean m_Version = false ; private boolean m_Nwarn = false ; private String m_Comment = null ; private String m_Cfile = null ; public void setBranch ( String branch ) { } public void setComment ( String comment ) { } public void setCommentFile ( String cfile ) { } public void setNoData ( boolean ndata ) { } public void setNoWarn ( boolean nwarn ) { } public void setOut ( String outf ) { } public void setReserved ( boolean reserved ) { } public void setVersion ( boolean version ) { } public String getBranch ( ) { } public String getComment ( ) { } public String getCommentFile ( ) { } public boolean getNoData ( ) { } public boolean getNoWarn ( ) { } public String getOut ( ) { } public boolean getReserved ( ) { } public boolean getVersion ( ) { } public void execute ( ) throws TaskException { Commandline commandLine = new Commandline ( ) ; Project aProj = getProject ( ) ; int result = 0 ; if ( ( getViewPath ( ) ) == null ) { <START_BUG> setViewPath ( aProj . getBaseDir ( ) . getPath ( ) ) ; <END_BUG> } commandLine . setExecutable ( getClearToolCommand ( ) ) ; commandLine . createArgument ( ) . setValue ( COMMAND_CHECKOUT ) ; checkOptions ( commandLine ) ; result = run ( commandLine ) ; if ( result != 0 ) { String msg = "Failed<seq2seq4repair_space>executing:<seq2seq4repair_space>" + ( commandLine . toString ( ) ) ; throw new TaskException ( msg ) ; } } private void getBranchCommand ( Commandline cmd ) { } private void getCommentCommand ( Commandline cmd ) { } private void getCommentFileCommand ( Commandline cmd ) { } private void getOutCommand ( Commandline cmd ) { } private void checkOptions ( Commandline cmd ) { } }

Fix:
setViewPath ( getBaseDirectory ( ) . getPath ( ) ) ;
Buggy code:
public class MaxEmbeddedClobFieldStrategy extends MaxEmbeddedLobFieldStrategy { private static final Localizer _loc = Localizer . forPackage ( MaxEmbeddedClobFieldStrategy . class ) ; private int _maxSize = 0 ; protected int getExpectedJavaType ( ) { } protected void update ( OpenJPAStateManager sm , Row row ) throws SQLException { String s = sm . fetchString ( field . getIndex ( ) ) ; <START_BUG> if ( ( s == null ) || ( ( s . length ( ) ) > ( _maxSize ) ) ) <END_BUG> row . setNull ( field . getColumns ( ) [ 0 ] , true ) ; else row . setString ( field . getColumns ( ) [ 0 ] , s ) ; } protected Boolean isCustom ( OpenJPAStateManager sm , JDBCStore store ) { } protected void putData ( OpenJPAStateManager sm , ResultSet rs , DBDictionary dict ) throws SQLException { } public void map ( boolean adapt ) { } public void initialize ( ) { } }

Fix:
if ( ( s == null ) || ( ( ( s . length ( ) ) > ( _maxSize ) ) && ( ! ( field . getColumns ( ) [ 0 ] . isNotNull ( ) ) ) ) )
Buggy code:
public class InstanceOfExpression extends OperatorExpression { public Expression expression ; public TypeReference type ; public InstanceOfExpression ( Expression expression , TypeReference type ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { LocalVariableBinding local = this . expression . localVariableBinding ( ) ; if ( ( local != null ) && ( ( ( local . type . tagBits ) & ( TagBits . IsBaseType ) ) == 0 ) ) { <START_BUG> flowContext . recordUsingNullReference ( currentScope , local , this . expression , FlowContext . CAN_ONLY_NULL , flowInfo ) ; <END_BUG> flowInfo = expression . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; FlowInfo initsWhenTrue = flowInfo . copy ( ) ; initsWhenTrue . markAsComparedEqualToNonNull ( local ) ; return FlowInfo . conditional ( initsWhenTrue , flowInfo . copy ( ) ) ; } return expression . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void tagAsUnnecessaryCast ( Scope scope , TypeBinding castType ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
flowContext . recordUsingNullReference ( currentScope , local , this . expression , ( ( FlowContext . CAN_ONLY_NULL ) | ( FlowContext . IN_INSTANCEOF ) ) , flowInfo ) ;
Buggy code:
public abstract class AbstractContextService implements IContextService { private List contextServiceListeners ; public AbstractContextService ( ) { } public void addContextServiceListener ( IContextServiceListener contextServiceListener ) { <START_BUG> if ( ( contextServiceListeners ) != null ) <END_BUG> contextServiceListeners = new ArrayList ( ) ; if ( ! ( contextServiceListeners . contains ( contextServiceListener ) ) ) contextServiceListeners . add ( contextServiceListener ) ; } public void removeContextServiceListener ( IContextServiceListener contextServiceListener ) { } protected void fireContextServiceChanged ( ) { } }

Fix:
if ( ( contextServiceListeners ) == null )
Buggy code:
public abstract class AbstractExceptionContextTest < T extends ExceptionContext & Serializable > extends TestCase { protected static final String TEST_MESSAGE_2 = "This<seq2seq4repair_space>is<seq2seq4repair_space>monotonous" ; protected static final String TEST_MESSAGE = "Test<seq2seq4repair_space>Message" ; protected T exceptionContext ; protected static class ObjectWithFaultyToString { @ Override public String toString ( ) { } } @ Override protected void setUp ( ) throws Exception { <START_BUG> exceptionContext . addContextValue ( "test1" , null ) . addContextValue ( "test2" , "some<seq2seq4repair_space>value" ) . addContextValue ( "test<seq2seq4repair_space>Date" , new Date ( ) ) . addContextValue ( "test<seq2seq4repair_space>Nbr" , new Integer ( 5 ) ) . addContextValue ( "test<seq2seq4repair_space>Poorly<seq2seq4repair_space>written<seq2seq4repair_space>obj" , new AbstractExceptionContextTest . ObjectWithFaultyToString ( ) ) ; <END_BUG> } public void testAddContextValue ( ) { } public void testSetContextValue ( ) { } public void testGetFirstContextValue ( ) { } public void testGetContextValues ( ) { } public void testGetContextLabels ( ) { } public void testGetContextEntries ( ) { } public void testJavaSerialization ( ) { } }

Fix:
exceptionContext . addContextValue ( "test1" , null ) . addContextValue ( "test2" , "some<seq2seq4repair_space>value" ) . addContextValue ( "test<seq2seq4repair_space>Date" , new Date ( ) ) . addContextValue ( "test<seq2seq4repair_space>Nbr" , Integer . valueOf ( 5 ) ) . addContextValue ( "test<seq2seq4repair_space>Poorly<seq2seq4repair_space>written<seq2seq4repair_space>obj" , new AbstractExceptionContextTest . ObjectWithFaultyToString ( ) ) ;
Buggy code:
public class PlannerTest extends PlannerBaseTest { private static final Logger LOG = Logger . getLogger ( PlannerTest . class ) ; private ConnectorMetadata connector1 = null ; private ConnectorMetadata connector2 = null ; private ClusterName clusterName = null ; private TableMetadata table1 = null ; private TableMetadata table2 = null ; private TableMetadata table3 = null ; @ BeforeClass public void setUp ( ) throws ManifestException { super . setUp ( ) ; DataStoreName dataStoreName = createTestDatastore ( ) ; Set < Operations > operationsC1 = new HashSet < > ( ) ; operationsC1 . add ( PROJECT ) ; operationsC1 . add ( SELECT_OPERATOR ) ; operationsC1 . add ( SELECT_FUNCTIONS ) ; operationsC1 . add ( SELECT_WINDOW ) ; operationsC1 . add ( SELECT_GROUP_BY ) ; operationsC1 . add ( DELETE_PK_EQ ) ; operationsC1 . add ( CREATE_INDEX ) ; operationsC1 . add ( DROP_INDEX ) ; operationsC1 . add ( UPDATE_PK_EQ ) ; operationsC1 . add ( TRUNCATE_TABLE ) ; operationsC1 . add ( DROP_TABLE ) ; Set < Operations > operationsC2 = new HashSet < > ( ) ; operationsC2 . add ( PROJECT ) ; operationsC2 . add ( SELECT_OPERATOR ) ; operationsC2 . add ( FILTER_PK_EQ ) ; operationsC2 . add ( SELECT_INNER_JOIN ) ; operationsC2 . add ( SELECT_INNER_JOIN_PARTIALS_RESULTS ) ; connector1 = createTestConnector ( "TestConnector1" , dataStoreName , new HashSet < ClusterName > ( ) , operationsC1 , "actorRef1" ) ; connector2 = createTestConnector ( "TestConnector2" , dataStoreName , new HashSet < ClusterName > ( ) , operationsC2 , "actorRef2" ) ; clusterName = createTestCluster ( "TestCluster1" , dataStoreName , connector1 . getName ( ) , connector2 . getName ( ) ) ; <START_BUG> CatalogName catalogName = createTestCatalog ( "demo" ) ; <END_BUG> createTestTables ( ) ; } public void createTestTables ( ) { } @ Test public void selectSingleColumn ( ) { } @ Test public void selectWithFunction ( ) { } @ Test public void selectJoinMultipleColumns ( ) { } @ Test public void selectJoinMultipleColumnsDiffOnNames ( ) { } @ Test public void dropTable ( ) { } @ Test public void deleteRows ( ) { } @ Test public void createIndex ( ) { } @ Test public void dropIndex ( ) { } @ Test public void updateTable ( ) { } @ Test public void truncateTable ( ) { } @ Test public void selectGroupBy ( ) { } }

Fix:
CatalogName catalogName = createTestCatalog ( "demo" ) . getName ( ) ;
Buggy code:
public abstract class AbstractHierarchy < T extends OWLObject > implements Hierarchy < T > { private static final Logger logger = LoggerFactory . getLogger ( AbstractHierarchy . class ) ; private SortedMap < T , SortedSet < T > > hierarchyUp ; private SortedMap < T , SortedSet < T > > hierarchyDown ; public AbstractHierarchy ( SortedMap < T , SortedSet < T > > hierarchyUp , SortedMap < T , SortedSet < T > > hierarchyDown ) { } @ Override public SortedSet < T > getChildren ( T entity ) { <START_BUG> return getChildren ( entity , false ) ; <END_BUG> } @ Override public SortedSet < T > getChildren ( T entity , boolean direct ) { } @ Override public SortedSet < T > getParents ( T entity ) { } @ Override public SortedSet < T > getParents ( T entity , boolean direct ) { } @ Override public SortedSet < T > getSiblings ( T entity ) { } @ Override public boolean isChildOf ( T entity1 , T entity2 ) { } @ Override public boolean isParentOf ( T entity1 , T entity2 ) { } @ Override public SortedSet < T > getRoots ( ) { } @ Override public boolean contains ( T entity ) { } public void thinOutSubsumptionHierarchy ( ) { } public AbstractHierarchy < T > cloneAndRestrict ( Set < T > allowedEntities ) { } public void setHierarchyUp ( SortedMap < T , SortedSet < T > > hierarchyUp ) { } public SortedMap < T , SortedSet < T > > getHierarchyUp ( ) { } public void setHierarchyDown ( SortedMap < T , SortedSet < T > > hierarchyDown ) { } public SortedMap < T , SortedSet < T > > getHierarchyDown ( ) { } public void precompute ( ) { } @ Override public String toString ( ) { } public String toString ( boolean showUpwardHierarchy ) { } private String toString ( SortedMap < T , SortedSet < T > > hierarchy , T concept , int depth ) { } public abstract T getTopConcept ( ) { } public abstract T getBottomConcept ( ) { } }

Fix:
return getChildren ( entity , true ) ;
Buggy code:
public class VerifyManifest extends AbstractCurationTask { private String archFmt = ConfigurationManager . getProperty ( "replicate" , "packer.archfmt" ) ; private final String manifestGroupName = ConfigurationManager . getProperty ( "replicate" , "group.manifest.name" ) ; @ Override public int perform ( DSpaceObject dso ) throws IOException { ReplicaManager repMan = ReplicaManager . instance ( ) ; <START_BUG> String objId = repMan . storageId ( dso . getHandle ( ) , null ) ; <END_BUG> boolean found = repMan . objectExists ( manifestGroupName , objId ) ; String result = ( ( "Manifest<seq2seq4repair_space>for<seq2seq4repair_space>object:<seq2seq4repair_space>" + ( dso . getHandle ( ) ) ) + "<seq2seq4repair_space>found:<seq2seq4repair_space>" ) + found ; report ( result ) ; setResult ( result ) ; return found ? Curator . CURATE_SUCCESS : Curator . CURATE_FAIL ; } }

Fix:
String objId = repMan . storageId ( dso . getHandle ( ) , MANIFEST_EXTENSION ) ;
Buggy code:
public class Game extends RandomColorGenerator { private Collection < Player > aPlayers ; private GameMap aMap ; private Player aCurrentPlayer ; public void printTiles ( ) { } public Game ( Collection < Player > pPlayers , int mapID ) throws TooManyPlayersException { } public Tile getTile ( Coordinates pCoord ) { } public Tile [ ] [ ] getGameTiles ( ) { } public void upgradeUnit ( Tile pTile ) { } public ArrayList < UnitType > wantToHireVillager ( Tile pTile ) { ArrayList < UnitType > rArray = new ArrayList < UnitType > ( ) ; <START_BUG> if ( pTile . getUnit ( ) . equals ( null ) ) { <END_BUG> rArray . add ( INFANTRY ) ; rArray . add ( KNIGHT ) ; rArray . add ( PEASANT ) ; rArray . add ( SOLDIER ) ; } else { if ( pTile . getUnit ( ) . getUnitType ( ) . equals ( PEASANT ) ) { rArray . add ( INFANTRY ) ; rArray . add ( SOLDIER ) ; rArray . add ( KNIGHT ) ; } if ( pTile . getUnit ( ) . getUnitType ( ) . equals ( INFANTRY ) ) { rArray . add ( SOLDIER ) ; rArray . add ( KNIGHT ) ; } if ( pTile . getUnit ( ) . getUnitType ( ) . equals ( SOLDIER ) ) { rArray . add ( KNIGHT ) ; } if ( pTile . getUnit ( ) . getUnitType ( ) . equals ( KNIGHT ) ) { return null ; } } return rArray ; } public PossibleGameActions tileIsClicked ( Tile startTile ) { } public void hireVillager ( Tile pTile , UnitType pUnitType ) { } public void beginTurn ( ) { } public void beginRound ( ) { } public void moveUnit ( Tile startTile , Tile pDestinationTile ) { } public void takeoverTile ( Tile startTile , Tile pDestinationTile ) { } public void buildRoad ( Tile pTile ) { } public void upgradeVillage ( Village v , VillageType newType ) { } public GameMap getGameMap ( ) { } public Collection < Player > getPlayers ( ) { } }

Fix:
if ( ( pTile . getUnit ( ) ) == null ) {
Buggy code:
public class NewsfeedActivity extends ActionBarActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; <START_BUG> setContentView ( activity_Newsfeed ) ; <END_BUG> } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
setContentView ( activity_newsfeed ) ;
Buggy code:
@ SuppressCodecs ( { "SimpleText" , "Memory" , "Direct" } ) public class TestSearchWithThreads extends LuceneTestCase { int NUM_DOCS ; final int NUM_SEARCH_THREADS = 5 ; int RUN_TIME_MSEC ; @ Override public void setUp ( ) throws Exception { } public void test ( ) throws Exception { final Directory dir = newDirectory ( ) ; final RandomIndexWriter w = new RandomIndexWriter ( random ( ) , dir ) ; final long startTime = System . currentTimeMillis ( ) ; final Document doc = new Document ( ) ; final Field body = newTextField ( "body" , "" , NO ) ; doc . add ( body ) ; final StringBuilder sb = new StringBuilder ( ) ; for ( int docCount = 0 ; docCount < ( NUM_DOCS ) ; docCount ++ ) { final int numTerms = random ( ) . nextInt ( 10 ) ; for ( int termCount = 0 ; termCount < numTerms ; termCount ++ ) { sb . append ( ( random ( ) . nextBoolean ( ) ? "aaa" : "bbb" ) ) ; sb . append ( '<seq2seq4repair_space>' ) ; } body . setStringValue ( sb . toString ( ) ) ; w . addDocument ( doc ) ; sb . delete ( 0 , sb . length ( ) ) ; } final IndexReader r = w . getReader ( ) ; <START_BUG> w . close ( ) ; <END_BUG> final long endTime = System . currentTimeMillis ( ) ; if ( VERBOSE ) System . out . println ( ( "BUILD<seq2seq4repair_space>took<seq2seq4repair_space>" + ( endTime - startTime ) ) ) ; final IndexSearcher s = newSearcher ( r ) ; final AtomicBoolean failed = new AtomicBoolean ( ) ; final AtomicLong netSearch = new AtomicLong ( ) ; Thread [ ] threads = new Thread [ NUM_SEARCH_THREADS ] ; for ( int threadID = 0 ; threadID < ( NUM_SEARCH_THREADS ) ; threadID ++ ) { threads [ threadID ] = new Thread ( ) { TotalHitCountCollector col = new TotalHitCountCollector ( ) ; @ Override public void run ( ) { try { long totHits = 0 ; long totSearch = 0 ; long stopAt = ( System . currentTimeMillis ( ) ) + ( RUN_TIME_MSEC ) ; while ( ( ( System . currentTimeMillis ( ) ) < stopAt ) && ( ! ( failed . get ( ) ) ) ) { s . search ( new TermQuery ( new Term ( "body" , "aaa" ) ) , col ) ; totHits += col . getTotalHits ( ) ; s . search ( new TermQuery ( new Term ( "body" , "bbb" ) ) , col ) ; totHits += col . getTotalHits ( ) ; totSearch ++ ; } assertTrue ( ( ( totSearch > 0 ) && ( totHits > 0 ) ) ) ; netSearch . addAndGet ( totSearch ) ; } catch ( Exception exc ) { failed . set ( true ) ; throw new RuntimeException ( exc ) ; } } } ; threads [ threadID ] . setDaemon ( true ) ; } for ( Thread t : threads ) { t . start ( ) ; } for ( Thread t : threads ) { t . join ( ) ; } if ( VERBOSE ) System . out . println ( ( ( ( ( NUM_SEARCH_THREADS ) + "<seq2seq4repair_space>threads<seq2seq4repair_space>did<seq2seq4repair_space>" ) + ( netSearch . get ( ) ) ) + "<seq2seq4repair_space>searches" ) ) ; r . close ( ) ; dir . close ( ) ; } }

Fix:
w . shutdown ( ) ;
Buggy code:
public class NewItemShop { private List < MerchantCategory > categories = null ; private MerchantCategory currentCategory = null ; public NewItemShop ( List < MerchantCategory > categories ) { } public List < MerchantCategory > getCategories ( ) { } public boolean hasOpenCategory ( ) { } public boolean hasOpenCategory ( MerchantCategory category ) { } public void openCategoryInventory ( Player player ) { } private void addCategoriesToInventory ( Inventory inventory ) { } public void handleInventoryClick ( InventoryClickEvent ice , Game game , Player player ) { } private void changeToOldShop ( Game game , Player player ) { } private void handleCategoryInventoryClick ( InventoryClickEvent ice , Game game , Player player ) { } private void openBuyInventory ( MerchantCategory category , Player player , Game game ) { List < VillagerTrade > offers = category . getOffers ( ) ; int sizeCategories = this . categories . size ( ) ; int sizeItems = offers . size ( ) ; int totalSize = sizeCategories + sizeItems ; int nom = ( ( totalSize % 9 ) == 0 ) ? 9 : totalSize % 9 ; int invSize = totalSize + ( 9 - nom ) ; player . playSound ( player . getLocation ( ) , CLICK , 10.0F , 1.0F ) ; this . currentCategory = category ; Inventory buyInventory = Bukkit . createInventory ( player , invSize , Main . _l ( "ingame.shop.name" ) ) ; this . addCategoriesToInventory ( buyInventory ) ; for ( int i = 0 ; i < ( offers . size ( ) ) ; i ++ ) { VillagerTrade trade = offers . get ( i ) ; <START_BUG> int slot = sizeCategories + i ; <END_BUG> ItemStack tradeStack = this . toItemStack ( trade , player , game ) ; buyInventory . setItem ( slot , tradeStack ) ; } player . openInventory ( buyInventory ) ; } private ItemStack toItemStack ( VillagerTrade trade , Player player , Game game ) { } private void handleBuyInventoryClick ( InventoryClickEvent ice , Game game , Player player ) { } @ SuppressWarnings ( "unchecked" ) private boolean buyItem ( ItemStack item , VillagerTrade trade , Player player ) { } private boolean hasEnoughRessource ( Player player , VillagerTrade trade ) { } private VillagerTrade getTradingItem ( MerchantCategory category , ItemStack stack , Game game , Player player ) { } private MerchantCategory getCategoryByMaterial ( Material material ) { } public void setCurrentCategory ( MerchantCategory category ) { } }

Fix:
int slot = ( ( 9 * ( invSize // 9 ) ) - 9 ) + i ;
Buggy code:
public abstract class MapObject { protected TileMap tileMap ; protected int tileSize ; protected double xmap ; protected double ymap ; protected double x ; protected double y ; protected double dx ; protected double dy ; protected int width ; protected int height ; protected int cwidth ; protected int cheight ; protected int currRow ; protected int currCol ; protected double xdest ; protected double ydest ; protected double xtemp ; protected double ytemp ; protected boolean topLeft ; protected boolean topRight ; protected boolean bottomLeft ; protected boolean bottomRight ; protected Animation animation ; protected int currentAction ; protected int previousAction ; protected boolean facingRight ; protected boolean left ; protected boolean right ; protected boolean up ; protected boolean down ; protected boolean jumping ; protected boolean falling ; protected double moveSpeed ; protected double maxSpeed ; protected double stopSpeed ; protected double fallSpeed ; protected double maxFallSpeed ; protected double jumpStart ; protected double stopJumpSpeed ; public MapObject ( TileMap tm ) { } public int getx ( ) { } public int gety ( ) { } public int getWidth ( ) { } public int getHeight ( ) { } public int getCWidth ( ) { } public int getCHeight ( ) { } public void setPosition ( double x , double y ) { } public void setVector ( double dx , double dy ) { } public void setMapPosition ( ) { } public void setLeft ( boolean b ) { } public void setRight ( boolean b ) { } public void setUp ( boolean b ) { } public void setDown ( boolean b ) { } public void setJumping ( boolean b ) { } public boolean intersects ( MapObject o ) { } public Rectangle getRectangle ( ) { } public void calculateCorners ( double x , double y ) { } public void checkTileMapCollision ( ) { } public boolean notOnScreen ( ) { } public boolean FellIntoAbyss ( ) { <START_BUG> return ( ( ( y ) + ( ymap ) ) + ( ( height ) // 2 ) ) > ( GamePanel . HEIGHT ) ; <END_BUG> } public void draw ( Graphics2D g ) { } }

Fix:
return ( ( ( y ) + ( ymap ) ) + ( ( height ) // 2 ) ) >= ( GamePanel . HEIGHT ) ;
Buggy code:
public final class ArrayBinding extends TypeBinding { public static final FieldBinding ArrayLength = new FieldBinding ( LENGTH , IntBinding , ( ( AccPublic ) | ( AccFinal ) ) , null , Constant . NotAConstant ) ; public TypeBinding leafComponentType ; public int dimensions ; LookupEnvironment environment ; char [ ] constantPoolName ; char [ ] genericTypeSignature ; public ArrayBinding ( TypeBinding type , int dimensions , LookupEnvironment environment ) { } public void collectSubstitutes ( Scope scope , TypeBinding otherType , Map substitutes , int constraint ) { } public char [ ] computeUniqueKey ( boolean isLeaf ) { } public char [ ] constantPoolName ( ) { } public String debugName ( ) { } public int dimensions ( ) { } public TypeBinding elementsType ( ) { } public TypeBinding erasure ( ) { } public LookupEnvironment environment ( ) { } public char [ ] genericTypeSignature ( ) { } public PackageBinding getPackage ( ) { } public int hashCode ( ) { } public boolean isCompatibleWith ( TypeBinding otherType ) { } public int kind ( ) { } public TypeBinding leafComponentType ( ) { } public int problemId ( ) { } public char [ ] qualifiedSourceName ( ) { } public char [ ] readableName ( ) { } public char [ ] shortReadableName ( ) { } public char [ ] sourceName ( ) { } public void swapUnresolved ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType , LookupEnvironment env ) { if ( ( this . leafComponentType ) == unresolvedType ) { <START_BUG> this . leafComponentType = ( resolvedType . isGenericType ( ) ) ? env . createRawType ( resolvedType , resolvedType . enclosingType ( ) ) : resolvedType ; <END_BUG> this . tagBits |= ( this . leafComponentType . tagBits ) & ( ( HasTypeVariable ) | ( HasDirectWildcard ) ) ; } } public String toString ( ) { } }

Fix:
this . leafComponentType = env . convertToRawType ( resolvedType ) ;
Buggy code:
public abstract class Task { protected Project project = null ; protected Target target = null ; protected String description = null ; protected Location location = Location . UNKNOWN_LOCATION ; protected String taskName = null ; protected String taskType = null ; protected RuntimeConfigurable wrapper ; public void setProject ( Project project ) { } public Project getProject ( ) { } public void setOwningTarget ( Target target ) { } public Target getOwningTarget ( ) { } public void setTaskName ( String name ) { } public String getTaskName ( ) { } void setTaskType ( String type ) { } public void log ( String msg ) { } public void log ( String msg , int msgLevel ) { } public void setDescription ( String desc ) { } public String getDescription ( ) { } public void init ( ) throws BuildException { } public void execute ( ) throws BuildException { } public Location getLocation ( ) { } public void setLocation ( Location location ) { } public RuntimeConfigurable getRuntimeConfigurableWrapper ( ) { if ( ( wrapper ) == null ) { <START_BUG> wrapper = new RuntimeConfigurable ( this ) ; <END_BUG> } return wrapper ; } protected void setRuntimeConfigurableWrapper ( RuntimeConfigurable wrapper ) { } public void maybeConfigure ( ) throws BuildException { } protected void handleOutput ( String line ) { } protected void handleErrorOutput ( String line ) { } public final void perform ( ) { } }

Fix:
wrapper = new RuntimeConfigurable ( this , getTaskName ( ) ) ;
Buggy code:
public class StreamRedirect extends Thread { public final Log log = LogFactory . getLog ( StreamRedirect . class ) ; InputStream stream ; PrintStream outputStream ; public StreamRedirect ( InputStream stream , PrintStream outputStream ) { } public void run ( ) { try { InputStreamReader streamReader = new InputStreamReader ( stream , Charset . defaultCharset ( ) ) ; BufferedReader streamBuffer = new BufferedReader ( streamReader ) ; String streamLine ; while ( ( streamLine = streamBuffer . readLine ( ) ) != null ) { outputStream . println ( streamLine ) ; } } catch ( IOException ioe ) { <START_BUG> log . error ( "stream<seq2seq4repair_space>redirect<seq2seq4repair_space>error" , ioe ) ; <END_BUG> } } }

Fix:
log . error ( "Stream<seq2seq4repair_space>redirect<seq2seq4repair_space>error" , ioe ) ;
Buggy code:
public class RequestCycle extends RequestHandlerStack implements IEventSink , IRequestCycle { private static final Logger log = LoggerFactory . getLogger ( RequestCycle . class ) ; private boolean cleanupFeedbackMessagesOnDetach = true ; private interface IExecutor < T > { void execute ( T object ) { } } public static RequestCycle get ( ) { } private static void set ( RequestCycle requestCycle ) { } private Request request ; private final Response originalResponse ; private final IRequestMapper requestMapper ; private final IExceptionMapper exceptionMapper ; private final RequestCycleListenerCollection listeners = new RequestCycleListenerCollection ( ) ; private UrlRenderer urlRenderer ; private MetaDataEntry < ? > [ ] metaData ; private final long startTime = System . currentTimeMillis ( ) ; public RequestCycle ( RequestCycleContext context ) { } protected UrlRenderer newUrlRenderer ( ) { <START_BUG> return new UrlRenderer ( getRequest ( ) . getClientUrl ( ) ) ; <END_BUG> } public Response getOriginalResponse ( ) { } public final UrlRenderer getUrlRenderer ( ) { } protected IRequestHandler resolveRequestHandler ( ) { } protected int getExceptionRetryCount ( ) { } public boolean processRequest ( ) { } public boolean processRequestAndDetach ( ) { } private void executeExceptionRequestHandler ( final IRequestHandler handler , final int retryCount ) { } protected IRequestHandler handleException ( final Exception e ) { } public Request getRequest ( ) { } public void setRequest ( Request request ) { } @ Override protected RequestCycle getRequestCycle ( ) { } public final < T > void setMetaData ( final MetaDataKey < T > key , final T object ) { } public final < T > T getMetaData ( final MetaDataKey < T > key ) { } public Url mapUrlFor ( IRequestHandler handler ) { } public Url mapUrlFor ( ResourceReference reference , PageParameters params ) { } public final < C extends Page > Url mapUrlFor ( final Class < C > pageClass , final PageParameters parameters ) { } public final CharSequence urlFor ( ResourceReference reference , PageParameters params ) { } public final < C extends Page > CharSequence urlFor ( final Class < C > pageClass , final PageParameters parameters ) { } public CharSequence urlFor ( IRequestHandler handler ) { } private String renderUrl ( Url url ) { } @ Override public void detach ( ) { } public void setResponsePage ( IRequestablePage page ) { } public void setResponsePage ( Class < ? extends IRequestablePage > pageClass ) { } public void setResponsePage ( Class < ? extends IRequestablePage > pageClass , PageParameters parameters ) { } public boolean isCleanupFeedbackMessagesOnDetach ( ) { } public void setCleanupFeedbackMessagesOnDetach ( boolean cleanupFeedbackMessagesOnDetach ) { } public final long getStartTime ( ) { } public void onEvent ( IEvent < ? > event ) { } protected void onBeginRequest ( ) { } protected void onEndRequest ( ) { } public RequestCycleListenerCollection getListeners ( ) { } }

Fix:
return new UrlRenderer ( getRequest ( ) . getClientUrl ( ) , getRequest ( ) . getPrefixToContextPath ( ) ) ;
Buggy code:
public class KillServer { public static void main ( String [ ] args ) { <START_BUG> KVClient u = new KVClient ( "localhost" ) ; <END_BUG> u . kill ( ) ; u . close ( ) ; } }

Fix:
KVClient u = new KVClient ( "plonk.cs.uwaterloo.ca" ) ;
Buggy code:
public class Files { private Files ( ) { } public static final void writeTo ( final File file , final InputStream input ) throws IOException { <START_BUG> Streams . writeStream ( input , new FileOutputStream ( file ) ) ; <END_BUG> } public static boolean remove ( final File file ) { } }

Fix:
Streams . copy ( input , new FileOutputStream ( file ) ) ;
Buggy code:
public class TestTopFieldCollector extends LuceneTestCase { private IndexSearcher is ; private IndexReader ir ; private Directory dir ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; dir = newDirectory ( ) ; RandomIndexWriter iw = new RandomIndexWriter ( random ( ) , dir ) ; int numDocs = atLeast ( 100 ) ; for ( int i = 0 ; i < numDocs ; i ++ ) { Document doc = new Document ( ) ; iw . addDocument ( doc ) ; } ir = iw . getReader ( ) ; <START_BUG> iw . close ( ) ; <END_BUG> is = newSearcher ( ir ) ; } @ Override public void tearDown ( ) throws Exception { } public void testSortWithoutFillFields ( ) throws Exception { } public void testSortWithoutScoreTracking ( ) throws Exception { } public void testSortWithScoreNoMaxScoreTracking ( ) throws Exception { } public void testSortWithScoreNoMaxScoreTrackingMulti ( ) throws Exception { } public void testSortWithScoreAndMaxScoreTracking ( ) throws Exception { } public void testOutOfOrderDocsScoringSort ( ) throws Exception { } public void testOutOfOrderDocsScoringSortMulti ( ) throws Exception { } public void testSortWithScoreAndMaxScoreTrackingNoResults ( ) throws Exception { } }

Fix:
iw . shutdown ( ) ;