nus-yam/ex-repair huggingface dataset:
Buggy code:
public interface QuizAPI { @ POST ( "//users" ) @ Headers ( { "Content-Type:<seq2seq4repair_space>application//json" } ) public void createUser ( @ Body UserWrapper user , Callback < Response > response ) { } @ GET ( "//users" ) public void getUsers ( Callback < List < User > > users ) { } @ GET ( "//login" ) public void login ( @ Query ( "user_name" ) String userName , @ Query ( "password" ) String pass , Callback < User > user ) { } @ POST ( "//questions" ) public void createQuestion ( @ Body QuestionWrapper questionWraper , Callback < Response > response ) { } @ POST ( "//quizzes" ) public void createQuize ( @ Body QuizWrapper quizWrapper , Callback < Response > response ) { } <START_BUG> @ GET ( "users//{user_id}//quizzes" ) <END_BUG> public void getQuizzes ( @ Path ( "user_id" ) int userId , Callback < List < Quiz > > quizzes ) ; @ GET ( "//quizzes//{quiz_id}//questions" ) public void getQuizQuestions ( @ Path ( "quiz_id" ) int quiz_id , Callback < List < Question > > questions ) { } @ GET ( "//quizzes//{quiz_id}//questions//{question_id}//choices" ) public void getQuestionChoices ( @ Path ( "quiz_id" ) int quiz_id , @ Path ( "question_id" ) int question_id , Callback < List < Choice > > choices ) { } @ POST ( "//users//{user_id}//quizzes//{quiz_id}//questions//{question_id}//answers" ) public void sendAnswer ( @ Path ( "user_id" ) int user_id , @ Path ( "quiz_id" ) int quiz_id , @ Path ( "question_id" ) int question_id , @ Body Answer answer , Callback < Response > response ) { } @ GET ( "//users//{user_id}//quizzes//{quiz_id}//questions//{question_id}//answers" ) public void getAnswer ( @ Path ( "user_id" ) int user_id , @ Path ( "quiz_id" ) int quiz_id , @ Path ( "question_id" ) int question_id , Callback < Answer > answer ) { } @ GET ( "//users//{user_id}//quizzes//{quiz_id}//answers" ) public void getAnswers ( @ Path ( "user_id" ) int user_id , @ Path ( "quiz_id" ) int quiz_id , Callback < List < Answer > > answers ) { } @ GET ( "//users//{user_id}//quizzes//{quiz_id}//results" ) public void getResult ( @ Path ( "user_id" ) int user_id , @ Path ( "quiz_id" ) int quiz_id , Callback < Result > rslt ) { } No newline ; at end ; of file ; }

Fix:
@ GET ( "//users//{user_id}//quizzes" )
Buggy code:
public class Ant extends Task { private String dir = null ; private String antFile = null ; private String target = null ; private String output = null ; Vector properties = new Vector ( ) ; Project p1 ; public void init ( ) { p1 = new Project ( ) ; Vector listeners = project . getBuildListeners ( ) ; for ( int i = 0 ; i < ( listeners . size ( ) ) ; i ++ ) { p1 . addBuildListener ( ( ( BuildListener ) ( listeners . elementAt ( i ) ) ) ) ; } if ( ( output ) != null ) { try { PrintStream out = new PrintStream ( new FileOutputStream ( output ) ) ; p1 . addBuildListener ( new DefaultLogger ( out , Project . MSG_INFO ) ) ; } catch ( IOException ex ) { <START_BUG> project . log ( ( "Ant:<seq2seq4repair_space>Can't<seq2seq4repair_space>set<seq2seq4repair_space>output<seq2seq4repair_space>to<seq2seq4repair_space>" + ( output ) ) ) ; <END_BUG> } } p1 . init ( ) ; Hashtable prop1 = project . getProperties ( ) ; Enumeration e = prop1 . keys ( ) ; while ( e . hasMoreElements ( ) ) { String arg = ( ( String ) ( e . nextElement ( ) ) ) ; String value = ( ( String ) ( prop1 . get ( arg ) ) ) ; p1 . setProperty ( arg , value ) ; } } public void execute ( ) throws BuildException { } public void setDir ( String d ) { } public void setAntfile ( String s ) { } public void setTarget ( String s ) { } public void setOutput ( String s ) { } public Task createProperty ( ) { } }

Fix:
log ( ( "Ant:<seq2seq4repair_space>Can't<seq2seq4repair_space>set<seq2seq4repair_space>output<seq2seq4repair_space>to<seq2seq4repair_space>" + ( output ) ) ) ;
Buggy code:
@ ApiMode ( desc = "回答" ) public class ApiAnswer { public static ApiAnswer forSimpleDisplay ( Answer answer ) { <START_BUG> return null ; <END_BUG> } @ JSONField ( name = "answer_id" ) @ ApiField ( desc = "答案id" ) private long answerId ; @ JSONField ( name = "question_id" ) @ ApiField ( desc = "问题id" ) private long questionId ; @ JSONField ( name = "user_id" ) @ ApiField ( desc = "用户id" ) private long userId ; @ JSONField ( name = "content" ) @ ApiField ( desc = "答案内容" ) private String content ; @ JSONField ( name = "state" ) @ ApiField ( desc = "state" ) private int state ; @ JSONField ( name = "create_at_ms" ) @ ApiField ( desc = "创建时间" ) private long createAtMs ; @ JSONField ( name = "update_at_ms" ) @ ApiField ( desc = "更新时间" ) private long updateAtMs ; public ApiAnswer ( Answer answer ) { } public long getAnswerId ( ) { } public void setAnswerId ( long answerId ) { } public long getQuestionId ( ) { } public void setQuestionId ( long questionId ) { } public long getUserId ( ) { } public void setUserId ( long userId ) { } public String getContent ( ) { } public void setContent ( String content ) { } public int getState ( ) { } public void setState ( int state ) { } public long getCreateAtMs ( ) { } public void setCreateAtMs ( long createAtMs ) { } public long getUpdateAtMs ( ) { } public void setUpdateAtMs ( long updateAtMs ) { } }

