nus-yam/ex-repair huggingface dataset:
Buggy code:
public class SwitchStatement extends Statement { public Expression testExpression ; public Statement [ ] statements ; public BlockScope scope ; public int explicitDeclarations ; public Label breakLabel ; public Case [ ] cases ; public DefaultCase defaultCase ; public int caseCount = 0 ; int preSwitchInitStateIndex = - 1 ; int mergedInitStateIndex = - 1 ; public SwitchStatement ( ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { flowInfo = testExpression . analyseCode ( currentScope , flowContext , flowInfo ) ; SwitchFlowContext switchContext = new SwitchFlowContext ( flowContext , this , ( breakLabel = new Label ( ) ) ) ; <START_BUG> FlowInfo caseInits = DeadEnd ; <END_BUG> preSwitchInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; int caseIndex = 0 ; if ( ( statements ) != null ) { boolean didAlreadyComplain = false ; for ( int i = 0 , max = statements . length ; i < max ; i ++ ) { Statement statement = statements [ i ] ; if ( ( caseIndex < ( caseCount ) ) && ( statement == ( cases [ caseIndex ] ) ) ) { caseIndex ++ ; caseInits = caseInits . mergedWith ( flowInfo . copy ( ) . unconditionalInits ( ) ) ; didAlreadyComplain = false ; } else if ( statement == ( defaultCase ) ) { caseInits = caseInits . mergedWith ( flowInfo . copy ( ) . unconditionalInits ( ) ) ; didAlreadyComplain = false ; } if ( ! ( caseInits . complainIfUnreachable ( statement , scope , didAlreadyComplain ) ) ) { caseInits = statement . analyseCode ( scope , switchContext , caseInits ) ; } else { didAlreadyComplain = true ; } } } if ( ( defaultCase ) == null ) { flowInfo . addPotentialInitializationsFrom ( caseInits . mergedWith ( switchContext . initsOnBreak ) ) ; mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; return flowInfo ; } FlowInfo mergedInfo = caseInits . mergedWith ( switchContext . initsOnBreak ) ; mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void resetStateForCodeGeneration ( ) { } public void resolve ( BlockScope upperScope ) { } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } public void branchChainTo ( Label label ) { } }

Fix:
FlowInfo caseInits = FlowInfo . DEAD_END ;
Buggy code:
public class StatefulRemoteViewInstanceFactory implements ViewInstanceFactory { private final String applicationName ; private final String moduleName ; private final String distinctName ; private final String beanName ; public StatefulRemoteViewInstanceFactory ( final String applicationName , final String moduleName , final String distinctName , final String beanName ) { } @ Override public ManagedReference createViewInstance ( final ComponentView componentView , final Map < Object , Object > contextData ) throws Exception { SessionID sessionID = ( ( SessionID ) ( contextData . get ( SessionID . class ) ) ) ; final StatefulEJBLocator statefulEJBLocator ; final StatefulSessionComponent statefulSessionComponent = ( ( StatefulSessionComponent ) ( componentView . getComponent ( ) ) ) ; if ( sessionID == null ) { statefulEJBLocator = EJBClient . createSession ( componentView . getViewClass ( ) , applicationName , moduleName , beanName , distinctName ) ; } else { <START_BUG> statefulEJBLocator = new StatefulEJBLocator ( componentView . getViewClass ( ) , applicationName , moduleName , beanName , distinctName , sessionID , statefulSessionComponent . getCache ( ) . getStrictAffinity ( ) ) ; <END_BUG> } final Object ejbProxy = EJBClient . createProxy ( statefulEJBLocator ) ; return new org . jboss . as . naming . ValueManagedReference ( new ImmediateValue ( ejbProxy ) ) ; } }

Fix:
statefulEJBLocator = new StatefulEJBLocator ( componentView . getViewClass ( ) , applicationName , moduleName , beanName , distinctName , sessionID , statefulSessionComponent . getCache ( ) . getStrictAffinity ( ) , null ) ;
Buggy code:
@ ActionBind public class HomeAction extends ActionDriven { private static final long serialVersionUID = - 9071696851530171069L ; static SimpleCache < String , Object > _cache = new SimpleCache < String , Object > ( 10 ) ; static int reload = 0 ; static void loadAside ( ) { } void search ( String keywords , Paging page ) throws Exception { } @ URLMapping ( "//" ) public void execute ( ) throws Exception { } @ URLMapping ( "//about//" ) public void about ( ) throws Exception { } @ URLMapping ( "//admin//" ) public void admin ( ) { if ( "login_" . equals ( super . getParameterString ( "tp" , "" ) ) ) { login ( ) ; return ; } if ( "logout_" . equals ( super . getParameterString ( "tp" , "" ) ) ) { new UserManager ( ) . deleteUserInCookie ( ) ; super . print ( "ok" ) ; return ; } <START_BUG> super . redirect ( "//admin//list//" ) ; <END_BUG> } private void login ( ) { } public void reg ( ) { } }

Fix:
super . redirect ( ( ( super . request ( ) . getContextPath ( ) ) + "//admin//list//" ) ) ;
Buggy code:
public final class LibraryApplication extends WicketExampleApplication { public LibraryApplication ( ) { } public Class getHomePage ( ) { } public Session newSession ( Request request , Response response ) { <START_BUG> return new LibrarySession ( this , request , response ) ; <END_BUG> } protected void init ( ) { } }

Fix:
return new LibrarySession ( this , request ) ;
Buggy code:
public class TestServiceTypeListener extends TestListener implements IServiceTypeListener { public TestServiceTypeListener ( int eventsToExpect ) { } public void serviceTypeDiscovered ( IServiceTypeEvent anEvent ) { events . add ( anEvent ) ; <START_BUG> if ( ( getEventCount ( ) ) == ( amountOfEventsToExpect ) ) { <END_BUG> synchronized ( this ) { notifyAll ( ) ; } } } }

Fix:
if ( ( events . size ( ) ) == ( amountOfEventsToExpect ) ) {
Buggy code:
public class MetricsConsumerBolt implements IBolt { IMetricsConsumer _metricsConsumer ; String _consumerClassName ; OutputCollector _collector ; Object _registrationArgument ; public MetricsConsumerBolt ( String consumerClassName , Object registrationArgument ) { } @ Override public void prepare ( Map stormConf , TopologyContext context , OutputCollector collector ) { try { _metricsConsumer = ( ( IMetricsConsumer ) ( Class . forName ( _consumerClassName ) . newInstance ( ) ) ) ; } catch ( Exception e ) { throw new RuntimeException ( ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>instantiate<seq2seq4repair_space>a<seq2seq4repair_space>class<seq2seq4repair_space>listed<seq2seq4repair_space>in<seq2seq4repair_space>config<seq2seq4repair_space>under<seq2seq4repair_space>section<seq2seq4repair_space>" + ( Config . TOPOLOGY_METRICS_CONSUMER_REGISTER ) ) + "<seq2seq4repair_space>with<seq2seq4repair_space>fully<seq2seq4repair_space>qualified<seq2seq4repair_space>name<seq2seq4repair_space>" ) + ( _consumerClassName ) ) , e ) ; } <START_BUG> _metricsConsumer . prepare ( stormConf , _registrationArgument , context ) ; <END_BUG> _collector = collector ; } @ Override public void execute ( Tuple input ) { } @ Override public void cleanup ( ) { } }

Fix:
_metricsConsumer . prepare ( stormConf , _registrationArgument , context , collector ) ;
Buggy code:
class FieldNotFoundResult implements BindingResult { private String property ; private Object sourceValue ; private MessageSource messageSource ; public FieldNotFoundResult ( String property , Object sourceValue , MessageSource messageSource ) { } public String getFieldName ( ) { } public Object getSubmittedValue ( ) { } public boolean isFailure ( ) { } public Alert getAlert ( ) { return new Alert ( ) { public String getCode ( ) { <START_BUG> return "propertyNotFound" ; <END_BUG> } public Severity getSeverity ( ) { return Severity . WARNING ; } public String getMessage ( ) { MessageBuilder builder = new MessageBuilder ( messageSource ) ; builder . code ( "bindSuccess" ) ; builder . arg ( "label" , new ResolvableArgument ( property ) ) ; builder . arg ( "value" , sourceValue ) ; builder . defaultMessage ( ( ( ( ( "Successfully<seq2seq4repair_space>bound<seq2seq4repair_space>user<seq2seq4repair_space>value<seq2seq4repair_space>" + ( StylerUtils . style ( sourceValue ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>property<seq2seq4repair_space>'" ) + ( property ) ) + "'" ) ) ; return builder . build ( ) ; } } ; } public String toString ( ) { } }

Fix:
return "fieldNotFound" ;
Buggy code:
public class GeofenceTransitionsIntent { private Activity mActivity ; public GeofenceTransitionsIntent ( Activity activity ) { } protected void handleTransition ( Intent intent , RadarList radarList ) { NotificationPreference notification = new NotificationPreference ( ) ; notification . getSharedPreferences ( mActivity ) ; GeofencingEvent geoFenceEvent = GeofencingEvent . fromIntent ( intent ) ; <START_BUG> if ( ! ( geoFenceEvent . hasError ( ) ) ) { <END_BUG> int transitionType = geoFenceEvent . getGeofenceTransition ( ) ; int triggeredGeoFenceId = Integer . valueOf ( geoFenceEvent . getTriggeringGeofences ( ) . get ( 0 ) . getRequestId ( ) ) ; int radarIndex = triggeredGeoFenceId // 3 ; int radiusIndex = triggeredGeoFenceId % 3 ; if ( ( Geofence . GEOFENCE_TRANSITION_ENTER ) == transitionType ) { showActivityAlwaysOnTop ( ) ; Radar radar = radarList . get ( radarIndex ) ; Float km = radar . getKm ( ) ; float radius = getRadiusMeters ( notification , radiusIndex ) ; createNotification ( mActivity . getString ( warning_message ) , String . format ( mActivity . getString ( radar_message ) , radius , km ) , ic_launcher , getNotificationId ( radius ) ) ; } else if ( ( ( Geofence . GEOFENCE_TRANSITION_EXIT ) == transitionType ) && ( radiusIndex == ( Constants . RADIUS_INDEX_THIRD_FENCE ) ) ) { radarList . setNextRadarIndex ( ( radarIndex + 1 ) ) ; } } } private void showActivityAlwaysOnTop ( ) { } private float getRadiusMeters ( NotificationPreference notification , int radiusIndex ) { } private int getNotificationId ( float radius ) { } private void createNotification ( String title , String text , int icon , int notificationId ) { } private Uri getSoundUri ( int notification ) { } private int getLedColor ( int notificationId ) { } }

Fix:
if ( ( geoFenceEvent != null ) && ( ! ( geoFenceEvent . hasError ( ) ) ) ) {
Buggy code:
final class XATransactionState extends ContextImpl { static final int TRO_TIMEOUT = - 3 ; static final int TRO_DEADLOCK = - 2 ; static final int TRO_FAIL = - 1 ; static final int T0_NOT_ASSOCIATED = 0 ; static final int T1_ASSOCIATED = 1 ; static final int TC_COMPLETED = 3 ; final EmbedConnection conn ; final EmbedXAResource creatingResource ; private EmbedXAResource associatedResource ; final XAXactId xid ; HashMap suspendedList ; int associationState ; int rollbackOnlyCode ; boolean isPrepared ; boolean performTimeoutRollback ; XATransactionState . CancelXATransactionTask timeoutTask = null ; private static class CancelXATransactionTask extends TimerTask { private XATransactionState xaState ; public CancelXATransactionTask ( XATransactionState xaState ) { } public boolean cancel ( ) { } public void run ( ) { } } XATransactionState ( ContextManager cm , EmbedConnection conn , EmbedXAResource resource , XAXactId xid ) { } public void cleanupOnError ( Throwable t ) { if ( t instanceof StandardException ) { StandardException se = ( ( StandardException ) ( t ) ) ; if ( ( se . getSeverity ( ) ) >= ( ExceptionSeverity . SESSION_SEVERITY ) ) { popMe ( ) ; return ; } if ( ( se . getSeverity ( ) ) == ( ExceptionSeverity . TRANSACTION_SEVERITY ) ) { synchronized ( this ) { conn . setApplicationConnection ( null ) ; notifyAll ( ) ; associationState = XATransactionState . TRO_FAIL ; if ( DEADLOCK . equals ( se . getMessageId ( ) ) ) rollbackOnlyCode = XAException . XA_RBDEADLOCK ; else <START_BUG> if ( LOCK_TIMEOUT . equals ( se . getMessageId ( ) ) ) <END_BUG> rollbackOnlyCode = XAException . XA_RBTIMEOUT ; else rollbackOnlyCode = XAException . XA_RBOTHER ; } } } } void start ( EmbedXAResource resource , int flags ) throws XAException { } boolean end ( EmbedXAResource resource , int flags , boolean endingCurrentXid ) throws XAException { } synchronized void scheduleTimeoutTask ( long timeoutMillis ) { } synchronized void xa_rollback ( ) throws SQLException { } synchronized void xa_commit ( boolean onePhase ) throws SQLException { } synchronized int xa_prepare ( ) throws SQLException { } private void xa_finalize ( ) { } synchronized void cancel ( String messageId ) throws XAException { } }

Fix:
if ( se . isLockTimeout ( ) )
Buggy code:
public class ResourceUtil { private ResourceUtil ( ) { } public static void renderTo ( IHeaderResponse resp , ResourceReference ref , boolean css , String string ) { } public static String readString ( IResourceStream resourceStream ) { } public static String readString ( IResourceStream resourceStream , Charset charset ) { try { InputStream stream = resourceStream . getInputStream ( ) ; try { byte [ ] bytes = IOUtils . toByteArray ( stream ) ; if ( charset == null ) charset = Charset . defaultCharset ( ) ; <START_BUG> return new String ( bytes , charset ) ; <END_BUG> } finally { resourceStream . close ( ) ; } } catch ( IOException e ) { throw new org . apache . wicket . WicketRuntimeException ( ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>string<seq2seq4repair_space>from<seq2seq4repair_space>" + resourceStream ) , e ) ; } catch ( ResourceStreamNotFoundException e ) { throw new org . apache . wicket . WicketRuntimeException ( ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>locate<seq2seq4repair_space>stream<seq2seq4repair_space>from<seq2seq4repair_space>" + resourceStream ) , e ) ; } } }

Fix:
return new String ( bytes , charset . name ( ) ) ;
Buggy code:
public class MutantBuilder { protected void _init ( BuildHelper helper ) { } protected void buildsetup ( BuildHelper helper ) { } protected void init ( BuildHelper helper ) { } protected void common ( BuildHelper helper ) { } protected void antcore ( BuildHelper helper ) { } protected void cli ( BuildHelper helper ) { } protected void start ( BuildHelper helper ) { } protected void ant1compat ( BuildHelper helper ) { } protected void remote ( BuildHelper helper ) { } protected void clean ( BuildHelper helper ) { } protected void antlibs ( BuildHelper helper ) { } protected void build_lib ( BuildHelper helper ) { helper . mkdir ( "${bin.dir}//antlibs//${libset}" ) ; helper . mkdir ( "${distlib.dir}//antlibs" ) ; helper . createPath ( "classpath.antlibs" ) ; helper . addPathElementToPath ( "classpath.antlibs" , "${distlib.dir}//common//common.jar" ) ; helper . addPathToPath ( "classpath.antlibs" , "classpath.common" ) ; helper . javac ( "${java.dir}//antlibs//${libset}" , "${bin.dir}//antlibs//${libset}" , "classpath.antlibs" ) ; <START_BUG> helper . jar ( "${bin.dir}//antlibs//${libset}" , "${distlib.dir}//antlibs//${libset}.tsk" , "${java.dir}//antlibs//${libset}" , "antlib.xml" ) ; <END_BUG> } protected void main ( BuildHelper helper ) { } protected void checkstyle ( BuildHelper helper ) { } protected void javadocs ( BuildHelper helper ) { } }

Fix:
helper . jar ( "${bin.dir}//antlibs//${libset}" , "${distlib.dir}//antlibs//${libset}.jar" , "${java.dir}//antlibs//${libset}" , "antlib.xml" ) ;
Buggy code:
public class SingleTypeReference extends TypeReference { public char [ ] token ; public SingleTypeReference ( char [ ] source , long pos ) { } public TypeReference copyDims ( int dim ) { } public char [ ] getLastToken ( ) { } protected TypeBinding getTypeBinding ( Scope scope ) { if ( ( this . resolvedType ) != null ) return this . resolvedType ; this . resolvedType = scope . getType ( token ) ; if ( ( ( scope . kind ) == ( Scope . CLASS_SCOPE ) ) && ( this . resolvedType . isValidBinding ( ) ) ) <START_BUG> if ( ( ( ClassScope ) ( scope ) ) . detectHierarchyCycle ( this . resolvedType , this , null ) ) <END_BUG> return null ; return this . resolvedType ; } public char [ ] [ ] getTypeName ( ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveTypeEnclosing ( BlockScope scope , ReferenceBinding enclosingType ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void traverse ( ASTVisitor visitor , ClassScope scope ) { } }

Fix:
if ( ( ( ClassScope ) ( scope ) ) . detectHierarchyCycle ( this . resolvedType , this ) )
Buggy code:
public class EclipseAdapterUtils { public static String makeLocationContext ( ICompilationUnit compilationUnit , IProblem problem ) { } public static ISourceLocation makeSourceLocation ( ICompilationUnit unit , IProblem problem ) { } public static IMessage makeMessage ( ICompilationUnit unit , IProblem problem ) { ISourceLocation sourceLocation = EclipseAdapterUtils . makeSourceLocation ( unit , problem ) ; IProblem [ ] seeAlso = problem . seeAlso ( ) ; ISourceLocation [ ] seeAlsoLocations = new ISourceLocation [ seeAlso . length ] ; for ( int i = 0 ; i < ( seeAlso . length ) ; i ++ ) { seeAlsoLocations [ i ] = new SourceLocation ( new File ( new String ( seeAlso [ i ] . getOriginatingFileName ( ) ) ) , seeAlso [ i ] . getSourceLineNumber ( ) ) ; } String extraDetails = problem . getSupplementaryMessageInfo ( ) ; boolean declared = false ; if ( ( extraDetails != null ) && ( extraDetails . endsWith ( "[deow=true]" ) ) ) { declared = true ; extraDetails = extraDetails . substring ( 0 , ( ( extraDetails . length ( ) ) - ( "[deow=true]" . length ( ) ) ) ) ; } <START_BUG> IMessage msg = new org . aspectj . bridge . Message ( problem . getMessage ( ) , extraDetails , ( problem . isError ( ) ? IMessage . ERROR : IMessage . WARNING ) , sourceLocation , null , seeAlsoLocations , declared ) ; <END_BUG> return msg ; } public static IMessage makeErrorMessage ( ICompilationUnit unit , String text , Exception ex ) { } public static IMessage makeErrorMessage ( String srcFile , String text , Exception ex ) { } private EclipseAdapterUtils ( ) { } }

Fix:
IMessage msg = new org . aspectj . bridge . Message ( problem . getMessage ( ) , extraDetails , ( problem . isError ( ) ? IMessage . ERROR : IMessage . WARNING ) , sourceLocation , null , seeAlsoLocations , declared , problem . getID ( ) ) ;
Buggy code:
public class QuizManager implements Constants { public static void initTables ( ) { } public static Quiz createQuiz ( String name , Account creator , String description , String date , boolean isRandom , boolean isOnePage , boolean isImmediate ) { } public static Quiz createQuiz ( Map < String , Object > quizMap ) { } public static Quiz getQuiz ( String quizName ) { } public static void removeQuiz ( Quiz quiz ) { } public static boolean quizNameInUse ( String quizName ) { } public static List < Quiz > getAllQuizzes ( ) { } public static List < Quiz > getQuizzes ( Account creator ) { Util . validateObject ( creator ) ; <START_BUG> List < Map < String , Object > > table = Database . getRows ( QUIZZES , CREATOR , creator ) ; <END_BUG> if ( ( table == null ) || ( ( table . size ( ) ) == 0 ) ) return null ; List < Quiz > result = new ArrayList < Quiz > ( ) ; for ( Map < String , Object > row : table ) { result . add ( new Quiz ( ( ( String ) ( row . get ( QUIZ_NAME ) ) ) ) ) ; } return result ; } public static List < Quiz > getMostPopularQuizzes ( int numRecords ) { } public static List < Quiz > getRecentlyCreatedQuizzes ( int numRecords ) { } }

Fix:
List < Map < String , Object > > table = Database . getRows ( QUIZZES , CREATOR , creator . getUserName ( ) ) ;
Buggy code:
public final class Factory { Class lexicalClass ; ClassLoader lookupClassLoader ; String filename ; public Factory ( String filename , Class lexicalClass ) { } public StaticPart makeSJP ( String kind , Signature sig , SourceLocation loc ) { } public StaticPart makeSJP ( String kind , Signature sig , int l , int c ) { } public StaticPart makeSJP ( String kind , Signature sig , int l ) { } private static Object [ ] NO_ARGS = new Object [ 0 ] ; public static JoinPoint makeJP ( JoinPoint . StaticPart staticPart , Object _this , Object target ) { } public static JoinPoint makeJP ( JoinPoint . StaticPart staticPart , Object _this , Object target , Object arg0 ) { } public static JoinPoint makeJP ( JoinPoint . StaticPart staticPart , Object _this , Object target , Object arg0 , Object arg1 ) { } public static JoinPoint makeJP ( JoinPoint . StaticPart staticPart , Object _this , Object target , Object [ ] args ) { } public MethodSignature makeMethodSig ( String stringRep ) { } public MethodSignature makeMethodSig ( int modifiers , String name , Class declaringType , Class [ ] parameterTypes , String [ ] parameterNames , Class [ ] exceptionTypes , Class returnType ) { } public ConstructorSignature makeConstructorSig ( String stringRep ) { } public ConstructorSignature makeConstructorSig ( int modifiers , Class declaringType , Class [ ] parameterTypes , String [ ] parameterNames , Class [ ] exceptionTypes ) { } public FieldSignature makeFieldSig ( String stringRep ) { } public FieldSignature makeFieldSig ( int modifiers , String name , Class declaringType , Class fieldType ) { } public AdviceSignature makeAdviceSig ( String stringRep ) { } public AdviceSignature makeAdviceSig ( int modifiers , String name , Class declaringType , Class [ ] parameterTypes , String [ ] parameterNames , Class [ ] exceptionTypes , Class returnType ) { } public InitializerSignature makeInitializerSig ( String stringRep ) { } public InitializerSignature makeInitializerSig ( int modifiers , Class declaringType ) { } public CatchClauseSignature makeCatchClauseSig ( String stringRep ) { } public CatchClauseSignature makeCatchClauseSig ( Class declaringType , Class parameterType , String parameterName ) { } public SourceLocation makeSourceLoc ( int line , int col ) { <START_BUG> return new SourceLocationImpl ( lexicalClass , this . filename , line , col ) ; <END_BUG> } }

Fix:
return new SourceLocationImpl ( lexicalClass , this . filename , line ) ;
Buggy code:
public class Javah extends Task { private Vector classes = new Vector ( 2 ) ; private String cls ; private File destDir ; private Path classpath = null ; private File outputFile = null ; private boolean verbose = false ; private boolean force = false ; private boolean old = false ; private boolean stubs = false ; private Path bootclasspath ; private static String lSep = System . getProperty ( "line.separator" ) ; private FacadeTaskHelper facade = null ; public Javah ( ) { } public void setClass ( String cls ) { } public Javah . ClassArgument createClass ( ) { } public class ClassArgument { private String name ; public ClassArgument ( ) { } public void setName ( String name ) { } public String getName ( ) { } } public String [ ] getClasses ( ) { ArrayList al = new ArrayList ( ) ; if ( ( cls ) != null ) { StringTokenizer tok = new StringTokenizer ( cls , "," , false ) ; while ( tok . hasMoreTokens ( ) ) { al . add ( tok . nextToken ( ) . trim ( ) ) ; } } Enumeration e = classes . elements ( ) ; while ( e . hasMoreElements ( ) ) { Javah . ClassArgument arg = ( ( Javah . ClassArgument ) ( e . nextElement ( ) ) ) ; al . add ( arg . getName ( ) ) ; } <START_BUG> return ( ( String [ ] ) ( al . toArray ( new String [ 0 ] ) ) ) ; <END_BUG> } public void setDestdir ( File destDir ) { } public File getDestdir ( ) { } public void setClasspath ( Path src ) { } public Path createClasspath ( ) { } public void setClasspathRef ( Reference r ) { } public Path getClasspath ( ) { } public void setBootclasspath ( Path src ) { } public Path createBootclasspath ( ) { } public void setBootClasspathRef ( Reference r ) { } public Path getBootclasspath ( ) { } public void setOutputFile ( File outputFile ) { } public File getOutputfile ( ) { } public void setForce ( boolean force ) { } public boolean getForce ( ) { } public void setOld ( boolean old ) { } public boolean getOld ( ) { } public void setStubs ( boolean stubs ) { } public boolean getStubs ( ) { } public void setVerbose ( boolean verbose ) { } public boolean getVerbose ( ) { } public void setImplementation ( String impl ) { } public ImplementationSpecificArgument createArg ( ) { } public String [ ] getCurrentArgs ( ) { } public void execute ( ) throws BuildException { } public void logAndAddFiles ( Commandline cmd ) { } protected void logAndAddFilesToCompile ( Commandline cmd ) { } }

Fix:
return ( ( String [ ] ) ( al . toArray ( new String [ al . size ( ) ] ) ) ) ;
Buggy code:
@ RestController @ RequestMapping ( "//teacher" ) public class TeacherController extends BaseController { @ Autowired private TeacherService teacherService ; @ Autowired private UserService userService ; @ RequestMapping ( value = "//status" , method = RequestMethod . GET ) public MomiaHttpResponse status ( @ RequestParam String utoken ) { } @ RequestMapping ( method = RequestMethod . GET ) public MomiaHttpResponse get ( @ RequestParam String utoken ) { } <START_BUG> @ RequestMapping ( method = RequestMethod . GET ) <END_BUG> public MomiaHttpResponse list ( @ RequestParam String tids ) { Set < Integer > teacherIds = new HashSet < Integer > ( ) ; for ( String teacherId : Splitter . on ( "," ) . trimResults ( ) . omitEmptyStrings ( ) . split ( tids ) ) { teacherIds . add ( Integer . valueOf ( teacherId ) ) ; } return MomiaHttpResponse . SUCCESS ( teacherService . list ( teacherIds ) ) ; } @ RequestMapping ( method = RequestMethod . POST ) public MomiaHttpResponse add ( @ RequestParam String utoken , @ RequestParam ( "teacher" ) String teacherJson ) { } @ RequestMapping ( value = "//experience" , method = RequestMethod . POST ) public MomiaHttpResponse addExperience ( @ RequestParam String utoken , @ RequestParam ( "experience" ) String experienceJsonStr ) { } @ RequestMapping ( value = "//experience//{expid}" , method = RequestMethod . GET ) public MomiaHttpResponse getExperience ( @ RequestParam String utoken , @ PathVariable ( "expid" ) int experienceId ) { } @ RequestMapping ( value = "//experience//{expid}" , method = RequestMethod . DELETE ) public MomiaHttpResponse addExperience ( @ RequestParam String utoken , @ PathVariable ( "expid" ) int experienceId ) { } @ RequestMapping ( value = "//education" , method = RequestMethod . POST ) public MomiaHttpResponse addEducation ( @ RequestParam String utoken , @ RequestParam ( "education" ) String educationJsonStr ) { } @ RequestMapping ( value = "//education//{eduid}" , method = RequestMethod . GET ) public MomiaHttpResponse getEducation ( @ RequestParam String utoken , @ PathVariable ( "eduid" ) int educationId ) { } @ RequestMapping ( value = "//education//{eduid}" , method = RequestMethod . DELETE ) public MomiaHttpResponse addEducation ( @ RequestParam String utoken , @ PathVariable ( "eduid" ) int educationId ) { } }

Fix:
@ RequestMapping ( value = "//list" , method = RequestMethod . GET )
Buggy code:
public class OawXSDResourceSet extends ResourceSetImpl implements XSDManager { private static int counter = 0 ; protected ExtendedMetaData extendedMetadata ; private int id = ( OawXSDResourceSet . counter ) ++ ; protected Log log = XSDLog . getLog ( getClass ( ) ) ; public OawXSDResourceSet ( ) { } public void clear ( ) { } public OawXSDResource createXsdResource ( URI uri ) { } public int getID ( ) { } public List < EPackage > getPackages ( ) { ArrayList < EPackage > l = new ArrayList < EPackage > ( ) ; for ( Resource r : getResources ( ) ) <START_BUG> if ( r instanceof Resource ) { <END_BUG> OawXSDResource x = ( ( OawXSDResource ) ( r ) ) ; if ( x . isEcorePackageGenerated ( ) ) l . add ( x . getEPackage ( ) ) ; } return l ; } public Set < EPackage > getPackages ( Collection < URI > uris ) { } public List < XSDSchema > getSchemas ( ) { } public OawXSDResource getXsdResource ( URI uri , boolean loadOnDemand ) { } public boolean hasErrors ( ) { } public boolean isEmpty ( ) { } public void loadAndGenerate ( URI uri ) { } public void markDirty ( URI uri ) { } public void registerPackage ( EPackage pkg ) { } public void reloadDirty ( ProgressMonitor pm ) { } private void reloadEPackagesWithDirtySchemas ( ProgressMonitor pm ) { } private void reloadSchemasWithDirtyFiles ( ProgressMonitor pm ) { } public void remove ( URI uri ) { } @ Override public String toString ( ) { } public void unregisterPackage ( EPackage pkg ) { } }

Fix:
if ( r instanceof OawXSDResource ) {
Buggy code:
public class MaintenanceService extends TestsPersistence implements IMaintenanceService { private int j = 1 ; @ SuppressWarnings ( "unchecked" ) @ Override @ Transactional ( readOnly = false , propagation = Propagation . REQUIRES_NEW ) public boolean createQuestion ( String questionText , String descriptionText , String category , int level , List < String > answers , int trueAnswerNumber ) { } private void addAnswersList ( String answer , int trueAnswerNumber , long keyQuestion ) { } @ SuppressWarnings ( "unchecked" ) @ Override @ Transactional ( readOnly = false , propagation = Propagation . REQUIRES_NEW ) public String UpdateQuestionInDataBase ( String questionID , String questionText , String descriptionText , String category , int level , List < String > answers , int trueAnswerNumber ) { } @ SuppressWarnings ( "unchecked" ) @ Override public String SearchQuestionInDataBase ( String question , String category ) { StringBuffer str ; List < Question > res = em . createQuery ( "SELECT<seq2seq4repair_space>c<seq2seq4repair_space>FROM<seq2seq4repair_space>Question<seq2seq4repair_space>c<seq2seq4repair_space>WHERE<seq2seq4repair_space>c.questionText<seq2seq4repair_space>LIKE<seq2seq4repair_space>:custName" ) . setParameter ( "custName" , ( ( "%" + question ) + "%" ) ) . getResultList ( ) ; str = new StringBuffer ( ) ; str . append ( "<table>" ) ; for ( Question questionLine : res ) { String line = questionLine . toString ( ) ; String [ ] element = line . split ( ":" ) ; <START_BUG> str . append ( ( ( ( ( ( ( "<tr><td<seq2seq4repair_space>onclick='test(value)'<seq2seq4repair_space>value='" + ( element [ 0 ] ) ) + "'>" ) + ( element [ 0 ] ) ) + ".<seq2seq4repair_space>" ) + ( element [ 1 ] ) ) + "<//td><//tr>" ) ) ; <END_BUG> } str . append ( "<//table><br>" ) ; return str . toString ( ) ; } @ SuppressWarnings ( "unchecked" ) @ Override public String getInformation ( String questionKey ) { } @ SuppressWarnings ( "unchecked" ) @ Override public List < String > GeneratedTestQuestion ( String category , String level ) { } @ SuppressWarnings ( "unchecked" ) private String getAnswers ( long id ) { } @ Override @ Transactional ( readOnly = false , propagation = Propagation . REQUIRES_NEW ) public boolean FillDataBaseFromTextResource ( List < String > inputParsedText ) { } }

Fix:
str . append ( ( ( ( ( ( ( ( ( "<tr<seq2seq4repair_space>onclick='test(" + ( element [ 0 ] ) ) + ")'><td>Category:<seq2seq4repair_space>" ) + ( element [ 3 ] ) ) + "<//td><td>" ) + ( element [ 0 ] ) ) + ".<seq2seq4repair_space>" ) + ( element [ 1 ] ) ) + "<//td><//tr>" ) ) ;
Buggy code:
public class TaskUtil { private static final String FIELD_SEPARATOR = ";" ; public static class TaskComparator implements Comparator < Task > { public int compare ( Task task1 , Task task2 ) { int dateComp ; Calendar date1 = task1 . getMainDate ( ) ; Calendar date2 = task2 . getMainDate ( ) ; if ( ( date1 == null ) && ( date2 == null ) ) { dateComp = task1 . getTitle ( ) . compareToIgnoreCase ( task2 . getTitle ( ) ) ; } else if ( date1 == null ) { dateComp = 1 ; } else if ( date2 == null ) { <START_BUG> dateComp = 1 ; <END_BUG> } else { dateComp = date1 . compareTo ( date2 ) ; } if ( dateComp != 0 ) { return dateComp ; } else { return task1 . getTitle ( ) . compareToIgnoreCase ( task2 . getTitle ( ) ) ; } } } public static Task getInstance ( String title , Calendar startDate , Calendar endDate , int recurringPeriod ) { } public static Task getInstance ( String title , Calendar startDate , Calendar endDate ) { } public static Task getInstance ( String title , Calendar startDate , int recurringPeriod ) { } public static Task getInstance ( String title , Calendar startDate ) { } public static Task parseFromStorage ( String entry ) { } public static Calendar parseDate ( String dateString ) { } public static String convertFromDate ( Calendar date ) { } public static String convertToStorage ( Task task ) { } public static String [ ] toStringArray ( Task task ) { } public static String toString ( Task task ) { } public static int daysBetween ( Calendar day1 , Calendar day2 ) { } public static boolean isBeforeDay ( Calendar date1 , Calendar date2 ) { } public static boolean isAfterDay ( Calendar date1 , Calendar date2 ) { } public static boolean willOccur ( Task task , Calendar date ) { } public static boolean isWithinNDays ( Task task , Calendar date , int n ) { } public static boolean isWithinPeriod ( Task task , Calendar start , Calendar end ) { } }

Fix:
dateComp = - 1 ;
Buggy code:
public class PropertyFileFinderTestCase extends PropertyTestHelper { @ Before public void setup ( ) throws IOException { } private File createPropertyFile ( String filename , String mode ) throws IOException { } @ Test public void overridePropertyfileLocationRead ( ) throws IOException { File domainMgmtUserFile = createPropertyFile ( "mgmt-users.properties" , "domain" ) ; File standaloneMgmtUserFile = createPropertyFile ( "mgmt-users.properties" , "standalone" ) ; System . setProperty ( "jboss.server.config.user.dir" , standaloneMgmtUserFile . getParent ( ) ) ; System . setProperty ( "jboss.domain.config.user.dir" , domainMgmtUserFile . getParent ( ) ) ; State propertyFileFinder = new PropertyFileFinder ( consoleMock , values ) ; State nextState = propertyFileFinder . execute ( ) ; assertTrue ( ( nextState instanceof PromptRealmState ) ) ; <START_BUG> assertTrue ( ( ( "Expected<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>the<seq2seq4repair_space>" + ( USER_NAME ) ) + "<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>known<seq2seq4repair_space>users" ) , values . getKnownUsers ( ) . contains ( USER_NAME ) ) ; <END_BUG> assertTrue ( ( "Expected<seq2seq4repair_space>the<seq2seq4repair_space>values.getPropertiesFiles()<seq2seq4repair_space>contained<seq2seq4repair_space>the<seq2seq4repair_space>" + standaloneMgmtUserFile ) , values . getUserFiles ( ) . contains ( standaloneMgmtUserFile ) ) ; assertTrue ( ( "Expected<seq2seq4repair_space>the<seq2seq4repair_space>values.getPropertiesFiles()<seq2seq4repair_space>contained<seq2seq4repair_space>the<seq2seq4repair_space>" + domainMgmtUserFile ) , values . getUserFiles ( ) . contains ( domainMgmtUserFile ) ) ; } @ Test public void overridePropertyfileLocationWrite ( ) throws IOException , StartException { } }

Fix:
assertTrue ( ( ( "Expected<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>the<seq2seq4repair_space>" + ( USER_NAME ) ) + "<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>known<seq2seq4repair_space>enabled<seq2seq4repair_space>users" ) , values . getEnabledKnownUsers ( ) . contains ( USER_NAME ) ) ;
Buggy code:
public class CascadingUtil { public static final String CASCADING_RUN_ID = "cascading_ext.cascading.run.id" ; private static final CascadingUtil INSTANCE = new CascadingUtil ( ) ; public static CascadingUtil get ( ) { } protected CascadingUtil ( ) { } private final Map < Object , Object > defaultProperties = new HashMap < Object , Object > ( ) ; private final List < FlowStepStrategyFactory < JobConf > > defaultFlowStepStrategies = new ArrayList < FlowStepStrategyFactory < JobConf > > ( ) ; private final Set < Class < ? extends Serialization > > serializations = new HashSet < Class < ? extends Serialization > > ( ) ; private final Map < Integer , Class < ? > > serializationTokens = new HashMap < Integer , Class < ? > > ( ) ; private transient JobConf conf = null ; public void setDefaultProperty ( Object key , Object value ) { } public void addDefaultFlowStepStrategy ( FlowStepStrategyFactory < JobConf > flowStepStrategyFactory ) { } public void addDefaultFlowStepStrategy ( Class < ? extends FlowStepStrategy < JobConf > > klass ) { } public void clearDefaultFlowStepStrategies ( ) { } public List < FlowStepStrategyFactory < JobConf > > getDefaultFlowStepStrategies ( ) { List < FlowStepStrategyFactory < JobConf > > defaultStrategies = Lists . newArrayList ( ) ; defaultStrategies . add ( new SimpleFlowStepStrategyFactory ( RenameJobStrategy . class ) ) ; defaultStrategies . add ( new SimpleFlowStepStrategyFactory ( BloomAssemblyStrategy . class ) ) ; <START_BUG> return defaultFlowStepStrategies ; <END_BUG> } public void addSerialization ( Class < ? extends Serialization > serialization ) { } public void addSerializationToken ( int token , Class < ? > klass ) { } private Map < String , String > getSerializationsProperty ( ) { } private Map < String , String > getSerializationTokensProperty ( ) { } public Map < Object , Object > getDefaultProperties ( ) { } public JobConf getJobConf ( ) { } public FlowConnector getFlowConnector ( ) { } public FlowConnector getFlowConnector ( Map < Object , Object > properties ) { } public FlowConnector getFlowConnector ( List < FlowStepStrategy < JobConf > > flowStepStrategies ) { } public FlowConnector getFlowConnector ( Map < Object , Object > properties , List < FlowStepStrategy < JobConf > > flowStepStrategies ) { } private FlowConnector realGetFlowConnector ( Map < Object , Object > properties , List < FlowStepStrategy < JobConf > > flowStepStrategies ) { } public FlowProcess < JobConf > getFlowProcess ( ) { } public FlowProcess < JobConf > getFlowProcess ( JobConf jobConf ) { } private void setAll ( Configuration conf , Map < String , String > properties ) { } }

Fix:
return defaultStrategies ;
Buggy code:
public class InitializePubsSubs { public String xmppServer ; static Logger logger = Logger . getLogger ( InitializePubsSubs . class ) ; public InitializePubsSubs ( String xmppServer ) { } public void initialize ( int nSubs , int nPubs , String pubNameTemplate , String userPassTemplate , String nodeNameTemplate , String subNameTemplate ) throws InterruptedException , XMPPException { String pubName = "" ; String pubPass = "" ; String nodeName = "" ; Publisher p = null ; InitializePubsSubs . logger . debug ( ( "nSubs:<seq2seq4repair_space>" + nSubs ) ) ; InitializePubsSubs . logger . debug ( ( "nPubs:<seq2seq4repair_space>" + nPubs ) ) ; for ( int nPub = 1 ; nPub <= nPubs ; nPub ++ ) { InitializePubsSubs . logger . debug ( ( "nPub:<seq2seq4repair_space>" + nPub ) ) ; pubName = String . format ( pubNameTemplate , nPub ) ; pubPass = String . format ( userPassTemplate , pubName ) ; p = new Publisher ( pubName , pubPass , xmppServer ) ; nodeName = String . format ( nodeNameTemplate , nPub ) ; p . getOrCreateNode ( nodeName ) ; p . disconnect ( ) ; p = null ; Runtime . getRuntime ( ) . gc ( ) ; } String subName = "" ; String subPass = "" ; Subscriber s = null ; for ( int nSub = 1 ; nSub <= nSubs ; nSub ++ ) { InitializePubsSubs . logger . debug ( ( "nSub:<seq2seq4repair_space>" + nSub ) ) ; subName = String . format ( subNameTemplate , nSub ) ; <START_BUG> subPass = String . format ( subNameTemplate , subName ) ; <END_BUG> s = new Subscriber ( subName , subPass , xmppServer ) ; for ( int i = 1 ; i <= nPubs ; i ++ ) { nodeName = String . format ( nodeNameTemplate , i ) ; s . subscribeIfNotSubscribedTo ( nodeName ) ; InitializePubsSubs . logger . debug ( ( "subscribed<seq2seq4repair_space>to<seq2seq4repair_space>" + nodeName ) ) ; } s . disconnect ( ) ; s = null ; Runtime . getRuntime ( ) . gc ( ) ; } } public static void main ( String [ ] args ) { } }

Fix:
subPass = String . format ( userPassTemplate , subName ) ;
Buggy code:
public class JavadocNodeImpl implements DetailNode { private int index ; private int type ; private String text ; private int lineNumber ; private int columnNumber ; private DetailNode [ ] children ; private DetailNode parent ; @ Override public int getType ( ) { } @ Override public String getText ( ) { } @ Override public int getLineNumber ( ) { } @ Override public int getColumnNumber ( ) { } @ Override public DetailNode [ ] getChildren ( ) { if ( ( children ) == null ) { <START_BUG> return null ; <END_BUG> } else { return Arrays . copyOf ( children , children . length ) ; } } @ Override public DetailNode getParent ( ) { } @ Override public int getIndex ( ) { } public void setType ( int type ) { } public void setText ( String text ) { } public void setLineNumber ( int lineNumber ) { } public void setColumnNumber ( int columnNumber ) { } public void setChildren ( DetailNode [ ] children ) { } public void setParent ( DetailNode parent ) { } public void setIndex ( int index ) { } @ Override public String toString ( ) { } }

Fix:
return new DetailNode [ 0 ] ;
Buggy code:
public class Group extends Composite { NSView contentView ; String text = "" ; public Group ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { checkWidget ( ) ; NSBox widget = ( ( NSBox ) ( view ) ) ; <START_BUG> int border = ( ( int ) ( 0.5F + ( widget . borderWidth ( ) ) ) ) ; <END_BUG> NSSize margins = widget . contentViewMargins ( ) ; NSRect frame = contentView . frame ( ) ; width += ( ( margins . width ) + border ) * 2 ; height += ( ( ( margins . height ) + border ) * 2 ) + ( frame . y ) ; return super . computeTrim ( x , y , width , height ) ; } NSView contentView ( ) { } void deregister ( ) { } void createHandle ( ) { } public Rectangle getClientArea ( ) { } String getNameText ( ) { } public String getText ( ) { } float getThemeAlpha ( ) { } void register ( ) { } void releaseHandle ( ) { } void setFont ( NSFont font ) { } public void setText ( String string ) { } }

Fix:
int border = ( ( int ) ( Math . ceil ( widget . borderWidth ( ) ) ) ) ;
Buggy code:
public enum ComputerMapper implements RowMapper < Computer > { instance ; private static final Logger LOGGER = LoggerFactory . getLogger ( ComputerMapper . class ) ; public Computer toObject ( ResultSet result ) { Computer comp = null ; LocalDateTime t1 = null ; LocalDateTime t2 = null ; Company co = null ; if ( result == null ) { return null ; } try { if ( ( result . getTimestamp ( "introduced" ) ) != null ) { t1 = result . getTimestamp ( "introduced" ) . toLocalDateTime ( ) ; } if ( ( result . getTimestamp ( "discontinued" ) ) != null ) { t2 = result . getTimestamp ( "discontinued" ) . toLocalDateTime ( ) ; } if ( ( result . getInt ( "company_id" ) ) != 0 ) { <START_BUG> int coId = result . getInt ( "company.id" ) ; <END_BUG> String coName = result . getString ( "company.name" ) ; co = new Company ( coId , coName ) ; } comp = new Computer ( result . getInt ( "computer.id" ) , result . getString ( "computer.name" ) , t1 , t2 , co ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; ComputerMapper . LOGGER . error ( e . getMessage ( ) ) ; throw new RuntimeException ( ) ; } return comp ; } }

Fix:
int coId = result . getInt ( "company_id" ) ;
Buggy code:
public class UrlServiceAccessHandler implements IServiceAccessHandler { private static final String RFC2782_PATH = "path" ; static final IContributionItem [ ] EMPTY_CONTRIBUTION = new IContributionItem [ ] { } ; public UrlServiceAccessHandler ( ) { } public IContributionItem [ ] getContributionsForService ( IServiceInfo serviceInfo ) { IServiceID serviceID = serviceInfo . getServiceID ( ) ; List serviceTypes = Arrays . asList ( serviceID . getServiceTypeID ( ) . getServices ( ) ) ; String protocol = null ; if ( ( ( serviceTypes . size ( ) ) == 1 ) && ( serviceTypes . contains ( "http" ) ) ) protocol = "http" ; else if ( ( ( serviceTypes . size ( ) ) == 1 ) && ( serviceTypes . contains ( "https" ) ) ) protocol = "https" ; else if ( ( ( serviceTypes . size ( ) ) == 1 ) && ( serviceTypes . contains ( "ftp" ) ) ) protocol = "ftp" ; if ( protocol == null ) return UrlServiceAccessHandler . EMPTY_CONTRIBUTION ; URI location = serviceInfo . getLocation ( ) ; StringBuffer buf = new StringBuffer ( protocol ) ; buf . append ( ":////" ) . append ( location . getHost ( ) ) ; if ( ( location . getPort ( ) ) != ( - 1 ) ) buf . append ( ":" ) . append ( location . getPort ( ) ) ; IServiceProperties svcProps = serviceInfo . getServiceProperties ( ) ; final String path = svcProps . getPropertyString ( UrlServiceAccessHandler . RFC2782_PATH ) ; if ( path != null ) { <START_BUG> if ( path . startsWith ( "//" ) ) <END_BUG> buf . append ( "//" ) ; buf . append ( path ) ; } final String urlString = buf . toString ( ) ; Action action = new Action ( ) { public void run ( ) { openBrowser ( urlString ) ; } } ; action . setText ( NLS . bind ( HttpServiceAccessHandler_MENU_TEXT , urlString ) ) ; return new IContributionItem [ ] { new ActionContributionItem ( action ) } ; } protected void openBrowser ( String urlString ) { } protected void logError ( String exceptionString , Throwable e ) { } }

Fix:
if ( ! ( path . startsWith ( "//" ) ) )
Buggy code:
public class Main { public static void main ( String [ ] args ) throws IOException { } private static void print ( String msg , Object ... args ) { } private static void getImageUrl ( ArrayList < String > imagePageUrl ) throws IOException { for ( String pageUrl : imagePageUrl ) { String url = pageUrl ; Document doc = Jsoup . connect ( url ) . get ( ) ; Elements media = doc . select ( "[src]" ) ; for ( Element src : media ) { if ( ( src . tagName ( ) . equals ( "img" ) ) & ( src . attr ( "abs:src" ) . endsWith ( "jpg" ) ) ) { System . out . println ( ( "Downloading:<seq2seq4repair_space>" + ( src . attr ( "abs:src" ) ) ) ) ; <START_BUG> String destination = ( LocalDateTime . now ( ) ) + ".jpg" ; <END_BUG> Main . saveImage ( src . attr ( "abs:src" ) , destination ) ; } } } } private static void saveImage ( String imageUrl , String destinationFile ) throws IOException { } private static void getImagePageUrl ( String pageUrl , ArrayList < String > imagePageUrl ) throws IOException { } No newline ; at end ; of file ; }

Fix:
String destination = ( LocalDateTime . now ( ) . toString ( ) . replaceAll ( ":" , "-" ) ) + ".jpg" ;
Buggy code:
public class StoryBagDialogVBox extends VBox { @ FXML private ListView listView ; @ FXML private Label infoLabel ; @ FXML private TextField searchBox ; private ObservableList < ItemCopy > filteredDataList ; private ObservableList < ItemCopy > fullDataList = FXCollections . observableArrayList ( ) ; private ObservableList < ItemCopy > selectedItems = FXCollections . observableArrayList ( ) ; public StoryBagDialogVBox ( ) { } public ObservableList < ItemCopy > getSelectedItems ( ) { } public void setItems ( ObservableList < ItemCopy > itemCopies ) { } public void setSelectedItems ( List < ItemCopy > items ) { } @ FXML private void applyFilter ( ) { String text = searchBox . getText ( ) ; <START_BUG> Predicate < ItemCopy > variablesContain = DisplayUtil . createPredicateForSearch ( text , ItemCopy . class ) ; <END_BUG> Predicate < ItemCopy > itemContains = ( i ) -> i . toString ( ) . toLowerCase ( ) . contains ( text . toLowerCase ( ) ) ; filteredDataList . clear ( ) ; fullDataList . forEach ( ( i ) -> { if ( ( variablesContain . test ( i ) ) || ( itemContains . test ( i ) ) ) { filteredDataList . add ( i ) ; if ( selectedItems . contains ( i ) ) { listView . getSelectionModel ( ) . select ( i ) ; } } } ) ; updateInfoLabel ( ) ; } private void updateInfoLabel ( ) { } }

Fix:
Predicate < ItemCopy > variablesContain = DisplayUtil . createPredicateForSearch ( text , ItemCopy . class , true ) ;