nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CreateSignature { private XMLSignature sig = null ; private File xmlFile = null ; private File detachedFile = null ; private String baseURI = null ; private String resource = null ; private String expression = null ; private String signatureType = null ; private Keystore keystore = null ; private char [ ] keystorePassword = null ; private char [ ] privateKeyPassword = null ; private String certificateAlias = null ; private String signatureId = null ; private String messageDigestAlgorithm = null ; private String signatureAlgorithm = null ; private String canonicalizationAlgorithm = null ; private String transformationAlgorithm = null ; private String textSelection = null ; private ArrayList < DigitalSignatureProperty > properties = null ; public Document sign ( Signature signWizard , ITextSelection selection , IProgressMonitor monitor ) throws Exception { Document signedDoc = null ; FileInputStream fis = null ; try { if ( monitor == null ) { monitor = new NullProgressMonitor ( ) ; } loadSettings ( signWizard , selection ) ; monitor . worked ( 1 ) ; keystore . load ( ) ; monitor . worked ( 1 ) ; <START_BUG> PrivateKey privateKey = ( ( PrivateKey ) ( keystore . getSecretKey ( certificateAlias , privateKeyPassword ) ) ) ; <END_BUG> monitor . worked ( 1 ) ; Document doc = Utils . parse ( xmlFile ) ; ResolverFragment fragmentResolver = new ResolverFragment ( ) ; sig = new XMLSignature ( doc , baseURI , signatureAlgorithm , canonicalizationAlgorithm ) ; sig . addResourceResolver ( fragmentResolver ) ; monitor . worked ( 1 ) ; if ( "enveloping" . equalsIgnoreCase ( signatureType ) ) { signedDoc = envelopingSignature ( privateKey , xmlFile ) ; } else if ( "enveloped" . equalsIgnoreCase ( signatureType ) ) { signedDoc = envelopedSignature ( privateKey , doc ) ; } else if ( "detached" . equalsIgnoreCase ( signatureType ) ) { signedDoc = detachedSignature ( privateKey , doc ) ; } } catch ( Exception ex ) { throw ex ; } finally { monitor . worked ( 1 ) ; if ( fis != null ) { fis . close ( ) ; } } return signedDoc ; } private void loadSettings ( Signature signature , ITextSelection selection ) throws Exception { } private Document detachedSignature ( PrivateKey privateKey , Document doc ) throws Exception { } private Document envelopedSignature ( PrivateKey privateKey , Document doc ) throws Exception { } private Document envelopingSignature ( PrivateKey privateKey , File file ) throws Exception { } private void addProperties ( Document doc ) throws Exception { } private boolean addCertificate ( ) throws Exception { } private DocumentFragment parseXml ( Document doc , String fragment ) throws Exception { } }

Fix:
PrivateKey privateKey = ( ( PrivateKey ) ( keystore . getPrivateKey ( certificateAlias , privateKeyPassword ) ) ) ;
Buggy code:
@ Autoload @ ApplicationScoped @ ManagedBean public class OptimizerServiceBean implements OptimizerServiceRemote { @ Inject private Logger log ; @ Inject QuartzService scheduler ; @ Inject ClusterDiscovery discovery ; @ Inject OvirtClient client ; @ Inject ConfigProvider configProvider ; Timer discoveryTimer ; Set < Thread > threads ; final Map < String , ClusterOptimizer > clusterOptimizers = new HashMap < > ( ) ; @ PostConstruct public void create ( ) { } public synchronized void discoveryTimeout ( final JobDetail timer ) { } @ PreDestroy public void stop ( ) { } public Set < String > getAllClusters ( ) { } public Set < String > getActiveClusters ( ) { } public void computeVmStart ( String cluster , String uuid ) { } public void cancelVmStart ( String cluster , String uuid ) { } @ Override public ScoreResult recomputeScore ( String cluster , Result oldResult ) { } @ Override public Result getCurrentResult ( String cluster ) { } private Result getCurrentResult ( ClusterOptimizer clusterOptimizer ) { } private Result solutionToResult ( String clusterId , OptimalDistributionStepsSolution solution ) { } private Map < String , Set < String > > hostToInstancesToVms ( Map < String , Set < Long > > h2i , Map < Long , Instance > instances ) { } private Map < String , String > instanceToHostToVm ( Map < Long , String > i2hs , Map < Long , Instance > instances ) { } @ Override public ScoreResult recomputeScore ( OptimalDistributionStepsSolution situation , Result result ) { } @ Override public Map < String , ScoreResult > simpleSchedule ( String clusterId , OptimalDistributionStepsSolution situation , Result baseResult , String vmId ) { } @ Override public Map < String , DebugSnapshot > getDebugSnapshot ( ) { Map < String , DebugSnapshot > snaps = new HashMap < > ( ) ; synchronized ( clusterOptimizers ) { for ( ClusterOptimizer optimizer : clusterOptimizers . values ( ) ) { DebugSnapshot snap = new DebugSnapshot ( ) ; snap . setCluster ( optimizer . getClusterId ( ) ) ; snap . setState ( optimizer . getBestSolution ( ) ) ; <START_BUG> snap . setResult ( getCurrentResult ( optimizer ) ) ; <END_BUG> snaps . put ( optimizer . getClusterId ( ) , snap ) ; } } return snaps ; } }

Fix:
snap . setResult ( solutionToResult ( optimizer . getClusterId ( ) , snap . getState ( ) ) ) ;
Buggy code:
public class VirtualMemory { private int VA ; private int [ ] s ; private int [ ] p ; private int [ ] w ; public VirtualMemory ( int virtualAddress ) { } public void splitVirtualAddress ( ) { } public int getS ( ) { } public int getP ( ) { } public int getW ( ) { } public static void main ( String [ ] args ) { <START_BUG> VirtualMemory vm = new VirtualMemory ( 2098698 ) ; <END_BUG> System . out . println ( vm . getS ( ) ) ; System . out . println ( vm . getP ( ) ) ; System . out . println ( vm . getW ( ) ) ; } }

