nus-yam/ex-repair huggingface dataset:
Buggy code:
public class JDTLikeHandleProviderTests extends XMLBasedAjcTestCase { IElementHandleProvider handleProvider ; protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } public void testMoreThanOneNamedPointcut ( ) { } public void testAspectHandle ( ) { } public void testAdviceHandle ( ) { } public void testPointcutHandle ( ) { } public void testGetIPEWithAspectHandle ( ) { } public void testAdviceHandleWithCrossCutting ( ) { } public void testPointcutHandleWithArgs ( ) { } public void testAdviceHandleWithArgs ( ) { } public void testFieldITD ( ) { } public void testMethodITD ( ) { } public void testMethodITDWithArgs ( ) { } public void testConstructorITDWithArgs ( ) { } public void testDeclareParentsHandle ( ) { } public void testTwoDeclareParents ( ) { } public void testMethodCallHandle ( ) { } public void testDeclareAtType ( ) { } public void testDeclareAtField ( ) { } public void testDeclareAtMethod ( ) { } public void testDeclareAtConstructor ( ) { } public void testTwoPiecesOfAdviceWithSameSignatureAndPointcut ( ) { } public void testDeclareWarningHandle ( ) { } public void testTwoDeclareWarningHandles ( ) { } public void testTenDeclareWarningHandles ( ) { } public void testCompilationUnitSameAsJDT ( ) { } public void testClassSameAsJDT ( ) { } public void testInterfaceSameAsJDT ( ) { } public void testConstructorSameAsJDT ( ) { } public void testConstructorWithArgsSameAsJDT ( ) { } public void testImportDeclarationSameAsJDT ( ) { } public void testTypeSameAsJDT ( ) { } public void testFieldSameAsJDT ( ) { } public void testInitializationSameAsJDT ( ) { } public void testMethodWithStringArrayArgsSameAsJDT ( ) { } public void testMethodWithIntArrayArgsSameAsJDT ( ) { } public void testMethodWithNoArgsSameAsJDT ( ) { } public void testMethodWithTwoArgsSameAsJDT ( ) { } public void testMethodWithTwoStringArgsSameAsJDT ( ) { } public void testEnumSameAsJDT ( ) { } public void testEnumValueSameAsJDT ( ) { } public void testAnnotationSameAsJDT ( ) { } public void testMethodWithListArgSameAsJDT ( ) { } public void testMethodWithGenericArgSameAsJDT ( ) { } public void testMethodWithTwoGenericArgsSameAsJDT ( ) { } public void testMethodWithTwoTypeParametersSameAsJDT ( ) { } public void testMethodWithTwoArgsSameAsJDT_2 ( ) { } private void compareHandles ( IProgramElement . Kind kind , String ipeName , String expectedHandle ) { } public static Test suite ( ) { } protected File getSpecFile ( ) { <START_BUG> return new File ( "..//tests//src//org//aspectj//systemtest//ajc152//jdtlikehandleprovider.xml" ) ; <END_BUG> } }

Fix:
return new File ( "..//tests//src//org//aspectj//systemtest//ajc153//jdtlikehandleprovider.xml" ) ;
Buggy code:
class AspectJAutoProxyBeanDefinitionParser implements BeanDefinitionParser { public BeanDefinition parse ( Element element , ParserContext parserContext ) { } private void extendBeanDefinition ( Element element , ParserContext parserContext ) { } private void addIncludePatterns ( Element element , ParserContext parserContext , BeanDefinition beanDef ) { ManagedList < TypedStringValue > includePatterns = new ManagedList < TypedStringValue > ( ) ; NodeList childNodes = element . getChildNodes ( ) ; for ( int i = 0 ; i < ( childNodes . getLength ( ) ) ; i ++ ) { Node node = childNodes . item ( i ) ; if ( node instanceof Element ) { Element includeElement = ( ( Element ) ( node ) ) ; TypedStringValue valueHolder = new TypedStringValue ( includeElement . getAttribute ( "name" ) ) ; valueHolder . setSource ( parserContext . extractSource ( includeElement ) ) ; includePatterns . add ( valueHolder ) ; } } if ( ! ( includePatterns . isEmpty ( ) ) ) { includePatterns . setSource ( parserContext . extractSource ( element ) ) ; <START_BUG> beanDef . getPropertyValues ( ) . addPropertyValue ( "includePatterns" , includePatterns ) ; <END_BUG> } } }

Fix:
beanDef . getPropertyValues ( ) . add ( "includePatterns" , includePatterns ) ;
Buggy code:
public class XpathDialog extends ElementListSelectionDialog { private IFile xmlDocument ; public XpathDialog ( Shell shell , ILabelProvider labelProvider ) { } public XpathDialog ( Shell shell , ILabelProvider labelProvider , IFile file , String message ) { } protected Control createDialogArea ( Composite parent ) { Control comp = super . createDialogArea ( parent ) ; <START_BUG> PlatformUI . getWorkbench ( ) . getHelpSystem ( ) . setHelp ( comp , "org.eclipse.wst.xml.security.doc.xpath" ) ; <END_BUG> return comp ; } private Object [ ] createContent ( ) { } }

Fix:
PlatformUI . getWorkbench ( ) . getHelpSystem ( ) . setHelp ( comp , XPATH_DIALOG ) ;
Buggy code:
public class Arguments extends ConfigTestElement implements Serializable { public static final String ARGUMENTS = "Arguments.arguments" ; public Arguments ( ) { } public CollectionProperty getArguments ( ) { } @ Override public void clear ( ) { } public void setArguments ( List < Argument > arguments ) { } public Map < String , String > getArgumentsAsMap ( ) { } public void addArgument ( String name , String value ) { } public void addArgument ( Argument arg ) { } public void addArgument ( String name , String value , String metadata ) { } public PropertyIterator iterator ( ) { } @ Override public String toString ( ) { <START_BUG> StringBuffer str = new StringBuffer ( ) ; <END_BUG> PropertyIterator iter = getArguments ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Argument arg = ( ( Argument ) ( iter . next ( ) . getObjectValue ( ) ) ) ; final String metaData = arg . getMetaData ( ) ; str . append ( arg . getName ( ) ) ; if ( metaData == null ) { str . append ( "=" ) ; } else { str . append ( metaData ) ; } str . append ( arg . getValue ( ) ) ; if ( iter . hasNext ( ) ) { str . append ( "&" ) ; } } return str . toString ( ) ; } public void removeArgument ( int row ) { } public void removeArgument ( Argument arg ) { } public void removeArgument ( String argName ) { } public void removeAllArguments ( ) { } public void addEmptyArgument ( ) { } public int getArgumentCount ( ) { } public Argument getArgument ( int row ) { } }

