nus-yam/ex-repair huggingface dataset:
Buggy code:
public class MemberValuePair extends ASTNode { public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( MemberValuePair . class , "name" , SimpleName . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; public static final ChildPropertyDescriptor VALUE_PROPERTY = new ChildPropertyDescriptor ( MemberValuePair . class , "value" , Expression . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private SimpleName name = null ; private Expression value = null ; MemberValuePair ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { MemberValuePair result = new MemberValuePair ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setName ( ( ( SimpleName ) ( ASTNode . copySubtree ( target , getName ( ) ) ) ) ) ; result . setValue ( ( ( Expression ) ( ASTNode . copySubtree ( target , getValue ( ) ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public SimpleName getName ( ) { } public final IMemberValuePairBinding resolveMemberValuePairBinding ( ) { } public void setName ( SimpleName name ) { } public Expression getValue ( ) { } public void setValue ( Expression value ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class ViewProvider extends AbstractProvider { private AbstractElement [ ] cachedElements ; private Map idToElement = new HashMap ( ) ; public String getId ( ) { } public AbstractElement getElementForId ( String id ) { } public AbstractElement [ ] getElements ( ) { if ( ( cachedElements ) == null ) { IViewDescriptor [ ] views = PlatformUI . getWorkbench ( ) . getViewRegistry ( ) . getViews ( ) ; cachedElements = new AbstractElement [ views . length ] ; for ( int i = 0 ; i < ( views . length ) ; i ++ ) { <START_BUG> ViewElement viewElement = new ViewElement ( views [ i ] ) ; <END_BUG> cachedElements [ i ] = viewElement ; idToElement . put ( viewElement . getId ( ) , viewElement ) ; } } return cachedElements ; } public ImageDescriptor getImageDescriptor ( ) { } public String getName ( ) { } }

Fix:
ViewElement viewElement = new ViewElement ( views [ i ] , this ) ;
Buggy code:
public class SpecifiedPathAddHandler extends PathAddHandler { public static SpecifiedPathAddHandler INSTANCE = new SpecifiedPathAddHandler ( ) ; private SpecifiedPathAddHandler ( ) { } protected void performRuntime ( NewOperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) { PathAddress address = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ; String name = address . getLastElement ( ) . getValue ( ) ; ModelNode pathNode = operation . get ( PATH ) ; ModelNode relNode = operation . get ( RELATIVE_TO ) ; String path = ( pathNode . isDefined ( ) ) ? pathNode . asString ( ) : null ; String relativeTo = ( relNode . isDefined ( ) ) ? relNode . asString ( ) : null ; <START_BUG> final ServiceTarget target = context . getServiceTarget ( ) . subTarget ( ) ; <END_BUG> if ( relativeTo == null ) { newControllers . add ( AbsolutePathService . addService ( name , path , target ) ) ; } else { newControllers . add ( RelativePathService . addService ( name , path , relativeTo , target ) ) ; } } protected boolean requiresRuntimeVerification ( ) { } }

Fix:
final ServiceTarget target = context . getServiceTarget ( ) ;
Buggy code:
@ Repository ( "imageDao" ) public class ImageDaoMySQL extends HibernateDao implements ImageDao { private static Logger log = Logger . getLogger ( ImageDaoMySQL . class ) ; @ Override public void save ( Image image ) { } @ Override public void delete ( Image image ) { } @ Override public void update ( Image image ) { } @ Override public Image getImageById ( String imageId ) { ImageDaoMySQL . log . debug ( ( "Looking<seq2seq4repair_space>for<seq2seq4repair_space>image<seq2seq4repair_space>with<seq2seq4repair_space>id=" + imageId ) ) ; <START_BUG> List list = find ( ( "from<seq2seq4repair_space>Image<seq2seq4repair_space>where<seq2seq4repair_space>IMAGE_ID<seq2seq4repair_space>=<seq2seq4repair_space>?" + imageId ) ) ; <END_BUG> return ( ( Image ) ( list . get ( 0 ) ) ) ; } }

Fix:
List list = find ( "from<seq2seq4repair_space>Image<seq2seq4repair_space>where<seq2seq4repair_space>IMAGE_ID<seq2seq4repair_space>=<seq2seq4repair_space>?" , imageId ) ;
Buggy code:
public class LocalPrefPathAttribute extends Attribute { private int localPreference ; @ Override protected int getTypeCode ( ) { <START_BUG> return BGPv4Constants . BGP_PATH_ATTRIBUTE_TYPE_MULTI_EXIT_DISC ; <END_BUG> } @ Override protected int getValueLength ( ) { } @ Override protected ChannelBuffer encodeValue ( ) { } public int getLocalPreference ( ) { } public void setLocalPreference ( int discriminator ) { } }

Fix:
return BGPv4Constants . BGP_PATH_ATTRIBUTE_TYPE_LOCAL_PREF ;
Buggy code:
public class BUnzip2 extends Unpack { private static final String DEFAULT_EXTENSION = ".bz2" ; protected String getDefaultExtension ( ) { } protected void extract ( ) throws TaskException { if ( ( source . lastModified ( ) ) > ( dest . lastModified ( ) ) ) { <START_BUG> log ( ( ( ( "Expanding<seq2seq4repair_space>" + ( source . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( dest . getAbsolutePath ( ) ) ) ) ; <END_BUG> FileOutputStream out = null ; CBZip2InputStream zIn = null ; FileInputStream fis = null ; BufferedInputStream bis = null ; try { out = new FileOutputStream ( dest ) ; fis = new FileInputStream ( source ) ; bis = new BufferedInputStream ( fis ) ; int b = bis . read ( ) ; if ( b != 'B' ) { throw new TaskException ( "Invalid<seq2seq4repair_space>bz2<seq2seq4repair_space>file." ) ; } b = bis . read ( ) ; if ( b != 'Z' ) { throw new TaskException ( "Invalid<seq2seq4repair_space>bz2<seq2seq4repair_space>file." ) ; } zIn = new CBZip2InputStream ( bis ) ; byte [ ] buffer = new byte [ 8 * 1024 ] ; int count = 0 ; do { out . write ( buffer , 0 , count ) ; count = zIn . read ( buffer , 0 , buffer . length ) ; } while ( count != ( - 1 ) ) ; } catch ( IOException ioe ) { String msg = "Problem<seq2seq4repair_space>expanding<seq2seq4repair_space>bzip2<seq2seq4repair_space>" + ( ioe . getMessage ( ) ) ; throw new TaskException ( msg , ioe ) ; } finally { if ( bis != null ) { try { bis . close ( ) ; } catch ( IOException ioex ) { } } if ( fis != null ) { try { fis . close ( ) ; } catch ( IOException ioex ) { } } if ( out != null ) { try { out . close ( ) ; } catch ( IOException ioex ) { } } if ( zIn != null ) { try { zIn . close ( ) ; } catch ( IOException ioex ) { } } } } } }

Fix:
getLogger ( ) . info ( ( ( ( "Expanding<seq2seq4repair_space>" + ( source . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( dest . getAbsolutePath ( ) ) ) ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class OliviaMenuBar extends ExMenuBar implements StoppableObserver , MenuBarModelObserver , MenuObserver { private final MenuBarModel model ; private final Map < MenuModel , JMenu > menuesMap = new HashMap < > ( ) ; public OliviaMenuBar ( ) { } private void initialize ( ) { } @ Override public void menuAdded ( MenuModel addedMenu , int index ) { } @ Override public void menuRemoved ( MenuModel removedMenu ) { } @ Override public void menuItemAdded ( MenuModel menu , MenuItemModel addedItem , int index ) { try ( ObserverStopper os = new ObserverStopper ( this ) ) { JMenu jmenu = menuesMap . get ( menu ) ; <START_BUG> MenuUtils . addMenuItem ( jmenu , addedItem ) ; <END_BUG> } } @ Override public void menuItemRemoved ( MenuModel menu , MenuItemModel removedItem ) { } @ Override public void startObserving ( ) { } @ Override public void stopObserving ( ) { } }

Fix:
MenuUtils . addMenuItem ( jmenu , menu . getKeyBindMap ( ) , addedItem ) ;
Buggy code:
public class WaspApplication extends Application { private static MyService service ; @ Override public void onCreate ( ) { super . onCreate ( ) ; RequestInterceptor interceptor = new RequestInterceptor ( ) { @ Override public void onHeadersAdded ( Map < String , String > headers ) { } @ Override public void onQueryParamsAdded ( Map < String , Object > params ) { } @ Override public WaspRetryPolicy getRetryPolicy ( ) { return new WaspRetryPolicy ( 45000 , 3 , 1.5F ) ; } @ Override public AuthToken getAuthToken ( ) { return null ; } } ; RequestInterceptor interceptor1 = new SimpleInterceptor ( ) { @ Override public void onHeadersAdded ( Map < String , String > headers ) { super . onHeadersAdded ( headers ) ; headers . put ( "InterceptorHeaderKey" , "InterceptorHeaderValue" ) ; } @ Override public void onQueryParamsAdded ( Map < String , Object > params ) { super . onQueryParamsAdded ( params ) ; params . put ( "name" , "something" ) ; } @ Override public WaspRetryPolicy getRetryPolicy ( ) { return new WaspRetryPolicy ( 45000 , 3 , 1.5F ) ; } @ Override public AuthToken getAuthToken ( ) { return new AuthToken ( "asdfad" , true ) ; } } ; <START_BUG> WaspApplication . service = new Wasp . Builder ( this ) . setEndpoint ( "http:////httpbin.org" ) . setLogLevel ( ALL ) . setRequestInterceptor ( interceptor1 ) . build ( ) . create ( MyService . class ) ; <END_BUG> } public static MyService getService ( ) { } }

Fix:
WaspApplication . service = new Wasp . Builder ( this ) . setEndpoint ( "http:////httpbin.org" ) . setLogLevel ( ALL ) . build ( ) . create ( MyService . class ) ;
Buggy code:
public class ViewMessageSourceCommand extends FolderCommand { protected File tempFile ; public ViewMessageSourceCommand ( FrameMediator frameMediator , DefaultCommandReference reference ) { } public void updateGUI ( ) throws Exception { } public void execute ( WorkerStatusController worker ) throws Exception { AbstractMailFrameController mailFrameController = ( ( AbstractMailFrameController ) ( frameMediator ) ) ; FolderCommandReference r = ( ( FolderCommandReference ) ( getReference ( ) ) ) ; Object [ ] uids = r . getUids ( ) ; MessageFolder folder = ( ( MessageFolder ) ( r . getFolder ( ) ) ) ; ( ( StatusObservableImpl ) ( folder . getObservable ( ) ) ) . setWorker ( worker ) ; Object [ ] destUids = new Object [ uids . length ] ; Object uid = uids [ 0 ] ; InputStream in = null ; OutputStream out = null ; try { in = new BufferedInputStream ( folder . getMessageSourceStream ( uid ) ) ; <START_BUG> tempFile = TempFileStore . createTempFile ( ) ; <END_BUG> out = new BufferedOutputStream ( new FileOutputStream ( tempFile ) ) ; byte [ ] buffer = new byte [ 1024 ] ; int read ; while ( ( read = in . read ( buffer , 0 , buffer . length ) ) > 0 ) { out . write ( buffer , 0 , read ) ; } } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } finally { if ( in != null ) { try { in . close ( ) ; } catch ( IOException ioe ) { } } if ( out != null ) { try { out . close ( ) ; } catch ( IOException ioe ) { } } } } }

Fix:
tempFile = TempFileStore . createTempFileWithSuffix ( "txt" ) ;
Buggy code:
public abstract class MessagesRepository { private static List < Message > messageList = new LinkedList < > ( ) ; public static List < Message > getMessageList ( ) { } public static Stream < Message > getTimeline ( String user ) { <START_BUG> return MessagesRepository . messageList . stream ( ) . filter ( ( message ) -> message . getAuthor ( ) . equals ( user ) ) ; <END_BUG> } public static Stream < Message > getWall ( String user ) { } }

Fix:
return MessagesRepository . messageList . stream ( ) . filter ( ( message ) -> message . getAuthor ( ) . equals ( user ) ) . sorted ( Comparator . comparing ( Message :: getCreationDate ) . reversed ( ) ) ;
Buggy code:
public class ResourceHttpRequestHandler extends WebContentGenerator implements InitializingBean , HttpRequestHandler { private static final Log logger = LogFactory . getLog ( ResourceHttpRequestHandler . class ) ; private static final boolean jafPresent = ClassUtils . isPresent ( "javax.activation.FileTypeMap" , ResourceHttpRequestHandler . class . getClassLoader ( ) ) ; private static final String CONTENT_ENCODING = "Content-Encoding" ; private final List < Resource > locations = new ArrayList < Resource > ( 4 ) ; private final List < ResourceResolver > resourceResolvers = new ArrayList < ResourceResolver > ( 4 ) ; private final List < ResourceTransformer > resourceTransformers = new ArrayList < ResourceTransformer > ( 4 ) ; public ResourceHttpRequestHandler ( ) { } public void setLocations ( List < Resource > locations ) { <START_BUG> Assert . notEmpty ( locations , "Locations<seq2seq4repair_space>list<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>empty" ) ; <END_BUG> this . locations . clear ( ) ; this . locations . addAll ( locations ) ; } public List < Resource > getLocations ( ) { } public void setResourceResolvers ( List < ResourceResolver > resourceResolvers ) { } public List < ResourceResolver > getResourceResolvers ( ) { } public void setResourceTransformers ( List < ResourceTransformer > resourceTransformers ) { } public List < ResourceTransformer > getResourceTransformers ( ) { } @ Override public void afterPropertiesSet ( ) throws Exception { } @ Override public void handleRequest ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } protected Resource getResource ( HttpServletRequest request ) throws IOException { } protected boolean isInvalidPath ( String path ) { } protected MediaType getMediaType ( Resource resource ) { } protected void setHeaders ( HttpServletResponse response , Resource resource , MediaType mediaType ) throws IOException { } protected void writeContent ( HttpServletResponse response , Resource resource ) throws IOException { } @ Override public String toString ( ) { } private static class ActivationMediaTypeFactory { private static final FileTypeMap fileTypeMap ; private static FileTypeMap loadFileTypeMapFromContextSupportModule ( ) { } public static MediaType getMediaType ( String filename ) { } } }

Fix:
Assert . notNull ( locations , "Locations<seq2seq4repair_space>list<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ;
Buggy code:
public class DateTextField extends TextField implements ITextFormatProvider { private static final long serialVersionUID = 1L ; public static DateTextField forDatePattern ( String id , IModel model , String datePattern ) { } public static DateTextField forDatePattern ( String id , String datePattern ) { } public static DateTextField forDateStyle ( String id , IModel model , String dateStyle ) { } public static DateTextField forDateStyle ( String id , String dateStyle ) { } public static DateTextField forShortStyle ( String id ) { } public static DateTextField forShortStyle ( String id , IModel model ) { } public static DateTextField withConverter ( String id , DateConverter converter ) { } public static DateTextField withConverter ( String id , IModel model , DateConverter converter ) { } private final DateConverter converter ; public DateTextField ( String id , IModel model , DateConverter converter ) { } public final IConverter getConverter ( Class clazz ) { } public final String getTextFormat ( ) { <START_BUG> return ( ( DateConverter ) ( converter ) ) . getDatePattern ( ) ; <END_BUG> } }

Fix:
return converter . getDatePattern ( ) ;
Buggy code:
public class RobotThread extends Thread { private final int transNumber ; private final String transactions ; private final String server ; private final int port ; private ArrayList < Integer > commitStack = new ArrayList < Integer > ( ) ; public RobotThread ( int _transNumber , String _transactions , String _server , int _port ) { } public void run ( ) { try { String [ ] queryGroups = transactions . split ( ";" ) ; int groupIndex = 0 ; while ( groupIndex < ( queryGroups . length ) ) { final Socket sock = new Socket ( server , port ) ; final ObjectOutputStream output = new ObjectOutputStream ( sock . getOutputStream ( ) ) ; final ObjectInputStream input = new ObjectInputStream ( sock . getInputStream ( ) ) ; Message msg = null ; Message resp = null ; msg = new Message ( queryGroups [ groupIndex ] ) ; output . writeObject ( msg ) ; resp = ( ( Message ) ( input . readObject ( ) ) ) ; if ( resp . theMessage . equals ( "ACK" ) ) { } else <START_BUG> if ( ( resp . theMessage . substring ( 0 , 3 ) ) == "ACS" ) { <END_BUG> String [ ] temp = resp . theMessage . split ( "<seq2seq4repair_space>" ) ; int commitOnServer = Integer . parseInt ( temp [ 1 ] ) ; if ( ! ( commitStack . contains ( commitOnServer ) ) ) { commitStack . add ( commitOnServer ) ; System . out . println ( ( ( ( ( "RobotThread:<seq2seq4repair_space>transaction<seq2seq4repair_space>" + ( transNumber ) ) + "<seq2seq4repair_space>added<seq2seq4repair_space>server<seq2seq4repair_space>" ) + commitOnServer ) + "<seq2seq4repair_space>to<seq2seq4repair_space>commit<seq2seq4repair_space>stack" ) ) ; } } else if ( resp . theMessage . equals ( "FIN" ) ) { entry . get ( transNumber ) . setEndTime ( new Date ( ) . getTime ( ) ) ; ThreadCounter . threadComplete ( ) ; System . out . println ( ( ( "RobotThread:<seq2seq4repair_space>transaction<seq2seq4repair_space>" + ( transNumber ) ) + "<seq2seq4repair_space>complete" ) ) ; } else { System . out . println ( "RobotThread:<seq2seq4repair_space>query<seq2seq4repair_space>handling<seq2seq4repair_space>error" ) ; } sock . close ( ) ; groupIndex ++ ; } } catch ( ConnectException ce ) { System . err . println ( ( ( ce . getMessage ( ) ) + ":<seq2seq4repair_space>Check<seq2seq4repair_space>server<seq2seq4repair_space>address<seq2seq4repair_space>and<seq2seq4repair_space>port<seq2seq4repair_space>number." ) ) ; ce . printStackTrace ( System . err ) ; } catch ( Exception e ) { System . err . println ( ( "Error:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; e . printStackTrace ( System . err ) ; } } No newline ; at end ; of file ; }

Fix:
if ( resp . theMessage . substring ( 0 , 3 ) . equals ( "ACS" ) ) {
Buggy code:
public class ScarabModulePeer extends org . tigris . scarab . om . BaseScarabModulePeer { public static Class getOMClass ( ) throws Exception { } public static List getAllModules ( ) throws Exception { } public static boolean checkExists ( Group group ) throws Exception , DataBackendException { Criteria criteria = new Criteria ( ) ; criteria . addSelectColumn ( MODULE_ID ) ; <START_BUG> String name = ( ( org . tigris . scarab . services . module . ModuleEntity ) ( group ) ) . getName ( ) ; <END_BUG> criteria . add ( MODULE_NAME , name ) ; criteria . add ( PARENT_ID , ( ( org . tigris . scarab . services . module . ModuleEntity ) ( group ) ) . getParentId ( ) ) ; List results = ( ( List ) ( BasePeer . doSelect ( criteria ) ) ) ; if ( ( results . size ( ) ) > 1 ) { throw new DataBackendException ( ( ( "Multiple<seq2seq4repair_space>groups<seq2seq4repair_space>named<seq2seq4repair_space>'" + name ) + "'<seq2seq4repair_space>exist!" ) ) ; } return ( results . size ( ) ) == 1 ; } }

Fix:
String name = ( ( org . tigris . scarab . services . module . ModuleEntity ) ( group ) ) . getRealName ( ) ;
Buggy code:
public class VolunteerTest { private static final String LAST = "Smith" ; private static final String FIRST = "John" ; private static final String EMAIL = "SmithJohn@gmail.com" ; private Volunteer tester ; @ Before public void setUp ( ) throws Exception { } @ Test public final void testVolunteerStringStringStringListOfJob ( ) { } @ Test public final void testGetJobs ( ) throws IOException , ClassNotFoundException { final Map < LocalDate , List < Job > > map = Calendar . getInstance ( ) . getJobs ( ) ; <START_BUG> final List < Job > list = map . get ( LocalDate . parse ( "2015-12-25" ) ) ; <END_BUG> final Job job = list . get ( 0 ) ; job . addVolunteer ( tester , 'm' ) ; final List < Job > jobs = tester . getJobs ( ) ; assertTrue ( "Volunteer<seq2seq4repair_space>wasn't<seq2seq4repair_space>added<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>job<seq2seq4repair_space>or<seq2seq4repair_space>get<seq2seq4repair_space>jobs<seq2seq4repair_space>didn't<seq2seq4repair_space>get<seq2seq4repair_space>the<seq2seq4repair_space>job." , jobs . contains ( job ) ) ; } @ Test public final void testEqualsObject ( ) { } }

Fix:
final List < Job > list = map . get ( LocalDate . parse ( "2015-08-19" ) ) ;
Buggy code:
public abstract class ConcurrentStreamWriterTestBase { private static final Logger LOG = LoggerFactory . getLogger ( ConcurrentStreamWriterTestBase . class ) ; @ ClassRule public static final TemporaryFolder TMP_FOLDER = new TemporaryFolder ( ) ; protected abstract LocationFactory getLocationFactory ( ) { } @ Test public void testConcurrentWrite ( ) throws Exception { } @ Test public void testConcurrentAppendFile ( ) throws Exception { } private boolean verifyEvents ( int threads , int msgPerThread , List < StreamEvent > events ) { } private ConcurrentStreamWriter createStreamWriter ( String streamName , StreamAdmin streamAdmin , int threads , StreamFileWriterFactory writerFactory ) throws IOException { } private Runnable createWriterTask ( final String accountId , final String streamName , final ConcurrentStreamWriter streamWriter , final int threadId , final int msgCount , final int batchSize , final CountDownLatch startLatch , final CountDownLatch completion ) { } private Runnable createAppendFileTask ( final String accountId , final String streamName , final ConcurrentStreamWriter streamWriter , final ConcurrentStreamWriterTestBase . FileInfo fileInfo , final CountDownLatch startLatch , final CountDownLatch completion ) { } private StreamFileWriterFactory createStreamFileWriterFactory ( ) { } private ConcurrentStreamWriterTestBase . FileInfo generateFile ( LocationFactory locationFactory , int id , int events ) throws IOException { } private static final class FileInfo { private final Location eventLocation ; private final Location indexLocation ; private final TimestampCloseable closeable ; private final long events ; private FileInfo ( Location eventLocation , Location indexLocation , TimestampCloseable closeable , long events ) { } } private static final class TestStreamAdmin extends NoopStreamAdmin { private final LocationFactory locationFactory ; private final long partitionDuration ; private final long indexInterval ; private TestStreamAdmin ( LocationFactory locationFactory , long partitionDuration , long indexInterval ) { } @ Override public boolean exists ( String name ) throws Exception { } @ Override public StreamConfig getConfig ( String streamName ) throws IOException { } } private static final class TestMetricsCollector implements MetricsCollector { @ Override <START_BUG> public void increment ( String metricName , int value ) { <END_BUG> } @ Override public void gauge ( String metricName , long value ) { } @ Override public MetricsCollector childCollector ( Map < String , String > tags ) { } @ Override public MetricsCollector childCollector ( String tagName , String tagValue ) { } } }

Fix:
public void increment ( String metricName , long value ) {
Buggy code:
public class RelayResourceDefinition extends SimpleResourceDefinition { static final PathElement PATH = PathElement . pathElement ( RELAY , RELAY_NAME ) ; private static final ResourceDescriptionResolver RESOLVER = JGroupsExtension . getResourceDescriptionResolver ( RELAY ) ; static final SimpleAttributeDefinition SITE = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( ModelKeys . SITE , ModelType . STRING , false ) . setXmlName ( Attribute . SITE . getLocalName ( ) ) . setAllowExpression ( true ) . setFlags ( RESTART_RESOURCE_SERVICES ) . build ( ) ; static final SimpleAttributeDefinition REMOTE_SITE = new SimpleAttributeDefinition ( ModelKeys . REMOTE_SITE , ModelType . PROPERTY , true ) ; static final SimpleListAttributeDefinition REMOTE_SITES = new SimpleListAttributeDefinition . Builder ( ModelKeys . REMOTE_SITES , RelayResourceDefinition . REMOTE_SITE ) . setAllowNull ( true ) . build ( ) ; static final SimpleAttributeDefinition PROPERTY = new SimpleAttributeDefinition ( ModelKeys . PROPERTY , ModelType . PROPERTY , true ) ; static final SimpleListAttributeDefinition PROPERTIES = new SimpleListAttributeDefinition . Builder ( ModelKeys . PROPERTIES , RelayResourceDefinition . PROPERTY ) . setAllowNull ( true ) . build ( ) ; static final AttributeDefinition [ ] ATTRIBUTES = new AttributeDefinition [ ] { RelayResourceDefinition . SITE } ; static void buildTransformation ( ModelVersion version , ResourceTransformationDescriptionBuilder parent ) { } RelayResourceDefinition ( ) { } @ Override public void registerAttributes ( ManagementResourceRegistration registration ) { } @ Override public void registerChildren ( ManagementResourceRegistration registration ) { registration . registerSubModel ( new RemoteSiteResourceDefinition ( ) ) ; <START_BUG> registration . registerSubModel ( INSTANCE ) ; <END_BUG> } }

Fix:
registration . registerSubModel ( new PropertyResourceDefinition ( ) ) ;
Buggy code:
public class ManagedBeansExtension implements Extension { public static final String NAMESPACE = "urn:jboss:domain:managedbeans:1.0" ; final ManagedBeansExtension . ManagedBeanSubsystemElementParser PARSER = new ManagedBeansExtension . ManagedBeanSubsystemElementParser ( ) ; final SubsystemFactory < ManagedBeansSubsystemElement > FACTORY = new SubsystemFactory < ManagedBeansSubsystemElement > ( ) { public ManagedBeansSubsystemElement createSubsystemElement ( ) { } } ; public void initialize ( ExtensionContext context ) { <START_BUG> context . registerSubsystem ( ManagedBeansExtension . NAMESPACE , FACTORY , PARSER ) ; <END_BUG> } public void activate ( final ServiceActivatorContext context ) { } static class ManagedBeanSubsystemElementParser implements XMLElementReader < List < ? super AbstractSubsystemUpdate < ManagedBeansSubsystemElement , ? > > > { public void readElement ( XMLExtendedStreamReader reader , List < ? super AbstractSubsystemUpdate < ManagedBeansSubsystemElement , ? > > arg1 ) throws XMLStreamException { } } }

Fix:
context . registerSubsystem ( ManagedBeansExtension . NAMESPACE , PARSER ) ;
Buggy code:
public class FileSystemUtils { private static final FileSystemUtils INSTANCE = new FileSystemUtils ( ) ; private static final int INIT_PROBLEM = - 1 ; private static final int OTHER = 0 ; private static final int WINDOWS = 1 ; private static final int UNIX = 2 ; private static final int POSIX_UNIX = 3 ; private static final int OS ; public FileSystemUtils ( ) { } public static long freeSpace ( String path ) throws IOException { } public static long freeSpaceKb ( String path ) throws IOException { } long freeSpaceOS ( String path , int os , boolean kb ) throws IOException { } long freeSpaceWindows ( String path ) throws IOException { } long parseDir ( String line , String path ) throws IOException { int bytesStart = 0 ; int bytesEnd = 0 ; int j = ( line . length ( ) ) - 1 ; innerLoop1 : while ( j >= 0 ) { char c = line . charAt ( j ) ; if ( Character . isDigit ( c ) ) { bytesEnd = j + 1 ; break innerLoop1 ; } j -- ; } innerLoop2 : while ( j >= 0 ) { char c = line . charAt ( j ) ; if ( ( ( ! ( Character . isDigit ( c ) ) ) && ( c != ',' ) ) && ( c != '.' ) ) { bytesStart = j + 1 ; break innerLoop2 ; } j -- ; } if ( j < 0 ) { throw new IOException ( ( ( ( "Command<seq2seq4repair_space>line<seq2seq4repair_space>'dir<seq2seq4repair_space>//-c'<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>return<seq2seq4repair_space>valid<seq2seq4repair_space>info<seq2seq4repair_space>" + "for<seq2seq4repair_space>path<seq2seq4repair_space>'" ) + path ) + "'" ) ) ; } <START_BUG> StringBuffer buf = new StringBuffer ( line . substring ( bytesStart , bytesEnd ) ) ; <END_BUG> for ( int k = 0 ; k < ( buf . length ( ) ) ; k ++ ) { if ( ( ( buf . charAt ( k ) ) == ',' ) || ( ( buf . charAt ( k ) ) == '.' ) ) { buf . deleteCharAt ( ( k -- ) ) ; } } return parseBytes ( buf . toString ( ) , path ) ; } long freeSpaceUnix ( String path , boolean kb , boolean posix ) throws IOException { } long parseBytes ( String freeSpace , String path ) throws IOException { } List < String > performCommand ( String [ ] cmdAttribs , int max ) throws IOException { } Process openProcess ( String [ ] cmdAttribs ) throws IOException { } }

Fix:
StringBuilder buf = new StringBuilder ( line . substring ( bytesStart , bytesEnd ) ) ;
Buggy code:
public class SMTPServer { private static final int NONE = 0 ; private static final int POP = 1 ; private static final int DEFAULT = 2 ; private static final int AUTH = 3 ; private static final int CLOSED = 0 ; private static final int INITIALIZED = 1 ; private static final int AUTHENTICTED = 2 ; private String [ ] capas ; protected SMTPProtocol protocol ; protected AccountItem accountItem ; protected Identity identity ; protected String fromAddress ; private int state ; public SMTPServer ( AccountItem accountItem ) { } private void ensureState ( int newstate ) throws IOException , SMTPException { } public boolean openConnection ( ) throws IOException , CommandCancelledException , SMTPException { } private boolean isSupported ( String string ) { } private String findSecurestMechanism ( ) throws SMTPException { List serverSupported = null ; for ( int i = 0 ; i < ( capas . length ) ; i ++ ) { if ( capas [ i ] . startsWith ( "AUTH" ) ) { serverSupported = parseAuthCapas ( capas [ i ] ) ; } } if ( serverSupported == null ) { throw new SMTPException ( "Server<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>support<seq2seq4repair_space>the<seq2seq4repair_space>AUTH<seq2seq4repair_space>command" ) ; } String mechanism = null ; for ( int i = 0 ; ( i < ( serverSupported . size ( ) ) ) && ( mechanism == null ) ; i ++ ) { <START_BUG> if ( AuthenticationFactory . getInstance ( ) . supports ( ( ( String ) ( serverSupported . get ( i ) ) ) ) ) { <END_BUG> mechanism = ( ( String ) ( serverSupported . get ( i ) ) ) ; } } if ( mechanism == null ) { throw new SMTPException ( "Server<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>support<seq2seq4repair_space>Authentication!" ) ; } return mechanism ; } private List parseAuthCapas ( String string ) { } private void initialize ( ) throws IOException , SMTPException { } private int getAuthentication ( String authType ) { } public void closeConnection ( ) { } protected void pop3Authentification ( ) throws IOException , CommandCancelledException , POP3Exception { } public void sendMessage ( SendableMessage message , WorkerStatusController workerStatusController ) throws IOException , SMTPException { } public String getName ( ) { } }

Fix:
if ( org . columba . ristretto . auth . AuthenticationFactory . getInstance ( ) . isSupported ( ( ( String ) ( serverSupported . get ( i ) ) ) ) ) {
Buggy code:
public class DiskIO { private static String installationDirectory = System . getProperties ( ) . getProperty ( "user.dir" ) ; private static String resourceFolder = "" ; public static boolean ensureDirectory ( File dir ) { } public static boolean ensureDirectory ( String path ) { } public static void saveStringInFile ( File toFile , String insertString ) throws IOException { } public static String readFileInString ( File fromFile ) throws IOException { StringBuffer strbuf = new StringBuffer ( ( ( int ) ( fromFile . length ( ) ) ) ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( new FileInputStream ( fromFile ) , "ISO-8859-1" ) ) ; String str ; <START_BUG> strbuf = new StringBuffer ( ) ; <END_BUG> while ( ( str = in . readLine ( ) ) != null ) { strbuf . append ( ( str + "\n" ) ) ; } in . close ( ) ; return strbuf . toString ( ) ; } public static boolean deleteDirectory ( File dir ) { } public static boolean emptyDirectory ( File dir ) { } public static boolean deleteFile ( String path ) { } public static InputStream getResourceStream ( String path ) throws IOException { } public static URL getResourceURL ( String path ) { } public static void setResourceRoot ( String path ) { } public static String getResourceRoot ( ) { } public static void copyFile ( File inputFile , File outputFile ) throws IOException { } public static boolean copyResource ( String resource , File outputFile ) throws IOException { } public static String readStringFromResource ( String resource ) throws IOException { } public static boolean copyResource ( String resource , String outputFile ) throws IOException { } }

Fix:
strbuf = new StringBuffer ( ( ( int ) ( fromFile . length ( ) ) ) ) ;
Buggy code:
public abstract class AbstractMapper implements IRequestMapper { public AbstractMapper ( ) { } protected IMapperContext getContext ( ) { } protected String requestListenerInterfaceToString ( RequestListenerInterface listenerInterface ) { } protected RequestListenerInterface requestListenerInterfaceFromString ( String interfaceName ) { } protected static String getPlaceholder ( String s ) { } protected boolean urlStartsWith ( Url url , String ... segments ) { } protected PageComponentInfo getPageComponentInfo ( Url url ) { } protected void encodePageComponentInfo ( Url url , PageComponentInfo info ) { } protected Class < ? extends IRequestablePage > getPageClass ( String name ) { } protected PageParameters extractPageParameters ( Request request , int segmentsToSkip , IPageParametersEncoder encoder ) { Checks . argumentNotNull ( request , "request" ) ; Checks . argumentNotNull ( encoder , "encoder" ) ; Url urlCopy = new Url ( request . getUrl ( ) ) ; while ( ( segmentsToSkip > 0 ) && ( ( urlCopy . getSegments ( ) . isEmpty ( ) ) == false ) ) { urlCopy . getSegments ( ) . remove ( 0 ) ; -- segmentsToSkip ; } if ( ( ! ( urlCopy . getQueryParameters ( ) . isEmpty ( ) ) ) && ( Strings . isEmpty ( urlCopy . getQueryParameters ( ) . get ( 0 ) . getValue ( ) ) ) ) { urlCopy . getQueryParameters ( ) . remove ( 0 ) ; } PageParameters decoded = encoder . decodePageParameters ( request . requestWithUrl ( urlCopy ) ) ; <START_BUG> return decoded != null ? decoded : new PageParameters ( ) ; <END_BUG> } protected Url encodePageParameters ( Url url , PageParameters pageParameters , IPageParametersEncoder encoder ) { } protected String [ ] getMountSegments ( String mountPath ) { } }

Fix:
return decoded ;
Buggy code:
public class LoginRequest extends ApiRequest < LoginApiResult > { protected final LoginRequest . Data data ; protected LoginRequest ( Context context , int endpointResID , LoginRequest . Data data ) { } public static LoginRequest makeRegistrationRequest ( Context context , String name , String email , String password ) { } public static LoginRequest makeLoginRequest ( Context context , String email , String password ) { } @ Override public void beforeSending ( ) { } @ Override public ResponseEntity < LoginApiResult > send ( ) { <START_BUG> return restTemplate . exchange ( apiUri , POST , new org . springframework . http . HttpEntity ( data , null ) , LoginApiResult . class ) ; <END_BUG> } public static class Data { private String name ; private String email ; private String password ; public Data ( ) { } public Data ( String name , String email , String password ) { } public Data ( String email , String password ) { } public String getEmail ( ) { } public void setEmail ( String email ) { } public String getPassword ( ) { } public void setPassword ( String password ) { } public String getName ( ) { } public void setName ( String name ) { } @ Override public String toString ( ) { } } }

Fix:
return restTemplate . exchange ( apiUri , POST , new org . springframework . http . HttpEntity ( data ) , LoginApiResult . class ) ;
Buggy code:
public class MoveProjectAction extends CopyProjectAction { private static String MOVE_TOOL_TIP = WorkbenchMessages . getString ( "MoveProjectAction.toolTip" ) ; private static String MOVE_TITLE = WorkbenchMessages . getString ( "MoveProjectAction.text" ) ; private static String PROBLEMS_TITLE = WorkbenchMessages . getString ( "MoveProjectAction.dialogTitle" ) ; private static String MOVE_PROGRESS_TITLE = WorkbenchMessages . getString ( "MoveProjectAction.progressMessage" ) ; public static final String ID = ( PlatformUI . PLUGIN_ID ) + ".MoveProjectAction" ; public MoveProjectAction ( Shell shell ) { } protected String getErrorsTitle ( ) { } boolean performMove ( final IProject project , final String projectName , final IPath newLocation ) { WorkspaceModifyOperation op = new WorkspaceModifyOperation ( ) { public void execute ( IProgressMonitor monitor ) { monitor . beginTask ( MoveProjectAction . MOVE_PROGRESS_TITLE , 100 ) ; try { if ( monitor . isCanceled ( ) ) throw new OperationCanceledException ( ) ; IProjectDescription newDescription = createDescription ( project , projectName , newLocation ) ; monitor . worked ( 50 ) ; <START_BUG> project . move ( newDescription , true , monitor ) ; <END_BUG> monitor . worked ( 50 ) ; } catch ( CoreException e ) { recordError ( e ) ; } finally { monitor . done ( ) ; } } } ; try { new org . eclipse . jface . dialogs . ProgressMonitorDialog ( shell ) . run ( true , true , op ) ; } catch ( InterruptedException e ) { return false ; } catch ( InvocationTargetException e ) { WorkbenchPlugin . log ( MessageFormat . format ( "Exception<seq2seq4repair_space>in<seq2seq4repair_space>{0}.performMove():<seq2seq4repair_space>{1}" , new Object [ ] { getClass ( ) . getName ( ) , e . getTargetException ( ) } ) ) ; displayError ( WorkbenchMessages . format ( "MoveProjectAction.internalError" , new Object [ ] { e . getTargetException ( ) . getMessage ( ) } ) ) ; return false ; } return true ; } protected Object [ ] queryDestinationParameters ( IProject project ) { } public void run ( ) { } }

Fix:
project . move ( newDescription , ( ( IResource . FORCE ) | ( IResource . SHALLOW ) ) , monitor ) ;
Buggy code:
public class Label extends Control { String text ; Image image ; boolean isImage ; NSTextField textView ; NSImageView imageView ; public Label ( Composite parent , int style ) { } int accessibilityAttributeNames ( int id , int sel ) { } boolean accessibilityIsIgnored ( int id , int sel ) { } void addRelation ( Control control ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } void createWidget ( ) { } NSAttributedString createString ( ) { <START_BUG> NSAttributedString attribStr = createString ( text , null , foreground , ( ( ( style ) & ( SWT . WRAP ) ) == 0 ? style : 0 ) , true , true ) ; <END_BUG> attribStr . autorelease ( ) ; return attribStr ; } NSFont defaultNSFont ( ) { } void deregister ( ) { } NSView eventView ( ) { } public int getAlignment ( ) { } public Image getImage ( ) { } String getNameText ( ) { } public String getText ( ) { } boolean isDescribedByLabel ( ) { } void register ( ) { } void releaseHandle ( ) { } void removeRelation ( ) { } public void setAlignment ( int alignment ) { } void updateBackground ( ) { } void _setAlignment ( ) { } void setFont ( NSFont font ) { } void setForeground ( float [ ] color ) { } boolean setTabItemFocus ( ) { } public void setImage ( Image image ) { } public void setText ( String string ) { } }

Fix:
NSAttributedString attribStr = createString ( text , null , foreground , style , ( ( ( style ) & ( SWT . WRAP ) ) != 0 ) , true , true ) ;
Buggy code:
class MainKernelServicesImpl extends AbstractKernelServicesImpl { protected MainKernelServicesImpl ( ServiceContainer container , ModelTestModelControllerService controllerService , StringConfigurationPersister persister , ManagementResourceRegistration rootRegistration , OperationValidator operationValidator , String mainSubsystemName , ExtensionRegistry extensionRegistry , ModelVersion legacyModelVersion , boolean successfulBoot , Throwable bootError , boolean registerTransformers ) { } public TransformedOperation transformOperation ( ModelVersion modelVersion , ModelNode operation ) throws OperationFailedException { checkIsMainController ( ) ; PathElement pathElement = PathElement . pathElement ( SUBSYSTEM , mainSubsystemName ) ; PathAddress opAddr = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ; if ( ( ( ( opAddr . size ( ) ) > 0 ) && ( opAddr . getElement ( 0 ) . equals ( pathElement ) ) ) || ( operation . get ( OP ) . asString ( ) . equals ( COMPOSITE ) ) ) { final Map < PathAddress , ModelVersion > subsystem = Collections . singletonMap ( EMPTY_ADDRESS . append ( pathElement ) , modelVersion ) ; <START_BUG> final TransformationTarget transformationTarget = TransformationTargetImpl . create ( extensionRegistry . getTransformerRegistry ( ) , getCoreModelVersionByLegacyModelVersion ( modelVersion ) , subsystem , MainKernelServicesImpl . MOCK_IGNORED_DOMAIN_RESOURCE_REGISTRY , SERVER ) ; <END_BUG> final Transformers transformers = Factory . create ( transformationTarget ) ; final TransformationContext transformationContext = createTransformationContext ( transformationTarget ) ; return transformers . transformOperation ( transformationContext , operation ) ; } return new org . jboss . as . controller . transform . OperationTransformer . TransformedOperation ( operation , OperationResultTransformer . ORIGINAL_RESULT ) ; } public ModelNode readTransformedModel ( ModelVersion modelVersion ) { } public ModelNode executeOperation ( final ModelVersion modelVersion , final TransformedOperation op ) { } private ModelVersion getCoreModelVersionByLegacyModelVersion ( ModelVersion legacyModelVersion ) { } private static IgnoredTransformationRegistry MOCK_IGNORED_DOMAIN_RESOURCE_REGISTRY = new TransformationTarget . IgnoredTransformationRegistry ( ) { @ Override public boolean isResourceTransformationIgnored ( PathAddress address ) { } @ Override public boolean isOperationTransformationIgnored ( PathAddress address ) { } @ Override public String getHostName ( ) { } } ; }

Fix:
final TransformationTarget transformationTarget = TransformationTargetImpl . create ( extensionRegistry . getTransformerRegistry ( ) , getCoreModelVersionByLegacyModelVersion ( modelVersion ) , subsystem , MainKernelServicesImpl . MOCK_IGNORED_DOMAIN_RESOURCE_REGISTRY , SERVER , null ) ;
Buggy code:
public class Abbreviations { private static final Log LOGGER = LogFactory . getLog ( Abbreviations . class ) ; public static final String JOURNALS_FILE_BUILTIN = "//journals//journalList.txt" ; public static final String JOURNALS_IEEE_ABBREVIATION_LIST_WITH_CODE = "//journals//IEEEJournalListCode.txt" ; public static final String JOURNALS_IEEE_ABBREVIATION_LIST_WITH_TEXT = "//journals//IEEEJournalListText.txt" ; public static JournalAbbreviationRepository journalAbbrev ; public static void initializeJournalNames ( JabRefPreferences jabRefPreferences ) { Abbreviations . journalAbbrev = new JournalAbbreviationRepository ( ) ; Abbreviations . journalAbbrev . readJournalListFromResource ( Abbreviations . JOURNALS_FILE_BUILTIN ) ; if ( jabRefPreferences . getBoolean ( USE_IEEE_ABRV ) ) { Abbreviations . journalAbbrev . readJournalListFromResource ( Abbreviations . JOURNALS_IEEE_ABBREVIATION_LIST_WITH_CODE ) ; } else { Abbreviations . journalAbbrev . readJournalListFromResource ( Abbreviations . JOURNALS_IEEE_ABBREVIATION_LIST_WITH_TEXT ) ; } String [ ] lists = jabRefPreferences . getStringArray ( EXTERNAL_JOURNAL_LISTS ) ; if ( ( lists != null ) && ( ( lists . length ) > 0 ) ) { for ( int i = ( lists . length ) - 1 ; i >= 0 ; i -- ) { String filename = lists [ i ] ; try { Abbreviations . journalAbbrev . readJournalListFromFile ( new File ( filename ) ) ; } catch ( FileNotFoundException e ) { Abbreviations . LOGGER . info ( ( "Cannot<seq2seq4repair_space>find<seq2seq4repair_space>external<seq2seq4repair_space>journal<seq2seq4repair_space>list<seq2seq4repair_space>file<seq2seq4repair_space>" + filename ) , e ) ; } } } String personalJournalList = jabRefPreferences . get ( PERSONAL_JOURNAL_LIST ) ; <START_BUG> if ( personalJournalList != null ) { <END_BUG> try { Abbreviations . journalAbbrev . readJournalListFromFile ( new File ( personalJournalList ) ) ; } catch ( FileNotFoundException e ) { Abbreviations . LOGGER . info ( ( ( "Personal<seq2seq4repair_space>journal<seq2seq4repair_space>list<seq2seq4repair_space>file<seq2seq4repair_space>'" + personalJournalList ) + "'<seq2seq4repair_space>not<seq2seq4repair_space>found." ) , e ) ; } } } }

Fix:
if ( ( personalJournalList != null ) && ( ! ( personalJournalList . trim ( ) . isEmpty ( ) ) ) ) {
Buggy code:
@ RunWith ( RobojavaTestRunner . class ) public class AsyncTasksTest { private MainActivity mMainActivity ; private MockWebServer mServer ; private static final int TASK_GET10TH_CHAR = 0 ; private static final int TASK_GET_EVERY_10TH_CHAR = 1 ; private static final int TASK_WORDS_COUNTER = 2 ; @ Before public void setup ( ) throws Exception { } @ Test public void testGetting10thCharAsyncTask ( ) throws Exception { } @ Test public void testGettingEvery10thCharAsyncTask ( ) throws Exception { mServer . enqueue ( new MockResponse ( ) . setResponseCode ( 200 ) . setBody ( "aaaaaaaaacaaaaaaaaayaaa" ) ) ; GettingEvery10thCharacterAsyncTask asyncTask = new GettingEvery10thCharacterAsyncTask ( AsyncTasksTest . TASK_GET_EVERY_10TH_CHAR ) ; asyncTask . execute ( mServer . getUrl ( "//" ) ) ; Robolectric . runBackgroundTasks ( ) ; CharsEveryNthPosition charsEveryNthPosition = ( ( CharsEveryNthPosition ) ( asyncTask . get ( 100 , TimeUnit . MILLISECONDS ) ) ) ; Assert . assertEquals ( 'c' , charsEveryNthPosition . getCharAtShift ( 10 ) . getChar ( ) ) ; Assert . assertEquals ( 'y' , charsEveryNthPosition . getCharAtShift ( 20 ) . getChar ( ) ) ; Robolectric . runUiThreadTasks ( ) ; <START_BUG> TextView textView = ( ( TextView ) ( mMainActivity . findViewById ( txv10thCharacterResponseTextView ) ) ) ; <END_BUG> assertThat ( textView ) . containsText ( "10:<seq2seq4repair_space>c" ) ; assertThat ( textView ) . containsText ( "20:<seq2seq4repair_space>y" ) ; mServer . enqueue ( new MockResponse ( ) . setResponseCode ( 404 ) ) ; asyncTask = new GettingEvery10thCharacterAsyncTask ( AsyncTasksTest . TASK_GET_EVERY_10TH_CHAR ) ; asyncTask . execute ( mServer . getUrl ( "//" ) ) ; Robolectric . runBackgroundTasks ( ) ; charsEveryNthPosition = ( ( CharsEveryNthPosition ) ( asyncTask . get ( 100 , TimeUnit . MILLISECONDS ) ) ) ; Assert . assertNull ( charsEveryNthPosition . getCharAtShift ( 10 ) ) ; } @ Test public void testWordsCounterAsyncTask ( ) throws Exception { } @ Test public void testRunButton ( ) { } @ After public void tearDown ( ) throws Exception { } }

Fix:
TextView textView = ( ( TextView ) ( mMainActivity . findViewById ( txvEvery10thCharacterResponseTextView ) ) ) ;
Buggy code:
public class Command { private StringBuilder command ; public Command ( String command ) { } public void addCommand ( String addedCommand ) { } public String get ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { Command other = ( ( Command ) ( obj ) ) ; <START_BUG> return this . command . equals ( other . get ( ) ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
return this . command . toString ( ) . equals ( other . get ( ) ) ;