nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CompositionList extends GDListActivity { private static final String TAG = CompositionList . class . getSimpleName ( ) ; private String composer ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private Activity getActivity ( ) { } @ Override protected void onStart ( ) { } @ Override protected void onStop ( ) { } private final class AsyncCursorLoader extends AsyncTask < String , Object , Cursor > { private Dialog waitingDialog ; @ Override protected void onPreExecute ( ) { } @ Override protected Cursor doInBackground ( String ... params ) { } @ Override protected void onPostExecute ( Cursor cursor ) { super . onPostExecute ( cursor ) ; Log . d ( CompositionList . TAG , "omPostExecute" ) ; ClassicoListAdapter listAdapter = new ClassicoListAdapter ( CompositionList . this , layout . simple_list_item_1 , cursor , new String [ ] { ClassicoDatabase . KEY_COMPOSITION } , new int [ ] { id . text1 } ) ; setListAdapter ( listAdapter ) ; getListView ( ) . setFastScrollEnabled ( true ) ; getListView ( ) . setOnItemClickListener ( new OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > arg0 , View arg1 , int arg2 , long arg3 ) { Log . d ( CompositionList . TAG , ( "onItemClick():<seq2seq4repair_space>" + arg3 ) ) ; final Intent scoreIntent = new Intent ( getApplicationContext ( ) , ScoreList . class ) ; Uri data = Uri . withAppendedPath ( CONTENT_URI , String . valueOf ( arg3 ) ) ; scoreIntent . setData ( data ) ; <START_BUG> scoreIntent . putExtra ( GD_ACTION_BAR_TITLE , "Score<seq2seq4repair_space>List" ) ; <END_BUG> startActivity ( scoreIntent ) ; } } ) ; waitingDialog . dismiss ( ) ; } } }

Fix:
scoreIntent . putExtra ( GD_ACTION_BAR_TITLE , TITLE ) ;
Buggy code:
public final class RadioButtonsTagTests extends AbstractFormTagTests { private RadioButtonsTag tag ; private TestBean bean ; @ Override @ SuppressWarnings ( "serial" ) protected void onSetUp ( ) { } public void testWithMultiValueArray ( ) throws Exception { } public void testWithMultiValueArrayAndDynamicAttributes ( ) throws Exception { } public void testWithMultiValueArrayWithDelimiter ( ) throws Exception { } public void testWithMultiValueMap ( ) throws Exception { } public void testWithMultiValueMapWithDelimiter ( ) throws Exception { } public void testWithMultiValueWithEditor ( ) throws Exception { } public void testCollectionOfPets ( ) throws Exception { } public void testCollectionOfPetsWithEditor ( ) throws Exception { } public void testWithoutItemsEnumBindTarget ( ) throws Exception { } public void testWithoutItemsEnumBindTargetWithExplicitLabelsAndValues ( ) throws Exception { } public void testWithNullValue ( ) throws Exception { } public void testHiddenElementOmittedOnDisabled ( ) throws Exception { this . tag . setPath ( "stringArray" ) ; this . tag . setItems ( new Object [ ] { "foo" , "bar" , "baz" } ) ; <START_BUG> this . tag . setDisabled ( true ) ; <END_BUG> int result = this . tag . doStartTag ( ) ; assertEquals ( SKIP_BODY , result ) ; String output = getOutput ( ) ; output = ( "<doc>" + output ) + "<//doc>" ; SAXReader reader = new SAXReader ( ) ; Document document = reader . read ( new StringReader ( output ) ) ; Element rootElement = document . getRootElement ( ) ; assertEquals ( "Both<seq2seq4repair_space>tag<seq2seq4repair_space>and<seq2seq4repair_space>hidden<seq2seq4repair_space>element<seq2seq4repair_space>rendered<seq2seq4repair_space>incorrectly" , 3 , rootElement . elements ( ) . size ( ) ) ; Element spanElement = ( ( Element ) ( document . getRootElement ( ) . elements ( ) . get ( 0 ) ) ) ; Element radioButtonElement = ( ( Element ) ( spanElement . elements ( ) . get ( 0 ) ) ) ; assertEquals ( "input" , radioButtonElement . getName ( ) ) ; assertEquals ( "radio" , radioButtonElement . attribute ( "type" ) . getValue ( ) ) ; assertEquals ( "stringArray" , radioButtonElement . attribute ( "name" ) . getValue ( ) ) ; assertEquals ( "checked" , radioButtonElement . attribute ( "checked" ) . getValue ( ) ) ; assertEquals ( "disabled" , radioButtonElement . attribute ( "disabled" ) . getValue ( ) ) ; assertEquals ( "foo" , radioButtonElement . attribute ( "value" ) . getValue ( ) ) ; } public void testSpanElementCustomizable ( ) throws Exception { } public void testDynamicTypeAttribute ( ) throws JspException { } private Date getDate ( ) { } @ Override protected TestBean createTestBean ( ) { } private static class MyStringTrimmerEditor extends StringTrimmerEditor { public final Set allProcessedValues = new HashSet ( ) ; public MyStringTrimmerEditor ( ) { } @ Override public void setAsText ( String text ) { } } }

Fix:
this . tag . setDisabled ( "true" ) ;
Buggy code:
public class BookTrackerService extends Service { private List < Publisher > publishersInFavoriteBooks ; private HashMap < Publisher , List < Book > > publisherBooksMap ; private Set < Publisher > nearbyPublishers ; private BookDataSource dataSource ; private BookTrackerService . UserLocationListener userLocationListener ; public static final long FILTER_DISTANCE = 10 ; private synchronized void update ( Location userLocation ) { } private void notifyUser ( Set < Book > booksForNotification ) { } private boolean isPublisherStallNearby ( Location userLocation , double stallLatitude , double stallLongitude ) { } private void createPublisherToBooksMap ( ) { } private Set < Book > getDummyBooks ( ) { } @ Override public void onCreate ( ) { super . onCreate ( ) ; <START_BUG> dataSource = BookDataSource . getInstance ( this , new BookDataSource . OnDataChangeListener ( ) { <END_BUG> @ Override public void onUpdate ( ) { createPublisherToBooksMap ( ) ; } } ) ; dataSource . open ( ) ; createPublisherToBooksMap ( ) ; nearbyPublishers = new HashSet ( ) ; userLocationListener = new BookTrackerService . UserLocationListener ( this ) ; notifyUser ( getDummyBooks ( ) ) ; } @ Override public int onStartCommand ( Intent intent , int flags , int startId ) { } @ Override public IBinder onBind ( Intent intent ) { } @ Override public void onDestroy ( ) { } protected class UserLocationListener implements LocationListener { private Context context ; private LocationManager locationManager ; public UserLocationListener ( Context context ) { } public void start ( ) { } public void stop ( ) { } private Location requestUpdateFromProvider ( String provider ) { } @ Override public void onLocationChanged ( Location location ) { } @ Override public void onProviderDisabled ( String provider ) { } @ Override public void onProviderEnabled ( String provider ) { } @ Override public void onStatusChanged ( String provider , int status , Bundle extras ) { } } }

