nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Storage { public static final String NEW_FILE_NAME = "mytextfile.txt" ; public static final String ERROR_NEW_FILE = "ERROR!<seq2seq4repair_space>In<seq2seq4repair_space>creating<seq2seq4repair_space>new<seq2seq4repair_space>file" ; public static final String TASK_UPLOADED = "Tasks<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>updated" ; public static final String TASK_NOT_UPLOADED = "Tasks<seq2seq4repair_space>not<seq2seq4repair_space>updated" ; public static final String ERROR_FILE_UNREFRESH = "File<seq2seq4repair_space>not<seq2seq4repair_space>refrshed" ; public static final String EMPTY_STRING = "" ; private static Storage stg ; public JSONArray newTask ; public JSONArray newEvent ; private static final Logger logger = Logger . getLogger ( Controller . class . getName ( ) ) ; String filename = "Jarvas_Storage.txt" ; Storage ( ) { } public static Storage getInstance ( ) { } public void saveToStorage ( ) { } private void fileRead ( ) { } public Vector < TaskToDo > convertToVector ( ) { Vector < TaskToDo > vecTask = new Vector < TaskToDo > ( ) ; <START_BUG> for ( int i = 0 ; i < ( newTask . size ( ) ) ; i ++ ) { <END_BUG> JSONObject task = ( ( JSONObject ) ( newTask . get ( i ) ) ) ; String name = task . get ( "Task" ) . toString ( ) ; String age = task . get ( "Date" ) . toString ( ) ; TaskToDo aTask = new TaskToDo ( name , age ) ; vecTask . add ( aTask ) ; } return vecTask ; } public void convertToJSONArray ( JSONObject newObject , JSONArray newArray ) { } public void convertTaskToJSONObject ( Vector < TaskToDo > tasks ) { } public void convertEventToJSONObject ( Vector < TaskEvent > events ) { } }