Fix:
VirtualMemory vm = new VirtualMemory ( 1048575 ) ;
Buggy code:
public class ServerModelDeploymentFullReplaceUpdate extends AbstractServerModelUpdate < Void > { private static final long serialVersionUID = 5773083013951607950L ; private final String deploymentUniqueName ; private final String deploymentRuntimeName ; private final byte [ ] hash ; private final boolean redeploy ; public ServerModelDeploymentFullReplaceUpdate ( final String deploymentUniqueName , final String deploymentRuntimeName , final byte [ ] hash , final boolean redeploy ) { } @ Override public void applyUpdate ( ServerModel element ) throws UpdateFailedException { } @ Override public < P > void applyUpdate ( UpdateContext updateContext , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { if ( redeploy ) { ServerDeploymentStartStopHandler startStopHandler = new ServerDeploymentStartStopHandler ( ) ; <START_BUG> startStopHandler . redeploy ( deploymentUniqueName , deploymentRuntimeName , hash , updateContext . getServiceContainer ( ) , resultHandler , param ) ; <END_BUG> } else if ( resultHandler != null ) { resultHandler . handleSuccess ( null , param ) ; } } @ Override public ServerModelDeploymentFullReplaceUpdate getCompensatingUpdate ( ServerModel original ) { } }

Fix:
startStopHandler . redeploy ( deploymentUniqueName , deploymentRuntimeName , hash , updateContext . getServiceRegistry ( ) , resultHandler , param ) ;
Buggy code:
public class EventHandlerEntity { @ SubscribeEvent public void playerTick ( PlayerEvent . LivingUpdateEvent event ) { } @ SubscribeEvent public void playerDeath ( PlayerDropsEvent event ) { } @ SubscribeEvent public void playerLoad ( PlayerEvent . LoadFromFile event ) { } public File getPlayerFile ( String suffix , File playerDirectory , String filename ) { } public static File getLegacyFileFromPlayer ( EntityPlayer player ) { } @ SubscribeEvent public void playerSave ( PlayerEvent . SaveToFile event ) { } @ SubscribeEvent public void onPlayerConstruct ( EntityConstructing event ) { <START_BUG> if ( ( ( event . entity ) instanceof EntityPlayer ) && ( ( BaublesIDHandler . get ( ( ( EntityPlayer ) ( event . entity ) ) ) ) == null ) ) { <END_BUG> BaublesIDHandler . register ( ( ( EntityPlayer ) ( event . entity ) ) ) ; Config . addBaublesID ( ) ; } } @ SubscribeEvent public void onLivingDeathEvent ( LivingDeathEvent event ) { } @ SubscribeEvent public void onEntityJoinWorld ( EntityJoinWorldEvent event ) { } }

Fix:
if ( ( ( ! ( event . entity . worldObj . isRemote ) ) && ( ( event . entity ) instanceof EntityPlayer ) ) && ( ( BaublesIDHandler . get ( ( ( EntityPlayer ) ( event . entity ) ) ) ) == null ) ) {
Buggy code:
class DialogTab extends Tab { Group dialogStyleGroup ; Group resultGroup ; Text textWidget ; Combo dialogCombo ; Button createButton ; Button okButton ; Button cancelButton ; Button yesButton ; Button noButton ; Button retryButton ; Button abortButton ; Button ignoreButton ; Button iconErrorButton ; Button iconInformationButton ; Button iconQuestionButton ; Button iconWarningButton ; Button iconWorkingButton ; Button primaryModalButton ; Button applicationModalButton ; Button systemModalButton ; Button saveButton ; Button openButton ; Button multiButton ; static String [ ] FilterExtensions = new String [ ] { "*.txt" , "*.bat" , "*.doc" , "*" } ; static String [ ] FilterNames = new String [ ] { ControlExample . getResourceString ( "FilterName_0" ) , ControlExample . getResourceString ( "FilterName_1" ) , ControlExample . getResourceString ( "FilterName_2" ) , ControlExample . getResourceString ( "FilterName_3" ) } ; DialogTab ( ControlExample instance ) { } void buttonStyleSelected ( SelectionEvent event ) { } void createButtonSelected ( SelectionEvent event ) { } void createControlGroup ( ) { } void createControlWidgets ( ) { } void createExampleGroup ( ) { super . createExampleGroup ( ) ; exampleGroup . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ; resultGroup = new Group ( exampleGroup , SWT . NONE ) ; resultGroup . setLayout ( new GridLayout ( ) ) ; <START_BUG> resultGroup . setLayoutData ( new GridData ( GridData . FILL_BOTH ) ) ; <END_BUG> resultGroup . setText ( ControlExample . getResourceString ( "Dialog_Result" ) ) ; } void createExampleWidgets ( ) { } void createListenersGroup ( ) { } void dialogSelected ( SelectionEvent event ) { } Control [ ] getExampleWidgets ( ) { } String getTabText ( ) { } void recreateExampleWidgets ( ) { } }

Fix:
resultGroup . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ;
Buggy code:
public class Arguments extends ConfigTestElement implements Serializable { public static String [ ] COLUMN_NAMES = new String [ ] { JMeterUtils . getResString ( "name" ) , JMeterUtils . getResString ( "value" ) , JMeterUtils . getResString ( "metadata" ) } ; public static final String ARGUMENTS = "Arguments.arguments" ; public Arguments ( ) { } public CollectionProperty getArguments ( ) { } public void clear ( ) { } public void setArguments ( List arguments ) { } public Map getArgumentsAsMap ( ) { } public void addArgument ( String name , String value ) { } public void addArgument ( Argument arg ) { } public void addArgument ( String name , String value , String metadata ) { } public PropertyIterator iterator ( ) { } public String toString ( ) { } public void removeArgument ( int row ) { } public void removeArgument ( Argument arg ) { } public void removeArgument ( String argName ) { } public void removeAllArguments ( ) { } public void addEmptyArgument ( ) { } public int getArgumentCount ( ) { } public Argument getArgument ( int row ) { Argument argument = null ; if ( row < ( getArguments ( ) . size ( ) ) ) { <START_BUG> argument = ( ( Argument ) ( getArguments ( ) . get ( row ) ) ) ; <END_BUG> } return argument ; } }

Fix:
argument = ( ( Argument ) ( getArguments ( ) . get ( row ) . getObjectValue ( ) ) ) ;
Buggy code:
public class DownloadPhotoUrlTask extends AsyncTask < Void , Void , String > { private Cloudinary mCloudinary ; private ImageView mImageView ; private String mPhotoFileName ; private ProgressDialog mProgressDialog ; public DownloadPhotoUrlTask ( ImageView imageView , String photoFileName , Context context ) { } @ Override protected String doInBackground ( Void ... params ) { String imageUrl = mCloudinary . url ( ) . generate ( ( ( mPhotoFileName ) + ".jpg" ) ) ; StringBuilder imageUrlRotate = new StringBuilder ( imageUrl ) ; <START_BUG> imageUrlRotate . insert ( 51 , "a_auto_left//" ) ; <END_BUG> return imageUrlRotate . toString ( ) ; } @ Override protected void onPostExecute ( String result ) { } }

Fix:
imageUrlRotate . insert ( 51 , "a_auto_left,r_40//" ) ;
Buggy code:
public final class JOrphanUtils { private JOrphanUtils ( ) { } public static String [ ] split ( String splittee , String splitChar , boolean truncate ) { } public static String [ ] split ( String splittee , String splitChar ) { } public static String [ ] split ( String splittee , String delims , String def ) { StringTokenizer tokens = new StringTokenizer ( splittee , delims , ( def != null ) ) ; boolean lastWasDelim = false ; List < String > strList = new ArrayList < String > ( ) ; while ( tokens . hasMoreTokens ( ) ) { String tok = tokens . nextToken ( ) ; if ( ( ( tok . length ( ) ) == 1 ) && ( ( delims . indexOf ( tok ) ) != ( - 1 ) ) ) { if ( lastWasDelim ) { strList . add ( def ) ; } lastWasDelim = true ; } else { lastWasDelim = false ; strList . add ( tok ) ; } } if ( lastWasDelim ) { strList . add ( def ) ; } <START_BUG> return strList . toArray ( new String [ 0 ] ) ; <END_BUG> } private static final String SPACES = "<seq2seq4repair_space>" ; private static final int SPACES_LEN = JOrphanUtils . SPACES . length ( ) ; public static StringBuilder rightAlign ( StringBuilder in , int len ) { } public static StringBuilder leftAlign ( StringBuilder in , int len ) { } public static String booleanToSTRING ( boolean value ) { } public static String replaceFirst ( String source , String search , String replace ) { } public static String replaceAllChars ( String source , char search , String replace ) { } public static String substitute ( final String input , final String pattern , final String sub ) { } public static String trim ( final String input , final String delims ) { } public static byte [ ] getByteArraySlice ( byte [ ] array , int begin , int end ) { } public static void closeQuietly ( Closeable cl ) { } public static void closeQuietly ( Socket sock ) { } public static void closeQuietly ( ServerSocket sock ) { } public static boolean startsWith ( byte [ ] target , byte [ ] search , int offset ) { } private static final byte [ ] XML_PFX = new byte [ ] { '<' , '?' , 'x' , 'm' , 'l' } ; public static boolean isXML ( byte [ ] target ) { } public static String baToHexString ( byte [ ] ba ) { } public static byte [ ] baToHexBytes ( byte [ ] ba ) { } private static byte toHexChar ( byte in ) { } public static int read ( InputStream is , byte [ ] buffer , int offset , int length ) throws IOException { } public static void displayThreads ( boolean includeDaemons ) { } }

Fix:
return strList . toArray ( new String [ strList . size ( ) ] ) ;
Buggy code:
public class NameSortTest extends ColumnFamilyStoreTest { @ Test public void testNameSort1 ( ) throws IOException , InterruptedException , ExecutionException { } @ Test public void testNameSort10 ( ) throws IOException , InterruptedException , ExecutionException { } @ Test public void testNameSort100 ( ) throws IOException , InterruptedException , ExecutionException { } private void testNameSort ( int N ) throws IOException , InterruptedException , ExecutionException { } private void validateNameSort ( Table table , int N ) throws IOException { for ( int i = 0 ; i < N ; ++ i ) { String key = Integer . toString ( i ) ; ColumnFamily cf ; cf = table . get ( key , "Standard1" ) ; Collection < IColumn > columns = cf . getAllColumns ( ) ; for ( IColumn column : columns ) { int j = Integer . valueOf ( column . name ( ) . split ( "-" ) [ 1 ] ) ; byte [ ] bytes = ( ( j % 2 ) == 0 ) ? bytes1 : bytes2 ; assert Arrays . equals ( bytes , column . value ( ) ) ; } cf = table . get ( key , "Super1" ) ; <START_BUG> assert cf != null ; <END_BUG> Collection < IColumn > superColumns = cf . getAllColumns ( ) ; assert ( superColumns . size ( ) ) == 8 ; for ( IColumn superColumn : superColumns ) { int j = Integer . valueOf ( superColumn . name ( ) . split ( "-" ) [ 1 ] ) ; Collection < IColumn > subColumns = superColumn . getSubColumns ( ) ; assert ( subColumns . size ( ) ) == 4 ; for ( IColumn subColumn : subColumns ) { int k = Integer . valueOf ( subColumn . name ( ) . split ( "-" ) [ 1 ] ) ; byte [ ] bytes = ( ( ( j + k ) % 2 ) == 0 ) ? bytes1 : bytes2 ; assert Arrays . equals ( bytes , subColumn . value ( ) ) ; } } } } }

Fix:
assert cf != null : ( "key<seq2seq4repair_space>" + key ) + "<seq2seq4repair_space>is<seq2seq4repair_space>missing!" ;
Buggy code:
public class DebuggableThreadPoolExecutor extends ThreadPoolExecutor { protected static Logger logger = Logger . getLogger ( DebuggableThreadPoolExecutor . class ) ; public DebuggableThreadPoolExecutor ( String threadPoolName ) { } public DebuggableThreadPoolExecutor ( int corePoolSize , int maximumPoolSize , long keepAliveTime , TimeUnit unit , BlockingQueue < Runnable > workQueue , ThreadFactory threadFactory ) { } public void afterExecute ( Runnable r , Throwable t ) { super . afterExecute ( r , t ) ; if ( r instanceof FutureTask ) { try { ( ( FutureTask ) ( r ) ) . get ( ) ; } catch ( InterruptedException e ) { throw new AssertionError ( e ) ; } catch ( ExecutionException e ) { <START_BUG> DebuggableThreadPoolExecutor . logger . error ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>executor<seq2seq4repair_space>futuretask" , e ) ; <END_BUG> } } if ( t != null ) { DebuggableThreadPoolExecutor . logger . error ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>ThreadPoolExecutor" , t ) ; } } }

Fix:
Thread . getDefaultUncaughtExceptionHandler ( ) . uncaughtException ( Thread . currentThread ( ) , e ) ;
Buggy code:
public class CustomResourceLoadingApplication extends WicketExampleApplication { private static Log log = LogFactory . getLog ( CustomResourceLoadingApplication . class ) ; private final class CustomResourceStreamLocator extends AbstractResourceStreamLocator { private ClassLoaderResourceStreamLocator classLoaderLocator = new ClassLoaderResourceStreamLocator ( ) ; @ Override protected IResourceStream locate ( Class clazz , String path ) { if ( CustomResourceLoadingApplication . log . isDebugEnabled ( ) ) { CustomResourceLoadingApplication . log . debug ( ( ( "Attempting<seq2seq4repair_space>to<seq2seq4repair_space>locate<seq2seq4repair_space>resource<seq2seq4repair_space>'" + path ) + "'<seq2seq4repair_space>using<seq2seq4repair_space>classloader<seq2seq4repair_space>the<seq2seq4repair_space>servlet<seq2seq4repair_space>context" ) ) ; } String location ; if ( clazz == ( AlternativePageFromWebContext . class ) ) { String extension = path . substring ( ( ( path . lastIndexOf ( '.' ) ) + 1 ) ) ; String simpleFileName = Strings . lastPathComponent ( clazz . getName ( ) , '.' ) ; location = ( ( "//WEB-INF//templates//" + simpleFileName ) + "." ) + extension ; } else { location = "//WEB-INF//templates//" + path ; } URL url ; try { <START_BUG> url = getWicketServlet ( ) . getServletContext ( ) . getResource ( location ) ; <END_BUG> if ( url != null ) { return new UrlResourceStream ( url ) ; } } catch ( MalformedURLException e ) { throw new WicketRuntimeException ( e ) ; } return classLoaderLocator . locate ( clazz , path ) ; } } public CustomResourceLoadingApplication ( ) { } @ Override public Class < ? extends Page > getHomePage ( ) { } @ Override protected void init ( ) { } }

Fix:
url = getServletContext ( ) . getResource ( location ) ;
Buggy code:
public class AsyncAppender extends AppenderSkeleton implements AppenderAttachable { public static final String LOCATION_INFO_OPTION = "LocationInfo" ; static final int BUFFER_SIZE = 128 ; BoundedFIFO bf = new BoundedFIFO ( AsyncAppender . BUFFER_SIZE ) ; AppenderAttachableImpl aai ; Dispatcher dispatcher ; boolean locationInfo = false ; public AsyncAppender ( ) { } public synchronized void addAppender ( Appender newAppender ) { } public void append ( LoggingEvent event ) { event . getNDC ( ) ; event . getThreadName ( ) ; if ( locationInfo ) { <START_BUG> event . setLocationInformation ( ) ; <END_BUG> } synchronized ( bf ) { if ( bf . isFull ( ) ) { try { bf . wait ( ) ; } catch ( InterruptedException e ) { LogLog . error ( "AsyncAppender<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>interrupted." , e ) ; } } bf . put ( event ) ; if ( bf . wasEmpty ( ) ) { bf . notify ( ) ; } } } public void close ( ) { } public Enumeration getAllAppenders ( ) { } public Appender getAppender ( String name ) { } public String [ ] getOptionStrings ( ) { } public boolean requiresLayout ( ) { } public synchronized void removeAllAppenders ( ) { } public synchronized void removeAppender ( Appender appender ) { } public synchronized void removeAppender ( String name ) { } public void setOption ( String option , String value ) { } }

Fix:
event . getLocationInformation ( ) ;
Buggy code:
public class ExceptionLoggerTest { private final TenacityFailingCommand failingCommand = new TenacityFailingCommand ( ) ; private final RuntimeException validException = new RuntimeException ( ) ; private final IllegalStateException validSubException = new IllegalStateException ( ) ; private final IOException invalidException = new IOException ( ) ; private ExceptionLoggerTest . DummyExceptionLogger exceptionLogger ; @ Before public void setUp ( ) throws Exception { } @ Test public void canLogSameTypeException ( ) throws Exception { } @ Test public void canLogSubTypeException ( ) throws Exception { } @ Test public void cannotLogInvalidTypeException ( ) throws Exception { } @ Test ( expected = IllegalStateException . class ) public void throwsIllegalStateIfLogInvalidType ( ) throws Exception { } @ Test public void logsExceptionOfSameType ( ) throws Exception { } @ Test public void logsExceptionOfSubType ( ) throws Exception { exceptionLogger . log ( validSubException , failingCommand ) ; <START_BUG> assertEquals ( ImmutableList . of ( validSubException ) , exceptionLogger . getLoggedExceptions ( ) ) ; <END_BUG> } static final class DummyExceptionLogger extends ExceptionLogger < RuntimeException > { private final List < RuntimeException > loggedExceptions ; DummyExceptionLogger ( ) { } @ Override protected < T > void logException ( RuntimeException exception , HystrixInvokableInfo < T > commandInstance ) { } public List < RuntimeException > getLoggedExceptions ( ) { } } }

Fix:
assertEquals ( ImmutableList . < RuntimeException > of ( validSubException ) , exceptionLogger . getLoggedExceptions ( ) ) ;
Buggy code:
public class TasksRecyclerAdapter extends RecyclerView . Adapter < TasksRecyclerAdapter . ViewHolder > { private ArrayList < Task > tasks ; private ArrayList < String > boldNames ; private boolean isManager ; private Typeface boldTypeFace ; public TasksRecyclerAdapter ( ArrayList < Task > tasks , ArrayList < String > boldNames , boolean isManager ) { } @ Override public TasksRecyclerAdapter . ViewHolder onCreateViewHolder ( ViewGroup parent , int viewType ) { } @ Override public void onBindViewHolder ( TasksRecyclerAdapter . ViewHolder holder , int position ) { Task task = tasks . get ( position ) ; if ( ( boldNames ) != null ) { if ( boldNames . contains ( task . getFirebaseId ( ) ) ) { holder . category . setTypeface ( boldTypeFace ) ; holder . description . setTypeface ( boldTypeFace ) ; holder . date . setTypeface ( boldTypeFace ) ; holder . status . setTypeface ( boldTypeFace ) ; } } holder . description . setText ( task . getName ( ) ) ; holder . category . setText ( task . getCategory ( ) ) ; String date = ( ( task . convertDateString ( ) ) + "<seq2seq4repair_space>" ) + ( task . convertTimeString ( ) ) ; holder . date . setText ( date ) ; <START_BUG> holder . status . setText ( task . getStatus ( ) ) ; <END_BUG> if ( isManager ) { holder . icon . setImageResource ( ic_action_edit ) ; } else { holder . icon . setImageResource ( ic_visibility_black_24dp ) ; } } @ Override public int getItemCount ( ) { } public static class ViewHolder extends RecyclerView . ViewHolder { private ImageView icon ; private TextView description ; private TextView category ; private TextView date ; private TextView status ; public ViewHolder ( View parentView ) { } } }

Fix:
holder . status . setText ( task . getAcceptStatus ( ) ) ;
Buggy code:
public abstract class WicketExampleApplication extends WebApplication { private static Log log = LogFactory . getLog ( WicketExampleApplication . class ) ; public WicketExampleApplication ( ) { } protected void init ( ) { if ( ( this . getWicketServlet ( ) . getServletContext ( ) . getInitParameter ( "deployment" ) ) != null ) { getSettings ( ) . configure ( getWicketServlet ( ) . getServletContext ( ) , "deployment" ) ; } else { <START_BUG> getSettings ( ) . configure ( getWicketServlet ( ) . getServletContext ( ) , "development" , "c://temp//;WEB-INF//classes" ) ; <END_BUG> } } public static void main ( String [ ] args ) { } }

Fix:
getSettings ( ) . configure ( getWicketServlet ( ) . getServletContext ( ) , "development" , "WEB-INF//classes" ) ;
Buggy code:
public class ZipFile { private Hashtable entries = new Hashtable ( 509 ) ; private Hashtable nameMap = new Hashtable ( 509 ) ; private static final class OffsetEntry { long headerOffset = - 1 ; long dataOffset = - 1 ; } private String encoding = null ; private RandomAccessFile archive ; public ZipFile ( File f ) throws IOException { } public ZipFile ( String name ) throws IOException { } public ZipFile ( String name , String encoding ) throws IOException { } public ZipFile ( File f , String encoding ) throws IOException { } public String getEncoding ( ) { } public void close ( ) throws IOException { } public static void closeQuietly ( ZipFile zipfile ) { } public Enumeration getEntries ( ) { } public ZipEntry getEntry ( String name ) { } public InputStream getInputStream ( ZipEntry ze ) throws IOException , ZipException { } private static final int CFH_LEN = ( ( ( ( ( ( ( ( ( ( ( ( ( ( 2 + 2 ) + 2 ) + 2 ) + 2 ) + 2 ) + 4 ) + 4 ) + 4 ) + 2 ) + 2 ) + 2 ) + 2 ) + 2 ) + 4 ) + 4 ; private void populateFromCentralDirectory ( ) throws IOException { } private static final int MIN_EOCD_SIZE = ( ( ( ( ( ( 4 + 2 ) + ( + 2 ) ) + ( + 2 ) ) + ( + 2 ) ) + 4 ) + ( + ( + 4 ) ) ) + 2 ; private static final int CFD_LOCATOR_OFFSET = ( ( ( ( 4 + 2 ) + ( + 2 ) ) + ( + 2 ) ) + ( + 2 ) ) + 4 ; private void positionAtCentralDirectory ( ) throws IOException { } private static final long LFH_OFFSET_FOR_FILENAME_LENGTH = ( ( ( ( ( ( ( 4 + 2 ) + 2 ) + 2 ) + 2 ) + 2 ) + 4 ) + 4 ) + 4 ; private void resolveLocalFileHeaderData ( ) throws IOException { } protected static Date fromDosTime ( ZipLong zipDosTime ) { } private static long dosToJavaTime ( long dosTime ) { Calendar cal = Calendar . getInstance ( ) ; cal . set ( Calendar . YEAR , ( ( ( int ) ( ( dosTime > > 25 ) & 127 ) ) + 1980 ) ) ; cal . set ( Calendar . MONTH , ( ( ( int ) ( ( dosTime > > 21 ) & 15 ) ) - 1 ) ) ; cal . set ( Calendar . DATE , ( ( ( int ) ( dosTime > > 16 ) ) & 31 ) ) ; cal . set ( Calendar . HOUR_OF_DAY , ( ( ( int ) ( dosTime > > 11 ) ) & 31 ) ) ; cal . set ( Calendar . MINUTE , ( ( ( int ) ( dosTime > > 5 ) ) & 63 ) ) ; cal . set ( Calendar . SECOND , ( ( ( int ) ( dosTime << 1 ) ) & 62 ) ) ; <START_BUG> return cal . getTimeInMillis ( ) ; <END_BUG> } protected String getString ( byte [ ] bytes ) throws ZipException { } private class BoundedInputStream extends InputStream { private long remaining ; private long loc ; private boolean addDummyByte = false ; BoundedInputStream ( long start , long remaining ) { } public int read ( ) throws IOException { } public int read ( byte [ ] b , int off , int len ) throws IOException { } void addDummy ( ) { } } }

Fix:
return cal . getTime ( ) . getTime ( ) ;
Buggy code:
public class SleepTest extends AbstractJavaSamplerClient implements Serializable { public static final long DEFAULT_SLEEP_TIME = 1000 ; public static final long DEFAULT_SLEEP_MASK = 1023 ; private long sleepTime ; private long sleepMask ; public SleepTest ( ) { } @ Override public void setupTest ( JavaSamplerContext context ) { } public SampleResult runTest ( JavaSamplerContext context ) { } @ Override public void teardownTest ( JavaSamplerContext context ) { } @ Override public Arguments getDefaultParameters ( ) { } private void listParameters ( JavaSamplerContext context ) { } private String whoAmI ( ) { <START_BUG> StringBuffer sb = new StringBuffer ( ) ; <END_BUG> sb . append ( Thread . currentThread ( ) . toString ( ) ) ; sb . append ( "@" ) ; sb . append ( Integer . toHexString ( hashCode ( ) ) ) ; return sb . toString ( ) ; } private long getSleepTime ( ) { } private long getSleepMask ( ) { } }

Fix:
StringBuilder sb = new StringBuilder ( ) ;
Buggy code:
public class ActivationAttributeHandler implements OperationStepHandler { public static final ActivationAttributeHandler INSTANCE = new ActivationAttributeHandler ( ) ; private ActivationAttributeHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { Activation val = Activation . valueOf ( operation . require ( VALUE ) . asString ( ) . toUpperCase ( Locale . ENGLISH ) ) ; ModelNode node = context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) ; node . get ( ACTIVATION ) . set ( val . toString ( ) . toLowerCase ( Locale . ENGLISH ) ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } }

Fix:
context . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public class NonCachingImage extends Image { private static final long serialVersionUID = 1L ; public NonCachingImage ( String id , IModel model ) { } public NonCachingImage ( String id , Resource imageResource ) { } public NonCachingImage ( String id , ResourceReference resourceReference , ValueMap resourceParameters ) { } public NonCachingImage ( String id , ResourceReference resourceReference ) { } public NonCachingImage ( String id , String string ) { } public NonCachingImage ( String id ) { } protected void onComponentTag ( ComponentTag tag ) { super . onComponentTag ( tag ) ; String url = tag . getAttributes ( ) . getString ( "src" ) ; url = url + ( ( url . indexOf ( "?" ) ) >= 0 ? "&" : "?" ) ; <START_BUG> url = ( url + "org.apache.wicket:antiCache=" ) + ( System . currentTimeMillis ( ) ) ; <END_BUG> tag . put ( "src" , url ) ; } }

Fix:
url = ( url + "wicket:antiCache=" ) + ( System . currentTimeMillis ( ) ) ;
Buggy code:
public class TextEditor { Shell shell ; ToolBar toolBar ; StyledText text ; Images images = new Images ( ) ; Vector cachedStyles = new Vector ( ) ; Color RED = null ; Color BLUE = null ; Color GREEN = null ; Font font = null ; ToolItem boldButton ; ToolItem italicButton ; ToolItem underlineButton ; ToolItem strikeoutButton ; static ResourceBundle resources = ResourceBundle . getBundle ( "examples_texteditor" ) ; Menu createEditMenu ( ) { } Menu createFileMenu ( ) { } void setStyle ( Widget widget ) { } void clear ( ) { } void fgColor ( Color fg ) { } void createMenuBar ( ) { } void createShell ( Display display ) { } void createStyledText ( ) { } void createToolBar ( ) { <START_BUG> toolBar = new ToolBar ( shell , SWT . NULL ) ; <END_BUG> SelectionAdapter listener = new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent event ) { setStyle ( event . widget ) ; } } ; boldButton = new ToolItem ( toolBar , SWT . CHECK ) ; boldButton . setImage ( images . Bold ) ; boldButton . setToolTipText ( TextEditor . resources . getString ( "Bold" ) ) ; boldButton . addSelectionListener ( listener ) ; italicButton = new ToolItem ( toolBar , SWT . CHECK ) ; italicButton . setImage ( images . Italic ) ; italicButton . setToolTipText ( TextEditor . resources . getString ( "Italic" ) ) ; italicButton . addSelectionListener ( listener ) ; underlineButton = new ToolItem ( toolBar , SWT . CHECK ) ; underlineButton . setImage ( images . Underline ) ; underlineButton . setToolTipText ( TextEditor . resources . getString ( "Underline" ) ) ; underlineButton . addSelectionListener ( listener ) ; strikeoutButton = new ToolItem ( toolBar , SWT . CHECK ) ; strikeoutButton . setImage ( images . Strikeout ) ; strikeoutButton . setToolTipText ( TextEditor . resources . getString ( "Strikeout" ) ) ; strikeoutButton . addSelectionListener ( listener ) ; ToolItem item = new ToolItem ( toolBar , SWT . SEPARATOR ) ; item = new ToolItem ( toolBar , SWT . PUSH ) ; item . setImage ( images . Red ) ; item . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent event ) { fgColor ( RED ) ; } } ) ; item = new ToolItem ( toolBar , SWT . PUSH ) ; item . setImage ( images . Green ) ; item . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent event ) { fgColor ( GREEN ) ; } } ) ; item = new ToolItem ( toolBar , SWT . PUSH ) ; item . setImage ( images . Blue ) ; item . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent event ) { fgColor ( BLUE ) ; } } ) ; item = new ToolItem ( toolBar , SWT . SEPARATOR ) ; item = new ToolItem ( toolBar , SWT . PUSH ) ; item . setImage ( images . Erase ) ; item . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent event ) { clear ( ) ; } } ) ; } void handleCutCopy ( ) { } void handleExtendedModify ( ExtendedModifyEvent event ) { } public static void main ( String [ ] args ) { } public Shell open ( Display display ) { } void setFont ( ) { } void initializeColors ( ) { } }