Fix:
return new ApiAnswer ( answer ) ;
Buggy code:
public class NodeCore { private static ClientNetworking cn ; private static String id ; public static void main ( String [ ] args ) { } public static ClientNetworking getClientNetworking ( ) { } public static String getId ( ) { } private static void generateId ( ) { try { String firstInterfaceFound = null ; Enumeration < NetworkInterface > networkInterfaces = NetworkInterface . getNetworkInterfaces ( ) ; StringBuilder sb = new StringBuilder ( ) ; while ( networkInterfaces . hasMoreElements ( ) ) { NetworkInterface network = networkInterfaces . nextElement ( ) ; byte [ ] bmac = network . getHardwareAddress ( ) ; <START_BUG> if ( ( bmac != null ) && ( ( bmac [ 0 ] ) != 0 ) ) { <END_BUG> for ( int i = 0 ; i < ( bmac . length ) ; i ++ ) { sb . append ( String . format ( "%02X%s" , bmac [ i ] , ( i < ( ( bmac . length ) - 1 ) ? "-" : "" ) ) ) ; } } } if ( ( ! ( sb . toString ( ) . isEmpty ( ) ) ) && ( firstInterfaceFound == null ) ) { NodeCore . id = Utilities . base64 ( sb . toString ( ) ) ; } else { Utilities . log ( "NodeCore" , "Interfaces<seq2seq4repair_space>are<seq2seq4repair_space>null,<seq2seq4repair_space>falling<seq2seq4repair_space>back<seq2seq4repair_space>to<seq2seq4repair_space>config<seq2seq4repair_space>mutex" , false ) ; NodeCore . id = Utilities . base64 ( Utilities . randomMACAddress ( ) ) ; } } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } }

