nus-yam/ex-repair huggingface dataset:
Buggy code:
public class PublisherSampler extends BaseJMSSampler implements TestListener { public static final String INPUT_FILE = "jms.input_file" ; public static final String RANDOM_PATH = "jms.random_path" ; public static final String TEXT_MSG = "jms.text_message" ; public static final String CONFIG_CHOICE = "jms.config_choice" ; public static final String MESSAGE_CHOICE = "jms.config_msg_type" ; private Publisher PUB = null ; private StringBuffer BUFFER = new StringBuffer ( ) ; private static FileServer FSERVER = FileServer . getFileServer ( ) ; private String file_contents = null ; static Logger log = LoggingManager . getLoggerForClass ( ) ; public PublisherSampler ( ) { } public void testStarted ( String test ) { } public void testEnded ( String test ) { } public void testEnded ( ) { } public void testStarted ( ) { } public void testIterationStart ( LoopIterationEvent event ) { } public synchronized void initClient ( ) { } public SampleResult sample ( Entry e ) { } public SampleResult sample ( ) { SampleResult result = new SampleResult ( ) ; result . setSampleLabel ( getName ( ) ) ; if ( ( this . PUB ) == null ) { this . initClient ( ) ; } int loop = this . getIterationCount ( ) ; if ( ( this . PUB ) != null ) { result . sampleStart ( ) ; for ( int idx = 0 ; idx < loop ; idx ++ ) { String tmsg = this . getMessageContent ( ) ; this . PUB . publish ( tmsg ) ; this . BUFFER . append ( tmsg ) ; } result . sampleEnd ( ) ; String content = this . BUFFER . toString ( ) ; <START_BUG> result . setBytes ( content . getBytes ( ) . length ) ; <END_BUG> result . setResponseCode ( "message<seq2seq4repair_space>published<seq2seq4repair_space>successfully" ) ; result . setResponseMessage ( ( loop + "<seq2seq4repair_space>messages<seq2seq4repair_space>published" ) ) ; result . setSuccessful ( true ) ; result . setResponseData ( content . getBytes ( ) ) ; result . setSampleCount ( loop ) ; this . BUFFER . setLength ( 0 ) ; } return result ; } public String getMessageContent ( ) { } public String getFileContent ( String path ) { } public void setConfigChoice ( String choice ) { } public String getConfigChoice ( ) { } public void setMessageChoice ( String choice ) { } public String getMessageChoice ( ) { } public void setInputFile ( String file ) { } public String getInputFile ( ) { } public void setRandomPath ( String path ) { } public String getRandomPath ( ) { } public void setTextMessage ( String message ) { } public String getTextMessage ( ) { } }

Fix:
result . setContentLength ( content . getBytes ( ) . length ) ;
Buggy code:
public class CSVFormatBuilderTest { private CSVFormatBuilder builder ; @ Before public void setUp ( ) throws Exception { <START_BUG> builder = new CSVFormatBuilder ( '+' , Character . valueOf ( '!' ) , null , Character . valueOf ( '#' ) , Character . valueOf ( '!' ) , true , true , Constants . CRLF , null ) ; <END_BUG> } @ Test public void testCommentStart ( ) { } @ Test public void testCopiedFormatIsEqualToOriginal ( ) { } @ Test public void testCopiedFormatWithChanges ( ) { } @ Test public void testDelimiter ( ) { } @ Test ( expected = IllegalStateException . class ) public void testDelimiterSameAsCommentStartThrowsException ( ) { } @ Test ( expected = IllegalStateException . class ) public void testDelimiterSameAsEscapeThrowsException ( ) { } @ Test public void testEscape ( ) { } @ Test ( expected = IllegalStateException . class ) public void testEscapeSameAsCommentStartThrowsException ( ) { } @ Test ( expected = IllegalStateException . class ) public void testEscapeSameAsCommentStartThrowsExceptionForWrapperType ( ) { } @ Test public void testHeaderReferenceCannotEscape ( ) { } @ Test public void testIgnoreEmptyLines ( ) { } @ Test public void testIgnoreSurroundingSpaces ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testNewFormatCRThrowsException ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testNewFormatLFThrowsException ( ) { } @ Test public void testQuoteChar ( ) { } @ Test ( expected = IllegalStateException . class ) public void testQuoteCharSameAsCommentStartThrowsException ( ) { } @ Test ( expected = IllegalStateException . class ) public void testQuoteCharSameAsCommentStartThrowsExceptionForWrapperType ( ) { } @ Test ( expected = IllegalStateException . class ) public void testQuoteCharSameAsDelimiterThrowsException ( ) { } @ Test public void testQuotePolicy ( ) { } @ Test ( expected = IllegalStateException . class ) public void testQuotePolicyNoneWithoutEscapeThrowsException ( ) { } @ Test public void testRecoardSeparator ( ) { } @ Test public void testRFC4180 ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testWithCommentStartCRThrowsException ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testWithDelimiterLFThrowsException ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testWithEscapeCRThrowsExceptions ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testWithQuoteLFThrowsException ( ) { } }

Fix:
builder = new CSVFormatBuilder ( '+' , Character . valueOf ( '!' ) , null , Character . valueOf ( '#' ) , Character . valueOf ( '!' ) , true , true , Constants . CRLF , Constants . EMPTY , null ) ;
Buggy code:
public interface EmployeeService { Employee findById ( int id ) { } Employee findByName ( String name ) { } Employee findBySalary ( double salary ) { } List < Employee > getAllEmployees ( ) { } <START_BUG> void createEmployee ( String name , double salary ) ; <END_BUG> void updateEmployee ( Employee empl ) { } void deleteEmployee ( Employee empl ) { } }

Fix:
Employee createEmployee ( String name , double salary ) ;
Buggy code:
public class AttachmentSelectionHandler extends SelectionHandler implements IconPanelSelectionListener { private Folder folder ; private Object messageUid ; private AttachmentView view ; private Integer [ ] address ; private boolean useLocalSelection ; public AttachmentSelectionHandler ( AttachmentView view ) { } public DefaultCommandReference [ ] getSelection ( ) { } public void setSelection ( DefaultCommandReference [ ] selection ) { <START_BUG> log . error ( "Not<seq2seq4repair_space>yet<seq2seq4repair_space>implemented!" ) ; <END_BUG> } public void setMessage ( Folder folder , Object messageUid ) { } public void selectionChanged ( int [ ] newselection ) { } public void setLocalReference ( FolderCommandReference [ ] r ) { } }