Fix:
toolBar = new ToolBar ( shell , SWT . NONE ) ;
Buggy code:
public abstract class AbstractValidator implements IValidator { private static final long serialVersionUID = 1L ; public void error ( final FormComponent formComponent ) { } public void error ( final FormComponent formComponent , final String resourceKey , final Map map ) { } public void error ( final FormComponent formComponent , final Map map ) { } public void error ( final FormComponent formComponent , final String resourceKey , final IModel resourceModel ) { Localizer localizer = formComponent . getLocalizer ( ) ; String message = localizer . getString ( resourceKey , formComponent . getParent ( ) , resourceModel , "" ) ; if ( Strings . isEmpty ( message ) ) { <START_BUG> String key = Classes . name ( getClass ( ) ) ; <END_BUG> message = localizer . getString ( key , formComponent . getParent ( ) , resourceModel ) ; } formComponent . error ( message ) ; } protected String resourceKey ( final FormComponent formComponent ) { } protected Map messageModel ( final FormComponent formComponent ) { } }

Fix:
String key = Classes . simpleName ( getClass ( ) ) ;
Buggy code:
public class DRFATest { static Category cat = Category . getInstance ( DRFATest . class ) ; static int limit ; public static void main ( String [ ] argv ) { } static void usage ( String msg ) { } static void init ( String limitStr ) { } static void test ( ) { } static void delay ( int amount ) { try { <START_BUG> Thread . currentThread ( ) . sleep ( amount ) ; <END_BUG> } catch ( Exception e ) { } } }