Fix:
StringBuilder str = new StringBuilder ( ) ;
Buggy code:
public class ExtensionAddHandler implements OperationStepHandler { public static final String OPERATION_NAME = ADD ; public static ModelNode getAddExtensionOperation ( ModelNode address ) { } private final ExtensionRegistry extensionRegistry ; private final boolean parallelBoot ; private final boolean slaveHC ; public ExtensionAddHandler ( final ExtensionRegistry extensionRegistry , final boolean parallelBoot , boolean slaveHC ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final String moduleName = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) . getLastElement ( ) . getValue ( ) ; ExtensionResource resource = new ExtensionResource ( moduleName , extensionRegistry ) ; context . addResource ( EMPTY_ADDRESS , resource ) ; if ( ( ! ( parallelBoot ) ) || ( ! ( context . isBooting ( ) ) ) ) { initializeExtension ( moduleName ) ; if ( ( slaveHC ) && ( ! ( context . isBooting ( ) ) ) ) { ModelNode subsystems = new ModelNode ( ) ; extensionRegistry . recordSubsystemVersions ( moduleName , subsystems ) ; context . getResult ( ) . set ( subsystems ) ; } } <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } void initializeExtension ( String module ) throws OperationFailedException { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public abstract class EntityManagerFactoryUtils { public static final int ENTITY_MANAGER_SYNCHRONIZATION_ORDER = ( DataSourceUtils . CONNECTION_SYNCHRONIZATION_ORDER ) - 100 ; private static final Log logger = LogFactory . getLog ( EntityManagerFactoryUtils . class ) ; public static EntityManagerFactory findEntityManagerFactory ( ListableBeanFactory beanFactory , String unitName ) throws NoSuchBeanDefinitionException { } public static EntityManager getTransactionalEntityManager ( EntityManagerFactory emf ) throws DataAccessResourceFailureException { } public static EntityManager getTransactionalEntityManager ( EntityManagerFactory emf , Map properties ) throws DataAccessResourceFailureException { } public static EntityManager doGetTransactionalEntityManager ( EntityManagerFactory emf , Map properties ) throws PersistenceException { } private static Object prepareTransaction ( EntityManager em , EntityManagerFactory emf ) { } private static void cleanupTransaction ( Object transactionData , EntityManagerFactory emf ) { } public static void applyTransactionTimeout ( Query query , EntityManagerFactory emf ) { EntityManagerHolder emHolder = ( ( EntityManagerHolder ) ( TransactionSynchronizationManager . getResource ( emf ) ) ) ; if ( ( emHolder != null ) && ( emHolder . hasTimeout ( ) ) ) { <START_BUG> int timeoutValue = emHolder . getTimeToLiveInSeconds ( ) ; <END_BUG> query . setHint ( "javax.persistence.lock.timeout" , timeoutValue ) ; query . setHint ( "javax.persistence.query.timeout" , timeoutValue ) ; } } public static DataAccessException convertJpaAccessExceptionIfPossible ( RuntimeException ex ) { } public static void closeEntityManager ( EntityManager em ) { } private static class EntityManagerSynchronization extends ResourceHolderSynchronization < EntityManagerHolder , EntityManagerFactory > implements Ordered { private final Object transactionData ; private final JpaDialect jpaDialect ; private final boolean newEntityManager ; public EntityManagerSynchronization ( EntityManagerHolder emHolder , EntityManagerFactory emf , Object txData , boolean newEm ) { } public int getOrder ( ) { } @ Override protected void flushResource ( EntityManagerHolder resourceHolder ) { } @ Override protected boolean shouldUnbindAtCompletion ( ) { } @ Override protected void releaseResource ( EntityManagerHolder resourceHolder , EntityManagerFactory resourceKey ) { } @ Override protected void cleanupResource ( EntityManagerHolder resourceHolder , EntityManagerFactory resourceKey , boolean committed ) { } } }

Fix:
int timeoutValue = ( ( int ) ( emHolder . getTimeToLiveInMillis ( ) ) ) ;
Buggy code:
public class SnapshotTakeHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = "take-snapshot" ; private final ConfigurationPersister persister ; public SnapshotTakeHandler ( ConfigurationPersister persister ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { try { String name = persister . snapshot ( ) ; context . getResult ( ) . set ( name ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } catch ( ConfigurationPersistenceException e ) { throw new OperationFailedException ( e . getMessage ( ) , new ModelNode ( ) . set ( e . getMessage ( ) ) ) ; } } @ Override public ModelNode getModelDescription ( Locale locale ) { } }

Fix:
context . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public class ExpandZipAction implements IObjectActionDelegate { private ISelection selection ; private IWorkbenchPart targetPart ; public ExpandZipAction ( ) { } private void expandZip ( IFile file ) { try { URI zipURI = new URI ( ZipFileSystem . SCHEME_ZIP , null , "//" , file . getLocationURI ( ) . toString ( ) , null ) ; IFolder link = file . getParent ( ) . getFolder ( new Path ( file . getName ( ) ) ) ; <START_BUG> link . createLink ( zipURI , REPLACE_RESOURCE , null ) ; <END_BUG> } catch ( Exception e ) { MessageDialog . openError ( getShell ( ) , "Error" , "Error<seq2seq4repair_space>opening<seq2seq4repair_space>zip<seq2seq4repair_space>file" ) ; e . printStackTrace ( ) ; } } private Shell getShell ( ) { } public void run ( IAction action ) { } public void selectionChanged ( IAction action , ISelection selection ) { } public void setActivePart ( IAction action , IWorkbenchPart targetPart ) { } }

Fix:
link . createLink ( zipURI , IResource . REPLACE , null ) ;
Buggy code:
public class LinkedBlockingDequeTest { @ Test public void testConstructWithCap ( ) throws Exception { } @ Test public void testCheckOfferFirstMethods ( ) throws Exception { } @ Test public void testContainsMethod ( ) throws Exception { } @ Test public void testFirstAndLast ( ) throws Exception { final LinkedBlockingDeque < String > Deque = new LinkedBlockingDeque < String > ( 20 ) ; final String Joe = "Joe" ; final String Bob = "Bob" ; final String Mary = "Mary" ; final String Sue = "Sue" ; Deque . add ( Joe ) ; Deque . add ( Bob ) ; Deque . add ( Sue ) ; Deque . add ( Mary ) ; final Object [ ] names = Deque . toArray ( ) ; assertEquals ( names [ 0 ] , Deque . getFirst ( ) ) ; <START_BUG> assertEquals ( names [ ( - 1 ) ] , Deque . getLast ( ) ) ; <END_BUG> assertEquals ( Joe , Deque . getFirst ( ) ) ; assertEquals ( Mary , Deque . getLast ( ) ) ; } }

Fix:
assertEquals ( names [ ( ( names . length ) - 1 ) ] , Deque . getLast ( ) ) ;
Buggy code:
public abstract class VibrationProfile extends DConnectProfile implements VibrationProfileConstants { public static final String VIBRATION_PATTERN_DELIM = "," ; public static final long DEFAULT_MAX_VIBRATION_TIME = 500 ; @ Override public final String getProfileName ( ) { } @ Override protected boolean onPutRequest ( final Intent request , final Intent response ) { } @ Override protected boolean onDeleteRequest ( final Intent request , final Intent response ) { } protected boolean onPutVibrate ( final Intent request , final Intent response , final String serviceId , final long [ ] pattern ) { } protected boolean onDeleteVibrate ( final Intent request , final Intent response , final String serviceId ) { } public static String getPattern ( final Intent request ) { } protected final long [ ] parsePattern ( final String pattern ) { <START_BUG> if ( pattern == null ) { <END_BUG> return new long [ ] { getMaxVibrationTime ( ) } ; } long [ ] result = null ; if ( pattern . contains ( VibrationProfile . VIBRATION_PATTERN_DELIM ) ) { String [ ] times = pattern . split ( VibrationProfile . VIBRATION_PATTERN_DELIM ) ; ArrayList < Long > values = new ArrayList < Long > ( ) ; for ( String time : times ) { try { String valueStr = time . trim ( ) ; if ( ( valueStr . length ( ) ) == 0 ) { if ( ( values . size ( ) ) != ( ( times . length ) - 1 ) ) { values . clear ( ) ; } break ; } long value = Long . parseLong ( time . trim ( ) ) ; if ( value < 0 ) { values . clear ( ) ; break ; } values . add ( value ) ; } catch ( NumberFormatException e ) { values . clear ( ) ; mLogger . warning ( ( "Exception<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>VibrationProfile#parsePattern()<seq2seq4repair_space>method.<seq2seq4repair_space>" + ( e . toString ( ) ) ) ) ; break ; } } if ( ( values . size ( ) ) != 0 ) { result = new long [ values . size ( ) ] ; for ( int i = 0 ; i < ( values . size ( ) ) ; i ++ ) { result [ i ] = values . get ( i ) ; } } } else { try { long time = Long . parseLong ( pattern ) ; if ( time >= 0 ) { result = new long [ ] { time } ; } } catch ( NumberFormatException e ) { mLogger . warning ( ( "Exception<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>VibrationProfile#parsePattern()<seq2seq4repair_space>method.<seq2seq4repair_space>" + ( e . toString ( ) ) ) ) ; } } return result ; } protected long getMaxVibrationTime ( ) { } }

Fix:
if ( ( pattern == null ) || ( ( pattern . length ( ) ) == 0 ) ) {
Buggy code:
public class QualifiedThisReference extends ThisReference { public TypeReference qualification ; ReferenceBinding currentCompatibleType ; public QualifiedThisReference ( TypeReference name , int pos , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { } protected boolean checkAccess ( MethodScope methodScope , TypeBinding targetType ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; TypeBinding qualificationTb = qualification . resolveType ( scope ) ; if ( qualificationTb == null ) return null ; int depth = 0 ; currentCompatibleType = scope . referenceType ( ) . binding ; while ( ( ( currentCompatibleType ) != null ) && ( ( currentCompatibleType ) != qualificationTb ) ) { depth ++ ; currentCompatibleType = ( currentCompatibleType . isStatic ( ) ) ? null : currentCompatibleType . enclosingType ( ) ; } bits &= ~ ( ASTNode . DepthMASK ) ; bits |= ( depth & 255 ) << ( ASTNode . DepthSHIFT ) ; if ( ( currentCompatibleType ) == null ) { scope . problemReporter ( ) . incorrectEnclosingInstanceReference ( this , qualificationTb ) ; return null ; } if ( depth == 0 ) { if ( ! ( checkAccess ( scope . methodScope ( ) , qualificationTb ) ) ) return null ; } else { MethodScope methodScope = scope . methodScope ( ) ; while ( methodScope != null ) { if ( ( methodScope . enclosingSourceType ( ) ) == ( currentCompatibleType ) ) { if ( ! ( this . checkAccess ( methodScope , qualificationTb ) ) ) return null ; break ; } methodScope = methodScope . parent . methodScope ( ) ; } } <START_BUG> return this . expressionType = qualificationTb ; <END_BUG> } public String toStringExpression ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
return this . resolvedType = qualificationTb ;
Buggy code:
class IndexOf extends AbstractVal implements Val { private final Val _val1 ; private final Val _val2 ; private Joins _joins = null ; private ClassMetaData _meta = null ; private Class _cast = null ; public IndexOf ( Val val1 , Val val2 ) { } public ClassMetaData getMetaData ( ) { } public void setMetaData ( ClassMetaData meta ) { } public boolean isVariable ( ) { } public Class getType ( ) { } public void setImplicitType ( Class type ) { } public void initialize ( Select sel , JDBCStore store , boolean nullTest ) { } public Joins getJoins ( ) { } public Object toDataStoreValue ( Object val , JDBCStore store ) { } public void select ( Select sel , JDBCStore store , Object [ ] params , boolean pks , JDBCFetchConfiguration fetch ) { } public void selectColumns ( Select sel , JDBCStore store , Object [ ] params , boolean pks , JDBCFetchConfiguration fetch ) { } public void groupBy ( Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { <START_BUG> sel . groupBy ( newSQLBuffer ( sel , store , params , fetch ) , false ) ; <END_BUG> } public void orderBy ( Select sel , JDBCStore store , Object [ ] params , boolean asc , JDBCFetchConfiguration fetch ) { } private SQLBuffer newSQLBuffer ( Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } public Object load ( Result res , JDBCStore store , JDBCFetchConfiguration fetch ) throws SQLException { } public boolean hasVariable ( Variable var ) { } public void calculateValue ( Select sel , JDBCStore store , Object [ ] params , Val other , JDBCFetchConfiguration fetch ) { } public void clearParameters ( ) { } public int length ( ) { } public void appendTo ( SQLBuffer sql , int index , Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } }

Fix:
sel . groupBy ( newSQLBuffer ( sel , store , params , fetch ) ) ;
Buggy code:
class ProgressMonitorFocusJobDialog extends ProgressMonitorJobsDialog { Job job ; public ProgressMonitorFocusJobDialog ( Shell parentShell ) { } protected void cancelPressed ( ) { } protected void configureShell ( Shell shell ) { } protected void createButtonsForButtonBar ( Composite parent ) { } private IJobChangeListener createCloseListener ( ) { } private IProgressMonitorWithBlocking getBlockingProgressMonitor ( ) { } public int open ( ) { } public void show ( Job jobToWatch ) { job = jobToWatch ; job . setProperty ( PROPERTY_IN_DIALOG , Boolean . TRUE ) ; ProgressManager . getInstance ( ) . progressFor ( job ) . addProgressListener ( getBlockingProgressMonitor ( ) ) ; setOpenOnRun ( false ) ; aboutToRun ( ) ; BusyIndicator . showWhile ( PlatformUI . getWorkbench ( ) . getDisplay ( ) , new Runnable ( ) { public void run ( ) { try { Thread . sleep ( SHORT_OPERATION_TIME ) ; } catch ( InterruptedException e ) { <START_BUG> WorkbenchPlugin . log ( e . getLocalizedMessage ( ) ) ; <END_BUG> } } } ) ; WorkbenchJob openJob = new WorkbenchJob ( ProgressMessages . getString ( "ProgressMonitorFocusJobDialog.UserDialogJob" ) ) { public IStatus runInUIThread ( IProgressMonitor monitor ) { if ( ( job . getState ( ) ) == ( Job . NONE ) ) { cleanUpFinishedJob ( ) ; return Status . CANCEL_STATUS ; } if ( ! ( ProgressManagerUtil . safeToOpen ( ProgressMonitorFocusJobDialog . this ) ) ) return Status . CANCEL_STATUS ; if ( ( ( getParentShell ( ) ) != null ) && ( getParentShell ( ) . isDisposed ( ) ) ) return Status . CANCEL_STATUS ; open ( ) ; return Status . OK_STATUS ; } } ; openJob . setSystem ( true ) ; openJob . schedule ( ) ; } private void cleanUpFinishedJob ( ) { } protected Control createDialogArea ( Composite parent ) { } }

Fix:
WorkbenchPlugin . log ( getClass ( ) , "show(Job)" , e ) ;
Buggy code:
public class NamespaceSupport implements NamespaceContext { protected String [ ] fNamespace = new String [ 16 * 2 ] ; protected int fNamespaceSize ; protected int [ ] fContext = new int [ 8 ] ; protected int fCurrentContext ; public NamespaceSupport ( ) { } public NamespaceSupport ( NamespaceContext context ) { } <START_BUG> public void reset ( SymbolTable symbolTable ) { <END_BUG> fNamespaceSize = 0 ; fCurrentContext = 0 ; fContext [ fCurrentContext ] = fNamespaceSize ; fNamespace [ ( ( fNamespaceSize ) ++ ) ] = XMLSymbols . PREFIX_XML ; fNamespace [ ( ( fNamespaceSize ) ++ ) ] = XML_URI ; fNamespace [ ( ( fNamespaceSize ) ++ ) ] = XMLSymbols . PREFIX_XMLNS ; fNamespace [ ( ( fNamespaceSize ) ++ ) ] = XMLNS_URI ; ++ ( fCurrentContext ) ; } public void pushContext ( ) { } public void popContext ( ) { } public boolean declarePrefix ( String prefix , String uri ) { } public String getURI ( String prefix ) { } public String getPrefix ( String uri ) { } public int getDeclaredPrefixCount ( ) { } public String getDeclaredPrefixAt ( int index ) { } public NamespaceContext getParentContext ( ) { } final class Context implements NamespaceContext { private int fCurrentContext ; public Context ( int currentContext ) { } public void setCurrentContext ( int currentContext ) { } public String getURI ( String prefix ) { } public int getDeclaredPrefixCount ( ) { } public String getDeclaredPrefixAt ( int index ) { } public NamespaceContext getParentContext ( ) { } } }

Fix:
public void reset ( ) {
Buggy code:
public class XMLVersionDetector { private static final char [ ] XML11_VERSION = new char [ ] { '1' , '.' , '1' } ; protected static final String SYMBOL_TABLE = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . SYMBOL_TABLE_PROPERTY ) ; protected static final String ERROR_REPORTER = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . ERROR_REPORTER_PROPERTY ) ; protected static final String ENTITY_MANAGER = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . ENTITY_MANAGER_PROPERTY ) ; protected static final String fVersionSymbol = "version" . intern ( ) ; protected static final String fXMLSymbol = "[xml]" . intern ( ) ; protected SymbolTable fSymbolTable ; protected XMLErrorReporter fErrorReporter ; protected XMLEntityManager fEntityManager ; protected String fEncoding = null ; private XMLString fVersionNum = new XMLString ( ) ; private final char [ ] fExpectedVersionString = new char [ ] { '<' , '?' , 'x' , 'm' , 'l' , '<seq2seq4repair_space>' , 'v' , 'e' , 'r' , 's' , 'i' , 'o' , 'n' , '=' , '<seq2seq4repair_space>' , '<seq2seq4repair_space>' , '<seq2seq4repair_space>' , '<seq2seq4repair_space>' , '<seq2seq4repair_space>' } ; public void reset ( XMLComponentManager componentManager ) throws XMLConfigurationException { } public void startDocumentParsing ( XMLEntityHandler scanner , short version ) { if ( version == ( Constants . XML_VERSION_1_0 ) ) { fEntityManager . setScannerVersion ( XML_VERSION_1_0 ) ; } else { fEntityManager . setScannerVersion ( XML_VERSION_1_1 ) ; } fErrorReporter . setDocumentLocator ( fEntityManager . getEntityScanner ( ) ) ; fEntityManager . setEntityHandler ( scanner ) ; <START_BUG> scanner . startEntity ( XMLVersionDetector . fXMLSymbol , fEntityManager . getCurrentResourceIdentifier ( ) , fEncoding ) ; <END_BUG> } public short determineDocVersion ( XMLInputSource inputSource ) throws IOException { } private void fixupCurrentEntity ( XMLEntityManager manager , char [ ] scannedChars , int length ) { } }

Fix:
scanner . startEntity ( XMLVersionDetector . fXMLSymbol , fEntityManager . getCurrentResourceIdentifier ( ) , fEncoding , null ) ;
Buggy code:
public class AltAddTaskActivity extends FragmentActivity implements TaskEditor { EditText eName ; EditText eDesc ; CheckBox cAllDay ; SimpleDateFormat sdf ; TextView eStartDate ; TextView eStartTime ; TextView eEndDate ; TextView eEndTime ; Date startDate ; Date endDate ; Date startTime ; Date endTime ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void startTimeDialog ( View view ) { } public void endTimeDialog ( View view ) { } public void startDateDialog ( View view ) { } public void endDateDialog ( View view ) { } public void saveData ( View view ) { Date junk = new Date ( ) ; <START_BUG> CalendarData data = new CalendarData ( ( - ( ( int ) ( junk . getTime ( ) ) ) ) , this ) ; <END_BUG> data . setStartDate ( CalendarGlobals . merge ( startDate , startTime ) ) ; data . setEndDate ( CalendarGlobals . merge ( endDate , endTime ) ) ; data . setName ( eName . getText ( ) . toString ( ) ) ; data . setDescription ( eDesc . getText ( ) . toString ( ) ) ; data . setRepeatEvery ( junk ) ; data . setRepeatUntil ( junk ) ; data . setIsAllDay ( true ) ; data . save ( ) ; calDC . addEvent ( data ) ; finish ( ) ; } @ Override public Date getStartDate ( ) { } @ Override public Date getStartTime ( ) { } @ Override public Date getEndDate ( ) { } @ Override public Date getEndTime ( ) { } @ Override public TextView getEStartDate ( ) { } @ Override public TextView getEStartTime ( ) { } @ Override public TextView getEEndDate ( ) { } @ Override public TextView getEEndTime ( ) { } @ Override public void setStartTime ( Date startTime ) { } @ Override public void setStartDate ( Date startDate ) { } @ Override public void setEndTime ( Date endTime ) { } @ Override public void setEndDate ( Date endDate ) { } }

Fix:
CalendarData data = new CalendarData ( ( ( int ) ( junk . getTime ( ) ) ) , this ) ;
Buggy code:
public class SelectFriendsActivity extends AppCompatActivity { public static final int RESULT_CODE = 1 ; public static final String SELECTED_USER_IDS = "user_ids" ; private List < ParseUser > mUsers ; private ArrayMap < Integer , Boolean > mSelected ; private SelectFriendRecyclerAdapter mRecyclerAdapter ; private PlaceholderRecyclerView mRecyclerView ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_select_friends ) ; Toolbar toolbar = ( ( Toolbar ) ( findViewById ( toolbar ) ) ) ; setSupportActionBar ( toolbar ) ; ActionBar actionBar = getSupportActionBar ( ) ; if ( actionBar != null ) { actionBar . setDisplayHomeAsUpEnabled ( true ) ; } mUsers = new ArrayList ( ) ; mSelected = new ArrayMap ( ) ; final FloatingActionButton fab = ( ( FloatingActionButton ) ( findViewById ( fab ) ) ) ; fab . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { Intent result = new Intent ( ) ; ArrayList < String > friendIds = new ArrayList < > ( ) ; for ( Map . Entry < Integer , Boolean > entry : mSelected . entrySet ( ) ) { if ( entry . getValue ( ) ) { friendIds . add ( mUsers . get ( entry . getKey ( ) ) . getObjectId ( ) ) ; } } result . putStringArrayListExtra ( SelectFriendsActivity . SELECTED_USER_IDS , friendIds ) ; <START_BUG> setResult ( SelectFriendsActivity . RESULT_CODE , result ) ; <END_BUG> finish ( ) ; } } ) ; mRecyclerAdapter = new SelectFriendRecyclerAdapter ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { int index = mUsers . indexOf ( v . getTag ( ) ) ; mSelected . put ( index , ( mSelected . containsKey ( index ) ? ! ( mSelected . get ( index ) ) : true ) ) ; mRecyclerAdapter . updateSelections ( mSelected ) ; if ( ( mSelected . size ( ) ) > 0 ) { int count = 0 ; for ( Map . Entry < Integer , Boolean > entry : mSelected . entrySet ( ) ) { if ( entry . getValue ( ) ) { count ++ ; } } if ( count > 0 ) { fab . setVisibility ( VISIBLE ) ; } else { fab . setVisibility ( INVISIBLE ) ; } } } } ) ; mRecyclerView = ( ( PlaceholderRecyclerView ) ( findViewById ( select_friends_recycler ) ) ) ; mRecyclerView . setLayoutManager ( new LinearLayoutManager ( this ) ) ; mRecyclerView . setAdapter ( mRecyclerAdapter ) ; mRecyclerView . setEmptyView ( findViewById ( no_friend_placeholder ) ) ; } @ Override protected void onStart ( ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
setResult ( RESULT_OK , result ) ;
Buggy code:
public class SqlDateConverter extends AbstractConverter { private static final long serialVersionUID = 1L ; public Date convertToObject ( final String value , Locale locale ) { if ( ( value == null ) || ( Strings . isEmpty ( value ) ) ) { return null ; } else { <START_BUG> return ( ( Date ) ( parse ( getDateFormat ( locale ) , value , locale ) ) ) ; <END_BUG> } } @ Override public String convertToString ( final Object value , Locale locale ) { } public DateFormat getDateFormat ( Locale locale ) { } @ Override protected Class < Date > getTargetType ( ) { } }

Fix:
return new Date ( ( ( java . util . Date ) ( parse ( getDateFormat ( locale ) , value , locale ) ) ) . getTime ( ) ) ;
Buggy code:
public class JavaElementFinder extends BindingKeyParser { private JavaProject project ; private WorkingCopyOwner owner ; public IJavaElement element ; public JavaModelException exception ; private ArrayList types = new ArrayList ( ) ; public JavaElementFinder ( String key , JavaProject project , WorkingCopyOwner owner ) { } private JavaElementFinder ( BindingKeyParser parser , JavaProject project , WorkingCopyOwner owner ) { } public void consumeAnnotation ( ) { } public void consumeField ( char [ ] fieldName ) { } public void consumeFullyQualifiedName ( char [ ] fullyQualifiedName ) { try { <START_BUG> this . element = this . project . findType ( new String ( CharOperation . replaceOnCopy ( fullyQualifiedName , '//' , '.' ) ) , owner ) ; <END_BUG> } catch ( JavaModelException e ) { this . exception = e ; } } public void consumeLocalType ( char [ ] uniqueKey ) { } public void consumeMemberType ( char [ ] simpleTypeName ) { } public void consumeMethod ( char [ ] selector , char [ ] signature ) { } public void consumePackage ( char [ ] pkgName ) { } public void consumeParser ( BindingKeyParser parser ) { } public void consumeSecondaryType ( char [ ] simpleTypeName ) { } public void consumeTypeVariable ( char [ ] position , char [ ] typeVariableName ) { } public BindingKeyParser newParser ( ) { } }

Fix:
this . element = this . project . findType ( new String ( CharOperation . replaceOnCopy ( fullyQualifiedName , '//' , '.' ) ) , this . owner ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class EditorFrame extends JFrame { private static final int FRAME_GAP = 20 ; private static final int ESTIMATED_FRAMES = 5 ; private static final int MAX_RECENT_FILES = 8 ; private static final double GROW_SCALE_FACTOR = Math . sqrt ( 2 ) ; private static final int MARGIN_SCREEN = 8 ; private static final int MARGIN_IMAGE = 2 ; private MenuFactory aAppFactory ; private ResourceBundle aAppResources ; private ResourceBundle aVersionResources ; private ResourceBundle aEditorResources ; private JDesktopPane aDesktop ; private JMenu aNewMenu ; private Clipboard aClipboard = new Clipboard ( ) ; private RecentFilesQueue aRecentFiles = new RecentFilesQueue ( ) ; private JMenu aRecentFilesMenu ; public EditorFrame ( Class < ? > pAppClass ) { } private void createFileMenu ( MenuFactory pFactory ) { } private void createEditMenu ( MenuFactory pFactory ) { } private void createViewMenu ( MenuFactory pFactory ) { } private void createWindowMenu ( MenuFactory pFactory ) { } private void createHelpMenu ( MenuFactory pFactory ) { } public void addGraphType ( String pResourceName , final Class < ? > pGraphClass ) { } public void readArgs ( String [ ] pArgs ) { } private void open ( String pName ) { } private void addInternalFrame ( final JInternalFrame pInternalFrame ) { } private void setTitle ( ) { } private void addRecentFile ( String pNewFile ) { } private void buildRecentFilesMenu ( ) { } public void openFile ( ) { } public void cut ( ) { } public void copy ( ) { } public void paste ( ) { GraphFrame frame = ( ( GraphFrame ) ( aDesktop . getSelectedFrame ( ) ) ) ; if ( frame == null ) { return ; } Graph curGraph = frame . getGraph ( ) ; GraphPanel panel = frame . getGraphPanel ( ) ; try { <START_BUG> SelectionList updatedSelectionList = aClipboard . pasteInto ( curGraph ) ; <END_BUG> panel . setSelectionList ( updatedSelectionList ) ; panel . repaint ( ) ; } finally { } } public void copyToClipboard ( ) { } public void save ( ) { } public void saveAs ( ) { } static String replaceExtension ( String pOriginal , String pToBeRemoved , String pDesired ) { } public void exportImage ( ) { } private File chooseFileToExportTo ( ) { } public static Graph read ( InputStream pIn ) throws IOException { } private static void saveFile ( Graph pGraph , OutputStream out ) { } private static BufferedImage getImage ( Graph pGraph ) { } public void showAboutDialog ( ) { } public void exit ( ) { } private static PersistenceDelegate staticFieldDelegate = new DefaultPersistenceDelegate ( ) { protected Expression instantiate ( Object oldInstance , Encoder out ) { } protected boolean mutatesTo ( Object oldInstance , Object newInstance ) { } } ; private static HashMap beanInfos ; }

Fix:
SelectionList updatedSelectionList = aClipboard . pasteInto ( panel ) ;
Buggy code:
public class Filters { private static final BigDecimal ZERO_BIGDECIMAL = new BigDecimal ( 0.0 ) ; private static final BigInteger ZERO_BIGINTEGER = new BigInteger ( "0" ) ; private static final int OP_ADD = 0 ; private static final int OP_SUBTRACT = 1 ; private static final int OP_MULTIPLY = 2 ; private static final int OP_DIVIDE = 3 ; private static final int OP_MOD = 4 ; private static final Localizer _loc = Localizer . forPackage ( Filters . class ) ; public static Class wrap ( Class c ) { } public static Class unwrap ( Class c ) { } public static Class promote ( Class c1 , Class c2 ) { } public static boolean canConvert ( Class c1 , Class c2 , boolean strict ) { } public static Object convert ( Object o , Class type ) { } public static Object add ( Object o1 , Class c1 , Object o2 , Class c2 ) { } public static Object subtract ( Object o1 , Class c1 , Object o2 , Class c2 ) { } public static Object multiply ( Object o1 , Class c1 , Object o2 , Class c2 ) { } public static Object divide ( Object o1 , Class c1 , Object o2 , Class c2 ) { } public static Object mod ( Object o1 , Class c1 , Object o2 , Class c2 ) { } private static Object op ( Object o1 , Class c1 , Object o2 , Class c2 , int op ) { } private static Object op ( int n1 , int n2 , int op ) { } private static Object op ( float n1 , float n2 , int op ) { } private static Object op ( double n1 , double n2 , int op ) { } private static Object op ( long n1 , long n2 , int op ) { } private static Object op ( BigDecimal n1 , BigDecimal n2 , int op ) { } private static Object op ( BigInteger n1 , BigInteger n2 , int op ) { } public static List parseDeclaration ( String dec , char split , String decType ) { } public static List splitExpressions ( String str , char split , int expected ) { } public static List addAccessPathMetaDatas ( List metas , ClassMetaData [ ] path ) { } public static AggregateListener hintToAggregateListener ( Object hint , ClassLoader loader ) { } public static AggregateListener [ ] hintToAggregateListeners ( Object hint , ClassLoader loader ) { } public static FilterListener hintToFilterListener ( Object hint , ClassLoader loader ) { } public static FilterListener [ ] hintToFilterListeners ( Object hint , ClassLoader loader ) { } public static Object hintToGetter ( Object target , String hintKey ) { if ( ( target == null ) || ( hintKey == null ) ) return null ; Method getter = ImplHelper . getGetter ( target . getClass ( ) , hintKey ) ; try { return getter . invoke ( target , ( ( Object [ ] ) ( null ) ) ) ; } catch ( Exception e ) { Throwable t = e ; if ( e instanceof InvocationTargetException ) t = ( ( InvocationTargetException ) ( e ) ) . getTargetException ( ) ; <START_BUG> throw new org . apache . openjpa . util . UserException ( Filters . _loc . get ( "bad-getter-hint" , target . getClass ( ) , hintKey ) ) . setCause ( e ) ; <END_BUG> } } public static void hintToSetter ( Object target , String hintKey , Object value ) { } }

Fix:
throw new org . apache . openjpa . util . UserException ( Filters . _loc . get ( "bad-getter-hint" , target . getClass ( ) , hintKey ) ) . setCause ( t ) ;
Buggy code:
public class LongEditor extends BaseEditor implements Editor { private final Template editorTemplate ; private Long value ; public LongEditor ( Template editorTemplate , Template viewTemplate , EditorService service ) { } @ Override public void setValue ( Object value ) { } @ Override public Object getValue ( ) { } @ Override public String getAsText ( ) { <START_BUG> return value . toString ( ) ; <END_BUG> } @ Override public Renderable getEditor ( Controller controller , PropertyValue property ) { } No newline ; at end ; of file ; }

Fix:
return ( value ) != null ? value . toString ( ) : "" ;
Buggy code:
public class SourceType extends Member implements IType { protected static final String [ ] fgEmptyList = new String [ ] { } ; protected SourceType ( IJavaElement parent , String name ) { } public IField createField ( String contents , IJavaElement sibling , boolean force , IProgressMonitor monitor ) throws JavaModelException { } public IInitializer createInitializer ( String contents , IJavaElement sibling , IProgressMonitor monitor ) throws JavaModelException { } public IMethod createMethod ( String contents , IJavaElement sibling , boolean force , IProgressMonitor monitor ) throws JavaModelException { } public IType createType ( String contents , IJavaElement sibling , boolean force , IProgressMonitor monitor ) throws JavaModelException { } protected boolean equalsDOMNode ( IDOMNode node ) throws JavaModelException { } public IType getDeclaringType ( ) { } public IField getField ( String name ) { } public IField [ ] getFields ( ) throws JavaModelException { } public String getFullyQualifiedName ( ) { } public IInitializer getInitializer ( int occurrenceCount ) { } public IInitializer [ ] getInitializers ( ) throws JavaModelException { } public IMethod getMethod ( String name , String [ ] parameterTypeSignatures ) { } public IMethod [ ] getMethods ( ) throws JavaModelException { } public IPackageFragment getPackageFragment ( ) { } public String getSuperclassName ( ) throws JavaModelException { } public String [ ] getSuperInterfaceNames ( ) throws JavaModelException { } public IType getType ( String name ) { } public String getTypeQualifiedName ( ) { } public IType [ ] getTypes ( ) throws JavaModelException { } public boolean hasChildren ( ) throws JavaModelException { } public boolean isClass ( ) throws JavaModelException { } public boolean isInterface ( ) throws JavaModelException { } public ITypeHierarchy newSupertypeHierarchy ( IProgressMonitor monitor ) throws JavaModelException { } public ITypeHierarchy newTypeHierarchy ( IProgressMonitor monitor ) throws JavaModelException { } public ITypeHierarchy newTypeHierarchy ( IJavaProject project , IProgressMonitor monitor ) throws JavaModelException { if ( project == null ) { throw new IllegalArgumentException ( Util . bind ( "hierarchy.nullProject" ) ) ; } <START_BUG> CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation ( this , SearchEngine . createJavaSearchScope ( new IResource [ ] { project . getProject ( ) } ) , true ) ; <END_BUG> runOperation ( op , monitor ) ; return op . getResult ( ) ; } public String [ ] [ ] resolveType ( String typeName ) throws JavaModelException { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } }

Fix:
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation ( this , SearchEngine . createJavaSearchScope ( new IJavaElement [ ] { project } ) , true ) ;
Buggy code:
public class EndpointArtifactFileChange extends TextFileChange { private static IDeveloperStudioLog log = Logger . getLog ( PLUGIN_ID ) ; private IFile endpointFile ; private String newName ; private String originalName ; public EndpointArtifactFileChange ( String name , IFile file , String originalName , String newName ) { } private void addTextEdits ( ) { } private void identifyReplaces ( ) throws IOException { } private int charsOnTheLine ( String line ) { } private int getArrayIndexWithString ( String stringToSearch , String [ ] array ) { int index = 0 ; for ( String string : array ) { <START_BUG> if ( string . contains ( stringToSearch ) ) { <END_BUG> return index ; } index ++ ; } return - 1 ; } }

Fix:
if ( string . startsWith ( stringToSearch ) ) {
Buggy code:
public class StringConstant extends Constant { public String value ; public StringConstant ( String value ) { } public boolean compileTimeEqual ( StringConstant right ) { } public String stringValue ( ) { } public String toString ( ) { } public int typeID ( ) { <START_BUG> return T_String ; <END_BUG> } }

Fix:
return TypeIds . T_JavaLangString ;
Buggy code:
@ WebServlet ( name = "DeleteFolderRequest" , urlPatterns = { "//DeleteFolderRequest" } ) public class DeleteFolderRequest extends HttpServlet { protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { String name = request . getParameter ( "name" ) ; String email = request . getParameter ( "email" ) ; Integer rootID = Integer . valueOf ( request . getParameter ( "rootID" ) ) ; Integer parentID = Integer . valueOf ( request . getParameter ( "id" ) ) ; Integer deleteID = Integer . valueOf ( request . getParameter ( "deleteID" ) ) ; <START_BUG> DeleteFile . delete ( deleteID ) ; <END_BUG> HashSet < File > fileList = null ; HashSet < Folder > folderList = null ; if ( parentID != null ) { fileList = ListFilesInFolder . list ( parentID ) ; folderList = ListFoldersInFolder . list ( parentID ) ; } RequestDispatcher dispatcher ; dispatcher = request . getRequestDispatcher ( "//welcome.jsp" ) ; request . setAttribute ( "name" , name ) ; request . setAttribute ( "email" , email ) ; request . setAttribute ( "rootID" , rootID ) ; request . setAttribute ( "id" , parentID ) ; request . setAttribute ( "fileList" , fileList ) ; request . setAttribute ( "folderList" , folderList ) ; dispatcher . forward ( request , response ) ; } @ Override public String getServletInfo ( ) { } No newline ; at end ; of file ; }

Fix:
DeleteFolder . delete ( deleteID ) ;
Buggy code:
public class Launcher { static String text ; static int firstPar ; static int secondPar ; public static void main ( String [ ] args ) { } public static void creatingSubstring ( String [ ] args ) throws Exception { Launcher . text = args [ 0 ] ; if ( ( ( args . length ) < 2 ) || ( ( args . length ) > 3 ) ) throw new Exception ( "Incorrect<seq2seq4repair_space>data" ) ; try { Launcher . firstPar = Integer . parseInt ( args [ 1 ] ) ; } catch ( NumberFormatException ex ) { throw new Exception ( "Second<seq2seq4repair_space>arg<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>integer" ) ; } try { <START_BUG> if ( ( args . length ) == 3 ) <END_BUG> Launcher . secondPar = Integer . parseInt ( args [ 2 ] ) ; else Launcher . secondPar = ( Launcher . text . length ( ) ) - 1 ; } catch ( NumberFormatException ex ) { throw new Exception ( "Third<seq2seq4repair_space>arg<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>integer" ) ; } if ( ( Launcher . secondPar ) > ( ( Launcher . text . length ( ) ) - 1 ) ) Launcher . secondPar = ( Launcher . text . length ( ) ) - 1 ; if ( ( Launcher . firstPar ) > ( Launcher . secondPar ) ) throw new Exception ( "Third<seq2seq4repair_space>arg<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>bigger<seq2seq4repair_space>then<seq2seq4repair_space>second" ) ; if ( ( Launcher . firstPar ) > ( ( Launcher . text . length ( ) ) - 1 ) ) throw new Exception ( "Second<seq2seq4repair_space>arg<seq2seq4repair_space>is<seq2seq4repair_space>incorrect" ) ; } }

Fix:
if ( ( ( args . length ) == 3 ) && ( ( Launcher . secondPar ) > ( Launcher . firstPar ) ) )
Buggy code:
public class ThisExpression extends Expression { public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = new ChildPropertyDescriptor ( ThisExpression . class , "qualifier" , Name . class , ASTNode . OPTIONAL , ASTNode . NO_CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Name optionalQualifier = null ; ThisExpression ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { ThisExpression result = new ThisExpression ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setQualifier ( ( ( Name ) ( ASTNode . copySubtree ( target , getQualifier ( ) ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Name getQualifier ( ) { } public void setQualifier ( Name name ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class ArrayList < E > extends ListTemplate < E > { private final E [ ] backingArray ; private ArrayList ( E [ ] array , int from , int to ) { } public static < E > ArrayList < E > empty ( ) { } @ SafeVarargs public static < E > ArrayList < E > of ( E ... array ) { } public static < E > ArrayList < E > ofRange ( E [ ] array , int from , int to ) { } @ SuppressWarnings ( "unchecked" ) public static < E > List < E > with ( Iterable < E > iterable ) { } private int weakChecked ( long index ) { } private int strongChecked ( long index ) { } @ Nullable @ Override public E get ( @ Nonnegative long index ) { } @ Override public boolean contains ( @ Nullable E element ) { <START_BUG> return ( indexOf ( element ) ) > 0 ; <END_BUG> } @ Override public long count ( ) { } @ Override public long indexOf ( @ Nullable E object , @ Nonnegative long from ) { } @ Override public long lastIndexOf ( @ Nullable E object , @ Nonnegative long from ) { } @ Override public List < E > subList ( @ Nonnegative long from , @ Nonnegative long to ) { } @ Override public E [ ] toArray ( ) { } @ Nonnull @ Override public ListIterator < E > iterator ( ) { } @ Override public Spliterator < E > spliterator ( ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
return ( indexOf ( element ) ) >= 0 ;