Fix:
for ( int i = 0 ; ( ( newTask ) != null ) && ( i < ( newTask . size ( ) ) ) ; i ++ ) {
Buggy code:
public class GraphicsExample { Composite parent ; GraphicsTab [ ] tabs ; GraphicsTab tab ; GraphicsBackground background ; ToolBar toolBar ; Tree tabList ; Text tabDesc ; Sash hSash ; Sash vSash ; Canvas canvas ; Composite tabControlPanel ; ToolItem backItem ; ToolItem dbItem ; Menu backMenu ; ArrayList resources ; ArrayList tabs_in_order ; boolean animate = true ; static boolean advanceGraphics ; static boolean advanceGraphicsInit ; static final int MARGIN = 5 ; static final int SASH_SPACING = 1 ; static final int TIMER = 30 ; static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle . getBundle ( "examples_graphics" ) ; public GraphicsExample ( final Composite parent ) { } boolean checkAdvancedGraphics ( ) { } void createControls ( final Composite parent ) { } void createCanvas ( Composite parent ) { } void recreateCanvas ( ) { } void paintBackground ( GC gc , Rectangle rect ) { } void createControlPanel ( Composite parent ) { } void createToolBar ( final Composite parent ) { } static Image createThumbnail ( Device device , String name ) { } static Image createImage ( Device device , Color color1 , Color color2 , int width , int height ) { } static Image createImage ( Device device , Color color ) { } void createTabList ( Composite parent ) { } void createTabDesc ( Composite parent ) { } GraphicsTab [ ] createTabs ( ) { } public void dispose ( ) { } TreeItem findItemByData ( TreeItem [ ] items , Object data ) { } public GraphicsTab getTab ( ) { } static String getResourceString ( String key ) { } static Image loadImage ( Device device , Class clazz , String string ) { } Image loadImage ( Device device , String name ) { } public void redraw ( ) { } public void setDoubleBuffered ( boolean doubleBuffered ) { } public void setFocus ( ) { } public void setTab ( GraphicsTab tab ) { } void startAnimationTimer ( ) { final Display display = parent . getDisplay ( ) ; display . timerExec ( GraphicsExample . TIMER , new Runnable ( ) { public void run ( ) { if ( canvas . isDisposed ( ) ) return ; int timeout = GraphicsExample . TIMER ; GraphicsTab tab = getTab ( ) ; if ( tab instanceof AnimatedGraphicsTab ) { AnimatedGraphicsTab animTab = ( ( AnimatedGraphicsTab ) ( tab ) ) ; if ( ( animate ) && ( animTab . getAnimation ( ) ) ) { Rectangle rect = canvas . getClientArea ( ) ; animTab . next ( rect . width , rect . height ) ; canvas . redraw ( ) ; canvas . update ( ) ; } <START_BUG> timeout = animTab . getSelectedAnimationTime ( ) ; <END_BUG> } display . timerExec ( timeout , this ) ; } } ) ; } public static void main ( String [ ] args ) { } }

Fix:
timeout = animTab . getAnimationTime ( ) ;
Buggy code:
public class Solution { public int findMin ( int [ ] num ) { int left = 0 ; int right = ( num . length ) - 1 ; while ( left < right ) { <START_BUG> int mid = ( left + right ) > > 1 ; <END_BUG> if ( ( num [ mid ] ) > ( num [ right ] ) ) { left = mid + 1 ; } else { right = mid ; } } return num [ left ] ; } public static void main ( String [ ] args ) { } }

Fix:
int mid = ( left + right ) > > > 1 ;
Buggy code:
public class WebXmlFileTest extends TestCase { public void test_filter ( ) throws IOException , ParserConfigurationException , SAXException { } public void test_servlet ( ) throws IOException , ParserConfigurationException , SAXException { } public void filterOrServlet ( boolean servlet ) throws IOException , ParserConfigurationException , SAXException { } private String getWebXml ( String filter , String url ) { <START_BUG> StringBuffer webxml = new StringBuffer ( ) ; <END_BUG> webxml . append ( "<web-app>" ) ; webxml . append ( ( ( "<" + filter ) + ">" ) ) ; webxml . append ( ( ( ( ( "<seq2seq4repair_space><" + filter ) + "-name>HelloWorldApplication<//" ) + filter ) + "-name>" ) ) ; webxml . append ( ( ( ( ( "<seq2seq4repair_space><" + filter ) + "-class>org.apache.wicket.protocol.http.WicketFilter<//" ) + filter ) + "-class>" ) ) ; webxml . append ( "<seq2seq4repair_space><init-param>" ) ; webxml . append ( "<seq2seq4repair_space><param-name>applicationClassName<//param-name>" ) ; webxml . append ( "<seq2seq4repair_space><param-value>org.apache.wicket.examples.helloworld.HelloWorldApplication<//param-value>" ) ; webxml . append ( "<seq2seq4repair_space><//init-param>" ) ; webxml . append ( ( ( "<//" + filter ) + ">" ) ) ; webxml . append ( "" ) ; webxml . append ( ( ( "<" + filter ) + "-mapping>" ) ) ; webxml . append ( ( ( ( ( "<seq2seq4repair_space><" + filter ) + "-name>HelloWorldApplication<//" ) + filter ) + "-name>" ) ) ; webxml . append ( ( ( "<seq2seq4repair_space><url-pattern>" + url ) + "<//url-pattern>" ) ) ; webxml . append ( "<seq2seq4repair_space><dispatcher>REQUEST<//dispatcher>" ) ; webxml . append ( "<seq2seq4repair_space><dispatcher>INCLUDE<//dispatcher>" ) ; webxml . append ( ( ( "<//" + filter ) + "-mapping>" ) ) ; webxml . append ( "<//web-app>" ) ; return webxml . toString ( ) ; } }

Fix:
StringBuilder webxml = new StringBuilder ( ) ;
Buggy code:
public class SecurityContextAssociationHandler implements HttpHandler { private final Map < String , Set < String > > principleVsRoleMap ; private final String contextId ; private final HttpHandler next ; public SecurityContextAssociationHandler ( final Map < String , Set < String > > principleVsRoleMap , final String contextId , final HttpHandler next ) { } @ Override public void handleRequest ( final HttpServerExchange exchange ) throws Exception { SecurityContext sc = exchange . getAttachment ( SECURITY_CONTEXT_ATTACHMENT ) ; String previousContextID = null ; String identity = null ; try { SecurityActions . setSecurityContextOnAssociation ( sc ) ; <START_BUG> ServletChain servlet = exchange . getAttachment ( CURRENT_SERVLET ) ; <END_BUG> identity = servlet . getManagedServlet ( ) . getServletInfo ( ) . getRunAs ( ) ; RunAsIdentity runAsIdentity = null ; if ( identity != null ) { ROOT_LOGGER . tracef ( "%s,<seq2seq4repair_space>runAs:<seq2seq4repair_space>%s" , servlet . getManagedServlet ( ) . getServletInfo ( ) . getName ( ) , identity ) ; final Set < String > roles = principleVsRoleMap . get ( identity ) ; runAsIdentity = new RunAsIdentity ( identity , identity , ( roles == null ? Collections . < String > emptySet ( ) : roles ) ) ; } SecurityActions . pushRunAsIdentity ( runAsIdentity ) ; previousContextID = setContextID ( contextId ) ; next . handleRequest ( exchange ) ; } finally { if ( identity != null ) { SecurityActions . popRunAsIdentity ( ) ; } SecurityActions . clearSecurityContext ( ) ; SecurityRolesAssociation . setSecurityRoles ( null ) ; setContextID ( previousContextID ) ; } } private static class SetContextIDAction implements PrivilegedAction < String > { private String contextID ; SetContextIDAction ( String contextID ) { } @ Override public String run ( ) { } } private String setContextID ( String contextID ) { } public static HandlerWrapper wrapper ( final Map < String , Set < String > > principleVsRoleMap , final String contextId ) { } }

Fix:
ServletChain servlet = exchange . getAttachment ( ATTACHMENT_KEY ) . getCurrentServlet ( ) ;
Buggy code:
public class VerifyNewAction extends XmlSecurityActionAdapter { private ITextEditor editor = null ; private IFile file = null ; private static final String ERROR_TEXT = "An<seq2seq4repair_space>error<seq2seq4repair_space>occured<seq2seq4repair_space>during<seq2seq4repair_space>verification" ; private static final String ACTION = "verify" ; public void selectionChanged ( final IAction action , final ISelection selection ) { } public void run ( final IAction action ) { } private void createVerification ( ) { VerifyDocument verify = new VerifyDocument ( ) ; ArrayList < VerificationResult > results = new ArrayList < VerificationResult > ( ) ; try { if ( ( file ) != null ) { results = verify . verify ( file . getLocation ( ) . toString ( ) ) ; } else { if ( editor . isDirty ( ) ) { saveEditorContent ( editor ) ; } file = ( ( IFile ) ( editor . getEditorInput ( ) . getAdapter ( IFile . class ) ) ) ; if ( ( file ) != null ) { results = verify . verify ( file . getLocation ( ) . toString ( ) ) ; } else { showInfo ( verificationImpossible , NLS . bind ( protectedDoc , VerifyNewAction . ACTION ) ) ; } } if ( ( results . size ( ) ) == 0 ) { <START_BUG> showInfo ( refreshImpossible , noSignaturesInDocument ) ; <END_BUG> } IWorkbenchPage page = PlatformUI . getWorkbench ( ) . getActiveWorkbenchWindow ( ) . getActivePage ( ) ; IViewPart vp = page . showView ( ID ) ; if ( vp instanceof SignatureView ) { ( ( SignatureView ) ( vp ) ) . setInput ( results ) ; } } catch ( XMLSignatureException xmlse ) { showError ( error , ( ( Messages . invalidValueElement ) + ( xmlse . getLocalizedMessage ( ) ) ) ) ; } catch ( KeyResolverException kre ) { showError ( error , ( ( Messages . invalidCertificate ) + ( kre . getLocalizedMessage ( ) ) ) ) ; } catch ( Exception ex ) { showErrorDialog ( error , verificationError , ex ) ; log ( VerifyNewAction . ERROR_TEXT , ex ) ; } } }

Fix:
showInfo ( signaturesView , noSignaturesInDocument ) ;
Buggy code:
public class PSVIDOMImplementationImpl extends CoreDOMImplementationImpl { static PSVIDOMImplementationImpl singleton = new PSVIDOMImplementationImpl ( ) ; public static DOMImplementation getDOMImplementation ( ) { } public boolean hasFeature ( String feature , String version ) { <START_BUG> return ( super . hasFeature ( feature , version ) ) || ( feature . equalsIgnoreCase ( "PSVI" ) ) ; <END_BUG> } public Document createDocument ( String namespaceURI , String qualifiedName , DocumentType doctype ) throws DOMException { } }

Fix:
return ( super . hasFeature ( feature , version ) ) || ( feature . equalsIgnoreCase ( "psvi" ) ) ;
Buggy code:
public class AppTest extends TestCase { public static boolean equals ( double [ ] x , double [ ] y , double delta ) { } public static boolean equals ( double [ ] [ ] x , double [ ] [ ] y , double delta ) { } public static ConditionalProbabilityWpsClient getClient ( ) { <START_BUG> return new ConditionalProbabilityWpsClient ( "http:////130.56.250.253:8080//wps//WebProcessingService" ) ; <END_BUG> } public static void print2DArray ( double [ ] [ ] array ) { } public static void printVector ( double [ ] array ) { } public AppTest ( String testName ) { } public static Test suite ( ) { } public void testQuantile ( ) throws IOException , WPSClientException { } public void testImputationNA ( ) throws IOException , WPSClientException { } public void testImputationNAAsync ( ) throws IOException , WPSClientException { } public void testHpiKdeAsync ( ) throws IOException , WPSClientException { } public void testHpiKde ( ) throws IOException , WPSClientException { } public void testHpiKdeDput ( ) throws IOException , WPSClientException { } public void testLogDensity ( ) throws IOException , WPSClientException { } public void testLogDensityAsync ( ) throws IOException , WPSClientException { } public void testMeanAcfAsync ( ) throws IOException , WPSClientException { } public void testMeanAcf ( ) throws IOException , WPSClientException { } public void testDoubleLogDensity ( ) throws IOException , WPSClientException { } public void testDoubleLogDensityAsync ( ) throws IOException , WPSClientException { } public void testQuantileAsync ( ) throws IOException , WPSClientException { } public void testCenLRAsync ( ) throws IOException , WPSClientException { } public void testCenLR ( ) throws IOException , WPSClientException { } }

Fix:
return new ConditionalProbabilityWpsClient ( "http:////130.56.248.192:8080//wps//WebProcessingService" ) ;
Buggy code:
public class DefaultTaskContext implements TaskContext { private static final Resources REZ = ResourceManager . getPackageResources ( DefaultTaskContext . class ) ; private final ServiceManager m_serviceManager ; private final Logger m_logger ; private final PropertyStore m_store ; private PropertyResolver m_propertyResolver ; public DefaultTaskContext ( final ServiceManager serviceManager , final Logger logger , final PropertyStore store ) { } public String getName ( ) { } public File getBaseDirectory ( ) { } public Object getService ( final Class serviceClass ) throws TaskException { } public File resolveFile ( final String filename ) { } public Object resolveValue ( final String value ) throws TaskException { try { if ( null == ( m_propertyResolver ) ) { m_propertyResolver = ( ( PropertyResolver ) ( getService ( PropertyResolver . class ) ) ) ; } <START_BUG> final Object object = m_propertyResolver . resolveProperties ( value , m_store ) ; <END_BUG> if ( null == object ) { final String message = DefaultTaskContext . REZ . getString ( "null-resolved-value.error" , value ) ; throw new TaskException ( message ) ; } return object ; } catch ( final TaskException te ) { final String message = DefaultTaskContext . REZ . getString ( "bad-resolve.error" , value ) ; throw new TaskException ( message , te ) ; } } public Object getProperty ( final String name ) { } public Map getProperties ( ) throws TaskException { } public void setProperty ( final String name , final Object value ) throws TaskException { } public void debug ( final String message ) { } public void debug ( final String message , final Throwable throwable ) { } public boolean isDebugEnabled ( ) { } public void verbose ( String message ) { } public void verbose ( String message , Throwable throwable ) { } public boolean isVerboseEnabled ( ) { } public void info ( final String message ) { } public void info ( final String message , final Throwable throwable ) { } public boolean isInfoEnabled ( ) { } public void warn ( final String message ) { } public void warn ( final String message , final Throwable throwable ) { } public boolean isWarnEnabled ( ) { } public void error ( final String message ) { } public void error ( final String message , final Throwable throwable ) { } public boolean isErrorEnabled ( ) { } public TaskContext createSubContext ( final String name ) throws TaskException { } }

Fix:
final Object object = m_propertyResolver . resolveProperties ( value , this ) ;
Buggy code:
public class SliceQueryFilter implements IFilter { private static Logger logger = LoggerFactory . getLogger ( SliceQueryFilter . class ) ; public final byte [ ] start ; public final byte [ ] finish ; public final List < byte [ ] > bitmasks ; public final boolean reversed ; public final int count ; public SliceQueryFilter ( byte [ ] start , byte [ ] finish , List < byte [ ] > bitmasks , boolean reversed , int count ) { } public IColumnIterator getMemtableColumnIterator ( ColumnFamily cf , DecoratedKey key , AbstractType comparator ) { } <START_BUG> public IColumnIterator getSSTableColumnIterator ( SSTableReader sstable , String key ) { <END_BUG> return new SSTableSliceIterator ( sstable , key , start , finish , getPredicate ( ) , reversed ) ; } public IColumnIterator getSSTableColumnIterator ( SSTableReader sstable , FileDataInput file , DecoratedKey key , long dataStart ) { } private Predicate < IColumn > getPredicate ( ) { } public SuperColumn filterSuperColumn ( SuperColumn superColumn , int gcBefore ) { } public Comparator < IColumn > getColumnComparator ( AbstractType comparator ) { } public void collectReducedColumns ( IColumnContainer container , Iterator < IColumn > reducedColumns , int gcBefore ) { } public Collection < IColumn > applyPredicate ( Collection < IColumn > columns ) { } @ SuppressWarnings ( "unchecked" ) private Predicate < IColumn > getBitmaskMatchColumnPredicate ( ) { } public static boolean matchesBitmask ( byte [ ] bitmask , byte [ ] name ) { } }

Fix:
public IColumnIterator getSSTableColumnIterator ( SSTableReader sstable , DecoratedKey key ) {
Buggy code:
public class ModelGeneralizer { private final Specification spec ; private final String property ; private final Model basisModel ; private final int k ; private final Map < StreamIndex , Interval > cache = new HashMap < > ( ) ; private final Map < String , Expr > equations = new HashMap < > ( ) ; private final Queue < StreamIndex > toGeneralize = new ArrayDeque < > ( ) ; private final Map < StreamIndex , Interval > generalized = new HashMap < > ( ) ; private final ReverseDependencyMap dependsOn ; private final IntIntervalGeneralizer intIntervalGeneralizer ; private final RealIntervalGeneralizer realIntervalGeneralizer ; public ModelGeneralizer ( Specification spec , String property , Model model , int k ) { } public Counterexample generalize ( ) { } private Interval generalizeInterval ( StreamIndex si ) { } private Interval generalizeBoolInterval ( StreamIndex si ) { } private Interval generalizeSubrangeIntInterval ( StreamIndex si ) { } private Counterexample extractCounterexample ( ) { } private Value convert ( Type type , Interval value ) { if ( type instanceof EnumType ) { EnumType et = ( ( EnumType ) ( type ) ) ; <START_BUG> return new jkind . lustre . values . EnumValue ( et . values . get ( getExactInt ( value ) ) ) ; <END_BUG> } else { return value ; } } private int getExactInt ( Interval value ) { } private Interval originalInterval ( StreamIndex si ) { } private boolean modelConsistent ( ) { } public boolean modelConsistent ( StreamIndex si , Interval proposedValue ) { } private void clearCacheFrom ( StreamIndex si ) { } public static class AlgebraicLoopException extends RuntimeException { private static final long serialVersionUID = 1L ; } private final Set < StreamIndex > working = new HashSet < > ( ) ; private Interval eval ( Expr expr , int i ) { } private Interval eval ( StreamIndex si ) { } public Interval evalId ( StreamIndex si ) { } private Interval getFromBasisModel ( StreamIndex si ) { } private Interval valueToInterval ( Value value ) { } }

Fix:
return new jkind . lustre . values . EnumValue ( et . getValue ( getExactInt ( value ) , "" ) ) ;
Buggy code:
@ SupportedAnnotationTypes ( { "javax.persistence.Entity" , "javax.persistence.Embeddable" , "javax.persistence.MappedSuperclass" } ) @ SupportedOptions ( { "log" } ) @ SupportedSourceVersion ( SourceVersion . RELEASE_6 ) public class AnnotationProcessor6 extends AbstractProcessor { private SourceAnnotationHandler handler ; private static Localizer _loc = Localizer . forPackage ( AnnotationProcessor6 . class ) ; private static final String UNDERSCORE = "_" ; private static enum TypeCategory { ATTRIBUTE ( "javax.persistence.metamodel.Attribute" ) , COLLECTION ( "javax.persistence.metamodel.Collection" ) , SET ( "javax.persistence.metamodel.Set" ) , LIST ( "javax.persistence.metamodel.List" ) , MAP ( "javax.persistence.metamodel.Map" ) ; private String type ; private TypeCategory ( String type ) { } public String getMetaModelType ( ) { } } private static List < String > CLASSNAMES_LIST = Arrays . asList ( new String [ ] { "java.util.List" , "java.util.AbstractList" , "java.util.AbstractSequentialList" , "java.util.ArrayList" , "java.util.Stack" , "java.util.Vector" } ) ; private static List < String > CLASSNAMES_SET = Arrays . asList ( new String [ ] { "java.util.Set" , "java.util.AbstractSet" , "java.util.EnumSet" , "java.util.HashSet" , "java.util.LinkedList" , "java.util.LinkedHashSet" , "java.util.SortedSet" , "java.util.TreeSet" } ) ; private static List < String > CLASSNAMES_MAP = Arrays . asList ( new String [ ] { "java.util.Map" , "java.util.AbstractMap" , "java.util.EnumMap" , "java.util.HashMap" , "java.util.Hashtable" , "java.util.IdentityHashMap" , "java.util.LinkedHashMap" , "java.util.Properties" , "java.util.SortedMap" , "java.util.TreeMap" } ) ; private static List < String > CLASSNAMES_COLLECTION = Arrays . asList ( new String [ ] { "java.util.Collection" , "java.util.AbstractCollection" , "java.util.AbstractQueue" , "java.util.Queue" , "java.util.PriorityQueue" } ) ; private AnnotationProcessor6 . TypeCategory toMetaModelTypeCategory ( String name ) { } @ Override public synchronized void init ( ProcessingEnvironment processingEnv ) { } @ Override public boolean process ( Set < ? extends TypeElement > annos , RoundEnvironment roundEnv ) { } private boolean process ( TypeElement e ) { } private void annotate ( SourceCode source , String originalClass ) { } private void comment ( SourceCode source ) { } private PrintWriter createSourceFile ( String metaClass , TypeElement e ) throws IOException { Filer filer = processingEnv . getFiler ( ) ; JavaFileObject javaFile = filer . createSourceFile ( metaClass , e ) ; <START_BUG> log ( AnnotationProcessor6 . _loc . get ( "mmg-process" , metaClass , javaFile . toUri ( ) ) . getMessage ( ) ) ; <END_BUG> OutputStream out = javaFile . openOutputStream ( ) ; PrintWriter writer = new PrintWriter ( out ) ; return writer ; } private void log ( String msg ) { } }

Fix:
log ( AnnotationProcessor6 . _loc . get ( "mmg-process" , javaFile . toUri ( ) ) . getMessage ( ) ) ;
Buggy code:
public class SlidingTabsColorsFragment extends Fragment { static final String LOG_TAG = "SlidingTabsColorsFragment" ; private SlidingTabLayout mSlidingTabLayout ; private ViewPager mViewPager ; private List < SlidingTabsColorsFragment . SamplePagerItem > mTabs = new ArrayList < SlidingTabsColorsFragment . SamplePagerItem > ( ItunesAppController . getNumCategories ( ) ) ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; for ( int tabIndex = 0 ; tabIndex < ( ItunesAppController . getNumCategories ( ) ) ; tabIndex ++ ) { <START_BUG> CategoryAttribute catAttr = ItunesAppController . getCategoryList ( ) . get ( tabIndex ) ; <END_BUG> mTabs . add ( new SlidingTabsColorsFragment . SamplePagerItem ( catAttr . getTitle ( ) , tabIndex , catAttr . getColor ( ) , catAttr . getColor ( ) ) ) ; } } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { } static class SamplePagerItem { private final CharSequence mTitle ; private final int mIndex ; private final int mIndicatorColor ; private final int mDividerColor ; SamplePagerItem ( CharSequence title , int index , int indicatorColor , int dividerColor ) { } Fragment createFragment ( ) { } CharSequence getTitle ( ) { } int getindex ( ) { } int getIndicatorColor ( ) { } int getDividerColor ( ) { } } class SampleFragmentPagerAdapter extends FragmentPagerAdapter { SampleFragmentPagerAdapter ( FragmentManager fm ) { } @ Override public Fragment getItem ( int i ) { } @ Override public int getCount ( ) { } @ Override public CharSequence getPageTitle ( int position ) { } } No newline ; at end ; of file ; }

Fix:
CategoryAttribute catAttr = ItunesAppController . getCategoryAttributeList ( ) . get ( tabIndex ) ;
Buggy code:
public class TarArchiveInputStream extends ArchiveInputStream { private static final int SMALL_BUFFER_SIZE = 256 ; private final byte [ ] SMALL_BUF = new byte [ TarArchiveInputStream . SMALL_BUFFER_SIZE ] ; private final int recordSize ; private final int blockSize ; private boolean hasHitEOF ; private long entrySize ; private long entryOffset ; private final InputStream is ; private TarArchiveEntry currEntry ; private final ZipEncoding encoding ; public TarArchiveInputStream ( InputStream is ) { } public TarArchiveInputStream ( InputStream is , String encoding ) { } public TarArchiveInputStream ( InputStream is , int blockSize ) { } public TarArchiveInputStream ( InputStream is , int blockSize , String encoding ) { } public TarArchiveInputStream ( InputStream is , int blockSize , int recordSize ) { } public TarArchiveInputStream ( InputStream is , int blockSize , int recordSize , String encoding ) { } @ Override public void close ( ) throws IOException { } public int getRecordSize ( ) { } @ Override public int available ( ) throws IOException { } @ Override public long skip ( long numToSkip ) throws IOException { } @ Override public synchronized void reset ( ) { } public TarArchiveEntry getNextTarEntry ( ) throws IOException { } private void skipRecordPadding ( ) throws IOException { } protected byte [ ] getLongNameData ( ) throws IOException { } private byte [ ] getRecord ( ) throws IOException { } protected boolean isEOFRecord ( byte [ ] record ) { } protected byte [ ] readRecord ( ) throws IOException { byte [ ] record = new byte [ recordSize ] ; <START_BUG> int readNow = is . read ( record ) ; <END_BUG> count ( readNow ) ; if ( readNow != ( recordSize ) ) { return null ; } return record ; } private void paxHeaders ( ) throws IOException { } Map < String , String > parsePaxHeaders ( InputStream i ) throws IOException { } private void applyPaxHeadersToCurrentEntry ( Map < String , String > headers ) { } private void readGNUSparse ( ) throws IOException { } @ Override public ArchiveEntry getNextEntry ( ) throws IOException { } private void tryToConsumeSecondEOFRecord ( ) throws IOException { } @ Override public int read ( byte [ ] buf , int offset , int numToRead ) throws IOException { } @ Override public boolean canReadEntryData ( ArchiveEntry ae ) { } public TarArchiveEntry getCurrentEntry ( ) { } protected final void setCurrentEntry ( TarArchiveEntry e ) { } protected final boolean isAtEOF ( ) { } protected final void setAtEOF ( boolean b ) { } private void consumeRemainderOfLastBlock ( ) throws IOException { } public static boolean matches ( byte [ ] signature , int length ) { } }

Fix:
int readNow = IOUtils . readFully ( is , record ) ;
Buggy code:
class StressCategory { static Level [ ] level = new Level [ ] { Level . TRACE , Level . DEBUG , Level . INFO , Level . WARN , Level . ERROR , Level . FATAL } ; static Level defaultLevel = Logger . getRootLogger ( ) . getLevel ( ) ; static int LENGTH ; static String [ ] names ; static Category [ ] cat ; static StressCategory . CT [ ] ct ; static Random random = new Random ( 10 ) ; public static void main ( String [ ] args ) { } static void permute ( int n ) { } static void swap ( String [ ] names , int i , int j ) { } public static void permutationDump ( ) { } static void createLoop ( int n ) { if ( n == ( StressCategory . LENGTH ) ) { for ( int i = 0 ; i < ( StressCategory . LENGTH ) ; i ++ ) { if ( ( StressCategory . ct [ i ] ) == null ) StressCategory . cat [ i ] = null ; else { <START_BUG> StressCategory . cat [ i ] = Category . getInstance ( StressCategory . ct [ i ] . catstr ) ; <END_BUG> StressCategory . cat [ i ] . setLevel ( StressCategory . ct [ i ] . level ) ; } } StressCategory . test ( ) ; Hierarchy h = ( ( Hierarchy ) ( LogManager . getLoggerRepository ( ) ) ) ; h . clear ( ) ; } else { StressCategory . ct [ n ] = null ; StressCategory . createLoop ( ( n + 1 ) ) ; StressCategory . ct [ n ] = new StressCategory . CT ( StressCategory . names [ n ] , null ) ; StressCategory . createLoop ( ( n + 1 ) ) ; int r = StressCategory . random . nextInt ( ) ; if ( r < 0 ) r = - r ; StressCategory . ct [ n ] = new StressCategory . CT ( StressCategory . names [ n ] , StressCategory . level [ ( r % 5 ) ] ) ; StressCategory . createLoop ( ( n + 1 ) ) ; } } static void test ( ) { } static void ctDump ( ) { } static void catDump ( ) { } static boolean checkCorrectness ( int i ) { } static Level getExpectedPrioriy ( StressCategory . CT ctParam ) { } static class CT { public String catstr ; public Level level ; CT ( String catstr , Level level ) { } } }

Fix:
StressCategory . cat [ i ] = Logger . getLogger ( StressCategory . ct [ i ] . catstr ) ;
Buggy code:
public class DCAwareRoundRobinPolicy implements CloseableLoadBalancingPolicy , LoadBalancingPolicy { private static final Logger logger = LoggerFactory . getLogger ( DCAwareRoundRobinPolicy . class ) ; private final String UNSET = "" ; private final ConcurrentMap < String , CopyOnWriteArrayList < Host > > perDcLiveHosts = new ConcurrentHashMap < String , CopyOnWriteArrayList < Host > > ( ) ; private final AtomicInteger index = new AtomicInteger ( ) ; @ VisibleForTesting volatile String localDc ; private final ConcurrentMap < String , CopyOnWriteArrayList < Host > > perDcSuspectedHosts = new ConcurrentHashMap < String , CopyOnWriteArrayList < Host > > ( ) ; private final int usedHostsPerRemoteDc ; private final boolean dontHopForLocalCL ; private volatile Configuration configuration ; public DCAwareRoundRobinPolicy ( ) { } public DCAwareRoundRobinPolicy ( String localDc ) { } public DCAwareRoundRobinPolicy ( String localDc , int usedHostsPerRemoteDc ) { } public DCAwareRoundRobinPolicy ( String localDc , int usedHostsPerRemoteDc , boolean allowRemoteDCsForLocalConsistencyLevel ) { } private DCAwareRoundRobinPolicy ( String localDc , int usedHostsPerRemoteDc , boolean allowRemoteDCsForLocalConsistencyLevel , boolean allowEmptyLocalDc ) { } @ Override public void init ( Cluster cluster , Collection < Host > hosts ) { } private String dc ( Host host ) { } @ SuppressWarnings ( "unchecked" ) private static CopyOnWriteArrayList < Host > cloneList ( CopyOnWriteArrayList < Host > list ) { } @ Override public HostDistance distance ( Host host ) { } @ Override public Iterator < Host > newQueryPlan ( String loggedKeyspace , final Statement statement ) { } private void waitOnReconnection ( Host h ) { try { h . getInitialReconnectionAttemptFuture ( ) . get ( configuration . getSocketOptions ( ) . getConnectTimeoutMillis ( ) , TimeUnit . MILLISECONDS ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } catch ( ExecutionException e ) { throw new AssertionError ( e ) ; } catch ( TimeoutException e ) { <START_BUG> DCAwareRoundRobinPolicy . logger . debug ( "Timeout<seq2seq4repair_space>while<seq2seq4repair_space>waiting<seq2seq4repair_space>only<seq2seq4repair_space>host<seq2seq4repair_space>initial<seq2seq4repair_space>reconnection<seq2seq4repair_space>future" , e ) ; <END_BUG> } } @ Override public void onUp ( Host host ) { } @ Override public void onSuspected ( Host host ) { } @ Override public void onDown ( Host host ) { } @ Override public void onAdd ( Host host ) { } @ Override public void onRemove ( Host host ) { } @ Override public void close ( ) { } }

Fix:
DCAwareRoundRobinPolicy . logger . debug ( ( "Timeout<seq2seq4repair_space>while<seq2seq4repair_space>waiting<seq2seq4repair_space>on<seq2seq4repair_space>initial<seq2seq4repair_space>reconnection<seq2seq4repair_space>future<seq2seq4repair_space>for<seq2seq4repair_space>" + h ) , e ) ;
Buggy code:
public class Dump { private static final String FILENAME_PREFIX = "ajcore" ; private static final DateFormat dateFormat = new SimpleDateFormat ( "yyyyMMdd" ) ; private static final DateFormat timeFormat = new SimpleDateFormat ( "HHmmss.SSS" ) ; private static final String FILENAME_SUFFIX = "txt" ; public static final String UNKNOWN_FILENAME = "Unknown" ; public static final String DUMP_EXCLUDED = "Excluded" ; public static final String NULL_OR_EMPTY = "Empty" ; private static Class exceptionClass ; private static Kind conditionKind = IMessage . ABORT ; private String reason ; private String fileName ; private PrintStream print ; private static String [ ] savedCommandLine ; private static List savedFullClasspath ; private static IMessageHolder savedMessageHolder ; private static Map nodes = new HashMap ( ) ; private static String lastDumpFileName = Dump . UNKNOWN_FILENAME ; public static String dump ( String reason ) { } public static String dumpWithException ( Throwable th ) { } public static String dumpOnExit ( ) { } private static boolean shouldDumpOnExit ( ) { } public static void setDumpOnException ( boolean b ) { } public static boolean getDumpOnException ( ) { } public static boolean setDumpOnExit ( IMessage . Kind condition ) { } public static boolean setDumpOnExit ( String condition ) { } public static Kind getDumpOnExit ( ) { } public static String getLastDumpFileName ( ) { } public static void saveCommandLine ( String [ ] args ) { } public static void saveFullClasspath ( List list ) { } public static void saveMessageHolder ( IMessageHolder holder ) { } public static void registerNode ( Class module , Dump . INode newNode ) { } private Dump ( String reason ) { } public String getFileName ( ) { } private void dumpDefault ( ) { } private void dumpException ( Throwable th ) { } private void dumpAspectJProperties ( ) { } private void dumpDumpConfiguration ( ) { } private void dumpFullClasspath ( ) { } private void dumpSytemProperties ( ) { } private void dumpCommandLine ( ) { } private void dumpCompilerMessages ( ) { } private void openDump ( ) { } public void close ( ) { } private void println ( String s ) { } private void println ( Object [ ] array ) { } private void println ( Properties props ) { } private void println ( Throwable th ) { } private void println ( File file ) { } private void println ( List list ) { if ( ( list == null ) || ( list . isEmpty ( ) ) ) println ( Dump . NULL_OR_EMPTY ) ; else for ( Iterator i = list . iterator ( ) ; i . hasNext ( ) ; ) { Object o = i . next ( ) ; if ( o instanceof Exception ) { println ( ( ( Exception ) ( o ) ) ) ; } else { <START_BUG> println ( i . next ( ) . toString ( ) ) ; <END_BUG> } } } public interface INode { public void accept ( Dump . IVisitor visior ) { } } public interface IVisitor { public void visitString ( String s ) { } public void visitList ( List list ) { } } }

Fix:
println ( o . toString ( ) ) ;
Buggy code:
public class AnonymousLoginValve extends AbstractValve { private static final Set nonAnonymousTargets = new HashSet ( ) ; private String username = null ; private String password = null ; public void initialize ( ) throws Exception { } public void invoke ( RunData data , ValveContext context ) throws IOException , TurbineException { } private void anonymousLogin ( RunData data , ValveContext context ) { try { <START_BUG> ScarabUser user = ( ( ScarabUser ) ( TurbineSecurity . getAuthenticatedUser ( username , password ) ) ) ; <END_BUG> data . setUser ( user ) ; user . setHasLoggedIn ( Boolean . TRUE ) ; user . updateLastLogin ( ) ; data . save ( ) ; } catch ( Exception e ) { Log . get ( ) . error ( ( "anonymousLogin<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>login<seq2seq4repair_space>anonymously:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } } }

Fix:
ScarabUser user = ( ( ScarabUser ) ( TurbineSecurity . getUser ( username ) ) ) ;
Buggy code:
public class OnlyOnceErrorHandler implements ErrorHandler { final String WARN_PREFIX = "log4j<seq2seq4repair_space>warning:<seq2seq4repair_space>" ; final String ERROR_PREFIX = "log4j<seq2seq4repair_space>error:<seq2seq4repair_space>" ; boolean firstTime = true ; <START_BUG> public void setLogger ( String loggerName ) { <END_BUG> } public void activateOptions ( ) { } public void error ( String message , Exception e , int errorCode ) { } public void error ( String message , Exception e , int errorCode , LoggingEvent event ) { } public void error ( String message ) { } public void setAppender ( Appender appender ) { } public void setBackupAppender ( Appender appender ) { } }

Fix:
public void setLogger ( Logger logger ) {
Buggy code:
public class EligibilityUploader { private SQLConnection connection ; private LocalDate statsDate ; public static void main ( String ... args ) throws IOException , URISyntaxException , SQLException { <START_BUG> LocalDate statsDate = new LocalDate ( 2016 , 3 , 24 ) ; <END_BUG> SQLConnection connection = new MySQLConnectionFactory ( ) . createConnection ( ) ; EligibilityUploader eligibilityUploader = new EligibilityUploader ( connection , statsDate ) ; eligibilityUploader . updateDatabase ( ) ; } public EligibilityUploader ( SQLConnection connection , LocalDate statsDate ) { } public void updateDatabase ( ) throws IOException , SQLException { } }

Fix:
LocalDate statsDate = DraftPrepRunner . statsDate ;
Buggy code:
@ Service ( "DownloadService" ) public final class DownloadService implements IDownloadService { static final Logger LOGGER = Logger . getLogger ( DownloadService . class . getName ( ) ) ; @ Autowired DownloadRepository downloadRepository ; @ Override public final Download findById ( final long downloadId ) { } @ Override public final LinkedList < Download > findByUser ( final User user ) { } @ Override public final void delete ( final Download download ) { } @ Override public final void delete ( final long downloadId ) { } @ Override public final Download save ( final Download download ) { } @ Override public Download saveToDisk ( final Download download ) { Thread t = new Thread ( new Runnable ( ) { @ Override public void run ( ) { final File file ; try { <START_BUG> DownloadService . LOGGER . info ( "Trying<seq2seq4repair_space>to<seq2seq4repair_space>save<seq2seq4repair_space>dowmload..." ) ; <END_BUG> file = FileUtility . getFileFromURL ( download ) ; FileUtility . saveToDrive ( file ) ; download . setEndDate ( new Date ( ) ) ; save ( download ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } ) ; t . start ( ) ; return download ; } }

Fix:
DownloadService . LOGGER . info ( "Trying<seq2seq4repair_space>to<seq2seq4repair_space>save<seq2seq4repair_space>download..." ) ;
Buggy code:
public class DefaultExpressionFactory implements ExpressionFactory { @ Override public NAryBooleanExpression and ( BooleanExpressionArgument ... childExpressions ) { } @ Override public NAryBooleanExpression or ( BooleanExpressionArgument ... childExpressions ) { } @ Override public NAryExpression plus ( ExpressionArgument ... childExpressions ) { } @ Override public NAryExpression times ( ExpressionArgument ... childExpressions ) { } @ Override public NAryBooleanExpression and ( Collection < ? extends BooleanExpressionArgument > childExpressions ) { } @ Override public NAryBooleanExpression or ( Collection < ? extends BooleanExpressionArgument > childExpressions ) { } @ Override public NAryExpression plus ( Collection < ? extends ExpressionArgument > childExpressions ) { } @ Override public NAryExpression times ( Collection < ? extends ExpressionArgument > childExpressions ) { } @ Override public UnaryBooleanExpression not ( BooleanExpressionArgument child ) { } @ Override public UnaryBooleanExpression isNull ( ColumnExpression columnExpression ) { } @ Override public UnaryBooleanExpression isNotNull ( ColumnExpression columnExpression ) { } @ Override public UnaryExpression minus ( ExpressionArgument argument ) { } @ Override public UnaryExpression minus ( Parameter < Number > argument ) { } @ Override public BinaryExpression expression ( String expressionType , ExpressionArgument argument1 , ExpressionArgument argument2 ) { } @ Override public BinaryBooleanExpression condition ( String conditionType , BooleanExpressionArgument argument1 , BooleanExpressionArgument argument2 ) { <START_BUG> return BinaryBooleanExpression ( conditionType , argument1 , argument2 ) ; <END_BUG> } @ Override public BinaryBooleanExpression like ( ColumnExpression columnExpression , String pattern ) { } @ Override public BinaryBooleanExpression like ( ColumnExpression columnExpression , Parameter < String > stringParameter ) { } @ Override public BinaryBooleanExpression like ( ColumnExpression columnExpression , ExpressionArgument argument ) { } }

Fix:
return new BinaryBooleanExpression ( conditionType , argument1 , argument2 ) ;
Buggy code:
public class ConsolePrinter { private static final String LINE = "\n──────────────────────────────────────────────────\n" ; public static final String ERROR_TEXT_FORMAT_START = "\n[31m" ; public static final String ERROR_TEXT_FORMAT_STOP = "[0m" ; private static Logger log = Logger . getLogger ( "user" ) ; private static Logger logError = Logger . getLogger ( "errorLog" ) ; private static Localization loc = Localization . getInstance ( ) ; private static StringBuilder sb = new StringBuilder ( ) ; private ConsolePrinter ( ) { } public static void print ( Localization . Messages enumMessage ) { } public static void exception ( Exception e ) { } public static void printListContent ( String dir , List < FileRecord > dirContents ) { ConsolePrinter . sb . delete ( 0 , ConsolePrinter . sb . length ( ) ) ; ConsolePrinter . sb . append ( ConsolePrinter . LINE ) ; ConsolePrinter . sb . append ( new File ( dir ) . getAbsolutePath ( ) ) ; ConsolePrinter . sb . append ( ConsolePrinter . LINE ) ; Iterator < FileRecord > iterator = dirContents . iterator ( ) ; while ( iterator . hasNext ( ) ) { FileRecord fileRecord = iterator . next ( ) ; ConsolePrinter . sb . append ( String . format ( "%-35s<%5s><seq2seq4repair_space>%15d<seq2seq4repair_space>bytes\n" , fileRecord . getName ( ) , fileRecord . getType ( ) . toString ( ) , fileRecord . getSize ( ) ) ) ; } ConsolePrinter . sb . append ( ConsolePrinter . LINE ) ; <START_BUG> ConsolePrinter . sb . append ( String . format ( "%s<seq2seq4repair_space>%d,<seq2seq4repair_space>%d<seq2seq4repair_space>%s<seq2seq4repair_space>&<seq2seq4repair_space>%d<seq2seq4repair_space>%s\n" , ConsolePrinter . loc . toString ( WORD_TOTAL ) , dirContents . size ( ) , Utils . countFolders ( dirContents ) , ConsolePrinter . loc . toString ( WORD_FOLDERS ) , Utils . countFiles ( dirContents ) , ConsolePrinter . loc . toString ( WORD_FILES ) ) ) ; <END_BUG> ConsolePrinter . sb . append ( ConsolePrinter . LINE ) . append ( ConsolePrinter . loc . toString ( NEW_COM ) ) . append ( "\n" ) ; ConsolePrinter . log . info ( ConsolePrinter . sb ) ; } public static void printRecentDirs ( List < String > recentDirs ) { } public static StringBuilder printHelp ( StringBuilder sb ) { } }

Fix:
ConsolePrinter . sb . append ( String . format ( "%s<seq2seq4repair_space>%d,<seq2seq4repair_space>%d<seq2seq4repair_space>%s<seq2seq4repair_space>&<seq2seq4repair_space>%d<seq2seq4repair_space>%s" , ConsolePrinter . loc . toString ( WORD_TOTAL ) , dirContents . size ( ) , Utils . countFolders ( dirContents ) , ConsolePrinter . loc . toString ( WORD_FOLDERS ) , Utils . countFiles ( dirContents ) , ConsolePrinter . loc . toString ( WORD_FILES ) ) ) ;
Buggy code:
public class CacheFile { public CacheFile ( Context context , String name ) { } public String read ( ) throws IOException { } public void remove ( ) { } public void sync ( boolean redo ) throws IOException { if ( ( ! redo ) && ( exists ( ) ) ) { return ; } <START_BUG> URL url = new URL ( ( ( BuildConfig . DEBUG ? "http:////192.168.1.102//tools//downloads//" : "https:////raw.githubusercontent.com//chonglou//BuddhismHomework//master//tools//mp3//" ) + ( name ) ) ) ; <END_BUG> Log . d ( "下载" , ( ( ( url . toString ( ) ) + "<seq2seq4repair_space>=><seq2seq4repair_space>" ) + ( getRealName ( ) ) ) ) ; DataInputStream dis = new DataInputStream ( url . openStream ( ) ) ; byte [ ] buf = new byte [ 1024 ] ; int len ; FileOutputStream fos = context . openFileOutput ( getRealName ( ) , MODE_PRIVATE ) ; while ( ( len = dis . read ( buf ) ) > 0 ) { fos . write ( buf , 0 , len ) ; } fos . flush ( ) ; } public String getRealName ( ) { } public boolean exists ( ) { } private String name ; private Context context ; }

Fix:
URL url = new URL ( ( ( BuildConfig . DEBUG ? "http:////192.168.1.102//tools//downloads//" : "https:////raw.githubusercontent.com//chonglou//BuddhismHomework//master//tools//downloads//" ) + ( name ) ) ) ;
Buggy code:
public abstract class GameEngine { private GameWorld _world ; private HashMap < String , SpaceShip > _players ; private GameState _gameState ; public GameWorld getWorld ( ) { } public HashMap < String , SpaceShip > getPlayers ( ) { } public GameState getGameState ( ) { } public GameEngine ( ) { } public void startGame ( ) { } public void tick ( ) { } private void checkTurn ( ) { int alive = 0 ; for ( SpaceShip pl : _players . values ( ) ) { if ( pl . isAlive ( ) ) { alive ++ ; } } <START_BUG> if ( ( ( alive == 1 ) && ( ( _players . size ( ) ) > 1 ) ) || ( alive == 0 ) ) { <END_BUG> if ( alive == 1 ) { for ( SpaceShip pl : _players . values ( ) ) { this . invokePlayerWon ( pl ) ; break ; } } this . startGame ( ) ; } } public abstract void invokePlayerWon ( SpaceShip pl ) { } public void playerInput ( String name , PlayerInput input ) { } public void removePlayer ( String name ) { } public void addPlayer ( String name , int imageID , boolean local ) { } public void addPlayer ( String name , int imageID ) { } }

Fix:
if ( ( ( alive == 1 ) && ( ( _players . size ( ) ) > 1 ) ) || ( ( alive == 0 ) && ( ( _players . size ( ) ) > 0 ) ) ) {
Buggy code:
public class OperationCodePiece extends NamedCodePiece { private CodePiece operationDef ; private String name ; private boolean fullyQualifiedTypeNames ; public OperationCodePiece ( CodePiece javadocDef , CodePiece operationDef , String name ) { } public StringBuffer getText ( ) { } public int getStartPosition ( ) { } public int getEndPosition ( ) { } public int getStartLine ( ) { } public int getEndLine ( ) { } public void write ( BufferedReader reader , BufferedWriter writer , Stack parseStateStack ) throws Exception { ParseState parseState = ( ( ParseState ) ( parseStateStack . peek ( ) ) ) ; Vector features = parseState . getNewFeatures ( ) ; boolean found = false ; for ( Iterator j = features . iterator ( ) ; ( j . hasNext ( ) ) && ( ! found ) ; ) { MFeature feature = ( ( MFeature ) ( j . next ( ) ) ) ; <START_BUG> if ( feature . getName ( ) . equals ( name ) ) { <END_BUG> found = true ; parseState . newFeature ( feature ) ; MOperation mOperation = ( ( MOperation ) ( feature ) ) ; writer . write ( GeneratorJava . getInstance ( ) . generateOperation ( mOperation , true ) ) ; } } if ( found ) { ffCodePiece ( reader , null ) ; } else { ffCodePiece ( reader , writer ) ; } } }

Fix:
if ( ( feature . getName ( ) . equals ( name ) ) && ( feature instanceof MOperation ) ) {
Buggy code:
public class JavaElementInfo { protected IJavaElement [ ] children ; static Object [ ] NO_NON_JAVA_RESOURCES = new Object [ ] { } ; protected JavaElementInfo ( ) { } public void addChild ( IJavaElement child ) { int length = this . children . length ; if ( length == 0 ) { this . children = new IJavaElement [ ] { child } ; } else { for ( int i = 0 ; i < length ; i ++ ) { <START_BUG> if ( children [ i ] . equals ( child ) ) <END_BUG> return ; } System . arraycopy ( this . children , 0 , ( this . children = new IJavaElement [ length + 1 ] ) , 0 , length ) ; this . children [ length ] = child ; } } public Object clone ( ) { } public IJavaElement [ ] getChildren ( ) { } public void removeChild ( IJavaElement child ) { } public void setChildren ( IJavaElement [ ] children ) { } }

Fix:
if ( this . children [ i ] . equals ( child ) )