Fix:
Thread . sleep ( amount ) ;
Buggy code:
public abstract class WicketTestCase extends TestCase { public MockWebApplication application ; public WicketTestCase ( String name ) { } protected void setUp ( ) throws Exception { } protected void executeTest ( final Class pageClass , final String filename ) throws Exception { } protected void executedListener ( final Class pageClass , final Component component , final String filename ) throws Exception { } protected void executedBehavior ( final Class pageClass , final AbstractAjaxBehavior behavior , final String filename ) throws Exception { assertNotNull ( behavior ) ; System . out . println ( ( ( ( ( "===<seq2seq4repair_space>" + ( pageClass . getName ( ) ) ) + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( behavior . toString ( ) ) ) + "<seq2seq4repair_space>===" ) ) ; application . setupRequestAndResponse ( ) ; WebRequestCycle cycle = application . createRequestCycle ( ) ; <START_BUG> application . getServletRequest ( ) . setRequestToRedirectString ( behavior . getCallbackUrl ( false ) ) ; <END_BUG> application . processRequestCycle ( cycle ) ; String document = application . getServletResponse ( ) . getDocument ( ) ; assertTrue ( DiffUtil . validatePage ( document , pageClass , filename ) ) ; } }

Fix:
application . getServletRequest ( ) . setRequestToRedirectString ( behavior . getCallbackUrl ( false ) . toString ( ) ) ;
Buggy code:
public class Configure_Letters { private static final String imagepath = "//home//roy//picP//newBW//" ; private static final String fileName = "abc" ; private static final String filetype = ".jpg" ; private static String fileString ( int num ) { } public static void main ( String [ ] args ) { File file = new File ( ( ( ( Configure_Letters . imagepath ) + ( Configure_Letters . fileName ) ) + ( Configure_Letters . filetype ) ) ) ; BlackWhite Bw = new BlackWhite ( ) ; RecCol D = new RecCol ( ) ; MatCol matcol = new MatCol ( ) ; int [ ] [ ] a ; int [ ] [ ] b ; try { BufferedImage original = ImageIO . read ( file ) ; BufferedImage negetive ; BufferedImage work ; BufferedImage sub ; negetive = Bw . BW ( original , Configure_Letters . fileString ( 2 ) , 130 , 2 , 0.5 ) ; Bw . NumOfColors ( negetive ) ; work = Bw . BW ( original , Configure_Letters . fileString ( 1 ) , 130 , 0 , 0.5 ) ; Bw . con ( original , Configure_Letters . fileString ( 2 ) ) ; GameOfLife gol = new GameOfLife ( ) ; <START_BUG> gol . GOL ( negetive , Configure_Letters . fileString ( 3 ) , D , 1 ) ; <END_BUG> D . mergeAllOver ( ) ; Test . Rects ( Configure_Letters . fileString ( 1 ) , Configure_Letters . fileString ( 4 ) , D . Rects ) ; RecLineCol recline = new RecLineCol ( ) ; MatLineCol matline = new MatLineCol ( ) ; matcol . ProRect ( work , D ) ; Config Config1 = new Config ( ) ; Config1 . conf ( original , matcol , D , ( ( Configure_Letters . imagepath ) + "Saves//save1.ser" ) ) ; } catch ( IOException ex ) { Logger . getLogger ( ImageProcessing . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } }

Fix:
gol . GOL ( negetive , Configure_Letters . fileString ( 3 ) , D , 1 , 5 ) ;
Buggy code:
public class StompMessage { public static final Charset CHARSET = Charset . forName ( "UTF-8" ) ; private final StompCommand command ; private final StompHeaders headers ; private final byte [ ] payload ; private String sessionId ; public StompMessage ( StompCommand command , StompHeaders headers , byte [ ] payload ) { } public StompMessage ( StompCommand command , StompHeaders headers ) { } public StompCommand getCommand ( ) { } public StompHeaders getHeaders ( ) { } public byte [ ] getPayload ( ) { } public void setSessionId ( String sessionId ) { } public String getStompSessionId ( ) { } @ Override public String toString ( ) { <START_BUG> return ( ( ( "StompMessage<seq2seq4repair_space>[headers=" + ( this . headers ) ) + ",<seq2seq4repair_space>payload=" ) + ( new String ( this . payload ) ) ) + "]" ; <END_BUG> } }

Fix:
return ( ( ( ( ( "StompMessage<seq2seq4repair_space>[" + ( command ) ) + ",<seq2seq4repair_space>headers=" ) + ( this . headers ) ) + ",<seq2seq4repair_space>payload=" ) + ( new String ( this . payload ) ) ) + "]" ;
Buggy code:
public class TestIrishAnalyzer extends BaseTokenStreamTestCase { public void testResourcesAvailable ( ) { } public void testBasics ( ) throws IOException { } public void testContractions ( ) throws IOException { } public void testExclude ( ) throws IOException { } public void testHyphens ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new IrishAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } }

Fix:
checkRandomData ( random ( ) , new IrishAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class HostControllerBootstrap { private final ServiceContainer serviceContainer = Factory . create ( "host-controller" ) ; private final HostControllerEnvironment environment ; private final byte [ ] authCode ; public HostControllerBootstrap ( final HostControllerEnvironment environment , final byte [ ] authCode ) { } public void bootstrap ( ) throws Exception { <START_BUG> final HostRunningModeControl runningModeControl = new HostRunningModeControl ( environment . getInitialRunningMode ( ) , RestartMode . SERVERS ) ; <END_BUG> final ControlledProcessState processState = new ControlledProcessState ( false ) ; ServiceTarget target = serviceContainer . subTarget ( ) ; ControlledProcessStateService . addService ( target , processState ) ; final HostControllerService hcs = new HostControllerService ( environment , runningModeControl , authCode , processState ) ; target . addService ( HC_SERVICE_NAME , hcs ) . install ( ) ; } }

Fix:
final HostRunningModeControl runningModeControl = environment . getRunningModeControl ( ) ;
Buggy code:
public abstract class BreadCrumbPanel extends Panel implements IBreadCrumbParticipant { private static final long serialVersionUID = 1L ; private IBreadCrumbModel breadCrumbModel ; public BreadCrumbPanel ( MarkupContainer parent , final String id , IBreadCrumbModel breadCrumbModel ) { } public BreadCrumbPanel ( MarkupContainer parent , final String id , IBreadCrumbModel breadCrumbModel , IModel model ) { } public void activate ( IBreadCrumbPanelFactory breadCrumbPanelFactory ) { } public void activate ( IBreadCrumbParticipant participant ) { } public final IBreadCrumbModel getBreadCrumbModel ( ) { } public Component getComponent ( ) { } public void onActivate ( IBreadCrumbParticipant previous ) { if ( previous != null ) { MarkupContainer parent = previous . getComponent ( ) . getParent ( ) ; <START_BUG> parent . replace ( this ) ; <END_BUG> } } public final void setBreadCrumbModel ( IBreadCrumbModel breadCrumbModel ) { } }

Fix:
this . reattach ( ) ;
Buggy code:
public class CustomListAdapter extends ArrayAdapter < NoteObject > { private ArrayList < NoteObject > objects ; public CustomListAdapter ( Context context , int textViewResourceId , ArrayList < NoteObject > items ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { View v = convertView ; if ( v == null ) { LayoutInflater inflater = ( ( LayoutInflater ) ( getContext ( ) . getSystemService ( LAYOUT_INFLATER_SERVICE ) ) ) ; v = inflater . inflate ( list_notes , null ) ; } NoteObject no = objects . get ( position ) ; if ( no != null ) { TextView note_title = ( ( TextView ) ( v . findViewById ( noteTitle ) ) ) ; TextView note_content = ( ( TextView ) ( v . findViewById ( noteContent ) ) ) ; if ( note_title != null ) { note_title . setText ( no . getTitle ( ) ) ; } if ( note_content != null ) { <START_BUG> if ( no . getContent ( ) . contains ( "//storage//sdcard//" ) ) { <END_BUG> note_content . setText ( "[Picture<seq2seq4repair_space>Note]" ) ; } else { if ( ( no . getContent ( ) . length ( ) ) < 40 ) { note_content . setText ( no . getContent ( ) ) ; } else { note_content . setText ( ( ( no . getContent ( ) . substring ( 0 , 40 ) ) + "..." ) ) ; } } } } return v ; } }

Fix:
if ( no . getContent ( ) . contains ( "//storage//" ) ) {
Buggy code:
@ ZenClass ( "mods.appeng.Inscriber" ) public class Inscriber { protected static final String name = "Applied<seq2seq4repair_space>Energistics<seq2seq4repair_space>2<seq2seq4repair_space>Inscriber" ; @ ZenMethod public static void addRecipe ( IItemStack [ ] imprintable , IItemStack plateA , IItemStack plateB , IItemStack out , String type ) { <START_BUG> if ( ( ( imprintable == null ) || ( out == null ) ) || ( ( ! ( type . equals ( "Press" ) ) ) || ( ! ( type . equals ( "Inscribe" ) ) ) ) ) { <END_BUG> LogHelper . logError ( String . format ( "Required<seq2seq4repair_space>parameters<seq2seq4repair_space>missing<seq2seq4repair_space>for<seq2seq4repair_space>%s<seq2seq4repair_space>Recipe." , Inscriber . name ) ) ; return ; } IInscriberRecipe recipe = new appeng . core . features . registries . entries . InscriberRecipe ( ArrayUtils . toArrayList ( toStacks ( imprintable ) ) , toStack ( out ) , toStack ( plateA ) , toStack ( plateB ) , InscriberProcessType . valueOf ( type ) ) ; for ( IInscriberRecipe r : AEApi . instance ( ) . registries ( ) . inscriber ( ) . getRecipes ( ) ) { if ( ( r != null ) && ( AppliedEnergisticsHelper . equals ( r , recipe ) ) ) { LogHelper . logWarning ( String . format ( "Duplicate<seq2seq4repair_space>%s<seq2seq4repair_space>Recipe<seq2seq4repair_space>found<seq2seq4repair_space>for<seq2seq4repair_space>%s.<seq2seq4repair_space>Command<seq2seq4repair_space>ignored!" , Inscriber . name , LogHelper . getStackDescription ( toStack ( out ) ) ) ) ; return ; } } MineTweakerAPI . apply ( new Inscriber . Add ( recipe ) ) ; } public static class Add extends BaseListAddition < IInscriberRecipe > { public Add ( IInscriberRecipe recipe ) { } @ Override public void apply ( ) { } @ Override public void undo ( ) { } @ Override public String getRecipeInfo ( IInscriberRecipe recipe ) { } @ Override protected boolean equals ( IInscriberRecipe recipe , IInscriberRecipe otherRecipe ) { } } @ ZenMethod public static void removeRecipe ( IIngredient output ) { } public static class Remove extends BaseListRemoval < IInscriberRecipe > { public Remove ( LinkedList < IInscriberRecipe > recipes ) { } @ Override public void apply ( ) { } @ Override public void undo ( ) { } @ Override public String getRecipeInfo ( IInscriberRecipe recipe ) { } } }

Fix:
if ( ( ( imprintable == null ) || ( out == null ) ) || ( ( ! ( type . equals ( "Press" ) ) ) && ( ! ( type . equals ( "Inscribe" ) ) ) ) ) {
Buggy code:
public class Application extends Controller { private static final String USERNAME = "username" ; public static void index ( ) { } private static String getUsername ( ) { } public static void login ( String username ) { } public static void getUsers ( String groupId ) { } public static void getMessages ( String groupId ) { } public static void postMessage ( String groupId , String text ) { } public static void poll ( String groupId , String lastMessageId ) { } public static void makeTestData ( ) { User user1 = new User ( "user1" , "Billy<seq2seq4repair_space>Blogpost" ) ; <START_BUG> User user2 = new User ( "user1" , "Jimmy<seq2seq4repair_space>Donut" ) ; <END_BUG> Data . addUser ( user1 ) ; Data . addUser ( user2 ) ; String groupId = Data . addGroup ( ) ; Data . addUserToGroup ( user1 . id , groupId ) ; Data . addUserToGroup ( user2 . id , groupId ) ; Data . postMessage ( user1 . id , groupId , "Billy<seq2seq4repair_space>Blogpost<seq2seq4repair_space>here<seq2seq4repair_space>with<seq2seq4repair_space>another<seq2seq4repair_space>weblog<seq2seq4repair_space>entry,<seq2seq4repair_space>thanks." ) ; Data . postMessage ( user2 . id , groupId , "Couldn't<seq2seq4repair_space>be<seq2seq4repair_space>happier<seq2seq4repair_space>over<seq2seq4repair_space>here,<seq2seq4repair_space>all<seq2seq4repair_space>the<seq2seq4repair_space>best,<seq2seq4repair_space>Jimmy<seq2seq4repair_space>Donut." ) ; final Set < String > allGroups = Data . getAllGroups ( ) ; for ( String group : allGroups ) { System . out . println ( ( "Group:<seq2seq4repair_space>" + group ) ) ; } final List < Message > messagesForGroup = Data . getMessagesForGroup ( groupId ) ; for ( Message message : messagesForGroup ) { System . out . println ( ( "Message:<seq2seq4repair_space>" + message ) ) ; } System . out . println ( ( "Group<seq2seq4repair_space>for<seq2seq4repair_space>Billy:<seq2seq4repair_space>" + ( Data . getGroupForUser ( user1 . id ) ) ) ) ; } No newline ; at end ; of file ; }

Fix:
User user2 = new User ( "user2" , "Jimmy<seq2seq4repair_space>Donut" ) ;
Buggy code:
public class BaseHrefScanner extends TagScanner { private LinkProcessor processor ; public BaseHrefScanner ( ) { } public BaseHrefScanner ( String filter , LinkProcessor processor ) { } public String [ ] getID ( ) { } protected Tag createTag ( TagData tagData , Tag tag , String url ) throws ParserException { String baseUrl = ( ( String ) ( tag . getAttribute ( "HREF" ) ) ) ; String absoluteBaseUrl = "" ; if ( ( baseUrl != null ) && ( ( baseUrl . length ( ) ) > 0 ) ) { <START_BUG> absoluteBaseUrl = LinkProcessor . removeLastSlash ( baseUrl . trim ( ) ) ; <END_BUG> processor . setBaseUrl ( absoluteBaseUrl ) ; } return new org . htmlparser . tags . BaseHrefTag ( tagData , absoluteBaseUrl ) ; } }

Fix:
absoluteBaseUrl = baseUrl . trim ( ) ;