Fix:
if ( ( ( bmac != null ) && ( ( bmac . length ) > 0 ) ) && ( ( bmac [ 0 ] ) != 0 ) ) {
Buggy code:
public class Localizer { private static final Log log = LogFactory . getLog ( Localizer . class ) ; private static final String NULL = new String ( ) ; private Application application ; private Map cachedValues = new ConcurrentReaderHashMap ( ) ; public Localizer ( final Application application ) { } public final void clearCache ( ) { } public String getString ( final String key , final Component component ) throws MissingResourceException { } public String getString ( final String key , final Component component , final IModel model ) throws MissingResourceException { } public String getString ( final String key , final Component component , final IModel model , final Locale locale , final String style , final String defaultValue ) throws MissingResourceException { } public String getString ( final String key , final Component component , final IModel model , final String defaultValue ) throws MissingResourceException { } public String getString ( final String key , final Component component , final String defaultValue ) throws MissingResourceException { } public String getString ( final String key , final String path , final List searchStack , final Locale locale , final String style ) throws MissingResourceException { } private String createCacheId ( final Class clazz , final Locale locale , final String style , final String key ) { } private String getCachedValue ( final String cacheId ) { } private List getComponentStack ( final Component component ) { if ( component == null ) { return null ; } if ( ( component . getPage ( ) ) == null ) { throw new IllegalArgumentException ( ( "Component<seq2seq4repair_space>without<seq2seq4repair_space>associated<seq2seq4repair_space>Page:<seq2seq4repair_space>" + ( component . toString ( true ) ) ) ) ; } List searchStack = new ArrayList ( ) ; searchStack . add ( component . getClass ( ) ) ; if ( ! ( component instanceof Page ) ) { MarkupContainer container = component . getParent ( ) ; <START_BUG> while ( true ) { <END_BUG> searchStack . add ( container . getClass ( ) ) ; if ( container instanceof Page ) { break ; } container = container . getParent ( ) ; } } return searchStack ; } private String substitutePropertyExpressions ( final Component component , final String string , final IModel model ) { } private String traverseResourceLoaders ( final String key , final String path , final List searchStack , final Locale locale , final String style ) { } }

Fix:
while ( container != null ) {
Buggy code:
public class DeclareSoft extends Declare { private TypePattern exception ; private Pointcut pointcut ; public DeclareSoft ( TypePattern exception , Pointcut pointcut ) { } public Object accept ( PatternNodeVisitor visitor , Object data ) { } public Declare parameterizeWith ( Map typeVariableBindingMap ) { } public String toString ( ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public void write ( DataOutputStream s ) throws IOException { } public static Declare read ( VersionedDataInputStream s , ISourceContext context ) throws IOException { } public Pointcut getPointcut ( ) { } public TypePattern getException ( ) { } public void resolve ( IScope scope ) { exception = exception . resolveBindings ( scope , null , false , true ) ; ResolvedType excType = exception . getExactType ( ) . resolve ( scope . getWorld ( ) ) ; <START_BUG> if ( excType != ( ResolvedType . MISSING ) ) { <END_BUG> if ( excType . isTypeVariableReference ( ) ) { excType = excType . getUpperBound ( ) . resolve ( scope . getWorld ( ) ) ; } if ( ! ( scope . getWorld ( ) . getCoreType ( THROWABLE ) . isAssignableFrom ( excType ) ) ) { scope . getWorld ( ) . showMessage ( ERROR , WeaverMessages . format ( NOT_THROWABLE , excType . getName ( ) ) , exception . getSourceLocation ( ) , null ) ; pointcut = Pointcut . makeMatchesNothing ( RESOLVED ) ; return ; } if ( scope . getWorld ( ) . getCoreType ( RUNTIME_EXCEPTION ) . isAssignableFrom ( excType ) ) { scope . getWorld ( ) . getLint ( ) . runtimeExceptionNotSoftened . signal ( new String [ ] { excType . getName ( ) } , exception . getSourceLocation ( ) , null ) ; pointcut = Pointcut . makeMatchesNothing ( RESOLVED ) ; return ; } } pointcut = pointcut . resolve ( scope ) ; } public boolean isAdviceLike ( ) { } public String getNameSuffix ( ) { } }

Fix:
if ( ! ( excType . isMissing ( ) ) ) {
Buggy code:
public class PathPageURLServlet extends BasePathServlet { public boolean doGet ( MappedResource resource , Property property , boolean isInverse , HttpServletRequest request , HttpServletResponse response , Configuration config ) throws IOException { Model descriptions = getAnonymousPropertyValues ( resource , property , isInverse ) ; if ( ( descriptions . size ( ) ) == 0 ) { return false ; } Resource r = descriptions . getResource ( resource . getWebURI ( ) ) ; List resourceDescriptions = new ArrayList ( ) ; StmtIterator it = ( isInverse ) ? descriptions . listStatements ( null , property , r ) : r . listProperties ( property ) ; while ( it . hasNext ( ) ) { Statement stmt = it . nextStatement ( ) ; RDFNode value = ( isInverse ) ? stmt . getSubject ( ) : stmt . getObject ( ) ; if ( ! ( value . isAnon ( ) ) ) continue ; resourceDescriptions . add ( new ResourceDescription ( ( ( Resource ) ( value . as ( Resource . class ) ) ) , descriptions , config ) ) ; } Model description = getResourceDescription ( resource ) ; ResourceDescription resourceDescription = new ResourceDescription ( resource , description , config ) ; <START_BUG> String title = ( ( ( ( resourceDescription . getLabel ( ) ) + ( isInverse ? "<seq2seq4repair_space>Ç<seq2seq4repair_space>" : "<seq2seq4repair_space>È<seq2seq4repair_space>" ) ) + ( config . getPrefixes ( ) . getNsURIPrefix ( property . getNameSpace ( ) ) ) ) + ":" ) + ( property . getLocalName ( ) ) ; <END_BUG> VelocityHelper template = new VelocityHelper ( getServletContext ( ) , response ) ; Context context = template . getVelocityContext ( ) ; context . put ( "project_name" , config . getProjectName ( ) ) ; context . put ( "project_link" , config . getProjectLink ( ) ) ; context . put ( "title" , title ) ; context . put ( "server_base" , config . getWebApplicationBaseURI ( ) ) ; context . put ( "sparql_endpoint" , resource . getDataset ( ) . getDataSource ( ) . getEndpointURL ( ) ) ; context . put ( "back_uri" , resource . getWebURI ( ) ) ; context . put ( "back_label" , resourceDescription . getLabel ( ) ) ; context . put ( "rdf_link" , ( isInverse ? resource . getInversePathDataURL ( property ) : resource . getPathDataURL ( property ) ) ) ; context . put ( "resources" , resourceDescriptions ) ; template . renderXHTML ( "pathpage.vm" ) ; return true ; } No newline ; at end ; of file ; }

Fix:
String title = ( ( ( ( resourceDescription . getLabel ( ) ) + ( isInverse ? "<seq2seq4repair_space>Â«<seq2seq4repair_space>" : "<seq2seq4repair_space>Â»<seq2seq4repair_space>" ) ) + ( config . getPrefixes ( ) . getNsURIPrefix ( property . getNameSpace ( ) ) ) ) + ":" ) + ( property . getLocalName ( ) ) ;
Buggy code:
@ Controller public class StoryController { @ PreRequest public static void determineScopeRoles ( RequestData requestData ) throws Exception { } public static void determineScopeRoles ( RequestData requestData , Story story ) throws Exception { } @ PreRequest public static void setupSerializer ( RequestData requestData ) { } @ RequireAuth @ Route ( method = Method . GET ) public static Object getAllHandler ( RequestData requestData ) throws Exception { } @ RequireAuth ( role = ScopeRole . TEAM_MEMBER ) @ Route ( method = Method . GET_ONE ) public static Object getOneHandler ( RequestData requestData ) throws Exception { } @ RequireAuth ( role = ScopeRole . TEAM_MEMBER ) @ Route ( method = Method . POST ) public static Object postHandler ( RequestData requestData ) throws Exception { } @ RequireAuth ( role = ScopeRole . TEAM_MEMBER ) @ Route ( method = Method . PUT ) public static Object putHandler ( RequestData requestData ) throws Exception { Story story = EbeanEx . require ( EbeanEx . find ( Story . class , requestData . getParameter ( "id" ) ) ) ; Payload payload = requestData . getPayload ( ) ; if ( payload . containsKey ( "iteration" ) ) { story . setIteration ( EbeanEx . require ( EbeanEx . find ( Iteration . class , requestData . getPayload ( ) . get ( "iteration" ) ) ) ) ; } if ( payload . containsKey ( "name" ) ) { story . setName ( payload . getString ( "name" ) ) ; } if ( payload . containsKey ( "description" ) ) { story . setDescription ( payload . getString ( "description" ) ) ; } if ( payload . containsKey ( "status" ) ) { Story . Status status = Status . valueOf ( payload . getOrDefault ( "status" , DEFINED . toString ( ) ) . toString ( ) ) ; if ( ( ( story . getStatus ( ) ) != ( Status . ACCEPTED ) ) && ( status == ( Status . ACCEPTED ) ) ) { requestData . requireScopeRole ( PRODUCT_OWNER ) ; } story . setStatus ( status ) ; } if ( payload . containsKey ( "points" ) ) { story . setStoryPoints ( payload . getInt ( "points" ) ) ; } if ( payload . containsKey ( "priority" ) ) { <START_BUG> story . setStoryPoints ( payload . getInt ( "priority" ) ) ; <END_BUG> } Ebean . save ( story ) ; return story ; } @ RequireAuth ( role = ScopeRole . TEAM_MEMBER ) @ Route ( method = Method . DELETE ) public static Object deleteHandler ( RequestData requestData ) throws Exception { } @ RequireAuth ( role = ScopeRole . TEAM_MEMBER ) @ Route ( method = Method . GET , route = "//story//{id}//task" ) public static Object getTask ( RequestData requestData ) throws Exception { } }

Fix:
story . setPriority ( payload . getInt ( "priority" ) ) ;
Buggy code:
@ Component public class Game extends AbstractGame { private final GameState state = new GameState ( ) ; @ Autowired private PlayerStore playerStore ; @ Autowired private AntBrains antBrains ; private AntGame antGame ; @ PostConstruct public void initialize ( ) { <START_BUG> GameBoard board = GameBoardBuilder . boardFromData ( 16 , 16 , new int [ ] { 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , SPAWNING_POINT_1 . getValue ( ) , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 } ) ; <END_BUG> state . setBoard ( board ) ; state . setMaxAntsPerPlayer ( 1 ) ; antGame = new AntGame ( state , playerStore , antBrains ) ; } public AntGame getAntGame ( ) { } public void setAntGame ( AntGame antGame ) { } public synchronized void start ( ) { } public synchronized void stop ( ) { } @ Override protected void doFrame ( ) { } public boolean isStarted ( ) { } }

Fix:
GameBoard board = GameBoardBuilder . boardFromData ( 16 , 16 , new int [ ] { 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , SPAWNING_POINT_1 . getValue ( ) , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , SPAWNING_POINT_2 . getValue ( ) , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 } ) ;
Buggy code:
public class Utils { public static final String getCanonicalPath ( File file ) { } public static final String getHash ( File file ) { if ( Debug . activate ( ) ) <START_BUG> System . out . println ( ( "Hashing<seq2seq4repair_space>" + ( file . getAbsolutePath ( ) ) ) ) ; <END_BUG> return Hash . xxhash32 ( file ) ; } public static void copyFileUsingFileStreams ( File source , File dest ) { } public static void copyFileUsingFileChannels ( File source , File dest ) { } public String copyNhash ( File source , File dest ) { } public static boolean isFileLocked ( File f ) { } public static int getUpdateFrequency ( int total ) { } public static String getRAMUsage ( ) { } No newline ; at end ; of file ; }

Fix:
System . out . println ( ( "DEBUG:<seq2seq4repair_space>Hashing<seq2seq4repair_space>" + ( file . getAbsolutePath ( ) ) ) ) ;
Buggy code:
public class BatchImageBuilder extends AbstractImageBuilder { protected BatchImageBuilder ( JavaBuilder javaBuilder ) { } public void build ( ) { } protected void addAllSourceFiles ( final ArrayList locations , final ArrayList typeNames ) throws CoreException { for ( int i = 0 , length = sourceFolders . length ; i < length ; i ++ ) { <START_BUG> final int srcFolderLength = ( sourceFolders [ i ] . getLocation ( ) . toString ( ) . length ( ) ) + 1 ; <END_BUG> sourceFolders [ i ] . accept ( new IResourceVisitor ( ) { public boolean visit ( IResource resource ) { if ( ( resource . getType ( ) ) == ( IResource . FILE ) ) { if ( JAVA_EXTENSION . equalsIgnoreCase ( resource . getFileExtension ( ) ) ) { String sourceLocation = resource . getLocation ( ) . toString ( ) ; locations . add ( sourceLocation ) ; typeNames . add ( sourceLocation . substring ( srcFolderLength , ( ( sourceLocation . length ( ) ) - 5 ) ) ) ; } return false ; } return true ; } } ) ; notifier . checkCancel ( ) ; } } protected void scrubOutputFolder ( ) throws CoreException { } protected void copyExtraResourcesBack ( ) throws CoreException { } public String toString ( ) { } }

Fix:
final int srcFolderLength = sourceFolders [ i ] . getLocation ( ) . addTrailingSeparator ( ) . toString ( ) . length ( ) ;
Buggy code:
public class CSVPrinter { private final Writer out ; private final CSVStrategy strategy ; private boolean newLine = true ; private char [ ] buf = new char [ 0 ] ; public CSVPrinter ( Writer out , CSVStrategy strategy ) { } public void println ( ) throws IOException { <START_BUG> out . write ( strategy . getPrinterNewline ( ) ) ; <END_BUG> newLine = true ; } public void flush ( ) throws IOException { } public void println ( String [ ] values ) throws IOException { } public void printlnComment ( String comment ) throws IOException { } public void print ( char [ ] value , int offset , int len , boolean checkForEscape ) throws IOException { } void printSep ( ) throws IOException { } void printAndEscape ( char [ ] value , int offset , int len ) throws IOException { } void printAndEncapsulate ( char [ ] value , int offset , int len ) throws IOException { } public void print ( String value , boolean checkForEscape ) throws IOException { } public void print ( String value ) throws IOException { } }

Fix:
out . write ( strategy . getLineSeparator ( ) ) ;
Buggy code:
public class UndertowSubsystemTestCase extends AbstractSubsystemBaseTest { public UndertowSubsystemTestCase ( ) { } @ Override protected String getSubsystemXml ( ) throws IOException { } @ Test public void testRuntime ( ) throws Exception { } @ Override protected AdditionalInitialization createAdditionalInitialization ( ) { } private static class RuntimeInitialization extends AdditionalInitialization { protected ControllerInitializer createControllerInitializer ( ) { ControllerInitializer ci = new ControllerInitializer ( ) { @ Override protected void initializeSocketBindingsOperations ( List < ModelNode > ops ) { super . initializeSocketBindingsOperations ( ops ) ; <START_BUG> final String [ ] names = new String [ ] { "ajp" , "http" , "http-2" , "https" , "https-2" , "ajps" } ; <END_BUG> final int [ ] ports = new int [ ] { 8009 , 8080 , 8081 , 8433 , 8434 , 8010 } ; for ( int i = 0 ; i < ( names . length ) ; i ++ ) { final ModelNode op = new ModelNode ( ) ; op . get ( OP ) . set ( ADD ) ; op . get ( OP_ADDR ) . set ( PathAddress . pathAddress ( PathElement . pathElement ( SOCKET_BINDING_GROUP , SOCKET_BINDING_GROUP_NAME ) , PathElement . pathElement ( SOCKET_BINDING , names [ i ] ) ) . toModelNode ( ) ) ; op . get ( PORT ) . set ( ports [ i ] ) ; ops . add ( op ) ; } } } ; ci . addSocketBinding ( "make-framework-happy" , 59999 ) ; return ci ; } @ Override protected void addExtraServices ( ServiceTarget target ) { } } }

Fix:
final String [ ] names = new String [ ] { "ajp" , "http" , "http-2" , "https-non-default" , "https-2" , "ajps" } ;
Buggy code:
public class TrainSemanticParser extends AbstractCli { private OptionSpec < String > ccgLexicon ; private OptionSpec < String > ccgRules ; private OptionSpec < Void > ccgApplicationOnly ; private OptionSpec < Void > ccgNormalFormOnly ; private OptionSpec < Void > skipWords ; private OptionSpec < String > jsonTrainingData ; private OptionSpec < String > trainingData ; private OptionSpec < Integer > beamSize ; private OptionSpec < String > modelOutput ; public TrainSemanticParser ( ) { } @ Override public void initializeOptions ( OptionParser parser ) { } @ Override public void run ( OptionSet options ) { List < CcgExample > trainingExamples = null ; if ( options . has ( jsonTrainingData ) ) { trainingExamples = TrainSemanticParser . readCcgExamplesJson ( options . valueOf ( jsonTrainingData ) ) ; } else if ( options . has ( trainingData ) ) { trainingExamples = TrainSemanticParser . readCcgExamples ( options . valueOf ( trainingData ) ) ; } Preconditions . checkState ( ( trainingExamples != null ) ) ; System . out . println ( ( ( "Read<seq2seq4repair_space>" + ( trainingExamples . size ( ) ) ) + "<seq2seq4repair_space>training<seq2seq4repair_space>examples" ) ) ; ParametricCcgParser family = createCcgParser ( options ) ; <START_BUG> CcgInference inferenceAlgorithm = new com . jayantkrish . jklol . ccg . CcgBeamSearchInference ( null , options . valueOf ( beamSize ) , ( - 1 ) , Integer . MAX_VALUE , 1 , false ) ; <END_BUG> GradientOracle < CcgParser , CcgExample > oracle = new com . jayantkrish . jklol . ccg . CcgPerceptronOracle ( family , inferenceAlgorithm , 0.0 ) ; GradientOptimizer trainer = createGradientOptimizer ( trainingExamples . size ( ) ) ; SufficientStatistics parameters = trainer . train ( oracle , oracle . initializeGradient ( ) , trainingExamples ) ; CcgParser ccgParser = family . getModelFromParameters ( parameters ) ; System . out . println ( "Serializing<seq2seq4repair_space>trained<seq2seq4repair_space>model..." ) ; IoUtils . serializeObjectToFile ( ccgParser , options . valueOf ( modelOutput ) ) ; System . out . println ( "Trained<seq2seq4repair_space>model<seq2seq4repair_space>parameters:" ) ; System . out . println ( family . getParameterDescription ( parameters ) ) ; } public static List < CcgExample > readCcgExamplesJson ( String jsonFilename ) { } public static List < CcgExample > readCcgExamples ( String filename ) { } private ParametricCcgParser createCcgParser ( OptionSet parsedOptions ) { } public static void main ( String [ ] args ) { } }

Fix:
CcgInference inferenceAlgorithm = new com . jayantkrish . jklol . ccg . CcgBeamSearchInference ( null , options . valueOf ( beamSize ) , ( - 1 ) , Integer . MAX_VALUE , Runtime . getRuntime ( ) . availableProcessors ( ) , false ) ;
Buggy code:
public class HomeListViewAdapter extends BaseAdapter { private ArrayList < Card > cardView ; private LayoutInflater inflater ; private Context context ; private SharedPreferences sharedPreferences ; String userID ; String facebookId ; String requestURL ; public HomeListViewAdapter ( Context c , LayoutInflater layoutInflater , ArrayList < Card > item ) { } @ Override public int getCount ( ) { } @ Override public Object getItem ( int position ) { } @ Override public long getItemId ( int position ) { } @ Override public View getView ( final int position , final View convertView , final ViewGroup parent ) { } static class ViewHolder { ImageButton bookMark ; ImageButton share ; TextView title ; TextView tagline ; TextView category1 ; TextView category2 ; TextView category3 ; TextView likesBookmark ; NetworkImageView bg ; } private void FacebookShare ( int position ) { FacebookSdk . sdkInitialize ( context . getApplicationContext ( ) ) ; if ( ShareDialog . canShow ( ShareLinkContent . class ) ) { ShareDialog shareDialog = new ShareDialog ( ( ( HomeScreen ) ( context ) ) ) ; <START_BUG> ShareLinkContent linkContent = new ShareLinkContent . Builder ( ) . setContentTitle ( cardView . get ( position ) . title ) . setContentDescription ( cardView . get ( position ) . tagline ) . setImageUrl ( Uri . parse ( cardView . get ( position ) . bg ) ) . setContentUrl ( Uri . parse ( ( "http:////tlpserver.herokuapp.com//#//tkId" + ( cardView . get ( position ) . _id ) ) ) ) . build ( ) ; <END_BUG> shareDialog . show ( linkContent ) ; } } private void TwitterShare ( int position ) { } private void EmailShare ( int position ) { } }

Fix:
ShareLinkContent linkContent = new ShareLinkContent . Builder ( ) . setContentTitle ( cardView . get ( position ) . title ) . setContentDescription ( cardView . get ( position ) . tagline ) . setImageUrl ( Uri . parse ( cardView . get ( position ) . bg ) ) . setContentUrl ( Uri . parse ( ( ( context . getResources ( ) . getString ( talkDetailsWebConnection ) ) + ( cardView . get ( position ) . _id ) ) ) ) . build ( ) ;
Buggy code:
public class ReadResponse implements Serializable { private static ICompactSerializer < ReadResponse > serializer_ ; public static ICompactSerializer < ReadResponse > serializer ( ) { } public static Message makeReadResponseMessage ( ReadResponse readResponse ) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( bos ) ; ReadResponse . serializer ( ) . serialize ( readResponse , dos ) ; <START_BUG> Message message = new Message ( StorageService . getLocalStorageEndPoint ( ) , MessagingService . responseStage_ , MessagingService . responseVerbHandler_ , new Object [ ] { bos . toByteArray ( ) } ) ; <END_BUG> return message ; } private String table_ ; private Row row_ ; private byte [ ] digest_ = new byte [ 0 ] ; private boolean isDigestQuery_ = false ; public ReadResponse ( String table , byte [ ] digest ) { } public ReadResponse ( String table , Row row ) { } public String table ( ) { } public Row row ( ) { } public byte [ ] digest ( ) { } public boolean isDigestQuery ( ) { } public void setIsDigestQuery ( boolean isDigestQuery ) { } }

Fix:
Message message = new Message ( StorageService . getLocalStorageEndPoint ( ) , MessagingService . responseStage_ , MessagingService . responseVerbHandler_ , bos . toByteArray ( ) ) ;
Buggy code:
public class SynchService extends IntentService implements LocationListener { public SynchService ( ) { } @ Override protected void onHandleIntent ( Intent intent ) { } @ Override public void onLocationChanged ( Location currentLocation ) { currentLocation . setLatitude ( currentLocation . getLatitude ( ) ) ; currentLocation . setLatitude ( currentLocation . getLatitude ( ) ) ; Log . i ( "location<seq2seq4repair_space>service" , ( "Latitude:<seq2seq4repair_space>" + ( currentLocation . getLatitude ( ) ) ) ) ; Log . i ( "location<seq2seq4repair_space>service" , ( "Logitude:<seq2seq4repair_space>" + ( currentLocation . getLongitude ( ) ) ) ) ; try { MeteoInfo meteo = new APIManager ( ) . getMeteoInfo ( this . getApplicationContext ( ) , currentLocation ) ; } catch ( Exception e ) { } <START_BUG> new LocationsDetector ( ) . detect ( this ) ; <END_BUG> NotificationHandler handler = new NotificationHandler ( this . getApplicationContext ( ) ) ; handler . show ( "Notifica<seq2seq4repair_space>creata" ) ; handler . update ( "Notifica<seq2seq4repair_space>aggiornata" ) ; } @ Override public void onStatusChanged ( String s , int i , Bundle bundle ) { } @ Override public void onProviderEnabled ( String s ) { } @ Override public void onProviderDisabled ( String s ) { } }

Fix:
new LocationsDetector ( ) . addLocationToHistory ( currentLocation ) ;
Buggy code:
public class ApplicationClassificationParentResourceDefinition extends SimpleResourceDefinition { public static final PathElement PATH_ELEMENT = PathElement . pathElement ( CONSTRAINT , APPLICATION_CLASSIFICATION ) ; public static final ApplicationClassificationParentResourceDefinition INSTANCE = new ApplicationClassificationParentResourceDefinition ( ) ; private ApplicationClassificationParentResourceDefinition ( ) { } @ Override public void registerChildren ( ManagementResourceRegistration resourceRegistration ) { <START_BUG> resourceRegistration . registerSubModel ( ApplicationClassificationResourceDefinition . INSTANCE ) ; <END_BUG> } }

Fix:
resourceRegistration . registerSubModel ( ApplicationClassificationTypeResourceDefinition . INSTANCE ) ;
Buggy code:
public class HintDialog { private Context mContext ; private View dialogView ; private TextView mTitle ; private TextView mOk ; private TextView mCancel ; private OnClickListener mOkOnClickListener ; private OnClickListener mCancelOnClickListener ; public HintDialog ( Context context , View view ) { } public void show ( ) { } public void show ( String title , String ok , String cancel ) { } public void show ( String title , String ok , String cancel , View . OnClickListener okOnClickListener , View . OnClickListener cancelOnClickListener ) { } public void show ( String ok , String cancel , View . OnClickListener okOnClickListener , View . OnClickListener cancelOnClickListener ) { } public void hide ( ) { } public void setText ( String title , String ok , String cancel ) { } public void setTitle ( String title ) { } public void setOkText ( String ok ) { } public void setCancelText ( String cancelText ) { } public void setOkOnClickListener ( OnClickListener l ) { } public void setCancelOnClickListener ( OnClickListener l ) { } public void setOkVisibility ( int v ) { <START_BUG> mCancel . setVisibility ( v ) ; <END_BUG> } public void setCancelVisibility ( int v ) { } }

Fix:
mOk . setVisibility ( v ) ;
Buggy code:
public class User { private static final Logger logger = LoggerFactory . getLogger ( User . class ) ; private long id ; private List < Group > groups ; private String name ; @ JSONField ( serialize = false ) private ConcurrentLinkedQueue < Client > clients ; public User ( ) { } public User ( long id ) { } public ConcurrentLinkedQueue < Client > getClients ( ) { } public void setClients ( ConcurrentLinkedQueue < Client > clients ) { } public long getId ( ) { } public void setId ( long id ) { } public List < Group > getGroups ( ) { } public void setGroups ( List < Group > groups ) { } public String getName ( ) { } public void setName ( String name ) { } @ Override public String toString ( ) { } public String stats ( ) { } public void send ( String eventName , BaseMessage msg ) { <START_BUG> User . logger . debug ( "send<seq2seq4repair_space>msg<seq2seq4repair_space>to<seq2seq4repair_space>user-><seq2seq4repair_space>thread:{}<seq2seq4repair_space>id:{}<seq2seq4repair_space>clients<seq2seq4repair_space>size:{}<seq2seq4repair_space>eventName:{}<seq2seq4repair_space>msg:{}" , Thread . currentThread ( ) . getName ( ) , id , this . clients . size ( ) , eventName , msg ) ; <END_BUG> for ( Client client : clients ) { client . send ( eventName , msg ) ; } User . logger . debug ( "send<seq2seq4repair_space>msg<seq2seq4repair_space>to<seq2seq4repair_space>user<seq2seq4repair_space>finished" ) ; } public void dismiss ( ) { } public void addClientToUser ( Client client ) { } public void removeClientFromUser ( Client client ) { } public void removeClientFromUser ( SocketIOClient ioClient ) { } }

Fix:
User . logger . debug ( "send<seq2seq4repair_space>msg<seq2seq4repair_space>to<seq2seq4repair_space>user-><seq2seq4repair_space>thread:{}<seq2seq4repair_space>userId:{}<seq2seq4repair_space>clients<seq2seq4repair_space>size:{}<seq2seq4repair_space>eventName:{}<seq2seq4repair_space>msg:{}" , Thread . currentThread ( ) . getName ( ) , id , this . clients . size ( ) , eventName , msg ) ;
Buggy code:
public class JBossWebParsingDeploymentProcessor implements DeploymentUnitProcessor { public static final long PRIORITY = PARSE_DESCRIPTORS . plus ( 320L ) ; private static final String JBOSS_WEB_XML = "WEB-INF//jboss-web.xml" ; public void processDeployment ( DeploymentUnitContext context ) throws DeploymentUnitProcessingException { final VirtualFile deploymentRoot = VirtualFileAttachment . getVirtualFileAttachment ( context ) ; final VirtualFile jbossWebXml = deploymentRoot . getChild ( JBossWebParsingDeploymentProcessor . JBOSS_WEB_XML ) ; WarMetaData warMetaData = context . getAttachment ( ATTACHMENT_KEY ) ; assert warMetaData != null ; if ( jbossWebXml . exists ( ) ) { InputStream is = null ; long time = System . currentTimeMillis ( ) ; try { is = jbossWebXml . openStream ( ) ; final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; XMLStreamReader xmlReader = inputFactory . createXMLStreamReader ( is ) ; warMetaData . setJbossWebMetaData ( JBossWebMetaDataParser . parse ( xmlReader ) ) ; } catch ( Exception e ) { throw new DeploymentUnitProcessingException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>" + jbossWebXml ) , e ) ; } finally { <START_BUG> Logger . getLogger ( "org.jboss.web" ) . info ( ( "parse<seq2seq4repair_space>" + ( ( System . currentTimeMillis ( ) ) - time ) ) ) ; <END_BUG> try { if ( is != null ) { is . close ( ) ; } } catch ( IOException e ) { } } } } }

Fix:
Logger . getLogger ( "org.jboss.web.JBossWebParsingDeploymentProcessor" ) . info ( ( ( "parse:<seq2seq4repair_space>" + ( ( System . currentTimeMillis ( ) ) - time ) ) + "ms" ) ) ;
Buggy code:
public class DomainFailureResultHandler implements OperationStepHandler { private final DomainOperationContext domainOperationContext ; public DomainFailureResultHandler ( DomainOperationContext domainOperationContext ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . getResult ( ) . set ( new ModelNode ( ) ) ; final boolean isDomain = isDomainOperation ( operation ) ; if ( ! ( collectDomainFailure ( context , isDomain ) ) ) { collectHostFailures ( context , isDomain ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } private boolean collectDomainFailure ( OperationContext context , final boolean isDomain ) { } private boolean collectHostFailures ( final OperationContext context , final boolean isDomain ) { } private boolean isDomainOperation ( final ModelNode operation ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public abstract class PathNode { public final int i ; public final int j ; public final PathNode prev ; public PathNode ( int i , int j , PathNode prev ) { } public abstract boolean isSnake ( ) { } public boolean isBootstrap ( ) { } public final PathNode previousSnake ( ) { } @ Override public String toString ( ) { <START_BUG> StringBuffer buf = new StringBuffer ( "[" ) ; <END_BUG> PathNode node = this ; while ( node != null ) { buf . append ( "(" ) ; buf . append ( Integer . toString ( node . i ) ) ; buf . append ( "," ) ; buf . append ( Integer . toString ( node . j ) ) ; buf . append ( ")" ) ; node = node . prev ; } buf . append ( "]" ) ; return buf . toString ( ) ; } }

Fix:
StringBuilder buf = new StringBuilder ( "[" ) ;
Buggy code:
class ChoiceCompletionProvider extends CompletionProvider < CompletionParameters > { private final List < ChoiceCompletionProvider . Choice > choices = new LinkedList < ChoiceCompletionProvider . Choice > ( ) ; private final InsertHandler < LookupElement > insertHandler ; static ChoiceCompletionProvider fromChoiceNames ( List < String > choices , InsertHandler < LookupElement > insertHandler ) { } private static List < ChoiceCompletionProvider . Choice > toChoices ( List < String > names ) { } ChoiceCompletionProvider ( List < ChoiceCompletionProvider . Choice > choices , InsertHandler < LookupElement > insertHandler ) { } @ Override protected void addCompletions ( @ NotNull CompletionParameters parameters , ProcessingContext context , @ NotNull CompletionResultSet result ) { } @ NotNull private Set < String > getExistingChoices ( @ NotNull CompletionParameters parameters ) { <START_BUG> final YAMLMapping mapping = YamlPsiElements . getFirstMapping ( parameters . getPosition ( ) ) ; <END_BUG> final Set < String > existingProperties = new HashSet < String > ( ) ; if ( mapping != null ) { for ( YAMLKeyValue keyValue : mapping . getKeyValues ( ) ) { existingProperties . add ( keyValue . getKeyText ( ) ) ; } } return existingProperties ; } static class Choice { private final String name ; private final String description ; Choice ( String name , String description ) { } public String getName ( ) { } String getDescription ( ) { } } }

Fix:
final YAMLMapping mapping = YamlPsiElements . getFirstMapping ( parameters . getPosition ( ) , 3 ) ;
Buggy code:
public class SingletonComponentDescription extends SessionBeanComponentDescription { private boolean initOnStartup ; public SingletonComponentDescription ( final String componentName , final String componentClassName , final EjbJarDescription ejbJarDescription , final ServiceName deploymentUnitServiceName ) { } @ Override public ComponentConfiguration createConfiguration ( EEModuleConfiguration moduleConfiguration ) { } public boolean isInitOnStartup ( ) { } public void initOnStartup ( ) { } @ Override public boolean allowsConcurrentAccess ( ) { } @ Override public SessionBeanType getSessionBeanType ( ) { } @ Override protected void setupViewInterceptors ( ViewDescription view ) { super . setupViewInterceptors ( view ) ; view . getConfigurators ( ) . addFirst ( new ViewConfigurator ( ) { @ Override public void configure ( DeploymentPhaseContext context , ComponentConfiguration componentConfiguration , ViewDescription description , ViewConfiguration configuration ) throws DeploymentUnitProcessingException { <START_BUG> configuration . addViewInterceptor ( new org . jboss . invocation . ImmediateInterceptorFactory ( new SingletonComponentInstanceAssociationInterceptor ( ) ) ) ; <END_BUG> } } ) ; } }

Fix:
configuration . addViewInterceptor ( new org . jboss . invocation . ImmediateInterceptorFactory ( new SingletonComponentInstanceAssociationInterceptor ( ) ) , true ) ;
Buggy code:
public class FallbackRepository implements FileRepository { private final FileRepository primary ; private final FileRepository secondary ; public FallbackRepository ( final FileRepository primary , final FileRepository secondary ) { } @ Override public File getFile ( final String relativePath ) { } @ Override public File getConfigurationFile ( String relativePath ) { File file = primary . getConfigurationFile ( relativePath ) ; <START_BUG> return file != null ? file : secondary . getFile ( relativePath ) ; <END_BUG> } @ Override public File [ ] getDeploymentFiles ( byte [ ] hash ) { } @ Override public File getDeploymentRoot ( byte [ ] hash ) { } }

Fix:
return file != null ? file : secondary . getConfigurationFile ( relativePath ) ;
Buggy code:
class ChatLayout extends Layout { protected static final int TEXT_HEIGHT_FUDGE = 8 ; Point iExtent ; Point tExtent ; int inputSize = 15 ; int separatorSize = 5 ; int textHeight = - 1 ; ChatLayout ( int defaultInputSize , int sepSize ) { } protected Point computeSize ( Composite composite , int wHint , int hHint , boolean changed ) { Control [ ] children = composite . getChildren ( ) ; if ( ( changed || ( ( iExtent ) == null ) ) || ( ( tExtent ) == null ) ) { iExtent = children [ 0 ] . computeSize ( SWT . DEFAULT , SWT . DEFAULT , false ) ; tExtent = children [ 1 ] . computeSize ( SWT . DEFAULT , SWT . DEFAULT , false ) ; } int width = ( ( iExtent . x ) + 5 ) + ( tExtent . x ) ; int height = Math . max ( iExtent . y , tExtent . y ) ; <START_BUG> return new Point ( ( width + 2 ) , ( height + 2 ) ) ; <END_BUG> } protected void layout ( Composite composite , boolean changed ) { } protected void setInputTextHeight ( int height ) { } }

Fix:
return new Point ( ( width + 2 ) , ( height + 200 ) ) ;
Buggy code:
@ Config ( constants = BuildConfig . class , sdk = VERSION_CODES . LOLLIPOP ) @ RunWith ( CustomRobolectricGradleTestRunner . class ) public class LibraryUpdateAlarmTest { ShadowApplication app ; Context context ; ShadowAlarmManager alarmManager ; @ Before public void setup ( ) { } @ Test public void testLibraryIntentHandling ( ) { } @ Test public void testAlarmIsNotStarted ( ) { } @ Test public void testAlarmIsNotStartedWhenBootReceivedAndSettingZero ( ) { } @ Test public void testAlarmIsStartedWhenBootReceivedAndSettingNotZero ( ) { } @ Test public void testOnlyOneAlarmExists ( ) { } @ Test public void testLibraryWillBeUpdatedWhenAlarmFired ( ) { } @ Test public void testLibraryUpdateServiceIsStartedWhenUpdateIntentIsReceived ( ) { Intent intent = new Intent ( context , LibraryUpdateService . class ) ; <START_BUG> intent . putExtra ( "is_forced" , false ) ; <END_BUG> assertThat ( app . getNextStartedService ( ) ) . isNotEqualTo ( intent ) ; LibraryUpdateAlarm alarm = new LibraryUpdateAlarm ( ) ; alarm . onReceive ( context , new Intent ( LibraryUpdateAlarm . LIBRARY_UPDATE_ACTION ) ) ; assertThat ( app . getNextStartedService ( ) ) . isEqualTo ( intent ) ; } @ Test public void testReceiverDoesntReactToNullActions ( ) { } @ Test public void testAlarmFiresCloseToDesiredTime ( ) { } }

Fix:
intent . putExtra ( "is_manual" , false ) ;
Buggy code:
public class ThisReference extends Reference { public static ThisReference implicitThis ( ) { } public ThisReference ( int sourceStart , int sourceEnd ) { } public FlowInfo analyseAssignment ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , Assignment assignment , boolean isCompound ) { } public boolean checkAccess ( MethodScope methodScope ) { } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { } public boolean isImplicitThis ( ) { } public boolean isThis ( ) { } public int nullStatus ( FlowInfo flowInfo ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; if ( ( ! ( this . isImplicitThis ( ) ) ) && ( ! ( checkAccess ( scope . methodScope ( ) ) ) ) ) { return null ; } <START_BUG> return this . resolvedType = scope . enclosingSourceType ( ) ; <END_BUG> } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
return this . resolvedType = scope . enclosingReceiverType ( ) ;
Buggy code:
public class AnnotProxyFieldValueFactory implements IFieldValueFactory { private final ISpringContextLocator contextLocator ; private final ConcurrentHashMap < SpringBeanLocator , Object > cache = Generics . newConcurrentHashMap ( ) ; private final ConcurrentHashMap < Class < ? > , String > beanNameCache = Generics . newConcurrentHashMap ( ) ; private final boolean wrapInProxies ; public AnnotProxyFieldValueFactory ( ISpringContextLocator contextLocator ) { } public AnnotProxyFieldValueFactory ( ISpringContextLocator contextLocator , boolean wrapInProxies ) { } public Object getFieldValue ( Field field , Object fieldOwner ) { } private String getBeanName ( final Field field ) { } private final String getBeanNameOfClass ( ApplicationContext ctx , Class < ? > clazz ) { } private BeanDefinition getBeanDefinition ( ConfigurableListableBeanFactory beanFactory , String name ) { if ( beanFactory . containsBeanDefinition ( name ) ) { return beanFactory . getBeanDefinition ( name ) ; } else { BeanFactory parent = beanFactory . getParentBeanFactory ( ) ; if ( ( parent != null ) && ( parent instanceof ConfigurableListableBeanFactory ) ) { <START_BUG> return getBeanDefinition ( beanFactory , name ) ; <END_BUG> } else { return null ; } } } public boolean supportsField ( Field field ) { } }

Fix:
return getBeanDefinition ( ( ( ConfigurableListableBeanFactory ) ( parent ) ) , name ) ;
Buggy code:
public class SingleDelimiterCodeFilterImpl implements CodeFilter { private final String delimiter ; public SingleDelimiterCodeFilterImpl ( final char delimiter ) { } @ Override public String apply ( final String input ) { <START_BUG> return input . replaceAll ( delimiter , "" ) ; <END_BUG> } }

Fix:
return input . replaceAll ( delimiter , "" ) . trim ( ) ;