Fix:
log . severe ( "Not<seq2seq4repair_space>yet<seq2seq4repair_space>implemented!" ) ;
Buggy code:
public class JMDNSDiscoveryContainer extends AbstractDiscoveryContainerAdapter implements IDiscoveryService , ServiceListener , ServiceTypeListener { private static final String SCHEME_PROPERTY = "jmdns.ptcl" ; private static final String URI_PATH_PROPERTY = "jmdns.uripath" ; private static final String NAMING_AUTHORITY_PROPERTY = "jmdns.namingauthority" ; public static final int DEFAULT_REQUEST_TIMEOUT = 3000 ; private static int instanceCount = 0 ; private InetAddress intf = null ; JmDNS jmdns = null ; private ID targetID = null ; List serviceTypes = null ; boolean disposed = false ; Object lock = new Object ( ) ; SimpleFIFOQueue queue = null ; Thread notificationThread = null ; public JMDNSDiscoveryContainer ( InetAddress addr ) { } public ID getConnectedID ( ) { } public void dispose ( ) { } public void connect ( ID targetID1 , IConnectContext joinContext ) throws ContainerConnectException { } private void initializeQueue ( ) { } protected void handleRuntimeException ( Throwable t ) { } public void disconnect ( ) { } public IServiceInfo getServiceInfo ( IServiceID service ) { } public IServiceInfo [ ] getServices ( ) { } public IServiceInfo [ ] getServices ( IServiceTypeID type ) { } public IServiceTypeID [ ] getServiceTypes ( ) { } public void registerService ( IServiceInfo serviceInfo ) throws ECFException { } public void unregisterService ( IServiceInfo serviceInfo ) { } private void runInThread ( Runnable runnable ) { } private void logError ( String errorString ) { } public void serviceTypeAdded ( final ServiceEvent arg0 ) { } void fireTypeDiscovered ( final IServiceTypeID serviceType ) { } public void serviceAdded ( final ServiceEvent arg0 ) { <START_BUG> Trace . trace ( PLUGIN_ID , ( ( "serviceAdded(" + arg0 ) + ")" ) ) ; <END_BUG> runInThread ( new Runnable ( ) { public void run ( ) { JmDNS localJmdns = null ; synchronized ( lock ) { localJmdns = jmdns ; } if ( localJmdns != null ) { String serviceType = arg0 . getType ( ) ; String serviceName = arg0 . getName ( ) ; ServiceInfo info = localJmdns . getServiceInfo ( serviceType , serviceName ) ; IServiceInfo aServiceInfo = null ; try { aServiceInfo = createIServiceInfoFromServiceInfo ( info ) ; } catch ( Exception e ) { return ; } fireDiscovered ( aServiceInfo ) ; } } } ) ; } Collection getAllListeners ( IServiceTypeID serviceTypeID ) { } public void serviceRemoved ( final ServiceEvent arg0 ) { } void fireUndiscovered ( IServiceInfo serviceInfo ) { } public void serviceResolved ( final ServiceEvent arg0 ) { } void fireDiscovered ( IServiceInfo serviceInfo ) { } private void checkServiceInfo ( ServiceInfo serviceInfo ) throws ECFException { } private IServiceTypeID createServiceTypeID ( String type ) { } IServiceInfo createIServiceInfoFromServiceEvent ( final ServiceEvent event ) throws Exception { } IServiceInfo createIServiceInfoFromServiceInfo ( final ServiceInfo serviceInfo ) throws Exception { } ServiceID createServiceID ( String type , String name ) { } private ServiceInfo createServiceInfoFromIServiceInfo ( IServiceInfo serviceInfo ) { } }

Fix:
Trace . trace ( PLUGIN_ID , ( ( "serviceAdded(" + ( arg0 . getName ( ) ) ) + ")" ) ) ;
Buggy code:
abstract class ContextLoaderUtils { private static final Log logger = LogFactory . getLog ( ContextLoaderUtils . class ) ; private static final String STANDARD_DEFAULT_CONTEXT_LOADER_CLASS_NAME = "org.springframework.test.context.support.GenericXmlContextLoader" ; static List < ContextConfigurationAttributes > resolveContextConfigurationAttributes ( Class < ? > clazz ) { } static ContextLoader resolveContextLoader ( Class < ? > testClass , List < ContextConfigurationAttributes > configAttributesList , String defaultContextLoaderClassName ) { } @ SuppressWarnings ( "unchecked" ) static Class < ? extends ContextLoader > resolveContextLoaderClass ( Class < ? > testClass , List < ContextConfigurationAttributes > configAttributesList , String defaultContextLoaderClassName ) { } static String [ ] resolveActiveProfiles ( Class < ? > clazz ) { } static MergedContextConfiguration buildMergedContextConfiguration ( Class < ? > testClass , String defaultContextLoaderClassName ) { List < ContextConfigurationAttributes > configAttributesList = ContextLoaderUtils . resolveContextConfigurationAttributes ( testClass ) ; ContextLoader contextLoader = ContextLoaderUtils . resolveContextLoader ( testClass , configAttributesList , defaultContextLoaderClassName ) ; final List < String > locationsList = new ArrayList < String > ( ) ; final List < Class < ? > > classesList = new ArrayList < Class < ? > > ( ) ; for ( ContextConfigurationAttributes configAttributes : configAttributesList ) { if ( ContextLoaderUtils . logger . isTraceEnabled ( ) ) { ContextLoaderUtils . logger . trace ( String . format ( "Processing<seq2seq4repair_space>locations<seq2seq4repair_space>and<seq2seq4repair_space>classes<seq2seq4repair_space>for<seq2seq4repair_space>context<seq2seq4repair_space>configuration<seq2seq4repair_space>attributes<seq2seq4repair_space>[%s]" , configAttributes ) ) ; } if ( contextLoader instanceof SmartContextLoader ) { SmartContextLoader smartContextLoader = ( ( SmartContextLoader ) ( contextLoader ) ) ; <START_BUG> smartContextLoader . processContextConfigurationAttributes ( configAttributes ) ; <END_BUG> locationsList . addAll ( Arrays . asList ( configAttributes . getLocations ( ) ) ) ; classesList . addAll ( Arrays . asList ( configAttributes . getClasses ( ) ) ) ; } else { String [ ] processedLocations = contextLoader . processLocations ( configAttributes . getDeclaringClass ( ) , configAttributes . getLocations ( ) ) ; locationsList . addAll ( Arrays . asList ( processedLocations ) ) ; } } String [ ] locations = StringUtils . toStringArray ( locationsList ) ; Class < ? > [ ] classes = ClassUtils . toClassArray ( classesList ) ; String [ ] activeProfiles = ContextLoaderUtils . resolveActiveProfiles ( testClass ) ; return new MergedContextConfiguration ( testClass , locations , classes , activeProfiles , contextLoader ) ; } }