Fix:
dataSource = new BookDataSource ( this , new BookDataSource . OnDataChangeListener ( ) {
Buggy code:
public class Log4jEntityResolver implements EntityResolver { public InputSource resolveEntity ( String publicId , String systemId ) { <START_BUG> LogLog . info ( ( ( ( ( "Log4jEntityResolver.resolveEntity(" + publicId ) + "," ) + systemId ) + ")<seq2seq4repair_space>called" ) ) ; <END_BUG> if ( systemId . endsWith ( "log4j.dtd" ) ) { Class clazz = getClass ( ) ; InputStream in = clazz . getResourceAsStream ( "//org//apache//log4j//xml//log4j.dtd" ) ; if ( in == null ) { LogLog . error ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>[log4j.dtd].<seq2seq4repair_space>Used<seq2seq4repair_space>[" + ( clazz . getClassLoader ( ) ) ) + "]<seq2seq4repair_space>class<seq2seq4repair_space>loader<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>search." ) ) ; return null ; } else { return new InputSource ( in ) ; } } else { return null ; } } }

Fix:
LogLog . debug ( ( ( ( ( "Log4jEntityResolver.resolveEntity(" + publicId ) + "," ) + systemId ) + ")<seq2seq4repair_space>called" ) ) ;
Buggy code:
public class DirectoryFileFilter extends AbstractFileFilter implements Serializable { public static final IOFileFilter DIRECTORY = new DirectoryFileFilter ( ) ; public static final IOFileFilter INSTANCE = DirectoryFileFilter . DIRECTORY ; protected DirectoryFileFilter ( ) { } @ Override <START_BUG> public boolean accept ( File file ) { <END_BUG> return file . isDirectory ( ) ; } }

Fix:
public boolean accept ( final File file ) {
Buggy code:
public class Game { List < Entity > entities = new ArrayList < Entity > ( ) ; private Timer timer ; private TimerTask clock ; private void create ( ) { timer = new Timer ( ) ; clock = new Clock ( this ) ; timer . scheduleAtFixedRate ( clock , 1000 , 1000 ) ; Player player = new Player ( this ) ; player . addToWorld ( ) ; new HealthModifier ( player , ( - 70 ) , ( - 1 ) , "Damage<seq2seq4repair_space>from<seq2seq4repair_space>no<seq2seq4repair_space>where<seq2seq4repair_space>-70" ) ; new HealthModifier ( player , 15 , 3000 , "Beginner<seq2seq4repair_space>luck<seq2seq4repair_space>+15" ) ; new HealthModifier ( player , 0.5F , "Regen<seq2seq4repair_space>+0.5" ) ; <START_BUG> new FoodModifier ( player , ( - 1 ) , "Hunger<seq2seq4repair_space>-1" ) ; <END_BUG> } public void update ( ) { } public void run ( ) { } }

Fix:
new FoodModifier ( player , ( - 15 ) , "Hunger<seq2seq4repair_space>-15" ) ;
Buggy code:
public class LoggerRemove extends AbstractLoggingSubsystemUpdate < Void > { private static final long serialVersionUID = - 9178350859833986971L ; private final String name ; public LoggerRemove ( String name ) { } protected < P > void applyUpdate ( UpdateContext updateContext , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { try { <START_BUG> final ServiceController < ? > controller = updateContext . getServiceContainer ( ) . getRequiredService ( LogServices . loggerName ( name ) ) ; <END_BUG> controller . setMode ( REMOVE ) ; controller . addListener ( new UpdateResultHandler . ServiceRemoveListener < P > ( resultHandler , param ) ) ; } catch ( Throwable t ) { resultHandler . handleFailure ( t , param ) ; } } public LoggerAdd getCompensatingUpdate ( LoggingSubsystemElement original ) { } protected void applyUpdate ( LoggingSubsystemElement element ) throws UpdateFailedException { } }

Fix:
final ServiceController < ? > controller = updateContext . getServiceRegistry ( ) . getRequiredService ( LogServices . loggerName ( name ) ) ;
Buggy code:
public class Lan { public enum Lanetype { SERIE ( "Serielån" ) , ANNUITET ( "Annuitetslån" ) ; private String tekst ; Lanetype ( String value ) { } public String getTekst ( ) { } public static Lan . Lanetype getByValue ( String value ) { } } private int lanebelop ; private int lopetid ; private int arligeTerminer ; private Lan . Lanetype lanetype ; private float renteFaktor ; private Termin [ ] terminer ; public Lan ( int lanebelop , int lopetid , int arligeTerminer , Lan . Lanetype lanetype , float renteSats ) { } public static String [ ] getLanetyper ( ) { } public void lagPlan ( ) { } private int calcRenter ( long restGjeld , float renteFaktor , int arligeTerminer ) { } public Termin getTermin ( int i ) { } @ Override public String toString ( ) { <START_BUG> return ( ( ( ( ( ( ( ( this . lanetype ) + "\n" ) + ( this . lanebelop ) ) + "\n" ) + ( this . lopetid ) ) + "\n" ) + ( this . arligeTerminer ) ) + "\n" ) + ( this . rentesats ) ; <END_BUG> } }

Fix:
return ( ( ( ( ( ( ( ( this . lanetype ) + "\n" ) + ( this . lanebelop ) ) + "\n" ) + ( this . lopetid ) ) + "\n" ) + ( this . arligeTerminer ) ) + "\n" ) + ( this . renteFaktor ) ;
Buggy code:
public class Cassandra { private Logger log = LoggerFactory . getLogger ( Cassandra . class ) ; private final CassandraHostConfigurator cassandraHostConfigurator ; private final ThriftCluster thriftCluster ; final String COUNTER_CF_NAME = "EzClientCountersCf" ; public Cassandra ( ) { } public Cassandra ( String hosts ) { } public Cassandra ( String hosts , boolean autoDiscover ) { } public Cassandra ( Cluster cluster ) { } public Keyspace getKeyspace ( String keyspaceName ) { } private void buildEzClientKeyspace ( String keyspaceName ) { log . info ( "attempting<seq2seq4repair_space>keyspace<seq2seq4repair_space>create" ) ; ThriftCfDef cfDef = new ThriftCfDef ( keyspaceName , COUNTER_CF_NAME ) ; <START_BUG> cfDef . setDefaultValidationClass ( COUNTERTYPE . toString ( ) ) ; <END_BUG> List < ColumnFamilyDefinition > cfDefs = new ArrayList < ColumnFamilyDefinition > ( ) ; cfDefs . add ( cfDef ) ; thriftCluster . addKeyspace ( new me . prettyprint . cassandra . service . ThriftKsDef ( keyspaceName , "SimpleStrategy" , 1 , cfDefs ) , true ) ; } public List < Keyspace > getKeyspaces ( ) { } public boolean connected ( ) { } }

Fix:
cfDef . setDefaultValidationClass ( COUNTERTYPE . getClassName ( ) ) ;
Buggy code:
public final class RemoteDeployer implements Deployer { private static final Logger LOGGER = Logger . getLogger ( RemoteDeployer . class ) ; private final Map < URL , String > url2Id = new HashMap < URL , String > ( ) ; private ServerDeploymentManager deploymentManager ; public RemoteDeployer ( ) throws IOException { } @ Override public void deploy ( final URL archiveURL ) throws Exception { <START_BUG> final DeploymentPlanBuilder builder = deploymentManager . newDeploymentPlan ( ) . add ( archiveURL ) . andDeploy ( ) ; <END_BUG> final DeploymentPlan plan = builder . build ( ) ; final DeploymentAction deployAction = builder . getLastAction ( ) ; final String uniqueId = deployAction . getDeploymentUnitUniqueName ( ) ; try { executeDeploymentPlan ( plan , deployAction ) ; } finally { url2Id . put ( archiveURL , uniqueId ) ; } } @ Override public void undeploy ( final URL archiveURL ) throws Exception { } private void executeDeploymentPlan ( final DeploymentPlan plan , final DeploymentAction deployAction ) throws Exception { } }

Fix:
final DeploymentPlanBuilder builder = deploymentManager . newDeploymentPlan ( ) . withRollback ( ) . add ( archiveURL ) . andDeploy ( ) ;
Buggy code:
public class GTFSClient extends Application { private final String TWITTER_KEY = "6Rs5gyo7xHoEYYkls0ajWP9PO" ; private final String TWITTER_SECRET = "8nvcBPCoqhkt1Lvzjv6Pb5GmBB4uBmreV3KSgVxfcgCJrMQT8E" ; public final String PREFS_NAME = "MyPrefsFile" ; private static GTFSClient instance ; private Socket client ; private String PROFILE_ID ; private MessageDbAdapter messageDbAdapter ; private boolean authenticated = false ; private boolean listening = false ; private String PROFILE_NAME ; private String SESSION_ID ; public Socket getClient ( ) { } public void setClient ( Socket client ) { } public boolean isListening ( ) { } public void setListening ( boolean listening ) { } public boolean isAuthenticated ( ) { } public void setAuthenticated ( boolean authenticated ) { } @ Override public void onCreate ( ) { super . onCreate ( ) ; getInstance ( ) ; messageDbAdapter = MessageDbAdapter . getInstance ( this ) ; Cognalys . enableAnalytics ( getApplicationContext ( ) , true , true ) ; try { messageDbAdapter . open ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } <START_BUG> if ( ! ( getID ( ) . equals ( null ) ) ) { <END_BUG> startService ( new Intent ( this , ManagerService . class ) ) ; startService ( new Intent ( this , NetworkService . class ) ) ; } } @ Override public void onConfigurationChanged ( Configuration newConfig ) { } @ Override public void onLowMemory ( ) { } @ Override public void onTerminate ( ) { } public MessageDbAdapter getDatabaseAdapter ( ) { } protected void getInstance ( ) { } public String getID ( ) { } public void setID ( String ID ) { } public String getPROFILE_NAME ( ) { } public void setPROFILE_NAME ( String PROFILE_NAME ) { } public String getSESSION_ID ( ) { } public void setSESSION_ID ( String SESSION_ID ) { } No newline ; at end ; of file ; }

Fix:
if ( ( getID ( ) ) != null ) {
Buggy code:
public class ClusteredSessionUnitTestCase { @ Test public void testNewSessionIsOutdated ( ) throws Exception { Engine engine = new MockEngine ( ) ; engine . setName ( "jboss.web" ) ; Host host = new MockHost ( ) ; host . setName ( "localhost" ) ; engine . addChild ( host ) ; StandardContext context = new StandardContext ( ) ; context . setName ( "test" ) ; host . addChild ( context ) ; <START_BUG> DistributableSessionManager < ? > mgr = new DistributableSessionManager < org . jboss . as . clustering . web . OutgoingDistributableSessionData > ( new MockDistributedCacheManagerFactory ( ) , context , SessionTestUtil . createWebMetaData ( 10 ) , new ContextClassResolver ( ) ) ; <END_BUG> context . setManager ( mgr ) ; mgr . start ( ) ; mgr . getReplicationConfig ( ) . setReplicationGranularity ( SESSION ) ; ClusteredSession < ? > sess = ( ( ClusteredSession < ? > ) ( mgr . createEmptySession ( ) ) ) ; assertTrue ( sess . isOutdated ( ) ) ; sess . setCreationTime ( System . currentTimeMillis ( ) ) ; assertFalse ( sess . isOutdated ( ) ) ; mgr . getReplicationConfig ( ) . setReplicationGranularity ( ATTRIBUTE ) ; sess = ( ( ClusteredSession < ? > ) ( mgr . createEmptySession ( ) ) ) ; assertTrue ( sess . isOutdated ( ) ) ; sess . setCreationTime ( System . currentTimeMillis ( ) ) ; assertFalse ( sess . isOutdated ( ) ) ; } }

Fix:
DistributableSessionManager < ? > mgr = new DistributableSessionManager < org . jboss . as . clustering . web . OutgoingDistributableSessionData > ( new MockDistributedCacheManagerFactory ( ) , SessionTestUtil . createWebMetaData ( 10 ) , new ContextClassResolver ( ) ) ;
Buggy code:
public class TarUtils { private static final int BYTE_MASK = 255 ; static final ZipEncoding DEFAULT_ENCODING = ZipEncodingHelper . getZipEncoding ( null ) ; static final ZipEncoding FALLBACK_ENCODING = new ZipEncoding ( ) { public boolean canEncode ( String name ) { } public ByteBuffer encode ( String name ) { } public String decode ( byte [ ] buffer ) { } } ; private TarUtils ( ) { } public static long parseOctal ( final byte [ ] buffer , final int offset , final int length ) { } public static long parseOctalOrBinary ( final byte [ ] buffer , final int offset , final int length ) { } private static long parseBinaryLong ( final byte [ ] buffer , final int offset , final int length , final boolean negative ) { } private static long parseBinaryBigInteger ( final byte [ ] buffer , final int offset , final int length , final boolean negative ) { } public static boolean parseBoolean ( final byte [ ] buffer , final int offset ) { } private static String exceptionMessage ( byte [ ] buffer , final int offset , final int length , int current , final byte currentByte ) { } public static String parseName ( byte [ ] buffer , final int offset , final int length ) { } public static String parseName ( byte [ ] buffer , final int offset , final int length , final ZipEncoding encoding ) throws IOException { } public static int formatNameBytes ( String name , byte [ ] buf , final int offset , final int length ) { } public static int formatNameBytes ( String name , byte [ ] buf , final int offset , final int length , final ZipEncoding encoding ) throws IOException { int len = name . length ( ) ; ByteBuffer b = encoding . encode ( name ) ; while ( ( ( b . limit ( ) ) > length ) && ( len > 0 ) ) { b = encoding . encode ( name . substring ( 0 , ( -- len ) ) ) ; } <START_BUG> final int limit = b . limit ( ) ; <END_BUG> System . arraycopy ( b . array ( ) , b . arrayOffset ( ) , buf , offset , limit ) ; for ( int i = limit ; i < length ; ++ i ) { buf [ ( offset + i ) ] = 0 ; } return offset + length ; } public static void formatUnsignedOctalString ( final long value , byte [ ] buffer , final int offset , final int length ) { } public static int formatOctalBytes ( final long value , byte [ ] buf , final int offset , final int length ) { } public static int formatLongOctalBytes ( final long value , byte [ ] buf , final int offset , final int length ) { } public static int formatLongOctalOrBinaryBytes ( final long value , byte [ ] buf , final int offset , final int length ) { } private static void formatLongBinary ( final long value , byte [ ] buf , final int offset , final int length , final boolean negative ) { } private static void formatBigIntegerBinary ( final long value , byte [ ] buf , final int offset , final int length , final boolean negative ) { } public static int formatCheckSumOctalBytes ( final long value , byte [ ] buf , final int offset , final int length ) { } public static long computeCheckSum ( final byte [ ] buf ) { } public static boolean verifyCheckSum ( byte [ ] header ) { } }

Fix:
final int limit = ( b . limit ( ) ) - ( b . position ( ) ) ;
Buggy code:
public class TestStressAdvance extends LuceneTestCase { public void testStressAdvance ( ) throws Exception { for ( int iter = 0 ; iter < 3 ; iter ++ ) { if ( VERBOSE ) { System . out . println ( ( "\nTEST:<seq2seq4repair_space>iter=" + iter ) ) ; } Directory dir = newDirectory ( ) ; RandomIndexWriter w = new RandomIndexWriter ( random ( ) , dir ) ; final Set < Integer > aDocs = new HashSet < > ( ) ; final Document doc = new Document ( ) ; final Field f = newStringField ( "field" , "" , NO ) ; doc . add ( f ) ; final Field idField = newStringField ( "id" , "" , YES ) ; doc . add ( idField ) ; int num = atLeast ( 4097 ) ; if ( VERBOSE ) { System . out . println ( ( "\nTEST:<seq2seq4repair_space>numDocs=" + num ) ) ; } for ( int id = 0 ; id < num ; id ++ ) { if ( ( random ( ) . nextInt ( 4 ) ) == 3 ) { f . setStringValue ( "a" ) ; aDocs . add ( id ) ; } else { f . setStringValue ( "b" ) ; } idField . setStringValue ( ( "" + id ) ) ; w . addDocument ( doc ) ; if ( VERBOSE ) { System . out . println ( ( "\nTEST:<seq2seq4repair_space>doc<seq2seq4repair_space>upto<seq2seq4repair_space>" + id ) ) ; } } w . forceMerge ( 1 ) ; final List < Integer > aDocIDs = new ArrayList < > ( ) ; final List < Integer > bDocIDs = new ArrayList < > ( ) ; final DirectoryReader r = w . getReader ( ) ; final int [ ] idToDocID = new int [ r . maxDoc ( ) ] ; for ( int docID = 0 ; docID < ( idToDocID . length ) ; docID ++ ) { int id = Integer . parseInt ( r . document ( docID ) . get ( "id" ) ) ; if ( aDocs . contains ( id ) ) { aDocIDs . add ( docID ) ; } else { bDocIDs . add ( docID ) ; } } final TermsEnum te = getOnlySegmentReader ( r ) . fields ( ) . terms ( "field" ) . iterator ( null ) ; DocsEnum de = null ; for ( int iter2 = 0 ; iter2 < 10 ; iter2 ++ ) { if ( VERBOSE ) { System . out . println ( ( ( ( "\nTEST:<seq2seq4repair_space>iter=" + iter ) + "<seq2seq4repair_space>iter2=" ) + iter2 ) ) ; } assertEquals ( FOUND , te . seekCeil ( new BytesRef ( "a" ) ) ) ; de = TestUtil . docs ( random ( ) , te , null , de , FLAG_NONE ) ; testOne ( de , aDocIDs ) ; assertEquals ( FOUND , te . seekCeil ( new BytesRef ( "b" ) ) ) ; de = TestUtil . docs ( random ( ) , te , null , de , FLAG_NONE ) ; testOne ( de , bDocIDs ) ; } <START_BUG> w . close ( ) ; <END_BUG> r . close ( ) ; dir . close ( ) ; } } private void testOne ( DocsEnum docs , List < Integer > expected ) throws Exception { } }

Fix:
w . shutdown ( ) ;
Buggy code:
public class TestCharsRef extends LuceneTestCase { public void testUTF16InUTF8Order ( ) { } public void testAppend ( ) { } public void testCopy ( ) { int numIters = atLeast ( 10 ) ; for ( int i = 0 ; i < numIters ; i ++ ) { CharsRef ref = new CharsRef ( ) ; char [ ] charArray = _TestUtil . randomRealisticUnicodeString ( random , 1 , 100 ) . toCharArray ( ) ; int offset = random . nextInt ( charArray . length ) ; int length = ( charArray . length ) - offset ; String str = new String ( charArray , offset , length ) ; <START_BUG> ref . copy ( charArray , offset , length ) ; <END_BUG> assertEquals ( str , ref . toString ( ) ) ; } } }

Fix:
ref . copyChars ( charArray , offset , length ) ;
Buggy code:
@ RunWith ( BMUnitRunner . class ) public class OperationSequencesTestCase extends OperationTestCaseBase { @ Test public void testCacheContainerAddRemoveAddSequence ( ) throws Exception { } @ Test public void testCacheContainerRemoveRemoveSequence ( ) throws Exception { } @ Test <START_BUG> @ BMRule ( name = "Test<seq2seq4repair_space>remove<seq2seq4repair_space>rollback<seq2seq4repair_space>operation" , targetClass = "org.jboss.as.clustering.infinispan.subsystem.CacheContainerRemoveHandler" , targetMethod = "removeExistingCacheServices" , targetLocation = "AT<seq2seq4repair_space>ENTRY" , action = "$1.setRollbackOnly()" ) <END_BUG> public void testCacheContainerRemoveRollback ( ) throws Exception { String subsystemXml = getSubsystemXml ( ) ; KernelServices servicesA = createKernelServicesBuilder ( null ) . setSubsystemXml ( subsystemXml ) . build ( ) ; ModelNode addContainerOp = getCacheContainerAddOperation ( "maximal2" ) ; ModelNode removeContainerOp = getCacheContainerRemoveOperation ( "maximal2" ) ; ModelNode addCacheOp = getCacheAddOperation ( "maximal2" , LOCAL_CACHE , "fred" ) ; ModelNode result = servicesA . executeOperation ( addContainerOp ) ; Assert . assertEquals ( SUCCESS , result . get ( OUTCOME ) . asString ( ) ) ; result = servicesA . executeOperation ( addCacheOp ) ; Assert . assertEquals ( SUCCESS , result . get ( OUTCOME ) . asString ( ) ) ; result = servicesA . executeOperation ( removeContainerOp ) ; Assert . assertEquals ( FAILED , result . get ( OUTCOME ) . asString ( ) ) ; ServiceName containerServiceName = EmbeddedCacheManagerService . getServiceName ( "maximal2" ) ; ServiceName cacheConfigurationServiceName = CacheConfigurationService . getServiceName ( "maximal2" , "fred" ) ; ServiceName cacheServiceName = CacheService . getServiceName ( "maximal2" , "fred" ) ; Assert . assertNotNull ( "cache<seq2seq4repair_space>container<seq2seq4repair_space>service<seq2seq4repair_space>not<seq2seq4repair_space>installed" , servicesA . getContainer ( ) . getService ( containerServiceName ) ) ; Assert . assertNotNull ( "cache<seq2seq4repair_space>configuration<seq2seq4repair_space>service<seq2seq4repair_space>not<seq2seq4repair_space>installed" , servicesA . getContainer ( ) . getService ( cacheConfigurationServiceName ) ) ; Assert . assertNotNull ( "cache<seq2seq4repair_space>service<seq2seq4repair_space>not<seq2seq4repair_space>installed" , servicesA . getContainer ( ) . getService ( cacheServiceName ) ) ; } @ Test public void testLocalCacheAddRemoveAddSequence ( ) throws Exception { } @ Test public void testLocalCacheRemoveRemoveSequence ( ) throws Exception { } }

Fix:
@ BMRule ( name = "Test<seq2seq4repair_space>remove<seq2seq4repair_space>rollback<seq2seq4repair_space>operation" , targetClass = "org.jboss.as.clustering.infinispan.subsystem.CacheContainerRemove" , targetMethod = "removeExistingCacheServices" , targetLocation = "AT<seq2seq4repair_space>ENTRY" , action = "$1.setRollbackOnly()" )
Buggy code:
public abstract class AbstractMethodDeclaration extends AstNode implements ReferenceContext , ProblemSeverities { public MethodScope scope ; public char [ ] selector ; public int declarationSourceStart ; public int declarationSourceEnd ; public int modifiers ; public int modifiersSourceStart ; public Argument [ ] arguments ; public TypeReference [ ] thrownExceptions ; public Statement [ ] statements ; public int explicitDeclarations ; public MethodBinding binding ; public boolean ignoreFurtherInvestigation = false ; public boolean needFreeReturn = false ; public Annotation annotation ; public int bodyStart ; public int bodyEnd = - 1 ; public CompilationResult compilationResult ; public boolean errorInSignature = false ; AbstractMethodDeclaration ( CompilationResult compilationResult ) { } public void abort ( int abortLevel ) { } public abstract void analyseCode ( ClassScope classScope , InitializationFlowContext initializationContext , FlowInfo info ) { } public void bindArguments ( ) { } public void bindThrownExceptions ( ) { } public CompilationResult compilationResult ( ) { } public void generateCode ( ClassScope classScope , ClassFile classFile ) { } private void generateCode ( ClassFile classFile ) { } private void checkArgumentsSize ( ) { } public boolean hasErrors ( ) { } public boolean isAbstract ( ) { } public boolean isClinit ( ) { } public boolean isConstructor ( ) { } public boolean isDefaultConstructor ( ) { } public boolean isInitializationMethod ( ) { } public boolean isNative ( ) { } public boolean isStatic ( ) { } public abstract void parseStatements ( Parser parser , CompilationUnitDeclaration unit ) { } public StringBuffer print ( int tab , StringBuffer output ) { } public StringBuffer printBody ( int indent , StringBuffer output ) { } public StringBuffer printReturnType ( int indent , StringBuffer output ) { } public void resolve ( ClassScope upperScope ) { } public void resolveAnnotation ( ) { if ( ( this . binding ) == null ) return ; if ( ( this . annotation ) != null ) { this . annotation . resolve ( this . scope ) ; return ; } if ( this . binding . isPublic ( ) ) { <START_BUG> this . scope . problemReporter ( ) . annotationMissingForPublic ( this . sourceStart , this . sourceEnd ) ; <END_BUG> } } public void resolveStatements ( ) { } public void tagAsHavingErrors ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , ClassScope classScope ) { } }

Fix:
this . scope . problemReporter ( ) . annotationMissing ( this . sourceStart , this . sourceEnd ) ;
Buggy code:
public class CameraActivity extends Fragment { public interface CameraPreviewListener { public void onPictureTaken ( String originalPicturePath , String previewPicturePath ) { } } private CameraActivity . CameraPreviewListener eventListener ; private static final String TAG = "CameraPreview" ; public FrameLayout mainLayout ; public FrameLayout frameContainerLayout ; private Preview mPreview ; private boolean canTakePicture = true ; private View view ; private Parameters cameraParameters ; private Camera mCamera ; private int numberOfCameras ; private int cameraCurrentlyLocked ; private int defaultCameraId ; public String defaultCamera ; public boolean tapToTakePicture ; public boolean dragEnabled ; public int width ; public int height ; public int x ; public int y ; public void setEventListener ( CameraActivity . CameraPreviewListener listener ) { } private String appResourcesPackage ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } public void setRect ( int x , int y , int width , int height ) { } private void createCameraPreview ( ) { } private void setDefaultCameraId ( ) { } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } public Camera getCamera ( ) { } public void switchCamera ( ) { } public void setCameraParameters ( Camera . Parameters params ) { } public boolean hasFrontCamera ( ) { } public Bitmap cropBitmap ( Bitmap bitmap , Rect rect ) { } public void takePicture ( final double maxWidth , final double maxHeight ) { } private void processPicture ( Bitmap bitmap ) { ByteArrayOutputStream jpeg_data = new ByteArrayOutputStream ( ) ; <START_BUG> int jpegCompressFormat = 0 ; <END_BUG> int mQuality = 90 ; try { if ( bitmap . compress ( jpegCompressFormat , mQuality , jpeg_data ) ) { byte [ ] code = jpeg_data . toByteArray ( ) ; byte [ ] output = Base64 . encode ( code , NO_WRAP ) ; String js_out = new String ( output ) ; eventListener . onPictureTaken ( js_out ) ; js_out = null ; output = null ; code = null ; } } catch ( Exception e ) { this . failPicture ( "Error<seq2seq4repair_space>compressing<seq2seq4repair_space>image." ) ; } jpeg_data = null ; } private void generatePictureFromView ( final Bitmap originalPicture , final Bitmap picture ) { } private File getOutputMediaFile ( String suffix ) { } private File storeImage ( Bitmap image , String suffix ) { } public int calculateInSampleSize ( BitmapFactory . Options options , int reqWidth , int reqHeight ) { } private Bitmap loadBitmapFromView ( View v ) { } @ Override public void onDestroy ( ) { } public void printPreviewSize ( String from ) { } }

Fix:
CompressFormat compressFormat = CompressFormat . JPEG ;
Buggy code:
public class Sash extends Control { boolean dragging ; int startX ; int startY ; int lastX ; int lastY ; static final int INCREMENT = 1 ; static final int PAGE_INCREMENT = 9 ; public Sash ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } int callWindowProc ( int hwnd , int msg , int wParam , int lParam ) { } void createHandle ( ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void drawBand ( int x , int y , int width , int height ) { } public void removeSelectionListener ( SelectionListener listener ) { } TCHAR windowClass ( ) { } int windowProc ( ) { } LRESULT WM_ERASEBKGND ( int wParam , int lParam ) { <START_BUG> LRESULT result = super . WM_ERASEBKGND ( wParam , lParam ) ; <END_BUG> drawBackground ( wParam ) ; return LRESULT . ONE ; } LRESULT WM_KEYDOWN ( int wParam , int lParam ) { } LRESULT WM_GETDLGCODE ( int wParam , int lParam ) { } LRESULT WM_LBUTTONDOWN ( int wParam , int lParam ) { } LRESULT WM_LBUTTONUP ( int wParam , int lParam ) { } LRESULT WM_MOUSEMOVE ( int wParam , int lParam ) { } LRESULT WM_SETCURSOR ( int wParam , int lParam ) { } }

Fix:
super . WM_ERASEBKGND ( wParam , lParam ) ;
Buggy code:
@ Controller @ RequestMapping ( "//auth" ) public class AuthenticationController { @ Autowired private UserService userService ; @ Autowired private VelocityEngine velocityEngine ; @ Autowired protected AuthenticationProviderService authenticationManager ; @ Autowired SendGrid sendGridService ; @ RequestMapping ( value = "//login" , method = RequestMethod . GET ) public final String displayLoginform ( Model model , @ RequestParam ( value = "error" , required = false ) final String error ) { } @ RequestMapping ( value = "//register" , method = RequestMethod . POST ) public String userNew ( @ ModelAttribute ( "user" ) User user , BindingResult result , ModelMap model ) { } @ RequestMapping ( value = "//validate//{userId}" , method = RequestMethod . GET ) public String validate ( @ PathVariable Integer userId , @ RequestParam ( "t" ) String validationToken , ModelMap model ) { } @ RequestMapping ( value = "//validate" , method = RequestMethod . POST ) public String validate ( @ ModelAttribute User user , ModelMap model , HttpSession session ) { String view = "redirect://" ; try { Authentication token = authenticationManager . authenticate ( new org . springframework . security . authentication . UsernamePasswordAuthenticationToken ( user . getEmail ( ) , user . getPassword ( ) ) ) ; SecurityContextHolder . getContext ( ) . setAuthentication ( token ) ; model . addAttribute ( "display_name" , user . getUsername ( ) ) ; } catch ( BadCredentialsException e ) { model . addAttribute ( "validateUser" , user ) ; model . addAttribute ( "error" , "Username//Password<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>match." ) ; view = "auth//validation" ; } catch ( DisabledException e ) { User dbUser = userService . findByEmail ( user . getEmail ( ) ) ; if ( ! ( dbUser . getActivationCode ( ) . equalsIgnoreCase ( user . getActivationCode ( ) ) ) ) { model . addAttribute ( "information" , "Your<seq2seq4repair_space>token<seq2seq4repair_space>has<seq2seq4repair_space>expired,<seq2seq4repair_space>you<seq2seq4repair_space>can<seq2seq4repair_space>request<seq2seq4repair_space>new<seq2seq4repair_space>token<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>sent<seq2seq4repair_space>here." ) ; view = "auth//token_recovery" ; } else { dbUser . setEnabled ( 1 ) ; userService . updateUser ( dbUser ) ; Authentication token = authenticationManager . authenticate ( new org . springframework . security . authentication . UsernamePasswordAuthenticationToken ( user . getEmail ( ) , user . getPassword ( ) ) ) ; SecurityContextHolder . getContext ( ) . setAuthentication ( token ) ; <START_BUG> session . setAttribute ( "display_name" , user . getUsername ( ) ) ; <END_BUG> } } return view ; } @ RequestMapping ( value = "//token_recovery" , method = RequestMethod . POST ) public String tokenRecovery ( @ RequestParam ( value = "email" , required = false ) final String email , ModelMap model ) { } public String displayInformation ( ModelMap model , String info ) { } private void sendValidationEmail ( User user ) { } }

Fix:
session . setAttribute ( "display_name" , dbUser . getUsername ( ) ) ;
Buggy code:
public class Database { private static final Properties properties = new Properties ( ) ; private static final String GLOBALS_VERSION = ProductInfo . getProductVersion ( ) ; private static final Connection connection ; public static void write ( String key , String value ) { } public static String read ( String key ) { } public static String getVersion ( ) { } public static boolean isNodeExist ( String key ) { } public static void addToNode ( String value , Object ... subscripts ) { } public static String getNodeValue ( Object ... subscripts ) { } public static List < String > getAllSubscripts ( String ... subscripts ) { NodeReference nodeReference = Database . connection . createNodeReference ( "logs" ) ; List < String > result = new ArrayList < String > ( ) ; for ( String subscript : subscripts ) { nodeReference . appendSubscript ( subscript ) ; } String subscript = "" ; do { <START_BUG> subscript = nodeReference . nextSubscript ( subscript ) ; <END_BUG> if ( ( subscript . length ( ) ) > 0 ) result . add ( subscript ) ; } while ( ( subscript . length ( ) ) > 0 ) ; return result ; } public static void closeConnection ( ) { } }

Fix:
subscript = nodeReference . previousSubscript ( subscript ) ;
Buggy code:
public class WebPage extends Page implements IHeaderRenderer { private String bodyOnLoad ; protected WebPage ( ) { } protected WebPage ( final IModel model ) { } public String urlFor ( final String pageMapName , final Class pageClass , final PageParameters parameters ) { } public String urlFor ( final Component component , final Class listenerInterface ) { } public String urlFor ( final String path ) { } public String getMarkupType ( ) { } protected final WebRequestCycle getWebRequestCycle ( ) { } protected final BookmarkablePageLink homePageLink ( final String id ) { } private void appendPageMapName ( final StringBuffer buffer ) { } private StringBuffer urlPrefix ( final WebRequestCycle cycle ) { } public final void renderHeadSections ( final HtmlHeaderContainer container ) { } public String getBodyOnLoad ( ) { } public final void appendToBodyOnLoad ( final String onLoad ) { } protected void onEndRequest ( ) { final Component header = get ( HEADER_ID ) ; if ( header != null ) { <START_BUG> this . remove ( header . getId ( ) ) ; <END_BUG> } super . onEndRequest ( ) ; } }

Fix:
this . remove ( header ) ;
Buggy code:
public class ActionStoreModelToDB extends UMLAction { public static ActionStoreModelToDB SINGLETON = new ActionStoreModelToDB ( ) ; protected ActionStoreModelToDB ( ) { } public void actionPerformed ( ActionEvent e ) { DBWriter writer = new DBWriter ( ) ; if ( writer . hasConnection ( ) ) { <START_BUG> ProjectBrowser pb = ProjectBrowser . TheInstance ; <END_BUG> Project p = ProjectManager . getManager ( ) . getCurrentProject ( ) ; MNamespace nm = p . getCurrentNamespace ( ) ; if ( ! ( nm instanceof MModel ) ) { JOptionPane . showMessageDialog ( null , "Error" , "Current<seq2seq4repair_space>Namespace<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>Model" , JOptionPane . ERROR_MESSAGE ) ; return ; } writer . store ( ( ( MModel ) ( nm ) ) ) ; } } public boolean shouldBeEnabled ( ) { } }

Fix:
ProjectBrowser pb = ProjectBrowser . getInstance ( ) ;
Buggy code:
public class AddressbookFilter extends AbstractFilter { public AddressbookFilter ( ) { } public boolean process ( MessageFolder folder , Object uid ) throws Exception { Header header = folder . getHeaderFields ( uid , new String [ ] { "From" } ) ; String from = header . get ( "From" ) ; Address address = null ; try { address = AddressParser . parseAddress ( from ) ; } catch ( Exception ex ) { return false ; } <START_BUG> Folder addressbook = FolderFacade . getCollectedAddresses ( ) ; <END_BUG> if ( addressbook . exists ( address . getMailAddress ( ) ) ) return true ; addressbook = FolderFacade . getAddressbook ( 101 ) ; if ( addressbook . exists ( address . getMailAddress ( ) ) ) return true ; return false ; } public void setUp ( FilterCriteria f ) { } }

Fix:
AbstractFolder addressbook = FolderFacade . getCollectedAddresses ( ) ;
Buggy code:
public class PredictiveModelOptimizer { private static final Logger logger = LoggerFactory . getLogger ( PredictiveModelOptimizer . class ) ; private Map < String , ? extends FieldValueRecommender > valuesToTest ; private CrossValidator crossValidator ; private HashMap < String , Object > bestConfig ; private final int iterations ; protected PredictiveModelOptimizer ( Map < String , ? extends FieldValueRecommender > valuesToTest , CrossValidator crossValidator , int iterations ) { } public Map < String , Object > determineOptimalConfig ( ) { } private void updateBestConfig ( ) { } private void findBestValueForField ( String field ) { PredictiveModelOptimizer . FieldLosses losses = new PredictiveModelOptimizer . FieldLosses ( ) ; FieldValueRecommender fieldValueRecommender = valuesToTest . get ( field ) ; for ( Object value : fieldValueRecommender . getValues ( ) ) { bestConfig . put ( field , value ) ; losses . addFieldLoss ( value , crossValidator . getLossForModel ( bestConfig ) ) ; <START_BUG> if ( fieldValueRecommender . shouldContinue ( losses . getLosses ( ) ) ) <END_BUG> break ; } bestConfig . put ( field , losses . valueWithLowestLoss ( ) ) ; } private HashMap < String , Object > setBestConfigToFirstValues ( Map < String , ? extends FieldValueRecommender > config ) { } private HashMap < String , Object > copyOf ( final HashMap < String , Object > map ) { } public static class FieldLosses { private List < PredictiveModelOptimizer . FieldLoss > losses = new ArrayList < > ( ) ; public void add ( PredictiveModelOptimizer . FieldLoss fieldLoss ) { } public Object valueWithLowestLoss ( ) { } public void addFieldLoss ( Object fieldValue , double loss ) { } public List < Double > getLosses ( ) { } } private static class FieldLoss implements Comparable < PredictiveModelOptimizer . FieldLoss > { private final Object fieldValue ; private final double loss ; public FieldLoss ( Object fieldValue , double loss ) { } @ Override public int compareTo ( PredictiveModelOptimizer . FieldLoss o ) { } } }

Fix:
if ( ! ( fieldValueRecommender . shouldContinue ( losses . getLosses ( ) ) ) )
Buggy code:
public abstract class ThreadPoolMetricsHandler extends AbstractRuntimeOnlyHandler { private final List < AttributeDefinition > metrics ; private final ServiceName serviceNameBase ; protected ThreadPoolMetricsHandler ( List < AttributeDefinition > metrics , ServiceName serviceNameBase ) { } public void registerAttributes ( final ManagementResourceRegistration registration ) { } @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { } protected abstract void setResult ( OperationContext context , String attributeName , Service < ? > service ) throws OperationFailedException { } protected ServiceController < ? > getService ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final String name = Util . getNameFromAddress ( operation . require ( OP_ADDR ) ) ; <START_BUG> ServiceController < ? > controller = context . getServiceRegistry ( true ) . getService ( serviceNameBase . append ( name ) ) ; <END_BUG> if ( controller == null ) { throw MESSAGES . threadPoolServiceNotFoundForMetrics ( serviceNameBase . append ( name ) ) ; } return controller ; } }

Fix:
ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( serviceNameBase . append ( name ) ) ;
Buggy code:
@ Test ( suiteName = "Identity//Keystone" ) public class KeystoneTests extends AbstractTest { private static final String JSON_ROLES = "//identity//roles.json" ; private static final String JSON_ROLE = "//identity//member-role.json" ; private static final String JSON_USERS = "//identity//users.json" ; private static final String JSON_TENANTS = "//identity//tenants.json" ; private static final String JSON_TENANT = "//identity//tenant-admin.json" ; private static final String JSON_EXTENSIONS = "//identity//extensions.json" ; private static final String JSON_TENANT_USERS = "//identity//tenant-users.json" ; @ Test ( priority = Integer . MIN_VALUE ) public void authenticateTest ( ) throws Exception { } public void testAuthorizationFailure ( ) throws IOException { } public void rolesTest ( ) throws Exception { respondWith ( KeystoneTests . JSON_ROLES ) ; List < ? extends Role > roles = os ( ) . identity ( ) . roles ( ) . list ( ) ; assertEquals ( roles . size ( ) , 5 ) ; respondWith ( KeystoneTests . JSON_ROLES ) ; Role role = os ( ) . identity ( ) . roles ( ) . getByName ( "admin" ) ; assertEquals ( role . getName ( ) , "admin" ) ; respondWith ( KeystoneTests . JSON_ROLE ) ; <START_BUG> role = os ( ) . identity ( ) . roles ( ) . get ( "b8e55a37fc3748de887f165954448db5" ) ; <END_BUG> assertEquals ( role . getName ( ) , "Member" ) ; } public void usersTest ( ) throws Exception { } public void testRegionTwo ( ) throws Exception { } @ Test ( expectedExceptions = { RegionEndpointNotFoundException . class } ) public void testInvalidRegion ( ) throws Exception { } public void testAPIPatterns ( ) { } public void testTenants ( ) throws Exception { } public void testTenantUsers ( ) throws Exception { } public void testExtensions ( ) throws Exception { } @ Override protected Service service ( ) { } }

Fix:
role = os ( ) . identity ( ) . roles ( ) . get ( "b80f8d4e28b74188858b654cb1fccf7d" ) ;
Buggy code:
class ClassLoadingMXBeanAttributeHandler extends AbstractPlatformMBeanAttributeHandler { static final ClassLoadingMXBeanAttributeHandler INSTANCE = new ClassLoadingMXBeanAttributeHandler ( ) ; private ClassLoadingMXBeanAttributeHandler ( ) { } @ Override protected void executeReadAttribute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final String name = operation . require ( NAME ) . asString ( ) ; <START_BUG> if ( ( ( PlatformMBeanUtil . JVM_MAJOR_VERSION ) > 6 ) && ( OBJECT_NAME . getName ( ) . equals ( name ) ) ) { <END_BUG> context . getResult ( ) . set ( ManagementFactory . CLASS_LOADING_MXBEAN_NAME ) ; } else if ( TOTAL_LOADED_CLASS_COUNT . equals ( name ) ) { context . getResult ( ) . set ( ManagementFactory . getClassLoadingMXBean ( ) . getTotalLoadedClassCount ( ) ) ; } else if ( LOADED_CLASS_COUNT . equals ( name ) ) { context . getResult ( ) . set ( ManagementFactory . getClassLoadingMXBean ( ) . getLoadedClassCount ( ) ) ; } else if ( UNLOADED_CLASS_COUNT . equals ( name ) ) { context . getResult ( ) . set ( ManagementFactory . getClassLoadingMXBean ( ) . getUnloadedClassCount ( ) ) ; } else if ( VERBOSE . equals ( name ) ) { context . getResult ( ) . set ( ManagementFactory . getClassLoadingMXBean ( ) . isVerbose ( ) ) ; } else if ( ( ClassLoadingResourceDefinition . CLASSLOADING_METRICS . contains ( name ) ) || ( ClassLoadingResourceDefinition . CLASSLOADING_READ_WRITE_ATTRIBUTES . contains ( name ) ) ) { throw ROOT_LOGGER . badReadAttributeImpl ( name ) ; } else { throw unknownAttribute ( operation ) ; } } @ Override protected void executeWriteAttribute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } }

Fix:
if ( OBJECT_NAME . getName ( ) . equals ( name ) ) {