nus-yam/ex-repair huggingface dataset:
Buggy code:
public class InferenceMaps implements InferenceMap { private Set < InferenceMap > maps ; public InferenceMaps ( Set < InferenceMap > maps ) { } @ Override public Set < AssertionInterface > inferNew ( Set < AssertionInterface > validPremises ) { Set < AssertionInterface > inferred = new HashSet < AssertionInterface > ( ) ; int count = 0 ; int size = maps . size ( ) ; for ( Iterator < InferenceMap > it = maps . iterator ( ) ; it . hasNext ( ) ; ) { ++ count ; <START_BUG> System . out . print ( ( ( ( ( "\r<seq2seq4repair_space>inferring:<seq2seq4repair_space>" + ( ( count * 100 ) // size ) ) + "%<seq2seq4repair_space>(" ) + count ) + ")" ) ) ; <END_BUG> InferenceMap phi = it . next ( ) ; inferred . addAll ( phi . inferNew ( validPremises ) ) ; } System . out . println ( "" ) ; return inferred ; } @ Override public String ruleName ( ) { } }

Fix:
System . err . print ( ( ( ( ( "\r<seq2seq4repair_space>inferring:<seq2seq4repair_space>" + ( ( count * 100 ) // size ) ) + "%<seq2seq4repair_space>(" ) + count ) + ")" ) ) ;
Buggy code:
public class ComponentTreeModel implements TreeModel , ComponentChangeListener { ArrayList < TreeModelListener > listeners = new ArrayList < TreeModelListener > ( ) ; private final RocketComponent root ; private final JTree tree ; public ComponentTreeModel ( RocketComponent root , JTree tree ) { } @ Override public Object getChild ( Object parent , int index ) { } @ Override public int getChildCount ( Object parent ) { } @ Override public int getIndexOfChild ( Object parent , Object child ) { } @ Override public Object getRoot ( ) { } @ Override public boolean isLeaf ( Object node ) { } @ Override public void addTreeModelListener ( TreeModelListener l ) { } @ Override public void removeTreeModelListener ( TreeModelListener l ) { } private void fireTreeNodeChanged ( RocketComponent node ) { } private void fireTreeStructureChanged ( RocketComponent source ) { } @ Override public void valueForPathChanged ( TreePath path , Object newValue ) { } @ Override public void componentChanged ( ComponentChangeEvent e ) { <START_BUG> if ( ( e . isTreeChange ( ) ) || ( e . isUndoChange ( ) ) ) { <END_BUG> fireTreeStructureChanged ( e . getSource ( ) ) ; if ( ( e . isTreeChange ( ) ) && ( e . isUndoChange ( ) ) ) { expandAll ( ) ; } } else if ( e . isOtherChange ( ) ) { fireTreeNodeChanged ( e . getSource ( ) ) ; } } public void expandAll ( ) { } public static RocketComponent componentFromPath ( TreePath path ) { } public static TreePath makeTreePath ( RocketComponent component ) { } public static String pathToString ( TreePath treePath ) { } }

Fix:
if ( ( ( e . isTreeChange ( ) ) || ( e . isUndoChange ( ) ) ) || ( e . isMassChange ( ) ) ) {
Buggy code:
public class CandidatesMetChem { public static List < CandidateMetChem > queryMass ( String database , double exactMass , double searchPPM , String databaseUrl , String username , String password ) throws ClassNotFoundException , RemoteException , SQLException { } public static List < CandidateMetChem > queryFormula ( String database , String formula , String databaseUrl , String username , String password ) throws ClassNotFoundException , RemoteException , SQLException { } public static IAtomContainer getCompound ( Integer candidate , String databaseUrl , String username , String password ) throws RemoteException , SQLException , CDKException { } public static IAtomContainer getCompoundOpenend ( Integer candidate , Query query ) throws RemoteException , SQLException , CDKException { <START_BUG> IAtomContainer molecule = query . getCompound ( candidate ) ; <END_BUG> return molecule ; } }

Fix:
IAtomContainer molecule = query . getCompoundConnectionOpened ( candidate ) ;
Buggy code:
public class PreferenceProvider extends AbstractProvider { private AbstractElement [ ] cachedElements ; private Map idToElement = new HashMap ( ) ; public String getId ( ) { } public AbstractElement getElementForId ( String id ) { } public AbstractElement [ ] getElements ( ) { if ( ( cachedElements ) == null ) { List list = PlatformUI . getWorkbench ( ) . getPreferenceManager ( ) . getElements ( PRE_ORDER ) ; Set uniqueElements = new HashSet ( list ) ; IPreferenceNode [ ] preferences = ( ( IPreferenceNode [ ] ) ( uniqueElements . toArray ( new IPreferenceNode [ uniqueElements . size ( ) ] ) ) ) ; cachedElements = new AbstractElement [ preferences . length ] ; for ( int i = 0 ; i < ( preferences . length ) ; i ++ ) { <START_BUG> PreferenceElement preferenceElement = new PreferenceElement ( preferences [ i ] ) ; <END_BUG> cachedElements [ i ] = preferenceElement ; idToElement . put ( preferenceElement . getId ( ) , preferenceElement ) ; } } return cachedElements ; } public ImageDescriptor getImageDescriptor ( ) { } public String getName ( ) { } }

Fix:
PreferenceElement preferenceElement = new PreferenceElement ( preferences [ i ] , this ) ;
Buggy code:
public class CacheResponse { static final byte UNKNOWN = 0 ; static final byte NEGATIVE = 1 ; static final byte PARTIAL = 2 ; static final byte SUCCESSFUL = 3 ; private byte type ; private Object data ; private Vector backtrace ; private CacheResponse ( ) { } CacheResponse ( byte _type , Object _data ) { } CacheResponse ( byte _type ) { } void set ( byte _type , Object _data ) { } void addRRset ( RRset rrset ) { } void addCNAME ( CNAMERecord cname ) { if ( ( backtrace ) == null ) backtrace = new Vector ( ) ; <START_BUG> backtrace . addElement ( cname ) ; <END_BUG> } public boolean isUnknown ( ) { } public boolean isNegative ( ) { } public boolean isPartial ( ) { } public boolean isSuccessful ( ) { } public RRset [ ] answers ( ) { } public CNAMERecord partial ( ) { } public Vector backtrace ( ) { } public String toString ( ) { } }

Fix:
backtrace . insertElementAt ( cname , 0 ) ;
Buggy code:
public class SysoutConfigurator implements Configurator { public void doConfigure ( URL url , LoggerRepository hierarchy ) { <START_BUG> Category . getRoot ( ) . addAppender ( new ConsoleAppender ( new SimpleLayout ( ) , ConsoleAppender . SYSTEM_OUT ) ) ; <END_BUG> } }

Fix:
Logger . getRootLogger ( ) . addAppender ( new ConsoleAppender ( new SimpleLayout ( ) , ConsoleAppender . SYSTEM_OUT ) ) ;
Buggy code:
public class ConnectionsFragment extends ListFragment implements ConnectionsManager . ConnectionEventsListener { private static int NEW_CONNECTION = 0 ; private static int CLOSED_CONNECTION = 1 ; private List < Map < String , String > > connections ; private SimpleAdapter simpleAdapter ; private Handler handler ; @ Override public void onCreate ( Bundle savedInstanceState ) { Log . i ( "netclip" , "ConnectionsFragment.onCreate" ) ; super . onCreate ( savedInstanceState ) ; this . handler = new Handler ( Looper . getMainLooper ( ) ) { @ Override public void handleMessage ( Message message ) { ConnectionsFragment . this . handleMessage ( message ) ; } } ; this . connections = new ArrayList < Map < String , String > > ( ) ; <START_BUG> this . simpleAdapter = new SimpleAdapter ( this . getContext ( ) , this . connections , layout . simple_list_item_2 , new String [ ] { "address" , "port" } , new int [ ] { id . text1 , id . text2 } ) ; <END_BUG> this . setListAdapter ( this . simpleAdapter ) ; } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onDestroyView ( ) { } @ Override public void onNewConnection ( StringsSocket socket , int kConnections ) { } @ Override public void onClosedConnection ( StringsSocket socket , int kConnections ) { } public void handleMessage ( Message message ) { } private void addInfoFromSocket ( StringsSocket socket ) { } private void removeInfoAboutSocket ( StringsSocket socket ) { } }

Fix:
this . simpleAdapter = new SimpleAdapter ( this . getActivity ( ) , this . connections , layout . simple_list_item_2 , new String [ ] { "address" , "port" } , new int [ ] { id . text1 , id . text2 } ) ;
Buggy code:
public class DigestUtils { private static final int STREAM_BUFFER_LENGTH = 1024 ; private static byte [ ] digest ( MessageDigest digest , InputStream data ) throws IOException { } private static byte [ ] getBytesUtf8 ( String data ) { } public static MessageDigest getDigest ( String algorithm ) { try { return MessageDigest . getInstance ( algorithm ) ; } catch ( NoSuchAlgorithmException e ) { <START_BUG> throw new RuntimeException ( e . getMessage ( ) ) ; <END_BUG> } } public static MessageDigest getMd5Digest ( ) { } public static MessageDigest getSha256Digest ( ) { } public static MessageDigest getSha384Digest ( ) { } public static MessageDigest getSha512Digest ( ) { } public static MessageDigest getShaDigest ( ) { } public static byte [ ] md5 ( byte [ ] data ) { } public static byte [ ] md5 ( InputStream data ) throws IOException { } public static byte [ ] md5 ( String data ) { } public static String md5Hex ( byte [ ] data ) { } public static String md5Hex ( InputStream data ) throws IOException { } public static String md5Hex ( String data ) { } public static byte [ ] sha ( byte [ ] data ) { } public static byte [ ] sha ( InputStream data ) throws IOException { } public static byte [ ] sha ( String data ) { } public static byte [ ] sha256 ( byte [ ] data ) { } public static byte [ ] sha256 ( InputStream data ) throws IOException { } public static byte [ ] sha256 ( String data ) { } public static String sha256Hex ( byte [ ] data ) { } public static String sha256Hex ( InputStream data ) throws IOException { } public static String sha256Hex ( String data ) { } public static byte [ ] sha384 ( byte [ ] data ) { } public static byte [ ] sha384 ( InputStream data ) throws IOException { } public static byte [ ] sha384 ( String data ) { } public static String sha384Hex ( byte [ ] data ) { } public static String sha384Hex ( InputStream data ) throws IOException { } public static String sha384Hex ( String data ) { } public static byte [ ] sha512 ( byte [ ] data ) { } public static byte [ ] sha512 ( InputStream data ) throws IOException { } public static byte [ ] sha512 ( String data ) { } public static String sha512Hex ( byte [ ] data ) { } public static String sha512Hex ( InputStream data ) throws IOException { } public static String sha512Hex ( String data ) { } public static String shaHex ( byte [ ] data ) { } public static String shaHex ( InputStream data ) throws IOException { } public static String shaHex ( String data ) { } public static MessageDigest updateDigest ( final MessageDigest messageDigest , final String valueToDigest ) { } public static MessageDigest updateDigest ( final MessageDigest messageDigest , byte [ ] valueToDigest ) { } }

Fix:
throw new RuntimeException ( e ) ;
Buggy code:
public class PropertyPlaceholder extends AbstractPropertyPlaceholder { public enum SystemProperties { never , fallback , override ; } private static final Logger LOGGER = LoggerFactory . getLogger ( PropertyPlaceholder . class ) ; private Map defaultProperties ; private Properties properties ; private List < URL > locations ; private boolean ignoreMissingLocations ; private PropertyPlaceholder . SystemProperties systemProperties = PropertyPlaceholder . SystemProperties . fallback ; public Map getDefaultProperties ( ) { } public void setDefaultProperties ( Map defaultProperties ) { } public List < URL > getLocations ( ) { } public void setLocations ( List < URL > locations ) { } public boolean isIgnoreMissingLocations ( ) { } public void setIgnoreMissingLocations ( boolean ignoreMissingLocations ) { } public PropertyPlaceholder . SystemProperties getSystemProperties ( ) { } public void setSystemProperties ( PropertyPlaceholder . SystemProperties systemProperties ) { } public void init ( ) throws Exception { properties = new Properties ( ) ; if ( ( locations ) != null ) { for ( URL url : locations ) { InputStream is = null ; try { is = url . openStream ( ) ; } catch ( IOException e ) { if ( ignoreMissingLocations ) { <START_BUG> PropertyPlaceholder . LOGGER . info ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>properties<seq2seq4repair_space>from<seq2seq4repair_space>url<seq2seq4repair_space>" + url ) , e ) ; <END_BUG> } else { throw e ; } } if ( is != null ) { try { properties . load ( is ) ; } finally { is . close ( ) ; } } } } } protected String getProperty ( String val ) { } }

Fix:
PropertyPlaceholder . LOGGER . debug ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>properties<seq2seq4repair_space>from<seq2seq4repair_space>url<seq2seq4repair_space>" + url ) + "<seq2seq4repair_space>while<seq2seq4repair_space>ignoreMissingLocations<seq2seq4repair_space>is<seq2seq4repair_space>set<seq2seq4repair_space>to<seq2seq4repair_space>true" ) ) ;
Buggy code:
public class MultiPhraseQuery extends Query { private String field ; private ArrayList < Term [ ] > termArrays = new ArrayList < Term [ ] > ( ) ; private ArrayList < Integer > positions = new ArrayList < Integer > ( ) ; private int slop = 0 ; public void setSlop ( int s ) { } public int getSlop ( ) { } public void add ( Term term ) { } public void add ( Term [ ] terms ) { } public void add ( Term [ ] terms , int position ) { } public List < Term [ ] > getTermArrays ( ) { } public int [ ] getPositions ( ) { } @ Override public void extractTerms ( Set < Term > terms ) { } private class MultiPhraseWeight extends Weight { private Similarity similarity ; private float value ; private float idf ; private float queryNorm ; private float queryWeight ; public MultiPhraseWeight ( Searcher searcher ) throws IOException { } @ Override public Query getQuery ( ) { } @ Override public float getValue ( ) { } @ Override public float sumOfSquaredWeights ( ) { } @ Override public void normalize ( float queryNorm ) { } @ Override public Scorer scorer ( IndexReader reader , boolean scoreDocsInOrder , boolean topScorer ) throws IOException { } @ Override public Explanation explain ( IndexReader reader , int doc ) throws IOException { } } @ Override public Query rewrite ( IndexReader reader ) { } @ Override public Weight createWeight ( Searcher searcher ) throws IOException { } @ Override public final String toString ( String f ) { StringBuilder buffer = new StringBuilder ( ) ; <START_BUG> if ( ! ( field . equals ( f ) ) ) { <END_BUG> buffer . append ( field ) ; buffer . append ( ":" ) ; } buffer . append ( "\"" ) ; Iterator < Term [ ] > i = termArrays . iterator ( ) ; while ( i . hasNext ( ) ) { Term [ ] terms = i . next ( ) ; if ( ( terms . length ) > 1 ) { buffer . append ( "(" ) ; for ( int j = 0 ; j < ( terms . length ) ; j ++ ) { buffer . append ( terms [ j ] . text ( ) ) ; if ( j < ( ( terms . length ) - 1 ) ) buffer . append ( "<seq2seq4repair_space>" ) ; } buffer . append ( ")" ) ; } else { buffer . append ( terms [ 0 ] . text ( ) ) ; } if ( i . hasNext ( ) ) buffer . append ( "<seq2seq4repair_space>" ) ; } buffer . append ( "\"" ) ; if ( ( slop ) != 0 ) { buffer . append ( "~" ) ; buffer . append ( slop ) ; } buffer . append ( ToStringUtils . boost ( getBoost ( ) ) ) ; return buffer . toString ( ) ; } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } private int termArraysHashCode ( ) { } private boolean termArraysEquals ( List < Term [ ] > termArrays1 , List < Term [ ] > termArrays2 ) { } }

Fix:
if ( ( ( field ) == null ) || ( ! ( field . equals ( f ) ) ) ) {
Buggy code:
@ RunWith ( Arquillian . class ) public class DeploymentWithBindTestCase { @ Deployment public static Archive < ? > deploy ( ) { } @ ArquillianResource private InitialContext iniCtx ; @ ArquillianResource private ManagementClient managementClient ; protected < T > T lookup ( Class < T > beanType ) throws NamingException { } @ Test public void testEjb ( ) throws Exception { } private String performCall ( String urlPattern , String op ) throws Exception { <START_BUG> return HttpRequest . get ( ( ( ( ( ( "http:////" + ( managementClient . getMgmtAddress ( ) ) ) + ":8080//test//" ) + urlPattern ) + "?op=" ) + op ) , 10 , TimeUnit . SECONDS ) ; <END_BUG> } @ Test public void testServlet ( ) throws Exception { } }

Fix:
return HttpRequest . get ( ( ( ( ( ( managementClient . getWebUri ( ) ) + "//test//" ) + urlPattern ) + "?op=" ) + op ) , 10 , TimeUnit . SECONDS ) ;
Buggy code:
public class CheckUtils { public static void checkFileExists ( String absoluteFilePath ) { } public static void checkFileExists ( File file ) { } public static void checkReadableFile ( File file ) { } public static void checkWritableFile ( File file ) { } public static void checkExecutableFile ( File file ) { } public static void checkDirectoryExists ( String absoluteDirPath ) { } public static void checkDirectoryExists ( File directory ) { if ( directory == null ) { throw new IllegalArgumentException ( "File<seq2seq4repair_space>instance<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; } if ( ! ( directory . exists ( ) ) ) { throw new IllegalArgumentException ( "Directory<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist<seq2seq4repair_space>on<seq2seq4repair_space>device" ) ; } <START_BUG> if ( ! ( directory . isFile ( ) ) ) { <END_BUG> throw new IllegalArgumentException ( "File<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>represent<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>directory" ) ; } } public static void checkArgument ( boolean condition , String message ) { } public static void checkState ( boolean condition , String message ) { } }

Fix:
if ( ! ( directory . isDirectory ( ) ) ) {
Buggy code:
public class AjLookupEnvironment extends LookupEnvironment { public EclipseFactory factory = null ; private List pendingTypesToWeave = new ArrayList ( ) ; private Map dangerousInterfaces = new HashMap ( ) ; public AjLookupEnvironment ( ITypeRequestor typeRequestor , CompilerOptions options , ProblemReporter problemReporter , INameEnvironment nameEnvironment ) { } public void completeTypeBindings ( ) { } private void doPendingWeaves ( ) { } private void addAdviceLikeDeclares ( ClassScope s ) { TypeDeclaration dec = s . referenceContext ; if ( dec instanceof AspectDeclaration ) { ResolvedTypeX typeX = factory . fromEclipse ( dec . binding ) ; factory . getWorld ( ) . getCrosscuttingMembersSet ( ) . addAdviceLikeDeclares ( typeX ) ; } SourceTypeBinding sourceType = s . referenceContext . binding ; ReferenceBinding [ ] memberTypes = sourceType . memberTypes ; for ( int i = 0 , length = memberTypes . length ; i < length ; i ++ ) { <START_BUG> addCrosscuttingStructures ( ( ( SourceTypeBinding ) ( memberTypes [ i ] ) ) . scope ) ; <END_BUG> } } private void addCrosscuttingStructures ( ClassScope s ) { } private void resolvePointcutDeclarations ( ClassScope s ) { } private void buildInterTypeAndPerClause ( ClassScope s ) { } private void weaveInterTypeDeclarations ( CompilationUnitScope unit , Collection typeMungers , Collection declareParents ) { } private void weaveInterTypeDeclarations ( SourceTypeBinding sourceType ) { } private void weaveInterTypeDeclarations ( SourceTypeBinding sourceType , Collection typeMungers , Collection declareParents , boolean skipInners ) { } private void doDeclareParents ( DeclareParents declareParents , SourceTypeBinding sourceType ) { } private void addParent ( SourceTypeBinding sourceType , ResolvedTypeX parent ) { } private List pendingTypesToFinish = new ArrayList ( ) ; boolean inBinaryTypeCreation = false ; public BinaryTypeBinding createBinaryTypeFrom ( IBinaryType binaryType , PackageBinding packageBinding , boolean needFieldsAndMethods ) { } }

Fix:
addAdviceLikeDeclares ( ( ( SourceTypeBinding ) ( memberTypes [ i ] ) ) . scope ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class BeanFactoryTestCase { @ Deployment ( name = "bean-factory" ) public static JavaArchive getBeanFactoryJar ( ) { JavaArchive archive = ShrinkWrap . create ( JavaArchive . class , "bean-factory.jar" ) ; archive . addPackage ( TFactory . class . getPackage ( ) ) ; <START_BUG> archive . addAsManifestResource ( "pojo//bf-jboss-beans.xml" , "bf-jboss-beans.xml" ) ; <END_BUG> return archive ; } @ Test @ OperateOnDeployment ( "bean-factory" ) public void testTypeBeans ( ) throws Exception { } }

Fix:
archive . addAsManifestResource ( BeanFactoryTestCase . class . getPackage ( ) , "bf-jboss-beans.xml" , "bf-jboss-beans.xml" ) ;
Buggy code:
public class ZipFileImpl implements IFile { private static final Logger logger = LoggerFactory . getLogger ( "org.apache.aries.application.utils" ) ; private String name = "" ; private final long size ; private final long lastModified ; protected File zip ; protected ZipEntry entry ; private ZipDirectory parent ; private final String url ; public ZipFileImpl ( File zip1 , ZipEntry entry1 , ZipDirectory parent1 ) { } protected ZipFileImpl ( File zip1 , File fs ) throws MalformedURLException { } public IDirectory convert ( ) { } public long getLastModified ( ) { } public String getName ( ) { } public IDirectory getParent ( ) { } public long getSize ( ) { } public boolean isDirectory ( ) { } public boolean isFile ( ) { } public InputStream open ( ) throws IOException { } public IDirectory getRoot ( ) { } public URL toURL ( ) throws MalformedURLException { <START_BUG> String entryURL = ( ( ( "jar:" + ( url ) ) + "!//" ) + ( getParent ( ) . getName ( ) ) ) + ( getName ( ) ) ; <END_BUG> URL result = new URL ( entryURL ) ; return result ; } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } ZipFile openZipFile ( ) { } void closeZipFile ( ZipFile z ) { } private class SpecialZipInputStream extends InputStream { private ZipFile zipFile ; private InputStream is ; public SpecialZipInputStream ( ZipEntry anEntry ) { } @ Override public int read ( ) throws IOException { } @ Override public void close ( ) throws IOException { } } }

Fix:
String entryURL = ( ( "jar:" + ( url ) ) + "!//" ) + ( getName ( ) ) ;
Buggy code:
public final class GeoDriver { private static final int WORLD_MIN_X = - 655360 ; private static final int WORLD_MAX_X = 393215 ; private static final int WORLD_MIN_Y = - 589824 ; private static final int WORLD_MAX_Y = 458751 ; public static final int GEO_REGIONS_X = 32 ; public static final int GEO_REGIONS_Y = 32 ; public static final int GEO_REGIONS = ( GeoDriver . GEO_REGIONS_X ) * ( GeoDriver . GEO_REGIONS_Y ) ; public static final int GEO_BLOCKS_X = ( GeoDriver . GEO_REGIONS_X ) * ( IRegion . REGION_BLOCKS_X ) ; public static final int GEO_BLOCKS_Y = ( GeoDriver . GEO_REGIONS_Y ) * ( IRegion . REGION_BLOCKS_Y ) ; public static final int GEO_BLOCKS = ( GeoDriver . GEO_REGIONS ) * ( IRegion . REGION_BLOCKS ) ; public static final int GEO_CELLS_X = ( GeoDriver . GEO_BLOCKS_X ) * ( IBlock . BLOCK_CELLS_X ) ; public static final int GEO_CELLS_Y = ( GeoDriver . GEO_BLOCKS_Y ) * ( IBlock . BLOCK_CELLS_Y ) ; private volatile IRegion [ ] _regions = new IRegion [ GeoDriver . GEO_REGIONS ] ; public GeoDriver ( ) { } private void checkGeoX ( int geoX ) { } private void checkGeoY ( int geoY ) { } private IRegion getRegion ( int geoX , int geoY ) { } public void loadRegion ( Path filePath , int regionX , int regionY ) throws IOException { } public void unloadRegion ( int regionX , int regionY ) { } public boolean hasGeoPos ( int geoX , int geoY ) { <START_BUG> return ( getRegion ( geoX , geoY ) ) != null ; <END_BUG> } public boolean checkNearestNswe ( int geoX , int geoY , int worldZ , int nswe ) { } public boolean checkNearestNswe ( int geoX , int geoY , int worldZ , int nswe , int zDeltaLimit ) { } public int getNearestZ ( int geoX , int geoY , int worldZ ) { } public int getNearestZ ( int geoX , int geoY , int worldZ , int zDeltaLimit ) { } public int getNextLowerZ ( int geoX , int geoY , int worldZ ) { } public int getNextLowerZ ( int geoX , int geoY , int worldZ , int zDeltaLimit ) { } public int getNextHigherZ ( int geoX , int geoY , int worldZ ) { } public int getNextHigherZ ( int geoX , int geoY , int worldZ , int zDeltaLimit ) { } public int getGeoX ( int worldX ) { } public int getGeoY ( int worldY ) { } public int getWorldX ( int geoX ) { } public int getWorldY ( int geoY ) { } }

Fix:
return getRegion ( geoX , geoY ) . hasGeo ( ) ;
Buggy code:
public class RegexpMatcherFactory { public RegexpMatcherFactory ( ) { } public RegexpMatcher newRegexpMatcher ( ) throws BuildException { } public RegexpMatcher newRegexpMatcher ( Project p ) throws BuildException { } protected RegexpMatcher createInstance ( String className ) throws BuildException { } protected void testAvailability ( String className ) throws BuildException { try { <START_BUG> Class implClass = Class . forName ( className ) ; <END_BUG> } catch ( Throwable t ) { throw new BuildException ( t ) ; } } }

Fix:
Class . forName ( className ) ;
Buggy code:
public class PacketQueue { private LinkedList < Packet > packets = new LinkedList < Packet > ( ) ; private Map < String , Packet > packetDict = new HashMap < String , Packet > ( ) ; private long packetCount = 0 ; private long packetBytes = 0 ; public PacketQueue ( ) { } public Packet enqueuePacket ( Packet packet ) { if ( packet == null ) { return null ; } packet . packetId = getUniquePacketId ( ) ; Class < ? > clazz = packet . getClass ( ) ; Field field ; byte [ ] data ; try { <START_BUG> field = clazz . getDeclaredField ( "data" ) ; <END_BUG> data = ( ( byte [ ] ) ( field . get ( packet ) ) ) ; } catch ( Exception e ) { return null ; } synchronized ( packets ) { packets . add ( packet ) ; packetDict . put ( packet . getPacketId ( ) , packet ) ; ++ ( packetCount ) ; if ( data != null ) { packetBytes += data . length ; } } return packet ; } public Packet dequeuePacket ( ) { } public Packet peekPacket ( ) { } public Packet getPacket ( String packetId ) { } public Packet pickPacket ( String packetId ) { } public void clearPackets ( ) { } public PacketStatus getPacketStatus ( ) { } public Map < String , Packet > getPacketMessages ( PacketQuery < ? > query ) { } public void calcPacketStatus ( PacketStatusSub status ) { } private int packetIdCounter = 0 ; private String getUniquePacketId ( ) { } No newline ; at end ; of file ; }

Fix:
field = clazz . getField ( "data" ) ;
Buggy code:
public class ExecTask extends Task { private static String lSep = System . getProperty ( "line.separator" ) ; private String os ; private File out ; private File dir ; protected boolean failOnError = false ; protected boolean newEnvironment = false ; private Integer timeout = null ; private Environment env = new Environment ( ) ; protected Commandline cmdl = new Commandline ( ) ; private FileOutputStream fos = null ; private ByteArrayOutputStream baos = null ; private String outputprop ; private String resultProperty ; private boolean failIfExecFails = true ; private boolean vmLauncher = true ; public void setTimeout ( Integer value ) { } public void setExecutable ( String value ) { } public void setDir ( File d ) { } public void setOs ( String os ) { } public void setCommand ( Commandline cmdl ) { } public void setOutput ( File out ) { } public void setOutputproperty ( String outputprop ) { } public void setFailonerror ( boolean fail ) { } public void setNewenvironment ( boolean newenv ) { } public void addEnv ( Environment . Variable var ) { } public Argument createArg ( ) { } public void setResultProperty ( String resultProperty ) { } protected void maybeSetResultPropertyValue ( int result ) { } public void setFailIfExecutionFails ( boolean flag ) { } public void execute ( ) throws BuildException { } protected void checkConfiguration ( ) throws BuildException { } protected boolean isValidOs ( ) { } public void setVMLauncher ( boolean vmLauncher ) { } protected Execute prepareExec ( ) throws BuildException { } protected final void runExecute ( Execute exe ) throws IOException { } protected void runExec ( Execute exe ) throws BuildException { exe . setCommandline ( cmdl . getCommandline ( ) ) ; try { runExecute ( exe ) ; } catch ( IOException e ) { if ( failIfExecFails ) { <START_BUG> throw new BuildException ( "Execute<seq2seq4repair_space>failed:<seq2seq4repair_space>" , e , location ) ; <END_BUG> } else { log ( ( "Execute<seq2seq4repair_space>failed:<seq2seq4repair_space>" + ( e . toString ( ) ) ) , MSG_ERR ) ; } } finally { logFlush ( ) ; } } protected ExecuteStreamHandler createHandler ( ) throws BuildException { } protected ExecuteWatchdog createWatchdog ( ) throws BuildException { } protected void logFlush ( ) { } }

Fix:
throw new BuildException ( ( "Execute<seq2seq4repair_space>failed:<seq2seq4repair_space>" + ( e . toString ( ) ) ) , e , location ) ;
Buggy code:
public class RedPenTest { @ Before public void setUp ( ) { } @ Test public void testEmptyValidator ( ) throws RedPenException { } @ Test public void testSentenceValidatorWithSimpleDocument ( ) throws RedPenException { } @ Test public void testSectionValidatorWithSimpleDocument ( ) throws RedPenException { List < Document > documents = new ArrayList < > ( ) ; documents . add ( new Document . DocumentBuilder ( ) . setFileName ( "tested<seq2seq4repair_space>file" ) . addSection ( 0 ) . addSectionHeader ( "foobar" ) . addParagraph ( ) . addSentence ( "it<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>piece<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>cake." , 0 ) . addSentence ( "that<seq2seq4repair_space>is<seq2seq4repair_space>also<seq2seq4repair_space>a<seq2seq4repair_space>piece<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>cake." , 1 ) . build ( ) ) ; RedPen redPen = getRedPenWithSectionValidator ( ) ; List < ValidationError > errors = redPen . validate ( documents ) . get ( documents . get ( 0 ) ) ; assertEquals ( 1 , errors . size ( ) ) ; for ( ValidationError error : errors ) { assertThat ( error . getValidatorName ( ) , is ( "SectionLength" ) ) ; <START_BUG> assertThat ( error . getMessage ( ) , containsString ( "The<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>character<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>section<seq2seq4repair_space>exceeds<seq2seq4repair_space>the<seq2seq4repair_space>maximum" ) ) ; <END_BUG> } } @ Test public void testDocumentWithHeader ( ) throws RedPenException { } @ Test public void testDocumentWithList ( ) throws RedPenException { } @ Test public void testDocumentWithoutContent ( ) throws RedPenException { } private RedPen getRedPenWithSentenceValidator ( ) throws RedPenException { } private RedPen getRedPenWithSectionValidator ( ) throws RedPenException { } }

Fix:
assertThat ( error . getMessage ( ) , containsString ( "The<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>characters<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>section<seq2seq4repair_space>exceeds<seq2seq4repair_space>the<seq2seq4repair_space>maximum<seq2seq4repair_space>of" ) ) ;
Buggy code:
public class JavaBuilder extends IncrementalProjectBuilder { IProject currentProject ; IJavaProject javaProject ; IWorkspaceRoot workspaceRoot ; ClasspathLocation [ ] classpath ; IContainer outputFolder ; IContainer [ ] sourceFolders ; SimpleLookupTable prereqOutputFolders ; State lastState ; BuildNotifier notifier ; public static final String JAVA_EXTENSION = "java" ; public static final String CLASS_EXTENSION = "class" ; public static final String JAR_EXTENSION = "jar" ; public static final String ZIP_EXTENSION = "zip" ; public static boolean DEBUG = false ; public static State readState ( DataInputStream in ) throws IOException { } public static void writeState ( Object state , DataOutputStream out ) throws IOException { } public JavaBuilder ( ) { } protected IProject [ ] build ( int kind , Map ignored , IProgressMonitor monitor ) throws CoreException { } private void buildAll ( ) { } private void buildDeltas ( SimpleLookupTable deltas ) { } private void cleanup ( ) { } private void clearLastState ( ) { } private void createFolder ( IContainer folder ) throws CoreException { } private SimpleLookupTable findDeltas ( ) { } private State getLastState ( IProject project ) { } private IProject [ ] getRequiredProjects ( ) { } private boolean hasClasspathChanged ( ) { } private boolean hasOutputLocationChanged ( ) { <START_BUG> return ! ( outputFolder . getLocation ( ) . toString ( ) . equals ( lastState . outputLocationString ) ) ; <END_BUG> } private void initializeBuilder ( ) throws CoreException { } private void recordNewState ( State state ) { } public String toString ( ) { } }

Fix:
return ! ( outputFolder . getLocation ( ) . toString ( ) . equalsIgnoreCase ( lastState . outputLocationString ) ) ;
Buggy code:
class ClasspathMultiDirectory extends ClasspathDirectory { String sourcePath ; NameEnvironment nameEnvironment ; ClasspathMultiDirectory ( String sourcePath , String binaryPath ) { } void cleanup ( ) { } public boolean equals ( Object o ) { } NameEnvironmentAnswer findClass ( char [ ] className , char [ ] [ ] packageName ) { if ( ( nameEnvironment . additionalSourceFilenames ) != null ) { String sourceFilename = ( new String ( className ) ) + ".java" ; if ( exists ( sourcePath , sourceFilename , packageName ) ) { String fullSourceName = ( sourcePath ) + ( NameEnvironment . assembleName ( sourceFilename , packageName , '//' ) ) ; String [ ] additionalSourceFilenames = nameEnvironment . additionalSourceFilenames ; for ( int i = 0 , l = additionalSourceFilenames . length ; i < l ; i ++ ) if ( fullSourceName . equals ( additionalSourceFilenames [ i ] ) ) <START_BUG> return new NameEnvironmentAnswer ( new SourceFile ( fullSourceName , packageName ) ) ; <END_BUG> } } return super . findClass ( className , packageName ) ; } public String toString ( ) { } }

Fix:
return new NameEnvironmentAnswer ( new SourceFile ( fullSourceName , className , packageName ) ) ;
Buggy code:
public class MainMenuView { String name ; private static final String [ ] [ ] menuItems = new String [ ] [ ] { new String [ ] { "1" , "New<seq2seq4repair_space>Game" } , new String [ ] { "S" , "Statistics" } , new String [ ] { "H" , "Help" } , new String [ ] { "X" , "Exit<seq2seq4repair_space>Minesweeper" } } ; MainMenuControl mainMenuControl = new MainMenuControl ( ) ; public MainMenuView ( ) { } public void getName ( ) { } public void getInput ( ) { String command ; Scanner inFile = new Scanner ( System . in ) ; do { this . display ( ) ; command = inFile . nextLine ( ) ; command = command . trim ( ) . toUpperCase ( ) ; switch ( command ) { case "1" : this . mainMenuControl . startGame ( 1 ) ; break ; case "S" : this . mainMenuControl . statsMenu ( ) ; break ; case "H" : this . mainMenuControl . displayHelpMenu ( ) ; break ; case "X" : break ; default : <START_BUG> new MinesweeperError ( ) . displayError ( "Invalid<seq2seq4repair_space>command.<seq2seq4repair_space>Please<seq2seq4repair_space>enter<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>command." ) ; <END_BUG> continue ; } } while ( ! ( command . equals ( "X" ) ) ) ; return ; } public final void display ( ) { } }

Fix:
new MinesweeperError ( ) . displayError ( ) ;
Buggy code:
public abstract class AbstractAutoCompleteBehavior extends AbstractAjaxBehavior { private static final PackageResourceReference AUTOCOMPLETE_JS = new PackageResourceReference ( AutoCompleteBehavior . class , "wicket-autocomplete.js" ) ; private static final PackageResourceReference AJAX_JS = new PackageResourceReference ( AbstractDefaultAjaxBehavior . class , "wicket-ajax.js" ) ; private static final long serialVersionUID = 1L ; protected String getImplementationId ( ) { } protected void onBind ( ) { } protected void onRenderHeadInitContribution ( Response response ) { } protected void onComponentRendered ( ) { Response response = getComponent ( ) . getResponse ( ) ; final String id = getComponent ( ) . getMarkupId ( ) ; response . write ( "<script<seq2seq4repair_space>type=\"text//javascript\">" ) ; response . write ( ( ( ( ( "new<seq2seq4repair_space>WicketAutoComplete('" + id ) + "','" ) + ( getCallbackUrl ( ) ) ) + "');" ) ) ; response . write ( "<//script>" ) ; <START_BUG> response . write ( ( ( "<div<seq2seq4repair_space>style=\"position:absolute;z-index:100;\"<seq2seq4repair_space>id=\"" + id ) + "-autocomplete\"<seq2seq4repair_space>class=\"wicket-aa\"><//div>" ) ) ; <END_BUG> } public final void onRequest ( ) { } protected abstract void onRequest ( String input , RequestCycle requestCycle ) { } }

Fix:
response . write ( ( ( "<div<seq2seq4repair_space>style=\"position:absolute;z-index:100;display:none;\"<seq2seq4repair_space>id=\"" + id ) + "-autocomplete\"<seq2seq4repair_space>class=\"wicket-aa\"><//div>" ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class SignTestCase { private static Logger log = Logger . getLogger ( SignTestCase . class . getName ( ) ) ; @ ArquillianResource URL baseUrl ; @ Deployment public static Archive < ? > deployment ( ) { <START_BUG> WebArchive war = ShrinkWrap . create ( WebArchive . class , "jaxws-wsse-sign.war" ) . addAsManifestResource ( new StringAsset ( "Dependencies:<seq2seq4repair_space>org.apache.ws.security\n" ) , "MANIFEST.MF" ) . addClasses ( ServiceIface . class , ServiceImpl . class , KeystorePasswordCallback . class ) . addAsResource ( ServiceIface . class . getPackage ( ) , "bob.jks" , "bob.jks" ) . addAsResource ( ServiceIface . class . getPackage ( ) , "bob.properties" , "bob.properties" ) . addAsWebInfResource ( ServiceIface . class . getPackage ( ) , "wsdl//SecurityService.wsdl" , "wsdl//SecurityService.wsdl" ) . addAsWebInfResource ( ServiceIface . class . getPackage ( ) , "wsdl//SecurityService_schema1.xsd" , "wsdl//SecurityService_schema1.xsd" ) . addAsWebInfResource ( SignTestCase . class . getPackage ( ) , "jaxws-endpoint-config.xml" , "jaxws-endpoint-config.xml" ) ; <END_BUG> SignTestCase . log . info ( war . toString ( true ) ) ; return war ; } @ Test public void signedRequest ( ) throws Exception { } private void setupWsse ( ServiceIface proxy ) throws MalformedURLException { } }

Fix:
WebArchive war = ShrinkWrap . create ( WebArchive . class , "jaxws-wsse-sign.war" ) . addAsManifestResource ( new StringAsset ( "Dependencies:<seq2seq4repair_space>org.apache.ws.security\n" ) , "MANIFEST.MF" ) . addClasses ( ServiceIface . class , ServiceImpl . class , KeystorePasswordCallback . class ) . addAsResource ( ServiceIface . class . getPackage ( ) , "bob.jks" , "bob.jks" ) . addAsResource ( ServiceIface . class . getPackage ( ) , "bob.properties" , "bob.properties" ) . addAsWebInfResource ( ServiceIface . class . getPackage ( ) , "wsdl//SecurityService-sign.wsdl" , "wsdl//SecurityService.wsdl" ) . addAsWebInfResource ( ServiceIface . class . getPackage ( ) , "wsdl//SecurityService_schema1.xsd" , "wsdl//SecurityService_schema1.xsd" ) . addAsWebInfResource ( SignTestCase . class . getPackage ( ) , "jaxws-endpoint-config.xml" , "jaxws-endpoint-config.xml" ) ;
Buggy code:
public class Processor implements Runnable { private static final Logger LOG = Logger . getLogger ( Processor . class ) ; private Configuration cfg ; private ModelSink sink ; private ModelSource source ; private static final String GRAPH_NAME = "graphName" ; public static void main ( String ... args ) throws ClassNotFoundException , IllegalAccessException , IllegalArgumentException , InstantiationException , NoSuchMethodException , SecurityException , InvocationTargetException , ConfigurationException { } public Processor ( Configuration cfg ) throws ClassNotFoundException , IllegalAccessException , IllegalArgumentException , InstantiationException , NoSuchMethodException , SecurityException , InvocationTargetException { } private Object createClass ( String key ) throws ClassNotFoundException , IllegalAccessException , IllegalArgumentException , InstantiationException , NoSuchMethodException , SecurityException , InvocationTargetException { } public void run ( ) { ClosableIterator < Model > modelIter = source . modelIterator ( ) ; try { while ( modelIter . hasNext ( ) ) { <START_BUG> if ( sink . insert ( modelIter . next ( ) , cfg . getString ( Processor . GRAPH_NAME ) ) ) { <END_BUG> Processor . LOG . error ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>update<seq2seq4repair_space>data" ) ; } } } catch ( IOException e ) { Processor . LOG . error ( e . getMessage ( ) , e ) ; } finally { modelIter . close ( ) ; } } }

Fix:
if ( ! ( sink . insert ( modelIter . next ( ) , cfg . getString ( Processor . GRAPH_NAME ) ) ) ) {
Buggy code:
public class InstalledDriversListOperationHandler implements OperationStepHandler { public static final InstalledDriversListOperationHandler INSTANCE = new InstalledDriversListOperationHandler ( ) ; private InstalledDriversListOperationHandler ( ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > sc = context . getServiceRegistry ( false ) . getRequiredService ( JDBC_DRIVER_REGISTRY_SERVICE ) ; DriverRegistry driverRegistry = DriverRegistry . class . cast ( sc . getValue ( ) ) ; ModelNode result = context . getResult ( ) ; for ( InstalledDriver driver : driverRegistry . getInstalledDrivers ( ) ) { ModelNode driverNode = new ModelNode ( ) ; driverNode . get ( Constants . DRIVER_NAME . getName ( ) ) . set ( driver . getDriverName ( ) ) ; if ( driver . isFromDeployment ( ) ) { driverNode . get ( Constants . DEPLOYMENT_NAME ) . set ( driver . getDriverName ( ) ) ; driverNode . get ( Constants . DRIVER_MODULE_NAME . getName ( ) ) ; driverNode . get ( Constants . MODULE_SLOT ) ; driverNode . get ( Constants . DRIVER_DATASOURCE_CLASS_NAME . getName ( ) ) ; driverNode . get ( Constants . DRIVER_XA_DATASOURCE_CLASS_NAME . getName ( ) ) ; } else { driverNode . get ( Constants . DEPLOYMENT_NAME ) ; driverNode . get ( Constants . DRIVER_MODULE_NAME . getName ( ) ) . set ( driver . getModuleName ( ) . getName ( ) ) ; driverNode . get ( Constants . MODULE_SLOT ) . set ( ( ( driver . getModuleName ( ) ) != null ? driver . getModuleName ( ) . getSlot ( ) : "" ) ) ; driverNode . get ( Constants . DRIVER_DATASOURCE_CLASS_NAME . getName ( ) ) . set ( ( ( driver . getDataSourceClassName ( ) ) != null ? driver . getDataSourceClassName ( ) : "" ) ) ; driverNode . get ( Constants . DRIVER_XA_DATASOURCE_CLASS_NAME . getName ( ) ) . set ( ( ( driver . getXaDataSourceClassName ( ) ) != null ? driver . getXaDataSourceClassName ( ) : "" ) ) ; } driverNode . get ( Constants . DRIVER_CLASS_NAME . getName ( ) ) . set ( driver . getDriverClassName ( ) ) ; driverNode . get ( Constants . DRIVER_MAJOR_VERSION . getName ( ) ) . set ( driver . getMajorVersion ( ) ) ; driverNode . get ( Constants . DRIVER_MINOR_VERSION . getName ( ) ) . set ( driver . getMinorVersion ( ) ) ; driverNode . get ( Constants . JDBC_COMPLIANT ) . set ( driver . isJdbcCompliant ( ) ) ; result . add ( driverNode ) ; } context . completeStep ( ) ; } } , RUNTIME ) ; } else { context . getResult ( ) . set ( ConnectorMessages . MESSAGES . noMetricsAvailable ( ) ) ; } context . completeStep ( ) ; } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class RepeatingView extends WebMarkupContainer { private static final long serialVersionUID = 1L ; private long childIdCounter = 0 ; public RepeatingView ( String id ) { } public RepeatingView ( String id , IModel model ) { } public String newChildId ( ) { } protected void onRender ( final MarkupStream markupStream ) { } protected Iterator renderIterator ( ) { } protected void renderChild ( final Component child ) { <START_BUG> child . render ( ) ; <END_BUG> } }

Fix:
child . render ( getMarkupStream ( ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class RunAsTestCase { private static final Logger log = Logger . getLogger ( RunAsTestCase . class . getName ( ) ) ; @ EJB ( mappedName = "java:global//ejb3security//WhoAmIBean" ) private WhoAmI whoAmIBean ; @ EJB ( mappedName = "java:global//ejb3security//EntryBean" ) private Entry entryBean ; @ Deployment public static Archive < ? > runAsDeployment ( ) { } @ Test public void testAuthentication_TwoBeans ( ) throws Exception { LoginContext lc = Util . getCLMLoginContext ( "user1" , "password1" ) ; lc . login ( ) ; try { String [ ] response = entryBean . doubleWhoAmI ( ) ; assertEquals ( "user1" , response [ 0 ] ) ; <START_BUG> assertEquals ( "user1" , response [ 1 ] ) ; <END_BUG> } finally { lc . logout ( ) ; } } @ Test public void testRunAsICIR_TwoBeans ( ) throws Exception { } }

Fix:
assertEquals ( "anonymous" , response [ 1 ] ) ;
Buggy code:
public class TestMapBackedSet2 < E > extends AbstractTestSet < E > { public TestMapBackedSet2 ( String testName ) { } @ Override public Set < E > makeObject ( ) { <START_BUG> return MapBackedSet . decorate ( new org . apache . commons . collections . map . LinkedMap < E , Object > ( ) ) ; <END_BUG> } @ SuppressWarnings ( "unchecked" ) protected Set < E > setupSet ( ) { } @ SuppressWarnings ( "unchecked" ) public void testOrdering ( ) { } @ Override public void testCanonicalEmptyCollectionExists ( ) { } @ Override public void testCanonicalFullCollectionExists ( ) { } }

Fix:
return MapBackedSet . mapBackedSet ( new org . apache . commons . collections . map . LinkedMap < E , Object > ( ) ) ;
Buggy code:
public class Simulator implements AsyncCallback < Document > { private Chrome chrome ; public Simulator ( Chrome chrome ) { } public void simulate ( ) { } @ Override public void onFailure ( Throwable caught ) { } @ Override public void onSuccess ( Document result ) { final Document doc = result ; this . chrome . add ( doc ) ; this . chrome . show ( doc ) ; final Editor editor = chrome . getEditors ( ) . get ( doc . getKey ( ) ) ; Random randomGenerator = new Random ( ) ; Timer t = new Timer ( ) { public void run ( ) { new DocCheckouter ( editor ) . checkoutDocument ( doc . getKey ( ) , clientId ) ; } } ; <START_BUG> t . schedule ( randomGenerator . nextInt ( 15000 ) ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
t . schedule ( randomGenerator . nextInt ( thinkTime ) ) ;
Buggy code:
public class BpelRetireDeploymentTest extends BPSMasterTest { private static final Log log = LogFactory . getLog ( BpelRetireDeploymentTest . class ) ; LimitedInstanceInfoType instanceInfo = null ; BpelPackageManagementClient bpelPackageManagementClient ; BpelProcessManagementClient bpelProcessManagementClient ; BpelInstanceManagementClient bpelInstanceManagementClient ; RequestSender requestSender ; public void setEnvironment ( ) throws Exception { } public void deployArtifact ( ) throws Exception { } @ Test ( groups = { "wso2.bps" , "wso2.bps.deployment" } , description = "Tests<seq2seq4repair_space>uploading<seq2seq4repair_space>Bpel<seq2seq4repair_space>with<seq2seq4repair_space>retire<seq2seq4repair_space>true" , priority = 1 ) public void testRetireClient ( ) throws Exception { deployArtifact ( ) ; <START_BUG> Thread . sleep ( 10000 ) ; <END_BUG> String processId = bpelProcessManagementClient . getProcessId ( "HelloWorld-retire" ) ; String status = bpelProcessManagementClient . getStatus ( processId ) ; Assert . assertTrue ( status . equals ( "RETIRED" . toUpperCase ( ) ) , "Process<seq2seq4repair_space>State<seq2seq4repair_space>is<seq2seq4repair_space>still<seq2seq4repair_space>Active" ) ; } @ AfterClass ( alwaysRun = true ) public void cleanup ( ) throws InterruptedException , RemoteException , LogoutAuthenticationExceptionException , PackageManagementException { } }

Fix:
Thread . sleep ( 20000 ) ;