Fix:
smartContextLoader . processContextConfiguration ( configAttributes ) ;
Buggy code:
public class WebMarkupContainerWithAssociatedMarkup < T > extends WebMarkupContainer < T > { private static final Log log = LogFactory . getLog ( WebMarkupContainerWithAssociatedMarkup . class ) ; private static final long serialVersionUID = 1L ; private boolean checkedBody = false ; private boolean noMoreWicketHeadTagsAllowed = false ; private transient boolean headersInitialized ; public WebMarkupContainerWithAssociatedMarkup ( MarkupContainer parent , final String id ) { } public WebMarkupContainerWithAssociatedMarkup ( MarkupContainer parent , final String id , IModel < T > model ) { } @ Override public MarkupFragment getMarkupFragment ( final String id ) { } @ Override public void renderHead ( final IHeaderResponse response ) { } private void renderHead ( final IHeaderResponse response , final MarkupFragment fragment ) { final Page page = WebMarkupContainerWithAssociatedMarkup . getPage ( ) ; final HeaderContainer headerContainer = ( ( HeaderContainer ) ( page . get ( HEADER_ID ) ) ) ; fragment . visitChildren ( MarkupFragment . class , new MarkupFragment . IVisitor ( ) { private boolean foundBody = false ; public Object visit ( final MarkupElement element , final MarkupFragment parent ) { final MarkupFragment frag = ( ( MarkupFragment ) ( element ) ) ; final ComponentTag tag = frag . getTag ( ) ; if ( tag . isWicketHeadTag ( ) ) { if ( ( foundBody ) == true ) { throwMarkupException ( fragment , tag , "<wicket:head><seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>before<seq2seq4repair_space>the<seq2seq4repair_space><body>,<seq2seq4repair_space><wicket:panel><seq2seq4repair_space>...<seq2seq4repair_space>tag" ) ; } WicketHeadContainer header = newWicketHeaderContainer ( frag ) ; header . setEnable ( headerContainer . okToRender ( header ) ) ; <START_BUG> header . render ( new wicket . markup . MarkupStream ( frag ) ) ; <END_BUG> return CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER ; } else if ( tag . isBodyTag ( ) ) { foundBody = true ; if ( page instanceof WebPage ) { addBodyModifier ( ONLOAD , tag ) ; addBodyModifier ( ONUNLOAD , tag ) ; } } else if ( tag . isMajorWicketComponentTag ( ) ) { foundBody = true ; } return CONTINUE_TRAVERSAL ; } } ) ; } public WicketHeadContainer newWicketHeaderContainer ( final MarkupFragment fragment ) { } private void throwMarkupException ( final MarkupFragment parent , final MarkupElement tag , final String message ) { } private void addBodyModifier ( final String attribute , final ComponentTag tag ) { } }

Fix:
header . render ( ) ;
Buggy code:
public class GetAllThoughtApi extends BaseDBApi { private int mEventKey ; public GetAllThoughtApi ( Context context , int mEventKey ) { } public Thoughts exec ( ) { Cursor cursor = mDatabaseHelper . getReadableDatabase ( ) . query ( NAME , new String [ ] { EventThoughtRelationTable . THOUGHT_ID } , ( ( EventThoughtRelationTable . EVENT_ID ) + "=?" ) , new String [ ] { String . valueOf ( mEventKey ) } , null , null , null ) ; if ( ( cursor . getCount ( ) ) < 1 ) { <START_BUG> return null ; <END_BUG> } ArrayList < Integer > thoughtIds = new ArrayList < > ( ) ; cursor . moveToFirst ( ) ; do { int id = cursor . getInt ( cursor . getColumnIndex ( THOUGHT_ID ) ) ; thoughtIds . add ( id ) ; } while ( cursor . moveToNext ( ) ) ; cursor . close ( ) ; Thoughts ret = new Thoughts ( ) ; for ( int id : thoughtIds ) { cursor = mDatabaseHelper . getReadableDatabase ( ) . query ( ThoughtsTable . NAME , new String [ ] { ThoughtsTable . ID , ThoughtsTable . THOUGHT , ThoughtsTable . TIMESTAMP } , ( ( ThoughtsTable . ID ) + "=?" ) , new String [ ] { String . valueOf ( id ) } , null , null , null ) ; if ( ( cursor . getCount ( ) ) < 1 ) { continue ; } cursor . moveToFirst ( ) ; int key = ( ( int ) ( cursor . getLong ( cursor . getColumnIndex ( ID ) ) ) ) ; String thought = cursor . getString ( cursor . getColumnIndex ( THOUGHT ) ) ; long time = cursor . getLong ( cursor . getColumnIndex ( TIMESTAMP ) ) ; ret . add ( new Thoughts . Thought ( key , thought , time ) ) ; } return ret ; } }

Fix:
return new Thoughts ( ) ;
Buggy code:
public class ResourceUpdateListener implements IResourceChangeListener { private HashMap definitionsToNatures = new HashMap ( ) ; private HashMap projectsNaturesCache = new HashMap ( ) ; private Collection allNatures = new HashSet ( ) ; ResourceUpdateListener ( ) { } public void resourceChanged ( IResourceChangeEvent event ) { <START_BUG> if ( ( definitionsToNatures ) == null ) <END_BUG> return ; IResourceDelta [ ] deltas = event . getDelta ( ) . getAffectedChildren ( ) ; for ( int i = 0 ; i < ( deltas . length ) ; i ++ ) { if ( ( ( deltas [ i ] . getFlags ( ) ) | ( IResourceDelta . DESCRIPTION ) ) > 0 ) { IResource resource = deltas [ i ] . getResource ( ) ; if ( checkProjectFileUpdate ( deltas [ i ] ) ) WorkbenchPlugin . getDefault ( ) . getDecoratorManager ( ) . updateForValueChanged ( resource , getValidator ( ) ) ; } if ( ( ( deltas [ i ] . getFlags ( ) ) | ( IResourceDelta . REMOVED ) ) > 0 ) { projectsNaturesCache . remove ( deltas [ i ] . getResource ( ) ) ; } } } private ILabelUpdateValidator getValidator ( ) { } protected boolean naturesChanged ( String [ ] natures , String [ ] cachedNatures ) { } private Collection getAllNatures ( ) { } private boolean checkProjectFileUpdate ( IResourceDelta parentDelta ) { } void dispose ( ) { } void listenFor ( LightweightDecoratorDefinition definition , boolean isEnabled , String [ ] natureValues ) { } }

