nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class SecondLevelCacheMetricsHandler extends AbstractRuntimeOnlyHandler { private final PersistenceUnitServiceRegistry persistenceUnitRegistry ; private SecondLevelCacheMetricsHandler ( PersistenceUnitServiceRegistry persistenceUnitRegistry ) { } @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { SecondLevelCacheStatistics statistics = getSecondLevelCacheStatistics ( operation ) ; if ( statistics != null ) { handle ( statistics , context , operation . require ( NAME ) . asString ( ) ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } protected abstract void handle ( SecondLevelCacheStatistics statistics , OperationContext context , String attributeName ) { } private SecondLevelCacheStatistics getSecondLevelCacheStatistics ( ModelNode operation ) { } static final SecondLevelCacheMetricsHandler getHitCount ( final PersistenceUnitServiceRegistry persistenceUnitRegistry ) { } static final SecondLevelCacheMetricsHandler getMissCount ( final PersistenceUnitServiceRegistry persistenceUnitRegistry ) { } static final SecondLevelCacheMetricsHandler getPutCount ( final PersistenceUnitServiceRegistry persistenceUnitRegistry ) { } static final SecondLevelCacheMetricsHandler getElementCountInMemory ( final PersistenceUnitServiceRegistry persistenceUnitRegistry ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class LogEntryGenerator { private static final Logger LOG = LogManager . getLogger ( LogEntryGenerator . class ) ; private RandomNumberGenerator randomNumberGenerator = new RandomNumberGenerator ( ) ; public void logSomeMessages ( ) { } private void callLogMethodById ( int id ) { } private void debug ( ) { } private void info ( ) { } private void warn ( ) { } private void error ( ) { try { throw new IllegalStateException ( "Something<seq2seq4repair_space>went<seq2seq4repair_space>wrong!" ) ; } catch ( IllegalStateException e ) { <START_BUG> LogEntryGenerator . LOG . info ( ( "Exception:<seq2seq4repair_space>Some<seq2seq4repair_space>error<seq2seq4repair_space>occured:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) , e ) ; <END_BUG> } } }

Fix:
LogEntryGenerator . LOG . error ( ( "Exception:<seq2seq4repair_space>Some<seq2seq4repair_space>error<seq2seq4repair_space>occured:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) , e ) ;
Buggy code:
public class IDStoreTest extends TestCase { IIDStore idStore ; protected void setUp ( ) throws Exception { } protected void clearStore ( ) { } protected void tearDown ( ) throws Exception { } public void testIDStore ( ) { } protected IIDEntry addGUID ( ) throws IDCreateException { } protected IIDEntry addStringID ( String value ) throws IDCreateException { } protected IIDEntry addLongID ( long value ) throws IDCreateException { } public void testStoreGUID ( ) throws Exception { } public void testStoreGUIDs ( ) throws Exception { } public void testStoreLongIDs ( ) throws Exception { } public void testListEmptyNamespaces ( ) throws Exception { } public void testOneNamespace ( ) throws Exception { } public void testTwoNamespace ( ) throws Exception { } public void testGetNamespaceNode ( ) throws Exception { } public void testGetIDEntries ( ) throws Exception { } public void testGetLongIDEntries ( ) throws Exception { } public void testCreateAssociation ( ) throws Exception { } public void testCreateAssociations ( ) throws Exception { final ID guid1 = IDFactory . getDefault ( ) . createGUID ( ) ; final IIDEntry entry1 = idStore . store ( guid1 ) ; final ID guid2 = IDFactory . getDefault ( ) . createGUID ( ) ; final IIDEntry entry2 = idStore . store ( guid2 ) ; final ID guid3 = IDFactory . getDefault ( ) . createGUID ( ) ; final IIDEntry entry3 = idStore . store ( guid3 ) ; final ID guid4 = IDFactory . getDefault ( ) . createGUID ( ) ; final IIDEntry entry4 = idStore . store ( guid4 ) ; final String key1 = "foo" ; final String key2 = "foo2" ; entry1 . putAssociate ( key1 , entry2 , true ) ; entry1 . putAssociate ( key1 , entry3 , false ) ; entry1 . putAssociate ( key2 , entry4 , true ) ; final IIDEntry entry1a = idStore . store ( guid1 ) ; assertNotNull ( entry1a ) ; final ID guid1a = entry1a . createID ( ) ; assertTrue ( guid1 . equals ( guid1a ) ) ; final IIDEntry [ ] entries1 = entry1a . getAssociates ( key1 ) ; assertNotNull ( entries1 ) ; assertTrue ( ( ( entries1 . length ) == 2 ) ) ; final IIDEntry entry2a = entries1 [ 0 ] ; assertNotNull ( entry2a ) ; final ID guid2a = entry2a . createID ( ) ; final IIDEntry entry3a = entries1 [ 1 ] ; assertNotNull ( entry3a ) ; final ID guid3a = entry3a . createID ( ) ; <START_BUG> assertTrue ( ( ( ( guid2 . equals ( guid2a ) ) && ( guid3 . equals ( guid3a ) ) ) || ( ( guid2 . equals ( guid3a ) ) && ( guid3 . equals ( guid2a ) ) ) ) ) ; <END_BUG> final IIDEntry [ ] entries2 = entry1a . getAssociates ( key2 ) ; assertNotNull ( entries2 ) ; assertTrue ( ( ( entries2 . length ) == 1 ) ) ; final IIDEntry entry4a = entries2 [ 0 ] ; assertNotNull ( entry4a ) ; final ID guid4a = entry4a . createID ( ) ; assertTrue ( guid4 . equals ( guid4a ) ) ; } }

Fix:
assertTrue ( ( ( guid2 . equals ( guid2a ) ) && ( guid3 . equals ( guid3a ) ) ) ) ;
Buggy code:
public class ReconcileWorkingCopyOperation extends JavaModelOperation { boolean createAST ; int astLevel ; boolean forceProblemDetection ; WorkingCopyOwner workingCopyOwner ; CompilationUnit ast ; public ReconcileWorkingCopyOperation ( IJavaElement workingCopy , boolean creatAST , int astLevel , boolean forceProblemDetection , WorkingCopyOwner workingCopyOwner ) { } protected void executeOperation ( ) throws JavaModelException { if ( ( this . progressMonitor ) != null ) { if ( this . progressMonitor . isCanceled ( ) ) throw new OperationCanceledException ( ) ; this . progressMonitor . beginTask ( org . eclipse . jdt . internal . core . util . Util . bind ( "element.reconciling" ) , 2 ) ; } CompilationUnit workingCopy = getWorkingCopy ( ) ; boolean wasConsistent = workingCopy . isConsistent ( ) ; try { if ( ! wasConsistent ) { JavaElementDeltaBuilder deltaBuilder = new JavaElementDeltaBuilder ( workingCopy ) ; this . ast = workingCopy . makeConsistent ( this . createAST , this . astLevel , this . progressMonitor ) ; deltaBuilder . buildDeltas ( ) ; if ( ( progressMonitor ) != null ) progressMonitor . worked ( 2 ) ; if ( ( deltaBuilder . delta ) != null ) { addReconcileDelta ( workingCopy , deltaBuilder . delta ) ; } } else { if ( forceProblemDetection ) { IProblemRequestor problemRequestor = workingCopy . getPerWorkingCopyInfo ( ) ; if ( ( problemRequestor != null ) && ( problemRequestor . isActive ( ) ) ) { CompilationUnitDeclaration unit = null ; try { problemRequestor . beginReporting ( ) ; char [ ] contents = workingCopy . getContents ( ) ; unit = CompilationUnitProblemFinder . process ( workingCopy , contents , this . workingCopyOwner , problemRequestor , ( ! ( this . createAST ) ) , this . progressMonitor ) ; problemRequestor . endReporting ( ) ; if ( ( progressMonitor ) != null ) progressMonitor . worked ( 1 ) ; if ( ( this . createAST ) && ( unit != null ) ) { Map options = workingCopy . getJavaProject ( ) . getOptions ( true ) ; <START_BUG> this . ast = AST . convertCompilationUnit ( this . astLevel , unit , contents , options , true , workingCopy . owner , this . progressMonitor ) ; <END_BUG> if ( ( progressMonitor ) != null ) progressMonitor . worked ( 1 ) ; } } finally { if ( unit != null ) { unit . cleanUp ( ) ; } } } } } } finally { if ( ( progressMonitor ) != null ) progressMonitor . done ( ) ; } } protected CompilationUnit getWorkingCopy ( ) { } public boolean isReadOnly ( ) { } protected IJavaModelStatus verify ( ) { } }

Fix:
this . ast = AST . convertCompilationUnit ( this . astLevel , unit , contents , options , true , workingCopy , this . progressMonitor ) ;
Buggy code:
public class ExactTypePattern extends TypePattern { protected TypeX type ; public static final Map primitiveTypesMap ; public static final Map boxedPrimitivesMap ; private static final Map boxedTypesMap ; public ExactTypePattern ( TypeX type , boolean includeSubtypes , boolean isVarArgs ) { } public boolean isArray ( ) { } protected boolean couldEverMatchSameTypesAs ( TypePattern other ) { if ( super . couldEverMatchSameTypesAs ( other ) ) return true ; TypeX otherType = other . getExactType ( ) ; if ( otherType != ( ResolvedTypeX . MISSING ) ) { return type . equals ( otherType ) ; } if ( other instanceof WildTypePattern ) { WildTypePattern owtp = ( ( WildTypePattern ) ( other ) ) ; <START_BUG> String yourSimpleNamePrefix = owtp . namePatterns [ 0 ] . maybeGetSimpleName ( ) ; <END_BUG> if ( yourSimpleNamePrefix != null ) { return type . getName ( ) . startsWith ( yourSimpleNamePrefix ) ; } } return true ; } protected boolean matchesExactly ( ResolvedTypeX matchType ) { } protected boolean matchesExactly ( ResolvedTypeX matchType , ResolvedTypeX annotatedType ) { } public TypeX getType ( ) { } public FuzzyBoolean matchesInstanceof ( ResolvedTypeX matchType ) { } public boolean matchesExactly ( Class matchType ) { } public FuzzyBoolean matchesInstanceof ( Class matchType ) { } public FuzzyBoolean willMatchDynamically ( Class staticType ) { } private Class getClassFor ( String typeName ) throws ClassNotFoundException { } public boolean equals ( Object other ) { } public int hashCode ( ) { } private static final byte EXACT_VERSION = 1 ; public void write ( DataOutputStream out ) throws IOException { } public static TypePattern read ( VersionedDataInputStream s , ISourceContext context ) throws IOException { } public static TypePattern readTypePattern150 ( VersionedDataInputStream s , ISourceContext context ) throws IOException { } public static TypePattern readTypePatternOldStyle ( DataInputStream s , ISourceContext context ) throws IOException { } public String toString ( ) { } public TypePattern resolveBindings ( IScope scope , Bindings bindings , boolean allowBinding , boolean requireExactType ) { } public TypePattern resolveBindingsFromRTTI ( boolean allowBinding , boolean requireExactType ) { } public Object accept ( PointcutVisitor visitor , Object data ) { } }

Fix:
String yourSimpleNamePrefix = owtp . getNamePatterns ( ) [ 0 ] . maybeGetSimpleName ( ) ;
Buggy code:
public class WebResponse extends Response { private static final Log log = LogFactory . getLog ( WebResponse . class ) ; protected boolean redirect ; private final HttpServletResponse httpServletResponse ; WebResponse ( ) { } WebResponse ( final HttpServletResponse httpServletResponse ) throws IOException { } public void close ( ) { } public final String encodeURL ( final String url ) { } public final HttpServletResponse getHttpServletResponse ( ) { } public OutputStream getOutputStream ( ) { } public final boolean isRedirect ( ) { } public void redirect ( final String url ) { } public final void setContentType ( final String mimeType ) { } public void setContentLength ( long length ) { } public void setLastModifiedTime ( Time time ) { if ( time != null ) { <START_BUG> httpServletResponse . setDateHeader ( "Expires" , ( ( time . getMilliseconds ( ) ) + ( 3600 * 1000 ) ) ) ; <END_BUG> httpServletResponse . setHeader ( "Cache-Control" , ( "max-age=" + 3600 ) ) ; httpServletResponse . setDateHeader ( "Last-Modified" , time . getMilliseconds ( ) ) ; } } public final void setLocale ( final Locale locale ) { } public void write ( final String string ) { } }

Fix:
httpServletResponse . setDateHeader ( "Expires" , ( ( System . currentTimeMillis ( ) ) + ( 3600 * 1000 ) ) ) ;
Buggy code:
public class Server { String host ; int port ; private AccountInformationImpl service ; public Server ( String host , int port ) { } public void run ( ) { } public static String getAppDir ( ) { } public static String getUsersTopicsFile ( ) { } public void loadConfig ( ) { } private void deserializeUserTopics ( List < String > lines ) { Map < String , String > users = new HashMap < > ( ) ; Map < String , List < String > > topics = new HashMap < > ( ) ; for ( String l : lines ) { System . out . println ( ( "\tParsing:<seq2seq4repair_space>" + l ) ) ; String [ ] parts = l . split ( ":" ) ; String username = parts [ 0 ] ; String password = parts [ 1 ] ; users . put ( username , password ) ; List < String > userFollowedTopics = new LinkedList < > ( ) ; <START_BUG> for ( int i = 1 ; i < ( parts . length ) ; ++ i ) { <END_BUG> System . out . println ( ( ( ( "\t\tAdding<seq2seq4repair_space>topic" + ( parts [ i ] ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>user<seq2seq4repair_space>" ) + username ) ) ; userFollowedTopics . add ( parts [ i ] ) ; } topics . put ( username , userFollowedTopics ) ; } service . setAccounts ( users ) ; service . setFollowedTopics ( topics ) ; } }

Fix:
for ( int i = 2 ; i < ( parts . length ) ; ++ i ) {
Buggy code:
public class KarafConfiguration extends Configuration { protected final File keyFile ; protected final File script ; protected KarafConfiguration ( KarafConfiguration . Builder < ? > builder ) { } public static KarafConfiguration . Builder < ? > builder ( ) { } public File getKeyFile ( ) { } @ Override public List < String > generateCommand ( ) { if ( ! ( script . exists ( ) ) ) { throw new IllegalStateException ( String . format ( "Script<seq2seq4repair_space>'%s'<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist" , script . getAbsolutePath ( ) ) ) ; } final List < String > cmd = new ArrayList < > ( ) ; if ( SystemUtils . IS_OS_WINDOWS ) { cmd . add ( "cmd" ) ; cmd . add ( "//c" ) ; cmd . add ( script . getAbsolutePath ( ) ) ; } else { <START_BUG> cmd . add ( "//bin//sh" ) ; <END_BUG> cmd . add ( script . getAbsolutePath ( ) ) ; } return cmd ; } public static abstract class Builder < T extends KarafConfiguration . Builder < T > > extends Configuration . Builder < T > { protected File keyFile ; protected File script ; public Builder ( ) { } public T keyFile ( String keyFile ) { } public KarafConfiguration build ( ) { } } private static class Builder2 extends KarafConfiguration . Builder < KarafConfiguration . Builder2 > { @ Override protected KarafConfiguration . Builder2 self ( ) { } } }

Fix:
cmd . add ( "//bin//bash" ) ;
Buggy code:
public class MainActivity extends Activity implements OnMapReadyCallback { @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public void onMapReady ( GoogleMap map ) { LatLng Geneva = new LatLng ( 46.2 , 6.15 ) ; map . moveCamera ( CameraUpdateFactory . newLatLngZoom ( Geneva , 10 ) ) ; map . setMyLocationEnabled ( true ) ; <START_BUG> new getUiSettings ( ) . setZoomControlsEnabled ( true ) ; <END_BUG> map . getUiSettings ( ) . setCompassEnabled ( true ) ; map . getUiSettings ( ) . setMapToolbarEnabled ( true ) ; map . addMarker ( new MarkerOptions ( ) . title ( "Geneva" ) . snippet ( "Best<seq2seq4repair_space>city<seq2seq4repair_space>so<seq2seq4repair_space>far" ) . position ( Geneva ) ) ; } No newline ; at end ; of file ; }

Fix:
map . getUiSettings ( ) . setZoomControlsEnabled ( true ) ;
Buggy code:
public class DistributableSession extends AbstractDistributableSession < Session < LocalSessionContext > > { private static final String AUTHENTICATED_SESSION_ATTRIBUTE_NAME = ( CachedAuthenticatedSessionHandler . class . getName ( ) ) + ".AuthenticatedSession" ; private final UndertowSessionManager manager ; private volatile Map . Entry < Session < LocalSessionContext > , SessionConfig > entry ; private final Batch batch ; public DistributableSession ( UndertowSessionManager manager , Session < LocalSessionContext > session , SessionConfig config , Batch batch ) { } @ Override public SessionManager getSessionManager ( ) { } @ Override protected Session < LocalSessionContext > getSession ( ) { } @ Override public void requestDone ( HttpServerExchange exchange ) { } @ Override public void setMaxInactiveInterval ( int interval ) { } @ Override public Object getAttribute ( String name ) { } @ Override public Object setAttribute ( String name , Object value ) { } @ Override public Object removeAttribute ( String name ) { } @ Override public void invalidate ( HttpServerExchange exchange ) { } @ Override public String changeSessionId ( HttpServerExchange exchange , SessionConfig config ) { Session < LocalSessionContext > oldSession = this . getSession ( ) ; SessionManager < LocalSessionContext > manager = this . manager . getSessionManager ( ) ; <START_BUG> String id = manager . createIdentifier ( ) ; <END_BUG> Session < LocalSessionContext > newSession = manager . createSession ( id ) ; for ( String name : oldSession . getAttributes ( ) . getAttributeNames ( ) ) { newSession . getAttributes ( ) . setAttribute ( name , oldSession . getAttributes ( ) . getAttribute ( name ) ) ; } newSession . getMetaData ( ) . setMaxInactiveInterval ( oldSession . getMetaData ( ) . getMaxInactiveInterval ( java . util . concurrent . TimeUnit . MILLISECONDS ) , java . util . concurrent . TimeUnit . MILLISECONDS ) ; newSession . getMetaData ( ) . setLastAccessedTime ( oldSession . getMetaData ( ) . getLastAccessedTime ( ) ) ; newSession . getLocalContext ( ) . setAuthenticatedSession ( oldSession . getLocalContext ( ) . getAuthenticatedSession ( ) ) ; config . setSessionId ( exchange , id ) ; this . entry = new java . util . AbstractMap . SimpleImmutableEntry ( newSession , config ) ; oldSession . invalidate ( ) ; return id ; } }

Fix:
String id = manager . createSessionId ( ) ;
Buggy code:
public final class FloatId extends OpenJPAId { private final float key ; public FloatId ( Class cls , Float key ) { } public FloatId ( Class cls , String key ) { } public FloatId ( Class cls , float key ) { } public FloatId ( Class cls , float key , boolean subs ) { } public float getId ( ) { } public Object getIdObject ( ) { <START_BUG> return new Float ( key ) ; <END_BUG> } public String toString ( ) { } protected int idHash ( ) { } protected boolean idEquals ( OpenJPAId o ) { } }

Fix:
return Float . valueOf ( key ) ;
Buggy code:
public final class FolderFactory { public static AddressbookFolder createAddressbookFolder ( AbstractFolder parent , String name ) { } <START_BUG> public static GroupFolder createGroupFolder ( AbstractFolder parent , IGroup group ) { <END_BUG> XmlElement folder = new XmlElement ( "folder" ) ; folder . addAttribute ( "uid" , AddressbookTreeNode . generateNextFolderUid ( ) . toString ( ) ) ; folder . addAttribute ( "type" , "GroupFolder" ) ; XmlElement property = new XmlElement ( "property" ) ; folder . addElement ( property ) ; property . addAttribute ( "name" , group . getName ( ) ) ; property . addElement ( group . getRootElement ( ) ) ; FolderItem item = new FolderItem ( folder ) ; GroupFolder f = new GroupFolder ( item ) ; parent . add ( f ) ; parent . getFolderItem ( ) . getRoot ( ) . addElement ( folder ) ; return f ; } }

Fix:
public static IGroupFolder createGroupFolder ( AbstractFolder parent , IGroup group ) {
Buggy code:
@ SuppressWarnings ( "restriction" ) public class JAXWSAnnotateWidgetFactory implements INamedWidgetContributorFactory { private SimpleWidgetContributor jaxwsAnnotateWidgetContributor ; private JAXWSAnnotateJavaWidget jaxwsAnnotateJavaWidget = new JAXWSAnnotateJavaWidget ( ) ; public INamedWidgetContributor getFirstNamedWidget ( ) { } public INamedWidgetContributor getNextNamedWidget ( INamedWidgetContributor widgetContributor ) { } public void registerDataMappings ( DataMappingRegistry dataRegistry ) { } public void setJava2WSDataModel ( Java2WSDataModel model ) { } private void init ( ) { jaxwsAnnotateWidgetContributor = new SimpleWidgetContributor ( ) ; CXFContext context = CXFCorePlugin . getDefault ( ) . getJava2WSContext ( ) ; <START_BUG> String title = CXFCreationUIMessages . bind ( JAVA2WS_JAXWS_ANNOTATE_PAGE_TITLE , new Object [ ] { CXFCorePlugin . getEdition ( ) , context . getCxfRuntimeVersion ( ) } ) ; <END_BUG> jaxwsAnnotateWidgetContributor . setTitle ( title ) ; jaxwsAnnotateWidgetContributor . setDescription ( JAVA2WS_JAXWS_ANNOTATE_PAGE_DESCRIPTION ) ; jaxwsAnnotateWidgetContributor . setFactory ( new WidgetContributorFactory ( ) { public WidgetContributor create ( ) { return jaxwsAnnotateJavaWidget ; } } ) ; } }

Fix:
String title = CXFCreationUIMessages . bind ( JAVA2WS_JAXWS_ANNOTATE_PAGE_TITLE , new Object [ ] { context . getCxfRuntimeEdition ( ) , context . getCxfRuntimeVersion ( ) } ) ;
Buggy code:
public class ConstructorReference extends SpelNodeImpl { private boolean isArrayConstructor = false ; private SpelNodeImpl [ ] dimensions ; private volatile ConstructorExecutor cachedExecutor ; public ConstructorReference ( int pos , SpelNodeImpl ... arguments ) { } public ConstructorReference ( int pos , SpelNodeImpl [ ] dimensions , SpelNodeImpl ... arguments ) { } @ Override public TypedValue getValueInternal ( ExpressionState state ) throws EvaluationException { } private TypedValue createNewInstance ( ExpressionState state ) throws EvaluationException { } private ConstructorExecutor findExecutorForConstructor ( String typeName , List < TypeDescriptor > argumentTypes , ExpressionState state ) throws SpelEvaluationException { } @ Override public String toStringAST ( ) { } private TypedValue createArray ( ExpressionState state ) throws EvaluationException { } private void populateReferenceTypeArray ( ExpressionState state , Object newArray , TypeConverter typeConverter , InlineList initializer , Class < ? > componentType ) { } private void populateByteArray ( ExpressionState state , Object newArray , TypeConverter typeConverter , InlineList initializer ) { } private void populateFloatArray ( ExpressionState state , Object newArray , TypeConverter typeConverter , InlineList initializer ) { } private void populateDoubleArray ( ExpressionState state , Object newArray , TypeConverter typeConverter , InlineList initializer ) { } private void populateShortArray ( ExpressionState state , Object newArray , TypeConverter typeConverter , InlineList initializer ) { } private void populateLongArray ( ExpressionState state , Object newArray , TypeConverter typeConverter , InlineList initializer ) { } private void populateCharArray ( ExpressionState state , Object newArray , TypeConverter typeConverter , InlineList initializer ) { } private void populateBooleanArray ( ExpressionState state , Object newArray , TypeConverter typeConverter , InlineList initializer ) { } private void populateIntArray ( ExpressionState state , Object newArray , TypeConverter typeConverter , InlineList initializer ) { } private boolean hasInitializer ( ) { } @ Override public boolean isCompilable ( ) { } @ Override public void generateCode ( MethodVisitor mv , CodeFlow cf ) { ReflectiveConstructorExecutor executor = ( ( ReflectiveConstructorExecutor ) ( this . cachedExecutor ) ) ; Constructor < ? > constructor = executor . getConstructor ( ) ; String classSlashedDescriptor = constructor . getDeclaringClass ( ) . getName ( ) . replace ( '.' , '//' ) ; mv . visitTypeInsn ( NEW , classSlashedDescriptor ) ; mv . visitInsn ( DUP ) ; SpelNodeImpl [ ] arguments = new SpelNodeImpl [ ( children . length ) - 1 ] ; System . arraycopy ( children , 1 , arguments , 0 , ( ( children . length ) - 1 ) ) ; <START_BUG> CodeFlow . generateCodeForArguments ( mv , cf , constructor , arguments ) ; <END_BUG> mv . visitMethodInsn ( INVOKESPECIAL , classSlashedDescriptor , "<init>" , CodeFlow . createSignatureDescriptor ( constructor ) , false ) ; cf . pushDescriptor ( this . exitTypeDescriptor ) ; } }

Fix:
generateCodeForArguments ( mv , cf , constructor , arguments ) ;
Buggy code:
public class WebSocketHandshake { private URI url = null ; private String protocol = null ; private String nonce = null ; private Map < String , String > extraHeaders = null ; public WebSocketHandshake ( URI url , String protocol , Map < String , String > extraHeaders ) { } public byte [ ] getHandshake ( ) { } private String generateHeader ( LinkedHashMap < String , String > headers ) { } private String createNonce ( ) { } public void verifyServerStatusLine ( String statusLine ) throws WebSocketException { } public void verifyServerHandshakeHeaders ( HashMap < String , String > headers ) throws WebSocketException { if ( ! ( headers . get ( "Upgrade" ) . toLowerCase ( ) . equals ( "websocket" ) ) ) { throw new WebSocketException ( "connection<seq2seq4repair_space>failed:<seq2seq4repair_space>missing<seq2seq4repair_space>header<seq2seq4repair_space>field<seq2seq4repair_space>in<seq2seq4repair_space>server<seq2seq4repair_space>handshake:<seq2seq4repair_space>Upgrade" ) ; } else <START_BUG> if ( ! ( headers . get ( "Connection" ) . toLowerCase ( ) . equals ( "Upgrade" ) ) ) { <END_BUG> throw new WebSocketException ( "connection<seq2seq4repair_space>failed:<seq2seq4repair_space>missing<seq2seq4repair_space>header<seq2seq4repair_space>field<seq2seq4repair_space>in<seq2seq4repair_space>server<seq2seq4repair_space>handshake:<seq2seq4repair_space>Connection" ) ; } } private int rand ( int min , int max ) { } }

Fix:
if ( ! ( headers . get ( "Connection" ) . toLowerCase ( ) . equals ( "upgrade" ) ) ) {
Buggy code:
public class ElvisDemo { private String getStreetName_NPE ( ElvisDemo . Order order ) { } private String getStreetName_LanguageLevelElvis ( ElvisDemo . Order order ) { } private String getStreetName_If ( ElvisDemo . Order order ) { } private String getStreetName_Ternary ( ElvisDemo . Order order ) { ElvisDemo . Customer customer = ( order == null ) ? null : order . getCustomer ( ) ; ElvisDemo . Address address = ( customer == null ) ? null : customer . getAddress ( ) ; <START_BUG> return address . getStreetName ( ) ; <END_BUG> } private String getStreetName_Optional ( ElvisDemo . Order order ) { } private String getStreetName_LibraryElvis ( ElvisDemo . Order order ) { } private static final class Order { private final ElvisDemo . Customer customer ; public Order ( ElvisDemo . Customer customer ) { } public ElvisDemo . Customer getCustomer ( ) { } } private static class Customer { private final ElvisDemo . Address address ; public Customer ( ElvisDemo . Address address ) { } public ElvisDemo . Address getAddress ( ) { } } private static class Address { private final String streetName ; public Address ( String streetName ) { } public String getStreetName ( ) { } } }

Fix:
return address == null ? null : address . getStreetName ( ) ;
Buggy code:
public interface GameManager { <START_BUG> boolean startGame ( ) ; <END_BUG> boolean endGame ( ) { } boolean isGameRunning ( ) { } boolean hasCustomGameType ( ) { } @ Nonnull GameType getGameType ( ) { } void setWinner ( @ Nonnull GameWinnable winner ) { } void setWinInterrupt ( boolean winInterrupt ) { } boolean isWinInterrupt ( ) { } void setUnreadyInterrupt ( boolean unreadyInterrupt ) { } boolean isUnreadyInterrupt ( ) { } }

Fix:
GameStartResult startGame ( ) ;
Buggy code:
public class WithinPointcut extends Pointcut { TypePattern typePattern ; public WithinPointcut ( TypePattern type ) { } private FuzzyBoolean isWithinType ( ResolvedTypeX type ) { } public FuzzyBoolean fastMatch ( ResolvedTypeX type ) { } public FuzzyBoolean match ( Shadow shadow ) { } public void write ( DataOutputStream s ) throws IOException { } public static Pointcut read ( DataInputStream s , ISourceContext context ) throws IOException { } public void resolveBindings ( IScope scope , Bindings bindings ) { } public void postRead ( ResolvedTypeX enclosingType ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { } public Test findResidue ( Shadow shadow , ExposedState state ) { } public Pointcut concretize1 ( ResolvedTypeX inAspect , IntMap bindings ) { <START_BUG> return this ; <END_BUG> } }

Fix:
return new WithinPointcut ( typePattern ) ;
Buggy code:
public class PoreChunk extends PoreWrapper < Chunk > implements org . bukkit . Chunk { public static PoreChunk of ( Chunk handle ) { } protected PoreChunk ( Chunk handle ) { } @ Override public int getX ( ) { } @ Override public int getZ ( ) { } @ Override public World getWorld ( ) { } @ Override public Block getBlock ( int x , int y , int z ) { <START_BUG> return PoreBlock . of ( getHandle ( ) . getBlock ( x , y , z ) ) ; <END_BUG> } @ Override public ChunkSnapshot getChunkSnapshot ( ) { } @ Override public ChunkSnapshot getChunkSnapshot ( boolean includeMaxblocky , boolean includeBiome , boolean includeBiomeTempRain ) { } @ Override public Entity [ ] getEntities ( ) { } @ Override public BlockState [ ] getTileEntities ( ) { } @ Override public boolean isLoaded ( ) { } @ Override public boolean load ( boolean generate ) { } @ Override public boolean load ( ) { } @ Override public boolean unload ( boolean save , boolean safe ) { } @ Override public boolean unload ( boolean save ) { } @ Override public boolean unload ( ) { } }

Fix:
return PoreBlock . of ( getHandle ( ) . getFullBlock ( x , y , z ) ) ;
Buggy code:
public class DefaultExceptionContext implements ExceptionContext { private static final long serialVersionUID = 293747957535772807L ; private List < String > contextKeyList = new ArrayList < String > ( ) ; private Map < String , Serializable > contextValueMap = new HashMap < String , Serializable > ( ) ; public ExceptionContext addLabeledValue ( String label , Serializable value ) { } public Serializable getLabeledValue ( String label ) { } public Set < String > getLabelSet ( ) { } public String getFormattedExceptionMessage ( String baseMessage ) { <START_BUG> StringBuffer buffer = new StringBuffer ( 256 ) ; <END_BUG> if ( baseMessage != null ) { buffer . append ( baseMessage ) ; } if ( ( contextKeyList . size ( ) ) > 0 ) { if ( ( buffer . length ( ) ) > 0L ) { buffer . append ( LINE_SEPARATOR ) ; } buffer . append ( "Exception<seq2seq4repair_space>Context:" ) ; buffer . append ( LINE_SEPARATOR ) ; buffer . append ( "\t" ) ; Object value ; String valueStr ; for ( String label : this . contextKeyList ) { buffer . append ( "[" ) ; buffer . append ( label ) ; buffer . append ( "=" ) ; value = this . contextValueMap . get ( label ) ; if ( value == null ) { buffer . append ( "null" ) ; } else { try { valueStr = value . toString ( ) ; } catch ( Throwable t ) { valueStr = "Excepted<seq2seq4repair_space>on<seq2seq4repair_space>toString():<seq2seq4repair_space>" + ( ExceptionUtils . getStackTrace ( t ) ) ; } buffer . append ( valueStr ) ; } buffer . append ( "]" ) ; buffer . append ( LINE_SEPARATOR ) ; buffer . append ( "\t" ) ; } buffer . append ( "---------------------------------" ) ; } return buffer . toString ( ) ; } }

Fix:
StringBuilder buffer = new StringBuilder ( 256 ) ;
Buggy code:
public class StrFieldSource extends FieldCacheSource { public StrFieldSource ( String field ) { } @ Override public String description ( ) { } @ Override public FunctionValues getValues ( Map context , AtomicReaderContext readerContext ) throws IOException { return new DocTermsIndexDocValues ( this , readerContext , field ) { @ Override protected String toTerm ( String readableValue ) { return readableValue ; } @ Override public int ordVal ( int doc ) { return termsIndex . getOrd ( doc ) ; } @ Override public int numOrd ( ) { <START_BUG> return termsIndex . numOrd ( ) ; <END_BUG> } @ Override public Object objectVal ( int doc ) { return strVal ( doc ) ; } @ Override public String toString ( int doc ) { return ( ( description ( ) ) + '=' ) + ( strVal ( doc ) ) ; } } ; } @ Override public boolean equals ( Object o ) { } private static int hcode = SortableFloatFieldSource . class . hashCode ( ) ; @ Override public int hashCode ( ) { } }

Fix:
return termsIndex . getValueCount ( ) ;
Buggy code:
public class AbsoluteHref extends WebComponent { public AbsoluteHref ( final String componentName ) { } protected void onComponentTag ( ComponentTag tag ) { String href = tag . getString ( "href" ) ; if ( ( href . charAt ( 0 ) ) != '//' ) { WebRequestCycle hcycle = ( ( WebRequestCycle ) ( getRequestCycle ( ) ) ) ; String requestUrl = ( ( wicket . protocol . http . WebRequest ) ( hcycle . getRequest ( ) ) ) . getHttpServletRequest ( ) . getRequestURL ( ) . toString ( ) ; <START_BUG> String urlPrefix = getPage ( ) . urlFor ( "" ) ; <END_BUG> int idx = requestUrl . indexOf ( urlPrefix ) ; if ( idx > 0 ) { urlPrefix = requestUrl . substring ( 0 , ( idx + ( urlPrefix . length ( ) ) ) ) ; href = ( urlPrefix + "//" ) + href ; } tag . put ( "href" , href ) ; } super . onComponentTag ( tag ) ; } protected void onComponentTagBody ( MarkupStream markupStream , ComponentTag openTag ) { } }

Fix:
String urlPrefix = getPage ( ) . urlFor ( ( ( String ) ( null ) ) ) ;
Buggy code:
public class IaSHandlerTransmutationRepair implements IIaSApiTransmutable { @ Override public int getTransmutationTime ( ItemStack target , ItemStack catalyst ) { if ( ! ( target . isItemDamaged ( ) ) ) return 0 ; final Item it = target . getItem ( ) ; if ( it instanceof ItemArmor ) { if ( ( catalyst . getItem ( ) ) == ( ( ( ItemArmor ) ( it ) ) . getArmorMaterial ( ) . customCraftingMaterial ) ) { <START_BUG> if ( ( ( catalyst . getItem ( ) ) == ( NyxItems . echirIngot ) ) && ( ! ( catalyst . isItemDamaged ( ) ) ) ) <END_BUG> return 0 ; return 850 ; } } if ( it instanceof IIaSTool ) { if ( ( ( IIaSTool ) ( it ) ) . canRepair ( ) ) { if ( IaSToolMaterial . extractMaterial ( target ) . isRepairable ( target , catalyst ) ) return 450 ; } return 0 ; } if ( it . getIsRepairable ( target , catalyst ) ) return 450 ; return 0 ; } @ Override public List < ItemStack > getTransmutationYield ( ItemStack target , ItemStack catalyst , World world ) { } @ Override public boolean spawnParticles ( ItemStack target , ItemStack catalyst , World world , Entity ent ) { } }

Fix:
if ( ( ( catalyst . getItem ( ) ) == ( NyxItems . echirIngot ) ) && ( ( catalyst . getItemDamage ( ) ) <= 0 ) )
Buggy code:
public class EarMetaDataParsingProcessor implements DeploymentUnitProcessor { private static final String APPLICATION_XML = "META-INF//application.xml" ; private static final String JBOSS_APP_XML = "META-INF//jboss-app.xml" ; public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( ! ( DeploymentTypeMarker . isType ( EAR , deploymentUnit ) ) ) { return ; } final ResourceRoot deploymentRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) ; final VirtualFile deploymentFile = deploymentRoot . getRoot ( ) ; final PropertyResolver propertyResolver = deploymentUnit . getAttachment ( FINAL_PROPERTY_RESOLVER ) ; final PropertyReplacer propertyReplacer = PropertyReplacers . resolvingReplacer ( propertyResolver ) ; <START_BUG> EarMetaData earMetaData = handleSpecMetadata ( deploymentFile , propertyReplacer ) ; <END_BUG> JBossAppMetaData jbossMetaData = handleJbossMetadata ( deploymentFile , propertyReplacer ) ; if ( ( earMetaData == null ) && ( jbossMetaData == null ) ) { return ; } if ( ( jbossMetaData != null ) && ( ( jbossMetaData . getDistinctName ( ) ) != null ) ) { deploymentUnit . putAttachment ( DISTINCT_NAME , jbossMetaData . getDistinctName ( ) ) ; } JBossAppMetaData merged ; if ( earMetaData != null ) { merged = new JBossAppMetaData ( earMetaData . getEarVersion ( ) ) ; } else { merged = new JBossAppMetaData ( ) ; } JBossAppMetaDataMerger . merge ( merged , jbossMetaData , earMetaData ) ; deploymentUnit . putAttachment ( EAR_METADATA , merged ) ; if ( ( merged . getEarEnvironmentRefsGroup ( ) ) != null ) { final DeploymentDescriptorEnvironment bindings = new DeploymentDescriptorEnvironment ( "java:app//env//" , merged . getEarEnvironmentRefsGroup ( ) ) ; deploymentUnit . putAttachment ( MODULE_DEPLOYMENT_DESCRIPTOR_ENVIRONMENT , bindings ) ; } } private EarMetaData handleSpecMetadata ( VirtualFile deploymentFile , final PropertyReplacer propertyReplacer ) throws DeploymentUnitProcessingException { } private JBossAppMetaData handleJbossMetadata ( VirtualFile deploymentFile , final PropertyReplacer propertyReplacer ) throws DeploymentUnitProcessingException { } public void undeploy ( final DeploymentUnit deploymentUnit ) { } }

Fix:
EarMetaData earMetaData = handleSpecMetadata ( deploymentFile , SpecDescriptorPropertyReplacement . propertyReplacer ( deploymentUnit ) ) ;
Buggy code:
public class MockWebApplicationTest extends TestCase { private MockWebApplication application ; public MockWebApplicationTest ( String name ) { } protected void setUp ( ) throws Exception { } public void testRenderHomePage ( ) throws Exception { } public void testClickLink ( ) throws Exception { } private boolean validateDocument ( String document , int expectedLinkClickCount ) { HtmlDocumentValidator validator = new HtmlDocumentValidator ( ) ; Tag html = new Tag ( "html" ) ; Tag head = new Tag ( "head" ) ; html . addExpectedChild ( head ) ; Tag title = new Tag ( "title" ) ; head . addExpectedChild ( title ) ; title . addExpectedChild ( new TextContent ( "Mock<seq2seq4repair_space>Page" ) ) ; Tag body = new Tag ( "body" ) ; html . addExpectedChild ( body ) ; Tag a = new Tag ( "a" ) ; <START_BUG> a . addExpectedAttribute ( "href" , "//MockWebApplication//MockWebApplication\\?component=[0-9]*.actionLink&amp;version=\\-?[0-9]*&amp;interface=ILinkListener" ) ; <END_BUG> a . addExpectedAttribute ( "id" , "wicket-actionLink" ) ; body . addExpectedChild ( a ) ; a . addExpectedChild ( new TextContent ( "Action<seq2seq4repair_space>link<seq2seq4repair_space>clicked<seq2seq4repair_space>" ) ) ; Tag span = new Tag ( "span" ) ; span . addExpectedChild ( new TextContent ( ( "" + expectedLinkClickCount ) ) ) ; a . addExpectedChild ( span ) ; a . addExpectedChild ( new TextContent ( "<seq2seq4repair_space>times" ) ) ; validator . addRootElement ( html ) ; return validator . isDocumentValid ( document ) ; } }

Fix:
a . addExpectedAttribute ( "href" , "//MockWebApplication//MockWebApplication\\?component=[0-9]*.actionLink&amp;revision=\\-?[0-9]*&amp;interface=ILinkListener" ) ;
Buggy code:
public class NewModelControllerClientOperationHandlerService extends NewAbstractModelControllerOperationHandlerService < NewModelControllerClientOperationHandler > { protected NewModelControllerClientOperationHandler createOperationHandler ( NewModelController modelController , ExecutorService executor ) { <START_BUG> return new NewModelControllerClientOperationHandler ( null , executor , modelController ) ; <END_BUG> } }

Fix:
return new NewModelControllerClientOperationHandler ( executor , modelController ) ;
Buggy code:
public class SkillName extends SimpleExpression < String > { @ Override protected String [ ] get ( Event event ) { } @ Override public boolean isSingle ( ) { } @ Override public Class < ? extends String > getReturnType ( ) { } @ Override public String toString ( Event event , boolean debug ) { <START_BUG> return this . getClass ( ) . getName ( ) ; <END_BUG> } @ Override public boolean init ( Expression < ? > [ ] exprs , int matchedPattern , Kleenean isDelayed , SkriptParser . ParseResult parseResult ) { } }

Fix:
return "name" ;
Buggy code:
public abstract class Migration { private static final Logger logger = LoggerFactory . getLogger ( Migration . class ) ; public static final String NAME_VALIDATOR_REGEX = "\\w+" ; public static final String MIGRATIONS_CF = "Migrations" ; public static final String SCHEMA_CF = "Schema" ; public static final byte [ ] MIGRATIONS_KEY = "Migrations<seq2seq4repair_space>Key" . getBytes ( Charsets . UTF_8 ) ; public static final byte [ ] LAST_MIGRATION_KEY = "Last<seq2seq4repair_space>Migration" . getBytes ( Charsets . UTF_8 ) ; protected RowMutation rm ; protected UUID newVersion ; protected UUID lastVersion ; protected transient boolean clientMode ; protected Migration ( ) { } Migration ( UUID newVersion , UUID lastVersion ) { } public void beforeApplyModels ( ) { } public final void apply ( ) throws IOException , ConfigurationException { } public final void announce ( ) { } public static UUID getLastMigrationId ( ) { } abstract void applyModels ( ) throws IOException { } public abstract void subdeflate ( org . apache . cassandra . db . migration . avro . Migration mi ) { } public abstract void subinflate ( org . apache . cassandra . db . migration . avro . Migration mi ) { } public UUID getVersion ( ) { } static RowMutation makeDefinitionMutation ( KSMetaData add , KSMetaData remove , UUID versionId ) throws IOException { } static void cleanupDeadFiles ( boolean wait ) { } public byte [ ] serialize ( ) throws IOException { } public static Migration deserialize ( byte [ ] bytes ) throws IOException { } public static Collection < IColumn > getLocalMigrations ( UUID start , UUID end ) { DecoratedKey dkey = StorageService . getPartitioner ( ) . decorateKey ( Migration . MIGRATIONS_KEY ) ; Table defs = Table . open ( SYSTEM_TABLE ) ; ColumnFamilyStore cfStore = defs . getColumnFamilyStore ( Migration . MIGRATIONS_CF ) ; <START_BUG> QueryFilter filter = QueryFilter . getSliceFilter ( dkey , new QueryPath ( Migration . MIGRATIONS_CF ) , UUIDGen . decompose ( start ) , UUIDGen . decompose ( end ) , null , false , 1000 ) ; <END_BUG> ColumnFamily cf = cfStore . getColumnFamily ( filter ) ; return cf . getSortedColumns ( ) ; } public static byte [ ] toUTF8Bytes ( UUID version ) { } public static boolean isLegalName ( String s ) { } }

Fix:
QueryFilter filter = QueryFilter . getSliceFilter ( dkey , new QueryPath ( Migration . MIGRATIONS_CF ) , UUIDGen . decompose ( start ) , UUIDGen . decompose ( end ) , false , 1000 ) ;
Buggy code:
public class NavigationDrawerFragment extends Fragment { private ActionBarDrawerToggle mDrawerToggle ; private DrawerLayout mDrawerLayout ; private boolean mUserLearnedDrawer ; private boolean mFromSavedInstanceState ; private View containerView ; private RecyclerView recyclerView ; private LinearLayoutManager linearLayoutManager ; private DrawerAdapter adapter ; public NavigationDrawerFragment ( ) { } public static List < DrawerItem > getData ( Context context ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , @ Nullable ViewGroup container , @ Nullable Bundle savedInstanceState ) { } public void setUp ( int fragmentID , DrawerLayout drawerLayout , final Toolbar toolbar ) { containerView = getActivity ( ) . findViewById ( fragmentID ) ; mDrawerLayout = drawerLayout ; adapter . setDrawerLayout ( mDrawerLayout ) ; mDrawerToggle = new ActionBarDrawerToggle ( getActivity ( ) , drawerLayout , toolbar , string . nav_drawer_open , string . nav_drawer_close ) { @ Override public void onDrawerClosed ( View drawerView ) { super . onDrawerClosed ( drawerView ) ; getActivity ( ) . invalidateOptionsMenu ( ) ; } @ Override public void onDrawerOpened ( View drawerView ) { super . onDrawerOpened ( drawerView ) ; if ( ! ( mUserLearnedDrawer ) ) { mUserLearnedDrawer = true ; SharedPreferencesProvider . saveToPreferences ( getActivity ( ) , KEY_USER_LEARNED_DRAWER , ( ( mUserLearnedDrawer ) + "" ) ) ; getActivity ( ) . invalidateOptionsMenu ( ) ; } } @ Override public void onDrawerSlide ( View drawerView , float slideOffset ) { if ( slideOffset < 0.6 ) { toolbar . setAlpha ( ( 1 - slideOffset ) ) ; } } } ; if ( ( ! ( mUserLearnedDrawer ) ) && ( ! ( mFromSavedInstanceState ) ) ) { mDrawerLayout . openDrawer ( containerView ) ; } <START_BUG> SharedPreferences sp = SharedPreferencesProvider . getSharedPreferences ( getActivity ( ) ) ; <END_BUG> int defaultView = Integer . parseInt ( sp . getString ( KEY_USER_DEFAULT_START_VIEW , "0" ) ) ; selectItem ( defaultView ) ; mDrawerLayout . setDrawerListener ( mDrawerToggle ) ; mDrawerLayout . post ( new Runnable ( ) { @ Override public void run ( ) { mDrawerToggle . syncState ( ) ; } } ) ; } private void selectItem ( int position ) { } }

Fix:
SharedPreferences sp = getActivity ( ) . getSharedPreferences ( PREF_FILE_NAME , MODE_PRIVATE ) ;
Buggy code:
public class Importer implements Runnable { private static File xmlFile ; @ Inject DAO db ; @ Override public void run ( ) { } @ XStreamAlias ( "indexerdata" ) public static class IndexerData { @ XStreamAlias ( "users" ) public List < User > users = new ArrayList < User > ( ) ; @ XStreamAlias ( "projects" ) public List < Project > projects = new ArrayList < Project > ( ) ; } public static void main ( String [ ] args ) { if ( ( args . length ) == 1 ) { String xmlFileName = args [ 0 ] ; Importer . xmlFile = new File ( xmlFileName ) ; <START_BUG> ObjectGraph objectGraph = ObjectGraph . create ( new DAO ( ) ) ; <END_BUG> Importer importer = objectGraph . get ( Importer . class ) ; importer . run ( ) ; } else { throw new IllegalArgumentException ( ) ; } } private static void populateDb ( DAO db , Importer . IndexerData data ) throws SQLException { } }

Fix:
ObjectGraph objectGraph = ObjectGraph . create ( new ImporterModule ( ) ) ;
Buggy code:
public class BatchEnvironmentFactory { private final Map < ClassLoader , BatchEnvironmentService > services = Collections . synchronizedMap ( new HashMap < ClassLoader , BatchEnvironmentService > ( ) ) ; private static class Holder { static final BatchEnvironmentFactory INSTANCE = new BatchEnvironmentFactory ( ) ; } public static BatchEnvironmentFactory getInstance ( ) { } public BatchEnvironment getBatchEnvironment ( ) { } public BatchEnvironment getBatchEnvironment ( final ClassLoader cl ) { } public void add ( final BatchEnvironmentService batchEnvironmentService ) { } public void add ( final ClassLoader cl , final BatchEnvironmentService batchEnvironmentService ) { } public BatchEnvironmentService remove ( ) { } public BatchEnvironmentService remove ( final ClassLoader cl ) { <START_BUG> return services . remove ( WildFlySecurityManager . getCurrentContextClassLoaderPrivileged ( ) ) ; <END_BUG> } }

Fix:
return services . remove ( cl ) ;
Buggy code:
public class KMeansDriver { private static final Logger log = LoggerFactory . getLogger ( KMeansDriver . class ) ; private KMeansDriver ( ) { } public static void main ( String [ ] args ) { } public static void runJob ( String input , String clustersIn , String output , String measureClass , double convergenceDelta , int maxIterations , int numCentroids ) { } private static boolean runIteration ( String input , String clustersIn , String clustersOut , String measureClass , String convergenceDelta , int numReduceTasks ) { JobClient client = new JobClient ( ) ; JobConf conf = new JobConf ( KMeansDriver . class ) ; conf . setOutputKeyClass ( Text . class ) ; conf . setOutputValueClass ( Text . class ) ; FileInputFormat . setInputPaths ( conf , new Path ( input ) ) ; Path outPath = new Path ( clustersOut ) ; FileOutputFormat . setOutputPath ( conf , outPath ) ; conf . setOutputFormat ( SequenceFileOutputFormat . class ) ; conf . setMapperClass ( KMeansMapper . class ) ; conf . setCombinerClass ( KMeansCombiner . class ) ; conf . setReducerClass ( KMeansReducer . class ) ; conf . setNumReduceTasks ( numReduceTasks ) ; conf . set ( CLUSTER_PATH_KEY , clustersIn ) ; conf . set ( DISTANCE_MEASURE_KEY , measureClass ) ; conf . set ( CLUSTER_CONVERGENCE_KEY , convergenceDelta ) ; client . setConf ( conf ) ; try { JobClient . runJob ( conf ) ; <START_BUG> FileSystem fs = FileSystem . get ( conf ) ; <END_BUG> return KMeansDriver . isConverged ( ( clustersOut + "//part-00000" ) , conf , fs ) ; } catch ( IOException e ) { KMeansDriver . log . warn ( e . toString ( ) , e ) ; return true ; } } private static void runClustering ( String input , String clustersIn , String output , String measureClass , String convergenceDelta ) { } private static boolean isConverged ( String filePath , JobConf conf , FileSystem fs ) throws IOException { } }

Fix:
FileSystem fs = FileSystem . get ( outPath . toUri ( ) , conf ) ;
Buggy code:
public final class MapView extends Viewport { private static final long serialVersionUID = Long . parseLong ( "MapView" , 35 ) ; private char [ ] [ ] view_contents_ ; private int x_ ; private int y_ ; private Avatar AvatarRef_ ; @ Override public void renderToDisplay ( ) { } public MapView ( Avatar _avatar ) { } private void render ( ) { x_ = AvatarRef_ . getMapRelation ( ) . getMyXCordinate ( ) ; y_ = AvatarRef_ . getMapRelation ( ) . getMyYCordinate ( ) ; int midpointx_ = ( x_ ) // 2 ; int midpointy_ = ( y_ ) // 2 ; for ( int i = 0 ; i != ( width_ ) ; ++ i ) { for ( int j = 0 ; j != ( height_ ) ; ++ j ) { <START_BUG> view_contents_ [ i ] [ j ] = map_relationship_ . getTileRepresentation ( ( i - midpointx_ ) , ( j + midpointy_ ) ) ; <END_BUG> } } } }

Fix:
view_contents_ [ i ] [ j ] = map_relationship_ . getTileRepresentation ( ( i - ( ( width_ ) // 2 ) ) , ( ( ( height_ ) // 2 ) - j ) ) ;