Fix:
if ( ( ( definitionsToNatures ) == null ) || ( ( event . getDelta ( ) ) == null ) )
Buggy code:
public class TestCustomNorms extends LuceneTestCase { final String floatTestField = "normsTestFloat" ; final String exceptionTestField = "normsTestExcp" ; public void testFloatNorms ( ) throws IOException { Directory dir = newDirectory ( ) ; MockAnalyzer analyzer = new MockAnalyzer ( random ( ) ) ; analyzer . setMaxTokenLength ( TestUtil . nextInt ( random ( ) , 1 , MAX_TERM_LENGTH ) ) ; IndexWriterConfig config = newIndexWriterConfig ( TEST_VERSION_CURRENT , analyzer ) ; Similarity provider = new TestCustomNorms . MySimProvider ( ) ; config . setSimilarity ( provider ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , dir , config ) ; final LineFileDocs docs = new LineFileDocs ( random ( ) ) ; int num = atLeast ( 100 ) ; for ( int i = 0 ; i < num ; i ++ ) { Document doc = docs . nextDoc ( ) ; float nextFloat = random ( ) . nextFloat ( ) ; Field f = new org . apache . lucene . document . TextField ( floatTestField , ( "" + nextFloat ) , Store . YES ) ; f . setBoost ( nextFloat ) ; doc . add ( f ) ; writer . addDocument ( doc ) ; doc . removeField ( floatTestField ) ; if ( rarely ( ) ) { writer . commit ( ) ; } } writer . commit ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> AtomicReader open = SlowCompositeReaderWrapper . wrap ( DirectoryReader . open ( dir ) ) ; NumericDocValues norms = open . getNormValues ( floatTestField ) ; assertNotNull ( norms ) ; for ( int i = 0 ; i < ( open . maxDoc ( ) ) ; i ++ ) { StoredDocument document = open . document ( i ) ; float expected = Float . parseFloat ( document . get ( floatTestField ) ) ; assertEquals ( expected , Float . intBitsToFloat ( ( ( int ) ( norms . get ( i ) ) ) ) , 0.0F ) ; } open . close ( ) ; dir . close ( ) ; docs . close ( ) ; } public class MySimProvider extends PerFieldSimilarityWrapper { Similarity delegate = new DefaultSimilarity ( ) ; @ Override public float queryNorm ( float sumOfSquaredWeights ) { } @ Override public Similarity get ( String field ) { } @ Override public float coord ( int overlap , int maxOverlap ) { } } public static class FloatEncodingBoostSimilarity extends Similarity { @ Override public long computeNorm ( FieldInvertState state ) { } @ Override public SimWeight computeWeight ( float queryBoost , CollectionStatistics collectionStats , TermStatistics ... termStats ) { } @ Override public SimScorer simScorer ( SimWeight weight , AtomicReaderContext context ) throws IOException { } } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public abstract class Logger { public boolean isOpen ( ) { } public static void log ( String logName , String message , int verbosityLevel ) { } public static void log ( String logName , String message ) { } public final void log ( String message , int verbosityLevel ) { } public final void log ( String message ) { } public final void log ( String message , Throwable t , int verbosityLevel ) { } public boolean matchVerbosityLevel ( int verbosityLevel ) { } protected abstract void realLog ( String message ) { } protected abstract void realLog ( String message , Throwable t ) { } public abstract void flush ( ) { } public synchronized void close ( ) { } public String getName ( ) { } public void setName ( String name ) { } public void setPath ( String path ) { if ( ( File . separatorChar ) == '//' ) this . path = path . replace ( '\\' , '//' ) ; else <START_BUG> if ( File . separatorChar = '\\' ) <END_BUG> this . path = path . replace ( '//' , '\\' ) ; } public String getPath ( ) { } public void open ( ) { } public static final int FATAL = Integer . MIN_VALUE ; public static final int ERROR = 1 ; public static final int WARNING = 2 ; public static final int INFORMATION = 3 ; public static final int DEBUG = 4 ; public void setVerbosityLevel ( String level ) { } public void setVerbosityLevel ( int level ) { } public int getVerbosityLevel ( ) { } public void setTimestamp ( String value ) { } public boolean isTimestamp ( ) { } public static void setDefaultSink ( Writer w ) { } public static Logger getLogger ( String name ) { } public static Enumeration getLoggerNames ( ) { } public static void putLogger ( Logger logger ) { } public static void removeLogger ( Logger logger ) { } public void setCustomOutput ( String value ) { } protected boolean custom ; protected Writer sink = Logger . defaultSink ; String path ; protected String name ; protected static Writer defaultSink = new PrintWriter ( System . err ) ; protected static Hashtable loggers = new Hashtable ( 5 ) ; private int level = Logger . WARNING ; protected boolean timeStamp = true ; }

Fix:
if ( ( File . separatorChar ) == '\\' )
Buggy code:
public class ReleasePaneData { Color color ; int number ; public final int MAX_POSSIBLE = 6 ; public final int MIN_POSSIBLE = 1 ; public ReleasePaneData ( ) { } public void incrementNumber ( ) { this . number += 1 ; <START_BUG> if ( ( this . number ) >= ( this . MAX_POSSIBLE ) ) { <END_BUG> this . number = this . MIN_POSSIBLE ; } } public void changeColor ( ) { } public ColoredSetItem generateSetItem ( ) { } }

Fix:
if ( ( this . number ) > ( this . MAX_POSSIBLE ) ) {
Buggy code:
@ SuppressWarnings ( "serial" ) class PNonTransState extends PCState { private static final Localizer _loc = Localizer . forPackage ( PNonTransState . class ) ; void initialize ( StateManagerImpl context ) { context . setDirty ( false ) ; context . clearSavedFields ( ) ; <START_BUG> context . proxyFields ( true , true ) ; <END_BUG> } PCState delete ( StateManagerImpl context ) { } PCState transactional ( StateManagerImpl context ) { } PCState release ( StateManagerImpl context ) { } PCState evict ( StateManagerImpl context ) { } PCState beforeRead ( StateManagerImpl context , int field ) { } PCState beforeWrite ( StateManagerImpl context , int field , boolean mutate ) { } PCState beforeOptimisticWrite ( StateManagerImpl context , int field , boolean mutate ) { } private PCState beforeWrite ( StateManagerImpl context , int field , boolean mutate , boolean optimistic ) { } PCState beforeNontransactionalWrite ( StateManagerImpl context , int field , boolean mutate ) { } boolean isPersistent ( ) { } public String toString ( ) { } }

Fix:
context . proxyFields ( true , false ) ;
Buggy code:
public class DecodeInterceptor extends BaseInterceptor { private String defaultEncoding = null ; private boolean useSessionEncoding = true ; private String charsetAttribute = "charset" ; private String charsetURIAttribute = ";charset=" ; private int encodingInfoNote ; private int decodedNote ; private int encodingSourceNote ; private int sessionEncodingNote ; private boolean normalize = true ; private boolean safe = true ; private boolean saveOriginal = false ; public DecodeInterceptor ( ) { } public void setDefaultEncoding ( String s ) { } public void setUseSessionEncoding ( boolean b ) { } public void setCharsetAttribute ( String s ) { } public void setNormalize ( boolean b ) { } public void setSaveOriginal ( boolean b ) { } public void setSafe ( boolean b ) { } public void engineInit ( ContextManager cm ) throws TomcatException { } private void normalizePath ( MessageBytes pathMB ) { } private boolean normalize ( ByteChunk bc ) { } private String normalize ( String str ) { } private boolean isSafeURI ( MessageBytes pathMB ) { } public int postReadRequest ( Request req ) { } public int beforeBody ( Request req , Response res ) { if ( useSessionEncoding ) { ServerSession sess = req . getSession ( false ) ; if ( sess != null ) { <START_BUG> String charset = res . getCharacterEncoding ( ) ; <END_BUG> if ( charset != null ) { sess . setNote ( sessionEncodingNote , charset ) ; if ( ( debug ) > 0 ) log ( ( "Setting<seq2seq4repair_space>per<seq2seq4repair_space>session<seq2seq4repair_space>encoding<seq2seq4repair_space>" + charset ) ) ; } } } return DECLINED ; } public Object getInfo ( Context ctx , Request req , int info , String k ) { } public int setInfo ( Context ctx , Request req , int info , String k , Object v ) { } private void dumpHeaders ( MimeHeaders mh ) { } private static final byte [ ] HTTP = new byte [ ] { ( ( byte ) ( 'h' ) ) , ( ( byte ) ( 't' ) ) , ( ( byte ) ( 't' ) ) , ( ( byte ) ( 'p' ) ) , ( ( byte ) ( ':' ) ) } ; private static final byte [ ] HTTPS = new byte [ ] { ( ( byte ) ( 'h' ) ) , ( ( byte ) ( 't' ) ) , ( ( byte ) ( 't' ) ) , ( ( byte ) ( 'p' ) ) , ( ( byte ) ( 's' ) ) , ( ( byte ) ( ':' ) ) } ; }

Fix:
String charset = res . getCharacterEncoding ( false ) ;
Buggy code:
public class BayesianChoice implements Serializable , Comparable < BayesianChoice > { private final String label ; final double min ; final double max ; public BayesianChoice ( String label , double min , double max ) { } public BayesianChoice ( String label , int index ) { } public String getLabel ( ) { } public double getMin ( ) { } public double getMax ( ) { } public boolean isIndex ( ) { } public String toString ( ) { } public String toFullString ( ) { } @ Override public int compareTo ( BayesianChoice other ) { <START_BUG> if ( ( this . min ) > ( other . min ) ) { <END_BUG> return - 1 ; } else { return 1 ; } } }

Fix:
if ( ( this . max ) < ( other . max ) ) {
Buggy code:
class AttributeTransformationDescription { final String name ; final List < RejectAttributeChecker > checks ; final String newName ; final DiscardAttributeChecker discardChecker ; final AttributeConverter converter ; final AttributeConverter addConverter ; AttributeTransformationDescription ( String name , List < RejectAttributeChecker > checks , String newName , DiscardAttributeChecker discardChecker , AttributeConverter converter , AttributeConverter addConverter ) { } boolean shouldDiscard ( ModelNode attributeValue , TransformationRule . AbstractTransformationContext context ) { if ( ( discardChecker ) == null ) { return false ; } if ( ( discardChecker . isDiscardUndefined ( ) ) && ( ! ( attributeValue . isDefined ( ) ) ) ) { return true ; } <START_BUG> if ( ( ! ( discardChecker . isAllowExpressions ( ) ) ) && ( ( attributeValue . getType ( ) ) == ( ModelType . EXPRESSION ) ) ) { <END_BUG> return false ; } if ( discardChecker . isValueDiscardable ( name , attributeValue , context . getContext ( ) ) ) { return true ; } return false ; } String getNewName ( ) { } boolean checkAttributeValueIsValid ( ModelNode attributeValue , TransformationRule . AbstractTransformationContext context ) { } void convertValue ( PathAddress address , ModelNode attributeValue , TransformationRule . AbstractTransformationContext context ) { } ModelNode addAttribute ( PathAddress address , TransformationRule . AbstractTransformationContext context ) { } }

Fix:
if ( ( ! ( discardChecker . isDiscardExpressions ( ) ) ) && ( ( attributeValue . getType ( ) ) == ( ModelType . EXPRESSION ) ) ) {
Buggy code:
public class SharedCacheResourceDefinition extends ClusteredCacheResourceDefinition { public SharedCacheResourceDefinition ( PathElement pathElement , ResourceDescriptionResolver descriptionResolver , AbstractAddStepHandler addHandler , OperationStepHandler removeHandler , ResolvePathHandler resolvePathHandler , boolean runtimeRegistration ) { } @ Override public void registerChildren ( ManagementResourceRegistration registration ) { super . registerChildren ( registration ) ; registration . registerSubModel ( new StateTransferResourceDefinition ( ) ) ; <START_BUG> registration . registerSubModel ( new BackupSiteResource ( isRuntimeRegistration ( ) ) ) ; <END_BUG> registration . registerSubModel ( new BackupForResourceDefinition ( ) ) ; } }

Fix:
registration . registerSubModel ( new BackupSiteResourceDefinition ( this . runtimeRegistration ) ) ;
Buggy code:
public class SpeedController implements SpeedInterface { @ FXML AnchorPane speedPane ; @ FXML Text speedText ; public void initialize ( ) { } public void updateVehicleSpeed ( int value , Timestamp timestamp ) { <START_BUG> speedText . setText ( ( ( String . valueOf ( value ) ) + "<seq2seq4repair_space>km//h" ) ) ; <END_BUG> } }

Fix:
speedText . setText ( String . valueOf ( value ) ) ;
Buggy code:
@ WebServlet ( name = "Users" , urlPatterns = "//users.sec" ) public class Users extends HttpServlet { protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { response . setContentType ( "text//html;charset=utf-8" ) ; UserService userService = new UserServiceGenericBasedImpl ( ) ; List < UserDTO > userDTOList = userService . getAllUsers ( ) ; request . setAttribute ( "userList" , userDTOList ) ; <START_BUG> request . getRequestDispatcher ( "WEB-INF//pages//users.jsp" ) . forward ( request , response ) ; <END_BUG> } @ Override protected void doPost ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { } }

Fix:
request . getRequestDispatcher ( "//WEB-INF//pages//users.jsp" ) . forward ( request , response ) ;
Buggy code:
public class CompactionIterator extends ReducingIterator < SSTableIdentityIterator , AbstractCompactedRow > implements Closeable , CompactionInfo . Holder { private static Logger logger = LoggerFactory . getLogger ( CompactionIterator . class ) ; public static final int FILE_BUFFER_SIZE = 1024 * 1024 ; protected final List < SSTableIdentityIterator > rows = new ArrayList < SSTableIdentityIterator > ( ) ; protected final CompactionType type ; protected final CompactionController controller ; private long totalBytes ; private long bytesRead ; private long row ; private long bytesAtLastDelay ; private long timeAtLastDelay ; private int targetBytesPerMS = - 1 ; public CompactionIterator ( CompactionType type , Iterable < SSTableReader > sstables , CompactionController controller ) throws IOException { } @ SuppressWarnings ( "unchecked" ) protected CompactionIterator ( CompactionType type , Iterator iter , CompactionController controller ) { } @ SuppressWarnings ( "unchecked" ) protected static CollatingIterator getCollatingIterator ( Iterable < SSTableReader > sstables ) throws IOException { } public CompactionInfo getCompactionInfo ( ) { } @ Override protected boolean isEqual ( SSTableIdentityIterator o1 , SSTableIdentityIterator o2 ) { } public void reduce ( SSTableIdentityIterator current ) { } protected AbstractCompactedRow getReduced ( ) { assert ( rows . size ( ) ) > 0 ; try { <START_BUG> AbstractCompactedRow compactedRow = controller . getCompactedRow ( rows ) ; <END_BUG> if ( compactedRow . isEmpty ( ) ) { controller . invalidateCachedRow ( compactedRow . key ) ; return null ; } controller . removeDeletedInCache ( compactedRow . key ) ; return compactedRow ; } finally { rows . clear ( ) ; if ( ( ( ( row ) ++ ) % ( controller . getThrottleResolution ( ) ) ) == 0 ) { bytesRead = 0 ; for ( SSTableScanner scanner : getScanners ( ) ) bytesRead += scanner . getFilePointer ( ) ; throttle ( ) ; } } } private void throttle ( ) { } public void close ( ) throws IOException { } protected Iterable < SSTableScanner > getScanners ( ) { } public String toString ( ) { } }

Fix:
AbstractCompactedRow compactedRow = controller . getCompactedRow ( new ArrayList < SSTableIdentityIterator > ( rows ) ) ;
Buggy code:
public class AngelsteelToolHelper { public static final int MAX_DEGREE = 11 ; public static final String NBT_BUFF_ARRAY_NAME = "angelbuffs" ; public static final ToolMaterial [ ] materials = new Item . ToolMaterial [ AngelsteelToolHelper . MAX_DEGREE ] ; public static ArrayList < Object > getDegreeList ( ) { } public static int [ ] getRandomBuffSet ( int lvl ) { } public static void writeToNBT ( NBTTagCompound nbtTagCompound , int [ ] buffs ) { } public static int [ ] readFromNBT ( NBTTagCompound nbtTagCompound ) { } public static boolean hasValidBuffs ( ItemStack stack ) { } public static NBTTagCompound getRandomBuffCompound ( int lvl ) { } public static boolean isAngelsteelTool ( Item item ) { } public static void initMaterials ( ) { for ( int i = 0 ; i < ( AngelsteelToolHelper . MAX_DEGREE ) ; i ++ ) { <START_BUG> AngelsteelToolHelper . materials [ i ] = EnumHelper . addToolMaterial ( ( "ANGELSTEEL" + i ) , 1 , 10 , ( ( float ) ( 5.0F * ( Math . pow ( 1.15 , i ) ) ) ) , ( ( float ) ( 3.0F * ( Math . pow ( 1.1 , i ) ) ) ) , 10 ) ; <END_BUG> } } }

Fix:
AngelsteelToolHelper . materials [ i ] = EnumHelper . addToolMaterial ( ( "ANGELSTEEL" + i ) , 5 , 10 , ( ( float ) ( 5.0F * ( Math . pow ( 1.15 , i ) ) ) ) , ( ( float ) ( 3.0F * ( Math . pow ( 1.1 , i ) ) ) ) , 10 ) ;
Buggy code:
public class MBeanClientInterceptorTests extends AbstractMBeanServerTests { protected static final String OBJECT_NAME = "spring:test=proxy" ; protected JmxTestBean target ; protected boolean runTests = true ; @ Override public void onSetUp ( ) throws Exception { target = new JmxTestBean ( ) ; target . setAge ( 100 ) ; target . setName ( "Rob<seq2seq4repair_space>Harrop" ) ; MBeanExporter adapter = new MBeanExporter ( ) ; Map < String , Object > beans = new HashMap < String , Object > ( ) ; beans . put ( MBeanClientInterceptorTests . OBJECT_NAME , target ) ; adapter . setServer ( getServer ( ) ) ; adapter . setBeans ( beans ) ; adapter . setAssembler ( new MBeanClientInterceptorTests . ProxyTestAssembler ( ) ) ; <START_BUG> adapter . afterPropertiesSet ( ) ; <END_BUG> } protected MBeanServerConnection getServerConnection ( ) throws Exception { } protected IJmxTestBean getProxy ( ) throws Exception { } @ Test public void testProxyClassIsDifferent ( ) throws Exception { } @ Test public void testDifferentProxiesSameClass ( ) throws Exception { } @ Test public void testGetAttributeValue ( ) throws Exception { } @ Test public void testSetAttributeValue ( ) throws Exception { } @ Test public void testSetAttributeValueWithRuntimeException ( ) throws Exception { } @ Test public void testSetAttributeValueWithCheckedException ( ) throws Exception { } @ Test public void testSetAttributeValueWithIOException ( ) throws Exception { } @ Test public void testSetReadOnlyAttribute ( ) throws Exception { } @ Test public void testInvokeNoArgs ( ) throws Exception { } @ Test public void testInvokeArgs ( ) throws Exception { } @ Test public void testInvokeUnexposedMethodWithException ( ) throws Exception { } @ Test public void testTestLazyConnectionToRemote ( ) throws Exception { } private static class ProxyTestAssembler extends AbstractReflectiveMBeanInfoAssembler { @ Override protected boolean includeReadAttribute ( Method method , String beanKey ) { } @ Override protected boolean includeWriteAttribute ( Method method , String beanKey ) { } @ Override protected boolean includeOperation ( Method method , String beanKey ) { } @ SuppressWarnings ( "unused" ) protected String getOperationDescription ( Method method ) { } @ SuppressWarnings ( "unused" ) protected String getAttributeDescription ( PropertyDescriptor propertyDescriptor ) { } @ SuppressWarnings ( "unused" ) protected void populateAttributeDescriptor ( Descriptor descriptor , Method getter , Method setter ) { } @ SuppressWarnings ( "unused" ) protected void populateOperationDescriptor ( Descriptor descriptor , Method method ) { } @ SuppressWarnings ( { "unused" , "rawtypes" } ) protected String getDescription ( String beanKey , Class beanClass ) { } @ SuppressWarnings ( { "unused" , "rawtypes" } ) protected void populateMBeanDescriptor ( Descriptor mbeanDescriptor , String beanKey , Class beanClass ) { } } }

Fix:
start ( adapter ) ;
Buggy code:
public class AdditionalInitialization extends AdditionalParsers { protected Type getType ( ) { } protected boolean isValidateOperations ( ) { <START_BUG> return false ; <END_BUG> } protected ControllerInitializer createControllerInitializer ( ) { } protected void setupController ( ControllerInitializer controllerInitializer ) { } protected void addExtraServices ( ServiceTarget target ) { } protected void initializeExtraSubystemsAndModel ( ExtensionContext extensionContext , Resource rootResource , ManagementResourceRegistration rootRegistration ) { } }

Fix:
return true ;
Buggy code:
final class DPServices extends IDroidPlannerServices . Stub { private static final String TAG = DPServices . class . getSimpleName ( ) ; private final WeakReference < DroidPlannerService > serviceRef ; DPServices ( DroidPlannerService service ) { } private DroidPlannerService getService ( ) { } @ Override public int getServiceVersionCode ( ) throws RemoteException { } @ Override public int getApiVersionCode ( ) throws RemoteException { } @ Override public IDroneApi registerDroneApi ( IApiListener listener , String appId ) throws RemoteException { } @ Override public Bundle [ ] getConnectedApps ( String requesterId ) throws RemoteException { <START_BUG> Log . d ( DPServices . TAG , ( "List<seq2seq4repair_space>connected<seq2seq4repair_space>apps<seq2seq4repair_space>request<seq2seq4repair_space>from<seq2seq4repair_space>" + requesterId ) ) ; <END_BUG> List < Bundle > appsInfo = new ArrayList < > ( ) ; for ( DroneApi droneApi : getService ( ) . droneApiStore ) { if ( droneApi . isConnected ( ) ) { final ConnectionParameter droneParams = droneApi . getDroneManager ( ) . getConnectionParameter ( ) ; final ConnectionParameter sanitizedParams = new ConnectionParameter ( droneParams . getConnectionType ( ) , droneParams . getParamsBundle ( ) , null ) ; Bundle info = new Bundle ( ) ; info . putString ( EXTRA_APP_ID , droneApi . getOwnerId ( ) ) ; info . putParcelable ( EXTRA_VEHICLE_CONNECTION_PARAMETER , sanitizedParams ) ; appsInfo . add ( info ) ; } } return appsInfo . toArray ( new Bundle [ appsInfo . size ( ) ] ) ; } @ Override public void releaseDroneApi ( IDroneApi dpApi ) throws RemoteException { } }

Fix:
Log . d ( DPServices . TAG , ( "List<seq2seq4repair_space>of<seq2seq4repair_space>connected<seq2seq4repair_space>apps<seq2seq4repair_space>request<seq2seq4repair_space>from<seq2seq4repair_space>" + requesterId ) ) ;
Buggy code:
public class DatacenterSyncWriteResponseHandler extends WriteResponseHandler { private final Map < String , Integer > dcResponses = new HashMap < String , Integer > ( ) ; private final Map < String , Integer > responseCounts ; private final DatacenterEndpointSnitch endpointSnitch ; public DatacenterSyncWriteResponseHandler ( Map < String , Integer > responseCounts , String table ) { } @ Override public synchronized void response ( Message message ) { try { <START_BUG> String dataCenter = endpointSnitch . getLocation ( message . getFrom ( ) ) ; <END_BUG> Object blockFor = responseCounts . get ( dataCenter ) ; if ( blockFor != null ) { Integer quorumCount = dcResponses . get ( dataCenter ) ; if ( quorumCount == null ) { dcResponses . put ( dataCenter , 1 ) ; } else if ( ( ( Integer ) ( blockFor ) ) > quorumCount ) { dcResponses . put ( dataCenter , ( quorumCount + 1 ) ) ; } else { responseCounts . remove ( dataCenter ) ; } } } catch ( UnknownHostException e ) { throw new RuntimeException ( e ) ; } responses . add ( message ) ; if ( responseCounts . isEmpty ( ) ) { condition . signal ( ) ; } } }

Fix:
String dataCenter = endpointSnitch . getDatacenter ( message . getFrom ( ) ) ;
Buggy code:
public class OrthodoxDay { private int dayOfYear ; private String nationalHoliday ; private List < OrthodoxHoliday > holidays ; private List < String > fastingFoods ; public int getDayOfYear ( ) { } public void setDayOfYear ( int dayOfYear ) { } public String getNationalHoliday ( ) { } public void setNationalHoliday ( String nationalHoliday ) { } public String getImageUrlOrPath ( Context context ) { File localFile = FileUtils . getOutputPictureFile ( context , dayOfYear , false ) ; <START_BUG> if ( localFile . exists ( ) ) { <END_BUG> return "file:" + ( localFile . getAbsolutePath ( ) ) ; } else { return ( ( BuildConfig . API_IMAGE ) + ( getDayOfYear ( ) ) ) + ".jpg" ; } } public String getBlurredImagePath ( Context context ) { } public List < OrthodoxHoliday > getHolidays ( ) { } public void setHolidays ( List < OrthodoxHoliday > holidays ) { } public List < String > getFastingFoods ( ) { } public void setFastingFoods ( List < String > fastingFoods ) { } }

Fix:
if ( ( localFile != null ) && ( localFile . exists ( ) ) ) {
Buggy code:
public class UserProxy { @ SuppressWarnings ( "unchecked" ) public static boolean checkLogin ( String username , String password ) throws IOException , ParseException { } public static String getQuestionsForUser ( String userId ) throws IOException , ClientProtocolException { <START_BUG> String url = "http:////scope-resolution.org//que//scripts//questions_for_user.php" ; <END_BUG> List < NameValuePair > postValues = new ArrayList < NameValuePair > ( ) ; postValues . add ( new BasicNameValuePair ( "username" , "" ) ) ; postValues . add ( new BasicNameValuePair ( "password" , "" ) ) ; String result = HttpFactory . HttpPostJSON ( postValues , url ) ; return result ; } }

Fix:
String url = "http:////www.scope-resolution.org//que//scripts//get_questions_for_user.php" ;
Buggy code:
public abstract class AbstractBrokerMessageHandler implements ApplicationEventPublisherAware , SmartLifecycle , MessageHandler { protected final Log logger = LogFactory . getLog ( getClass ( ) ) ; private Collection < String > destinationPrefixes ; private ApplicationEventPublisher eventPublisher ; private AtomicBoolean brokerAvailable = new AtomicBoolean ( false ) ; private boolean autoStartup = true ; private Object lifecycleMonitor = new Object ( ) ; private volatile boolean running = false ; public AbstractBrokerMessageHandler ( Collection < String > destinationPrefixes ) { } public Collection < String > getDestinationPrefixes ( ) { } @ Override public void setApplicationEventPublisher ( ApplicationEventPublisher publisher ) { } public ApplicationEventPublisher getApplicationEventPublisher ( ) { } public void setAutoStartup ( boolean autoStartup ) { } @ Override public boolean isAutoStartup ( ) { } @ Override public int getPhase ( ) { } @ Override public final boolean isRunning ( ) { } @ Override public final void start ( ) { } protected void startInternal ( ) { } @ Override public final void stop ( ) { } protected void stopInternal ( ) { } @ Override public final void stop ( Runnable callback ) { } @ Override public final void handleMessage ( Message < ? > message ) { if ( ! ( this . running ) ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( ( "STOMP<seq2seq4repair_space>broker<seq2seq4repair_space>relay<seq2seq4repair_space>not<seq2seq4repair_space>running.<seq2seq4repair_space>Ignoring<seq2seq4repair_space>message<seq2seq4repair_space>id=" + ( message . getHeaders ( ) . getId ( ) ) ) ) ; } return ; } if ( logger . isTraceEnabled ( ) ) { <START_BUG> logger . trace ( ( "Message<seq2seq4repair_space>" + message ) ) ; <END_BUG> } handleMessageInternal ( message ) ; } protected abstract void handleMessageInternal ( Message < ? > message ) { } protected boolean checkDestinationPrefix ( String destination ) { } protected void publishBrokerAvailableEvent ( ) { } protected void publishBrokerUnavailableEvent ( ) { } }

Fix:
logger . trace ( ( "Handling<seq2seq4repair_space>message<seq2seq4repair_space>" + message ) ) ;
Buggy code:
public class AnnotationMetadataTests extends TestCase { public void testStandardAnnotationMetadata ( ) throws IOException { } public void testAsmAnnotationMetadata ( ) throws IOException { } private void doTestAnnotationInfo ( AnnotationMetadata metadata ) { assertEquals ( AnnotationMetadataTests . AnnotatedComponent . class . getName ( ) , metadata . getClassName ( ) ) ; assertFalse ( metadata . isInterface ( ) ) ; assertFalse ( metadata . isAbstract ( ) ) ; assertTrue ( metadata . isConcrete ( ) ) ; assertTrue ( metadata . hasSuperClass ( ) ) ; assertEquals ( Object . class . getName ( ) , metadata . getSuperClassName ( ) ) ; assertEquals ( 1 , metadata . getInterfaceNames ( ) . length ) ; assertEquals ( Serializable . class . getName ( ) , metadata . getInterfaceNames ( ) [ 0 ] ) ; assertTrue ( metadata . hasAnnotation ( Component . class . getName ( ) ) ) ; assertTrue ( metadata . hasAnnotation ( Scope . class . getName ( ) ) ) ; assertTrue ( metadata . hasAnnotation ( AnnotationMetadataTests . SpecialAttr . class . getName ( ) ) ) ; assertEquals ( 3 , metadata . getAnnotationTypes ( ) . size ( ) ) ; assertTrue ( metadata . getAnnotationTypes ( ) . contains ( Component . class . getName ( ) ) ) ; assertTrue ( metadata . getAnnotationTypes ( ) . contains ( Scope . class . getName ( ) ) ) ; assertTrue ( metadata . getAnnotationTypes ( ) . contains ( AnnotationMetadataTests . SpecialAttr . class . getName ( ) ) ) ; Map < String , Object > compAttrs = metadata . getAnnotationAttributes ( Component . class . getName ( ) ) ; assertEquals ( 1 , compAttrs . size ( ) ) ; assertEquals ( "myName" , compAttrs . get ( "value" ) ) ; Map < String , Object > scopeAttrs = metadata . getAnnotationAttributes ( Scope . class . getName ( ) ) ; assertEquals ( 1 , scopeAttrs . size ( ) ) ; assertEquals ( "myScope" , scopeAttrs . get ( "value" ) ) ; Map < String , Object > specialAttrs = metadata . getAnnotationAttributes ( AnnotationMetadataTests . SpecialAttr . class . getName ( ) ) ; assertEquals ( 2 , specialAttrs . size ( ) ) ; <START_BUG> assertEquals ( String . class , specialAttrs . get ( "clazz" ) ) ; <END_BUG> assertEquals ( Thread . State . NEW , specialAttrs . get ( "state" ) ) ; } private void doTestMethodAnnotationInfo ( AnnotationMetadata classMetadata ) { } @ Target ( ElementType . TYPE ) @ Retention ( RetentionPolicy . RUNTIME ) public @ interface SpecialAttr { Class clazz ( ) ; Thread . State state ( ) ; } @ Component ( "myName" ) @ Scope ( "myScope" ) @ AnnotationMetadataTests . SpecialAttr ( clazz = String . class , state = Thread . State . NEW ) private static class AnnotatedComponent implements Serializable { @ Autowired public void doWork ( @ Qualifier ( "myColor" ) Color color ) { } @ Test public void doSleep ( ) { } } }

Fix:
assertEquals ( String . class . getName ( ) , specialAttrs . get ( "clazz" ) ) ;