nus-yam/ex-repair huggingface dataset:
Buggy code:
public class iConServlet extends HttpServlet { private static final long serialVersionUID = 1L ; public iConServlet ( ) { } private String getLoginID ( String query ) { } private String getLatitude ( String query ) { } private String getLongitude ( String query ) { } private String getRadius ( String query ) { } @ SuppressWarnings ( "unchecked" ) protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { iConServer iconserver = ( ( iConServer ) ( this . getServletContext ( ) . getAttribute ( "iconserver" ) ) ) ; if ( iconserver == null ) { this . getServletContext ( ) . setAttribute ( "iconserver" , ( iconserver = iConServer . getInstance ( ) ) ) ; <START_BUG> iconserver . intialize ( 765 , 4 ) ; <END_BUG> iconserver . setUrl ( "rigi-lab-03.cs.uvic.ca" ) ; } else { } iConWeb iconweb = ( ( iConWeb ) ( this . getServletContext ( ) . getAttribute ( "iconweb" ) ) ) ; if ( iconweb == null ) { this . getServletContext ( ) . setAttribute ( "iconweb" , ( iconweb = iConWeb . getInstance ( ) ) ) ; iconweb . addServer ( iconserver ) ; } else { } HashMap < String , Integer > dbtoicon = ( ( HashMap < String , Integer > ) ( this . getServletContext ( ) . getAttribute ( "dbtoicon" ) ) ) ; if ( dbtoicon == null ) { this . getServletContext ( ) . setAttribute ( "dbtoicon" , ( dbtoicon = new HashMap < String , Integer > ( ) ) ) ; } String queryString = request . getQueryString ( ) ; queryString = queryString . replaceAll ( "%20" , "<seq2seq4repair_space>" ) ; String id = getLoginID ( queryString ) ; String lat = this . getLatitude ( queryString ) ; String lng = this . getLongitude ( queryString ) ; String rad = getRadius ( queryString ) ; String address = request . getRemoteAddr ( ) ; int userkey = dbtoicon . get ( id ) ; iconweb . moveUser ( "rigi-lab-03.cs.uvic.ca" , address , new Double ( lat ) . doubleValue ( ) , new Double ( lng ) . doubleValue ( ) , userkey ) ; String coverres = iconweb . getCoverage ( "rigi-lab-03.cs.uvic.ca" , address , new Double ( lat ) . doubleValue ( ) , new Double ( lng ) . doubleValue ( ) , userkey , iconserver . metersToDegree ( new Double ( rad ) . doubleValue ( ) ) ) ; String responsePositions = new String ( ) ; StringTokenizer st = new StringTokenizer ( coverres ) ; while ( st . hasMoreTokens ( ) ) { int key = new Integer ( st . nextToken ( ) ) ; iConAddress addr = iconserver . getUserAddress ( key ) ; responsePositions += ( ( ( addr . getLatitude ( ) ) + "<seq2seq4repair_space>" ) + ( addr . getLongitude ( ) ) ) + "<seq2seq4repair_space>" ; } response . getWriter ( ) . write ( responsePositions ) ; response . getWriter ( ) . close ( ) ; } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } }

Fix:
iconserver . intialize ( 765 , 6 ) ;
Buggy code:
public class SwitchExpressionTest { @ Test public void testLogic ( ) { } @ Test public void testUsesOperatorEquals ( ) { final CheckEvaluationExpression switchExpr = new CheckEvaluationExpression ( "xyz" ) ; final CheckEvaluationExpression caseAExpr = new CheckEvaluationExpression ( "a" ) ; final CheckEvaluationExpression valueAExpr = new CheckEvaluationExpression ( "aValue" ) ; final CheckEvaluationExpression defaultExpr = new CheckEvaluationExpression ( "defaultValue" ) ; final List < Pair < ExpressionBase , ExpressionBase > > cases = new ArrayList < Pair < ExpressionBase , ExpressionBase > > ( ) ; cases . add ( new Pair < ExpressionBase , ExpressionBase > ( caseAExpr , valueAExpr ) ) ; final SwitchExpression expr = new SwitchExpression ( switchExpr , cases , defaultExpr , SOURCE_POS ) ; final NamedFunction myStringEquals = new org . eclipse . xtend . backend . testhelpers . NamedFunctionFactory ( "operatorEquals" , org . eclipse . xtend . backend . types . builtin . StringType . INSTANCE , org . eclipse . xtend . backend . types . builtin . StringType . INSTANCE ) { public Object invoke ( ExecutionContext ctx , Object [ ] params ) { return true ; } } . create ( ) ; final FunctionDefContextInternal fdc = new org . eclipse . xtend . backend . functions . FunctionDefContextFactory ( new org . eclipse . xtend . backend . types . CompositeTypesystem ( ) ) . create ( ) ; <START_BUG> fdc . register ( myStringEquals ) ; <END_BUG> final ExecutionContext ctx = createEmptyExecutionContext ( ) ; assertEquals ( "defaultValue" , expr . evaluate ( ctx ) ) ; ctx . setFunctionDefContext ( fdc ) ; assertEquals ( "aValue" , expr . evaluate ( ctx ) ) ; } }

Fix:
fdc . register ( myStringEquals , true ) ;
Buggy code:
public class TestOmitTf extends LuceneTestCase { public static class SimpleSimilarity extends Similarity { @ Override public float computeNorm ( String field , FieldInvertState state ) { } @ Override public float queryNorm ( float sumOfSquaredWeights ) { } @ Override public float tf ( float freq ) { } @ Override public float sloppyFreq ( int distance ) { } @ Override public float idf ( int docFreq , int numDocs ) { } @ Override public float coord ( int overlap , int maxOverlap ) { } @ Override public IDFExplanation idfExplain ( Collection < Term > terms , IndexSearcher searcher ) throws IOException { } } public void testOmitTermFreqAndPositions ( ) throws Exception { } public void testMixedMerge ( ) throws Exception { } public void testMixedRAM ( ) throws Exception { } private void assertNoPrx ( Directory dir ) throws Throwable { } public void testNoPrxFile ( ) throws Throwable { } public void testBasic ( ) throws Exception { } public static class CountingHitCollector extends Collector { static int count = 0 ; static int sum = 0 ; private int docBase = - 1 ; CountingHitCollector ( ) { } @ Override public void setScorer ( Scorer scorer ) throws IOException { } @ Override public void collect ( int doc ) throws IOException { } public static int getCount ( ) { } public static int getSum ( ) { } @ Override public void setNextReader ( AtomicReaderContext context ) { <START_BUG> this . docBase = docBase ; <END_BUG> } @ Override public boolean acceptsDocsOutOfOrder ( ) { } } }

Fix:
docBase = context . docBase ;
Buggy code:
public class BookmarkablePageRequestTarget implements IBookmarkablePageRequestTarget { private Page page ; private final Class pageClass ; private final String pageMapName ; private final PageParameters pageParameters ; public BookmarkablePageRequestTarget ( Class pageClass ) { } public BookmarkablePageRequestTarget ( Class pageClass , PageParameters pageParameters ) { } public BookmarkablePageRequestTarget ( String pageMapName , Class pageClass ) { } public BookmarkablePageRequestTarget ( String pageMapName , Class pageClass , PageParameters pageParameters ) { } public void detach ( RequestCycle requestCycle ) { if ( ( page ) != null ) { <START_BUG> page . internalDetach ( ) ; <END_BUG> } } public boolean equals ( Object obj ) { } public final Page getPage ( ) { } public final Class getPageClass ( ) { } public final String getPageMapName ( ) { } public final PageParameters getPageParameters ( ) { } public int hashCode ( ) { } public void processEvents ( RequestCycle requestCycle ) { } public void respond ( RequestCycle requestCycle ) { } public String toString ( ) { } protected Page newPage ( final Class pageClass , final RequestCycle requestCycle ) { } protected final Page getPage ( RequestCycle requestCycle ) { } }

Fix:
page . detach ( ) ;
Buggy code:
public class MentionDetector { private static final String AT_SYMBOL = "@" ; private static final String WHITESPACE = "<seq2seq4repair_space>" ; private final String text ; private final RemovePunctuationMarks removePunctuationMarks = new RemovePunctuationMarks ( ) ; private final EmailValidator emailValidator = new EmailValidator ( ) ; private List < Mention > mentionsCache = null ; public MentionDetector ( String text ) { } public boolean hasMentions ( ) { } public List < Mention > getMentions ( ) { } List < Mention > parseMentions ( ) { } private boolean isEmail ( String word ) { } private String getWordStartingAtPosition ( Integer atPosition ) { } private String getWordEndingAtPosition ( int startingPosition , int atPosition ) { String startingText = text . substring ( startingPosition , atPosition ) ; int lastIndex = startingText . lastIndexOf ( "<seq2seq4repair_space>" ) ; if ( lastIndex == ( - 1 ) ) { <START_BUG> return "" ; <END_BUG> } else { return startingText . substring ( lastIndex , ( ( startingText . length ( ) ) - 1 ) ) . trim ( ) ; } } private String getWordWithoutTheAtSymbol ( Integer position ) { } private int getMentionStart ( String token , int tokenIndex ) { } public List < Sequence > getSequences ( ) { } private boolean isMention ( String token ) { } private boolean textBetweenMentionsIsWhitespace ( Mention firstMention , Mention nextMention ) { } private List < Integer > getAtSymbolsCount ( ) { } }

Fix:
return startingText ;
Buggy code:
public final class WebSubsystemElement extends AbstractSubsystemElement < WebSubsystemElement > { private static final long serialVersionUID = 4287677532426993047L ; public static final ServiceName JBOSS_WEB = JBOSS . append ( "web" ) ; public static final ServiceName JBOSS_WEB_SERVER = WebSubsystemElement . JBOSS_WEB . append ( "server" ) ; public static final ServiceName JBOSS_WEB_CONNECTOR = WebSubsystemElement . JBOSS_WEB . append ( "connector" ) ; public static final ServiceName JBOSS_WEB_HOST = WebSubsystemElement . JBOSS_WEB . append ( "host" ) ; private String defaultHost ; private WebContainerConfigElement config ; private final NavigableMap < String , WebConnectorElement > connectors = new TreeMap < String , WebConnectorElement > ( ) ; private final NavigableMap < String , WebVirtualHostElement > hosts = new TreeMap < String , WebVirtualHostElement > ( ) ; protected WebSubsystemElement ( String defaultHost ) { } public String getDefaultHost ( ) { } public void setDefaultHost ( String defaultHost ) { } protected void getUpdates ( List < ? super AbstractSubsystemUpdate < WebSubsystemElement , ? > > list ) { } protected boolean isEmpty ( ) { } protected AbstractSubsystemAdd < WebSubsystemElement > getAdd ( ) { } protected < P > void applyRemove ( UpdateContext updateContext , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { <START_BUG> final ServiceController < ? > service = updateContext . getServiceContainer ( ) . getService ( WebSubsystemElement . JBOSS_WEB ) ; <END_BUG> if ( service == null ) { resultHandler . handleSuccess ( null , param ) ; } else { service . addListener ( new UpdateResultHandler . ServiceRemoveListener < P > ( resultHandler , param ) ) ; } } protected Class < WebSubsystemElement > getElementClass ( ) { } public void writeContent ( XMLExtendedStreamWriter streamWriter ) throws XMLStreamException { } public WebContainerConfigElement getConfig ( ) { } public void setConfig ( WebContainerConfigElement config ) { } WebConnectorElement addConnector ( final String name ) { } public WebConnectorElement getConnector ( final String name ) { } boolean removeConnector ( final String name ) { } WebVirtualHostElement addHost ( final String name ) { } public WebVirtualHostElement getHost ( final String name ) { } boolean removeHost ( final String name ) { } }

Fix:
final ServiceController < ? > service = updateContext . getServiceRegistry ( ) . getService ( WebSubsystemElement . JBOSS_WEB ) ;
Buggy code:
class LUT extends IndexColorModel implements Cloneable { public double min ; public double max ; public LUT ( byte [ ] r , byte [ ] g , byte [ ] b ) { } public LUT ( int bits , int size , byte [ ] r , byte [ ] g , byte [ ] b ) { } public LUT ( IndexColorModel cm , double min , double max ) { } static byte [ ] getReds ( IndexColorModel cm ) { } static byte [ ] getGreens ( IndexColorModel cm ) { } static byte [ ] getBlues ( IndexColorModel cm ) { } public byte [ ] getBytes ( ) { } public LUT createInvertedLut ( ) { } public static LUT createLutFromColor ( Color color ) { } public synchronized Object clone ( ) { } public String toString ( ) { <START_BUG> return ( ( ( ( ( ( "rgb[0]=" + ( LUT . colorToString ( new Color ( getRGB ( 0 ) ) ) ) ) + ",<seq2seq4repair_space>rgb[255]=" ) + ( LUT . colorToString ( new Color ( getRGB ( 255 ) ) ) ) ) + ",<seq2seq4repair_space>min=" ) + ( String . format ( "%.4f" , min ) ) ) + ",<seq2seq4repair_space>max=" ) + ( String . format ( "%.4" , max ) ) ; <END_BUG> } public static String colorToString ( Color color ) { } public static String hexToColor ( String hex ) { } }

Fix:
return ( ( ( ( ( ( "rgb[0]=" + ( LUT . colorToString ( new Color ( getRGB ( 0 ) ) ) ) ) + ",<seq2seq4repair_space>rgb[255]=" ) + ( LUT . colorToString ( new Color ( getRGB ( 255 ) ) ) ) ) + ",<seq2seq4repair_space>min=" ) + ( String . format ( "%.4f" , min ) ) ) + ",<seq2seq4repair_space>max=" ) + ( String . format ( "%.4f" , max ) ) ;
Buggy code:
public abstract class FourierSeriesBuilder { public static Signal fourierSerie ( SerieFourier sf , int n , double amplitude , double periode , Discretiseur discretiseur ) { } public static double puissanceMoyenne ( SerieFourier sf , int n ) { double a02 = Math . pow ( sf . getCoefficientA0 ( ) , 2 ) ; double sum = 0.0 ; <START_BUG> for ( int i = 0 ; i <= n ; ++ i ) <END_BUG> sum += ( Math . pow ( sf . getCoefficientAn ( i ) , 2 ) ) + ( Math . pow ( sf . getCoefficientBn ( i ) , 2 ) ) ; return a02 + ( 0.5 * sum ) ; } }

Fix:
for ( int i = 1 ; i <= n ; i ++ )
Buggy code:
public class FileReporter extends JPanel { private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; Hashtable data = new Hashtable ( ) ; public void init ( String file ) throws IOException { File datafile = new File ( file ) ; BufferedReader reader = null ; if ( datafile . canRead ( ) ) { reader = new BufferedReader ( new FileReader ( datafile ) ) ; } else { JOptionPane . showMessageDialog ( null , "The<seq2seq4repair_space>file<seq2seq4repair_space>you<seq2seq4repair_space>specified<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>read." , "Information" , JOptionPane . INFORMATION_MESSAGE ) ; return ; } String line ; while ( ( line = reader . readLine ( ) ) != null ) { try { <START_BUG> line . trim ( ) ; <END_BUG> if ( ( line . startsWith ( "#" ) ) || ( ( line . length ( ) ) == 0 ) ) { continue ; } int splitter = line . lastIndexOf ( '<seq2seq4repair_space>' ) ; String key = line . substring ( 0 , splitter ) ; int len = ( line . length ( ) ) - 1 ; Integer value = null ; if ( ( line . charAt ( len ) ) == ',' ) { value = new Integer ( line . substring ( ( splitter + 1 ) , len ) ) ; } else { value = new Integer ( line . substring ( ( splitter + 1 ) ) ) ; } Vector v = getData ( key ) ; if ( v == null ) { v = new Vector ( ) ; this . data . put ( key , v ) ; } v . addElement ( value ) ; } catch ( NumberFormatException nfe ) { FileReporter . log . error ( ( "This<seq2seq4repair_space>line<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>parsed:<seq2seq4repair_space>" + line ) , nfe ) ; } catch ( Exception e ) { FileReporter . log . error ( ( "This<seq2seq4repair_space>line<seq2seq4repair_space>caused<seq2seq4repair_space>a<seq2seq4repair_space>problem:<seq2seq4repair_space>" + line ) , e ) ; } } reader . close ( ) ; showPanel ( ) ; } public Vector getData ( String key ) { } public void showPanel ( ) { } }

Fix:
line = line . trim ( ) ;
Buggy code:
public class PCEnhancerTask extends AbstractTask { protected Flags flags = new PCEnhancer . Flags ( ) ; protected String dirName = null ; public void setDirectory ( String dirName ) { } public void setAddDefaultConstructor ( boolean addDefCons ) { } public void setEnforcePropertyRestrictions ( boolean fail ) { } public void setTmpClassLoader ( boolean tmpClassLoader ) { } protected Configuration newConfiguration ( ) { } protected void executeOn ( String [ ] files ) throws IOException { flags . directory = ( ( dirName ) == null ) ? null : Files . getFile ( dirName , getClassLoader ( ) ) ; OpenJPAConfiguration conf = ( ( OpenJPAConfiguration ) ( getConfiguration ( ) ) ) ; <START_BUG> MetaDataRepository repos = new MetaDataRepository ( conf ) ; <END_BUG> PCEnhancer . run ( conf , files , flags , repos , null , getClassLoader ( ) ) ; } }

Fix:
MetaDataRepository repos = conf . newMetaDataRepositoryInstance ( ) ;
Buggy code:
public class RolloutPlanBuilder { ArrayList series = new ArrayList ( ) ; public static class RolloutPolicy { private final boolean rollingToServers ; private final Integer maxFailurePercentage ; private final Integer maxFailedServers ; public RolloutPolicy ( boolean rollingToServers , Integer maxFailurePercentage , Integer maxFailedServers ) { } public ModelNode toModelNode ( ) { } } private boolean rollBackAcrossGroups = false ; public void addGroup ( String groupName , RolloutPlanBuilder . RolloutPolicy policy ) { } public void addConcurrentGroups ( Map < String , RolloutPlanBuilder . RolloutPolicy > concurrentGroups ) { } public String buildAsString ( ) { ModelNode plan = build ( ) ; String planString = plan . toString ( ) ; <START_BUG> planString = planString . replace ( System . getProperty ( "line.separator" ) , "<seq2seq4repair_space>" ) ; <END_BUG> return planString ; } public ModelNode build ( ) { } public void setRollBackAcrossGroups ( boolean rollBackAcrossGroups ) { } }

Fix:
planString = planString . replace ( "\n" , "<seq2seq4repair_space>" ) ;
Buggy code:
public class HeaderPopulator extends AbstractPopulator { private final Demographic demographic ; private final CE < String > code ; private final II templateId ; public HeaderPopulator ( PatientExport patientExport , CE < String > code , II templateId ) { } @ Override public void populate ( ) { CS < BindingRealm > binding = new CS < BindingRealm > ( ) ; binding . setCodeEx ( new BindingRealm ( DocumentHeader . E2E_DTC_CLINICAL_DOCUMENT_TYPE_REALM_CODE , null ) ) ; clinicalDocument . setRealmCode ( new org . marc . everest . datatypes . generic . SET < CS < BindingRealm > > ( binding ) ) ; clinicalDocument . setTypeId ( new II ( DocumentHeader . E2E_DTC_CLINICAL_DOCUMENT_TYPE_ID , DocumentHeader . E2E_DTC_CLINICAL_DOCUMENT_TYPE_ID_EXTENSION ) ) ; LIST < II > templateIds = new LIST < II > ( ) ; templateIds . add ( new II ( DocumentHeader . TEMPLATE_ID ) ) ; templateIds . add ( templateId ) ; clinicalDocument . setTemplateId ( templateIds ) ; <START_BUG> clinicalDocument . setId ( demographic . getDemographicNo ( ) . toString ( ) , UUID . randomUUID ( ) . toString ( ) . toUpperCase ( ) ) ; <END_BUG> clinicalDocument . setCode ( code ) ; clinicalDocument . setTitle ( "E2E-DTC<seq2seq4repair_space>Record<seq2seq4repair_space>of<seq2seq4repair_space>" . concat ( demographic . getFirstName ( ) ) . concat ( "<seq2seq4repair_space>" ) . concat ( demographic . getLastName ( ) ) ) ; clinicalDocument . setEffectiveTime ( new GregorianCalendar ( ) , MINUTE ) ; clinicalDocument . setConfidentialityCode ( Normal ) ; clinicalDocument . setLanguageCode ( LANGUAGE_ENGLISH_CANADIAN ) ; } }

Fix:
clinicalDocument . setId ( UUID . randomUUID ( ) . toString ( ) . toUpperCase ( ) , demographic . getDemographicNo ( ) . toString ( ) ) ;
Buggy code:
public class AsmModuleTests extends TestCase { <START_BUG> public static Test suite ( ) { <END_BUG> TestSuite suite = new TestSuite ( AsmModuleTests . class . getName ( ) ) ; suite . addTestSuite ( AsmModuleTests . class ) ; return suite ; } public AsmModuleTests ( String name ) { } public void testNothing ( ) { } }

Fix:
public static TestSuite suite ( ) {
Buggy code:
final class PropertyRemove extends AbstractRemoveStepHandler { static final PropertyRemove INSTANCE = new PropertyRemove ( ) ; private PropertyRemove ( ) { } @ Override protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { } @ Override protected void recoverServices ( final OperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { <START_BUG> FeatureAdd . INSTANCE . performRuntime ( context , operation , model , null , null ) ; <END_BUG> } }

Fix:
PropertyAdd . INSTANCE . performRuntime ( context , operation , model , null , null ) ;
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "4.5-SNAPSHOT-20080626-0650" ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return "4.5-SNAPSHOT-20080715-1721" ;
Buggy code:
public class DataSourceDefinitionAnnotationParser implements DeploymentUnitProcessor { private static final DotName DATASOURCE_DEFINITION = DotName . createSimple ( DataSourceDefinition . class . getName ( ) ) ; private static final DotName DATASOURCE_DEFINITIONS = DotName . createSimple ( DataSourceDefinitions . class . getName ( ) ) ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } @ Override public void undeploy ( DeploymentUnit context ) { } private void processDataSourceDefinition ( final EEModuleDescription eeModuleDescription , final AnnotationInstance datasourceDefinition , final ClassInfo targetClass ) throws DeploymentUnitProcessingException { } private BindingConfiguration getBindingConfiguration ( final AnnotationInstance datasourceAnnotation ) { } private int asInt ( AnnotationInstance annotation , String string ) { } private String asString ( final AnnotationInstance annotation , String property ) { } private boolean asBool ( final AnnotationInstance annotation , String property ) { AnnotationValue value = annotation . value ( property ) ; <START_BUG> return value == null ? false : value . asBoolean ( ) ; <END_BUG> } private String [ ] asArray ( final AnnotationInstance annotation , String property ) { } private List < AnnotationInstance > getNestedDataSourceAnnotations ( AnnotationInstance datasourceDefinitions ) { } }

Fix:
return value == null ? true : value . asBoolean ( ) ;
Buggy code:
public class DrawView extends View implements OnTouchListener { private static final String TAG = "DrawView" ; DrawView . DrawViewBackground background ; Bitmap backgroundPicture ; List < Point > points = new ArrayList < Point > ( ) ; List < Paint > paint = new ArrayList < Paint > ( ) ; List < List < Integer > > newLine = new ArrayList < List < Integer > > ( ) ; int which ; public int size = 8 ; public DrawView ( Context context , AttributeSet attrs ) { } public DrawView ( Context context ) { } private void init ( ) { } public void setBackgroundPicture ( Bitmap picture ) { } public void setColor ( int color ) { } public void setColor ( String hexidecimalColor ) { } public void setBrushSize ( int size ) { } public void clearKeepBrush ( boolean keepBackground ) { } public void clear ( ) { } public Bitmap get ( ) { } public int getColor ( ) { } public int getBrushSize ( ) { } @ Override public void onMeasure ( int maxWidth , int maxHeight ) { } public void drawTo ( Canvas canvas ) { } @ Override public void onDraw ( Canvas canvas ) { drawTo ( canvas ) ; int totalSize = 0 ; for ( Point p : points ) { totalSize += p . length ( ) ; } <START_BUG> if ( totalSize > 400 ) { <END_BUG> setBackgroundPicture ( get ( ) ) ; clearKeepBrush ( true ) ; } } public void setDrawViewBackground ( DrawView . DrawViewBackground background ) { } public boolean onTouch ( View view , MotionEvent event ) { } public void touch ( View view , MotionEvent event ) { } public static final DrawView . DrawViewBackground PLAIN = new DrawView . DrawViewBackground ( ) { @ Override public void drawOn ( Canvas canvas ) { } } ; public static final DrawView . DrawViewBackground LINED = new DrawView . DrawViewBackground ( ) { final float SPACING_PX = TypedValue . applyDimension ( COMPLEX_UNIT_DIP , 35 , Resources . getSystem ( ) . getDisplayMetrics ( ) ) ; final Paint LINE_PAINT = new Paint ( ) ; @ Override public void drawOn ( Canvas canvas ) { } } ; public interface DrawViewBackground { public void drawOn ( Canvas canvas ) { } } }

Fix:
if ( ( totalSize > 400 ) && ( drawingNewLine ) ) {
Buggy code:
public class ZipArchiveInputStream extends ArchiveInputStream { private final ZipInputStream input ; public ZipArchiveInputStream ( InputStream inputStream ) { } public ArchiveEntry getNextEntry ( ) throws IOException { ZipEntry entry = input . getNextEntry ( ) ; if ( entry == null ) { return null ; } <START_BUG> return ( ( ArchiveEntry ) ( new ZipArchiveEntry ( entry ) ) ) ; <END_BUG> } public int read ( byte [ ] b , int off , int len ) throws IOException { } public int read ( ) throws IOException { } public static boolean matches ( byte [ ] signature , int length ) { } }

Fix:
return ( ( ArchiveEntry ) ( new ZipEntry ( entry ) ) ) ;
Buggy code:
public class MarshalProjects extends MarshalPRC { private ObjectFactory FACTORY ; private CfProjType PROJECT ; private HashMap < String , String > mapResearcher ; private HashMap < String , String > mapUncheckeds ; private Quartet < List < String > , List < String > , List < String > , List < String > > QUARTET ; private String TITLE ; private String URI ; private String OFFICIAL_CODE ; private String CODE ; private String PROGRAMME ; private String DATE_INICI ; private String DATE_FI ; public MarshalProjects ( ObjectFactory factory , String title , String uri , String officialCode , String code , String programme , String dateInici , String dateFi , Quartet < List < String > , List < String > , List < String > , List < String > > quartet , CSVResearcher researcher ) { } private void setAttrProj ( ObjectFactory factory , String title , String uri , String officialCode , String code , String programme , String dateInici , String dateFi ) { } private void createProject ( ) { PROJECT = FACTORY . createCfProjType ( ) ; PROJECT . setCfProjId ( RandomNumeric . getInstance ( ) . newId ( ) ) ; createDate ( null , DATE_INICI , DATE_FI , FACTORY , PROJECT ) ; createUrl ( URI , PROJECT ) ; createTitle ( TITLE , FACTORY , PROJECT ) ; createCode ( CODE , CLASS_ID . getINTERNAL_PROJECT_CODE ( ) , FACTORY , PROJECT ) ; createCode ( OFFICIAL_CODE , CLASS_ID . getOFFICIAL_PROJECT_CODE ( ) , FACTORY , PROJECT ) ; createFundingProgramme ( PROGRAMME , FACTORY , PROJECT ) ; <START_BUG> createRelationCfPers ( FACTORY , PROJECT , QUARTET , CODE , mapResearcher , mapResearcher ) ; <END_BUG> } public CfProjType getPROJECT ( ) { } }

Fix:
createRelationCfPers ( FACTORY , PROJECT , QUARTET , CODE , mapResearcher , mapUncheckeds ) ;
Buggy code:
public final class DefaultOptionCreator { private DefaultOptionCreator ( ) { } public static Option helpOption ( ) { } public static DefaultOptionBuilder inputOption ( ) { <START_BUG> return new DefaultOptionBuilder ( ) . withLongName ( "input" ) . withRequired ( false ) . withShortName ( "i" ) . withArgument ( new ArgumentBuilder ( ) . withName ( "input" ) . withMinimum ( 1 ) . withMaximum ( 1 ) . create ( ) ) . withDescription ( "Path<seq2seq4repair_space>to<seq2seq4repair_space>job<seq2seq4repair_space>input<seq2seq4repair_space>directory.<seq2seq4repair_space>Must<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>SequenceFile<seq2seq4repair_space>of<seq2seq4repair_space>VectorWritable" ) ; <END_BUG> } public static DefaultOptionBuilder clustersInOption ( ) { } public static DefaultOptionBuilder outputOption ( ) { } public static DefaultOptionBuilder overwriteOption ( ) { } public static DefaultOptionBuilder distanceMeasureOption ( ) { } public static DefaultOptionBuilder t1Option ( ) { } public static DefaultOptionBuilder t2Option ( ) { } public static DefaultOptionBuilder maxIterationsOption ( ) { } public static DefaultOptionBuilder kOption ( ) { } public static DefaultOptionBuilder convergenceOption ( ) { } public static DefaultOptionBuilder alphaOption ( ) { } public static DefaultOptionBuilder modelDistributionOption ( ) { } public static DefaultOptionBuilder modelPrototypeOption ( ) { } public static DefaultOptionBuilder numMappersOption ( ) { } public static DefaultOptionBuilder numReducersOption ( ) { } public static DefaultOptionBuilder clusteringOption ( ) { } public static DefaultOptionBuilder emitMostLikelyOption ( ) { } public static DefaultOptionBuilder thresholdOption ( ) { } public static DefaultOptionBuilder mOption ( ) { } public static DefaultOptionBuilder inputIsCanopiesOption ( ) { } public static DefaultOptionBuilder numTopicsOption ( ) { } public static DefaultOptionBuilder numWordsOption ( ) { } public static DefaultOptionBuilder topicSmoothingOption ( ) { } }

Fix:
return new DefaultOptionBuilder ( ) . withLongName ( "input" ) . withRequired ( false ) . withShortName ( "i" ) . withArgument ( new ArgumentBuilder ( ) . withName ( "input" ) . withMinimum ( 1 ) . withMaximum ( 1 ) . create ( ) ) . withDescription ( "Path<seq2seq4repair_space>to<seq2seq4repair_space>job<seq2seq4repair_space>input<seq2seq4repair_space>directory." ) ;
Buggy code:
public interface Evictor < K > { void evict ( K id ) { } class LockingEvictOperation < K , V > implements Operation < K , V , Boolean > { private final K key ; public LockingEvictOperation ( K key ) { } @ Override public Boolean invoke ( Cache < K , V > cache ) { <START_BUG> boolean locked = cache . getAdvancedCache ( ) . lock ( Collections . singleton ( key ) ) ; <END_BUG> if ( locked ) { cache . getAdvancedCache ( ) . withFlags ( Flag . SKIP_LOCKING ) . evict ( this . key ) ; } return locked ; } } class EvictOperation < K , V > implements Operation < K , V , Void > { private final K key ; public EvictOperation ( K key ) { } @ Override public Void invoke ( Cache < K , V > cache ) { cache . getAdvancedCache ( ) . withFlags ( Flag . SKIP_LOCKING ) . evict ( this . key ) ; return null ; } } }

Fix:
boolean locked = cache . getAdvancedCache ( ) . lock ( Collections . singleton ( this . key ) ) ;
Buggy code:
public abstract class WeaveTestCase extends TestCase { public boolean regenerate = false ; public boolean runTests = true ; public BcelWorld world = new BcelWorld ( ) ; public WeaveTestCase ( String name ) { } public static InstructionList getAdviceTag ( BcelShadow shadow , String where ) { } public void weaveTest ( String name , String outName , ShadowMunger planner ) throws IOException { } static String classDir = "..//weaver//bin" ; static String outDir = "out" ; public void weaveTest ( String name , String outName , List planners ) throws IOException { } protected void weaveTestInner ( BcelWeaver weaver , UnwovenClassFile classFile , String name , String outName ) throws IOException { BcelObjectType classType = ( ( BcelObjectType ) ( world . resolve ( classFile . getClassName ( ) ) ) ) ; LazyClassGen gen = weaver . weave ( classFile , classType ) ; if ( gen == null ) { <START_BUG> gen = new LazyClassGen ( classType ) ; <END_BUG> } try { checkClass ( gen , WeaveTestCase . outDir , ( outName + ".txt" ) ) ; if ( runTests ) { System . out . println ( ( ( ( ( "*******RUNNING:<seq2seq4repair_space>" + outName ) + "<seq2seq4repair_space>" ) + name ) + "<seq2seq4repair_space>*******" ) ) ; TestUtil . runMain ( makeClassPath ( WeaveTestCase . outDir ) , name ) ; } } catch ( Error e ) { gen . print ( System . err ) ; throw e ; } catch ( RuntimeException e ) { gen . print ( System . err ) ; throw e ; } } public String makeClassPath ( String outDir ) { } public static UnwovenClassFile makeUnwovenClassFile ( String classDir , String name , String outDir ) throws IOException { } public void checkClass ( LazyClassGen gen , String outDir , String expectedFile ) throws IOException { } void genClass ( LazyClassGen gen , String outDir , String expectedFile ) throws IOException { } void realCheckClass ( LazyClassGen gen , String outDir , String expectedFile ) throws IOException { } public ShadowMunger makeConcreteAdvice ( String mungerString ) { } public ShadowMunger makeConcreteAdvice ( String mungerString , int extraArgFlag ) { } protected ShadowMunger makeConcreteAdvice ( String mungerString , int extraArgFlag , PerClause perClause ) { } public ShadowMunger makeAdviceField ( String kind , String extraArgType ) { } public List makeAdviceAll ( String kind , boolean matchOnlyPrintln ) { } public List makeAdviceAll ( final String kind ) { } public Pointcut makePointcutAll ( ) { } public Pointcut makePointcutNoZeroArg ( ) { } public Pointcut makePointcutPrintln ( ) { } public Pointcut makeConcretePointcut ( String s ) { } public Pointcut makeResolvedPointcut ( String s ) { } public String [ ] getStandardTargets ( ) { } public String getTraceJar ( ) { } protected void weaveTest ( String [ ] inClassNames , String outKind , ShadowMunger patternMunger ) throws IOException { } protected void weaveTest ( String [ ] inClassNames , String outKind , List patternMungers ) throws IOException { } protected List addLexicalOrder ( List l ) { } public void checkShadowSet ( List l , String [ ] ss ) { } }

Fix:
gen = classType . getLazyClassGen ( ) ;
Buggy code:
public class MetricsInterceptor extends AbstractInterceptor implements MetricsConstants { private String applicationName = "<undefined>" ; private String beanName = "<undefined>" ; private Thread publisher ; private List msgQueue = new ArrayList ( 2000 ) ; public void create ( ) { } public void destroy ( ) { } public Object invoke ( Invocation invocation ) throws Exception { } private final void addEntry ( Invocation invocation , long begin , long end ) { } private Message createMessage ( Session session , String principal , int txID , String method , String checkpoint , long time ) { } private class Publisher implements Runnable { private boolean running = true ; private int delay = 2000 ; private TopicConnection connection = null ; public void run ( ) { try { final boolean IS_TRANSACTED = true ; final int ACKNOWLEDGE_MODE = Session . DUPS_OK_ACKNOWLEDGE ; Context namingContext = new InitialContext ( ) ; <START_BUG> TopicConnectionFactory fact = ( ( TopicConnectionFactory ) ( namingContext . lookup ( "TopicConnectionFactory" ) ) ) ; <END_BUG> connection = fact . createTopicConnection ( ) ; Topic topic = ( ( Topic ) ( namingContext . lookup ( "topic//metrics" ) ) ) ; TopicSession session = connection . createTopicSession ( IS_TRANSACTED , ACKNOWLEDGE_MODE ) ; TopicPublisher pub = session . createPublisher ( topic ) ; pub . setDeliveryMode ( NON_PERSISTENT ) ; pub . setPriority ( DEFAULT_PRIORITY ) ; pub . setTimeToLive ( DEFAULT_TIME_TO_LIVE ) ; connection . start ( ) ; while ( running ) { Object [ ] array ; long sleepTime = delay ; try { Thread . sleep ( sleepTime ) ; long begin = System . currentTimeMillis ( ) ; synchronized ( msgQueue ) { array = msgQueue . toArray ( ) ; msgQueue . clear ( ) ; } for ( int i = 0 ; i < ( array . length ) ; ++ i ) { Message msg = createMessage ( session , ( ( MetricsInterceptor . Entry ) ( array [ i ] ) ) . principal , ( ( MetricsInterceptor . Entry ) ( array [ i ] ) ) . id , ( ( MetricsInterceptor . Entry ) ( array [ i ] ) ) . method , ( ( MetricsInterceptor . Entry ) ( array [ i ] ) ) . checkpoint , ( ( MetricsInterceptor . Entry ) ( array [ i ] ) ) . time ) ; pub . publish ( msg ) ; } try { session . commit ( ) ; } catch ( Exception e ) { } long end = System . currentTimeMillis ( ) ; sleepTime = ( delay ) - ( end - begin ) ; } catch ( InterruptedException e ) { running = false ; } } connection . close ( ) ; } catch ( NamingException e ) { log . warn ( e ) ; } catch ( JMSException e ) { log . warn ( e ) ; } } } private final class Entry { int id = - 1 ; long time ; String principal ; String checkpoint ; String method ; public Entry ( Principal principal , Method method , Transaction tx , long time , String checkpoint ) { } } }

Fix:
TopicConnectionFactory fact = ( ( TopicConnectionFactory ) ( namingContext . lookup ( "ConnectionFactory" ) ) ) ;
Buggy code:
public class TestAVLTree < E > extends TestBinarySearchTree { private static final int TIMEOUT = 2000 ; private phaseA . AVLTree < String > AVLTree ; public phaseA . AVLTree < String > getDataCounter ( ) { } @ Before public void createTree ( ) { } @ Test ( timeout = TestAVLTree . TIMEOUT ) public void test_null_AVL_height ( ) { } @ Test ( timeout = TestAVLTree . TIMEOUT ) public void test_one_node_height ( ) { <START_BUG> dc . incCount ( "a" ) ; <END_BUG> assertEquals ( "The<seq2seq4repair_space>height<seq2seq4repair_space>of<seq2seq4repair_space>[a]" , 0 , AVLTree . getHeight ( ) ) ; } @ Test ( timeout = TestAVLTree . TIMEOUT ) public void test_two_same_node_height ( ) { } @ Test ( timeout = TestAVLTree . TIMEOUT ) public void test_two_same_three_nodes_height ( ) { } @ Test ( timeout = TestAVLTree . TIMEOUT ) public void test_two_diff_node_height ( ) { } @ Test ( timeout = TestAVLTree . TIMEOUT ) public void test_three_nodes_AVL_height ( ) { } @ Test ( timeout = TestAVLTree . TIMEOUT ) public void right_right_rotation ( ) { } @ Test ( timeout = TestAVLTree . TIMEOUT ) public void left_left_rotation ( ) { } @ Test ( timeout = TestAVLTree . TIMEOUT ) public void left_right_rotation ( ) { } @ Test ( timeout = TestAVLTree . TIMEOUT ) public void right_left_rotation ( ) { } @ Test ( timeout = TestAVLTree . TIMEOUT ) public void right_left_rotation_five_nodes ( ) { } No newline ; at end ; of file ; }

Fix:
AVLTree . incCount ( "a" ) ;
Buggy code:
public class DatabasePersistence implements IPersistenceService { private boolean connected ; private Connection connection ; public DatabasePersistence ( ) { } public boolean open ( ) { String host = Domain . getDbHostName ( ) ; int port = Domain . getDbPort ( ) ; String schema = Domain . getDbSchema ( ) ; String username = Domain . getDbUsername ( ) ; String password = Domain . getDbPassword ( ) ; try { Class . forName ( "com.mysql.jdbc.Driver" ) ; <START_BUG> connection = DriverManager . getConnection ( ( ( ( "jdbc:mysql////" + host ) + ":" ) + schema ) , username , password ) ; <END_BUG> connected = true ; } catch ( SQLException | ClassNotFoundException ex ) { ex . printStackTrace ( ) ; connected = false ; } return connected ; } public boolean isOpen ( ) { } public void close ( ) { } }

Fix:
connection = DriverManager . getConnection ( ( ( ( ( ( "jdbc:mysql:////" + host ) + ":" ) + port ) + "//" ) + schema ) , username , password ) ;
Buggy code:
public class Game { private int num_players ; private Player [ ] players ; private List < PieceDef > pieces ; public Game ( Options options ) { } public int getNumPlayers ( ) { } synchronized void addLines ( int player , int lines ) { <START_BUG> if ( ( num_players ) == 2 ) { <END_BUG> players [ ( 1 - player ) ] . addExtraLines ( lines ) ; } } public synchronized PieceDef getNextPiece ( int num ) { } public synchronized Player getPlayer ( int pID ) { } public synchronized void execute ( int player , Command command ) { } public void start ( ) { } }

Fix:
if ( ( ( num_players ) == 2 ) && ( ! ( players [ ( 1 - player ) ] . hasLost ( ) ) ) ) {
Buggy code:
public class SourceMethod extends NamedMember implements IMethod { protected String [ ] parameterTypes ; protected SourceMethod ( JavaElement parent , String name , String [ ] parameterTypes ) { } protected void closing ( Object info ) throws JavaModelException { } public boolean equals ( Object o ) { } public int getElementType ( ) { } public String [ ] getExceptionTypes ( ) throws JavaModelException { } protected void getHandleMemento ( StringBuffer buff ) { } protected char getHandleMementoDelimiter ( ) { } public String getKey ( ) { try { <START_BUG> return getKey ( this , Binding . USE_ACCESS_FLAGS_IN_BINDING_KEY , false ) ; <END_BUG> } catch ( JavaModelException e ) { return null ; } } public int getNumberOfParameters ( ) { } public String [ ] getParameterNames ( ) throws JavaModelException { } public String [ ] getParameterTypes ( ) { } public ITypeParameter getTypeParameter ( String typeParameterName ) { } public ITypeParameter [ ] getTypeParameters ( ) throws JavaModelException { } public String [ ] getTypeParameterSignatures ( ) throws JavaModelException { } public IJavaElement getPrimaryElement ( boolean checkOwner ) { } public String getReturnType ( ) throws JavaModelException { } public String getSignature ( ) throws JavaModelException { } public int hashCode ( ) { } public boolean isConstructor ( ) throws JavaModelException { } public boolean isMainMethod ( ) throws JavaModelException { } public boolean isResolved ( ) { } public boolean isSimilar ( IMethod method ) { } public String readableName ( ) { } public JavaElement resolved ( Binding binding ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info , boolean showResolvedInfo ) { } protected void toStringName ( StringBuffer buffer ) { } protected void toStringName ( StringBuffer buffer , int flags ) { } }

Fix:
return getKey ( this , true , false ) ;
Buggy code:
public abstract class AbstractAutoCompleteRenderer implements IAutoCompleteRenderer { public final void render ( Object object , Response response ) { } public final void renderHeader ( Response response ) { } public final void renderFooter ( Response response ) { <START_BUG> response . write ( "<ul>" ) ; <END_BUG> } protected abstract void renderChoices ( Object object , Response response ) { } protected abstract String getTextValue ( Object object ) { } }

Fix:
response . write ( "<//ul>" ) ;
Buggy code:
class TransactionSubsystem10Parser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > { public static final TransactionSubsystem10Parser INSTANCE = new TransactionSubsystem10Parser ( ) ; private TransactionSubsystem10Parser ( ) { } @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } static void parseObjectStoreEnvironmentElementAndEnrichOperation ( final XMLExtendedStreamReader reader , ModelNode operation ) throws XMLStreamException { } static void parseCoordinatorEnvironmentElement ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { } static void parseCoreEnvironmentElement ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { } static void parseProcessIdEnvironmentElement ( XMLExtendedStreamReader reader , ModelNode coreEnvironmentAdd ) throws XMLStreamException { } static void parseSocketProcessIdElement ( XMLExtendedStreamReader reader , ModelNode coreEnvironmentAdd ) throws XMLStreamException { } static void parseRecoveryEnvironmentElement ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { Set < Attribute > required = EnumSet . of ( BINDING , STATUS_BINDING ) ; final int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; final String value = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; required . remove ( attribute ) ; switch ( attribute ) { case BINDING : TransactionSubsystemRootResourceDefinition . BINDING . parseAndSetParameter ( value , operation , reader ) ; break ; case STATUS_BINDING : TransactionSubsystemRootResourceDefinition . STATUS_BINDING . parseAndSetParameter ( value , operation , reader ) ; break ; case RECOVERY_LISTENER : RECOVERY_LISTENER . parseAndSetParameter ( value , operation , reader ) ; break ; default : <START_BUG> unexpectedAttribute ( reader , i ) ; <END_BUG> } } if ( ! ( required . isEmpty ( ) ) ) { throw missingRequired ( reader , required ) ; } requireNoContent ( reader ) ; } }

Fix:
throw unexpectedAttribute ( reader , i ) ;
Buggy code:
public class RangeUtil { public static final int NO_FLAG = 0 ; public static final int LBRACE_MISSING = 1 ; public static final int IGNORE = 2 ; static class RangeResult { private static final int INITIAL_SIZE = 10 ; int pos ; int [ ] intervalStarts ; int [ ] intervalEnds ; int [ ] intervalFlags ; RangeResult ( ) { } void addInterval ( int start , int end ) { } void addInterval ( int start , int end , int flags ) { } int [ ] [ ] getRanges ( ) { } private void quickSort ( int [ ] list , int [ ] list2 , int [ ] list3 , int left , int right ) { } private int compare ( int i1 , int i2 ) { } } public static boolean containsErrorInSignature ( AbstractMethodDeclaration method ) { } public static int [ ] [ ] computeDietRange ( TypeDeclaration [ ] types ) { } private static void computeDietRange0 ( TypeDeclaration [ ] types , RangeUtil . RangeResult result ) { for ( int j = 0 ; j < ( types . length ) ; j ++ ) { TypeDeclaration [ ] memberTypeDeclarations = types [ j ] . memberTypes ; if ( ( memberTypeDeclarations != null ) && ( ( memberTypeDeclarations . length ) > 0 ) ) { RangeUtil . computeDietRange0 ( types [ j ] . memberTypes , result ) ; } AbstractMethodDeclaration [ ] methods = types [ j ] . methods ; if ( methods != null ) { int length = methods . length ; for ( int i = 0 ; i < length ; i ++ ) { AbstractMethodDeclaration method = methods [ i ] ; if ( RangeUtil . containsIgnoredBody ( method ) ) { if ( RangeUtil . containsErrorInSignature ( method ) ) { method . errorInSignature = true ; result . addInterval ( method . declarationSourceStart , method . declarationSourceEnd , RangeUtil . IGNORE ) ; } else { int flags = ( ( ( method . sourceEnd ) + 1 ) == ( method . bodyStart ) ) ? RangeUtil . LBRACE_MISSING : RangeUtil . NO_FLAG ; result . addInterval ( method . bodyStart , method . bodyEnd , flags ) ; } } } } FieldDeclaration [ ] fields = types [ j ] . fields ; if ( fields != null ) { int length = fields . length ; for ( int i = 0 ; i < length ; i ++ ) { if ( ( fields [ i ] ) instanceof Initializer ) { Initializer initializer = ( ( Initializer ) ( fields [ i ] ) ) ; <START_BUG> if ( ( initializer . declarationSourceEnd ) == ( initializer . bodyEnd ) ) { <END_BUG> initializer . errorInSignature = true ; result . addInterval ( initializer . declarationSourceStart , initializer . declarationSourceEnd , RangeUtil . IGNORE ) ; } else { result . addInterval ( initializer . bodyStart , initializer . bodyEnd ) ; } } } } } } public static boolean isInInterval ( int start , int end , int [ ] intervalStart , int [ ] intervalEnd ) { } public static int getPreviousInterval ( int start , int end , int [ ] intervalStart , int [ ] intervalEnd ) { } public static boolean containsIgnoredBody ( AbstractMethodDeclaration method ) { } }

Fix:
if ( ( ( initializer . declarationSourceEnd ) == ( initializer . bodyEnd ) ) && ( ( initializer . declarationSourceStart ) != ( initializer . declarationSourceEnd ) ) ) {
Buggy code:
public final class EmailAddressResultHandler extends ResultHandler { private static final int [ ] buttons = new int [ ] { string . button_email , string . button_add_contact } ; public EmailAddressResultHandler ( Activity activity , ParsedResult result ) { } @ Override public int getButtonCount ( ) { } @ Override public int getButtonText ( int index ) { } @ Override public void handleButtonPress ( int index ) { EmailAddressParsedResult emailResult = ( ( EmailAddressParsedResult ) ( getResult ( ) ) ) ; switch ( index ) { case 0 : <START_BUG> sendEmailFromUri ( emailResult . getMailtoURI ( ) , null , null ) ; <END_BUG> break ; case 1 : String [ ] addresses = new String [ 1 ] ; addresses [ 0 ] = emailResult . getEmailAddress ( ) ; addContact ( null , null , addresses , null , null , null , null ) ; break ; } } @ Override public int getDisplayTitle ( ) { } }

Fix:
sendEmailFromUri ( emailResult . getMailtoURI ( ) , emailResult . getEmailAddress ( ) , null , null ) ;
Buggy code:
public class PageTable { private int pid ; private int grootte ; private List < PageTableEntry > pageTable ; public PageTable ( int grootte ) { } public List < PageTableEntry > getPageTable ( ) { } public void setPageTable ( List < PageTableEntry > pageTable ) { } public PageTableEntry findPageTableEntry ( double pageNumber ) { int i = 0 ; boolean found = false ; PageTableEntry pageTableEntry = null ; while ( ( ! found ) && ( i < ( pageTable . size ( ) ) ) ) { pageTableEntry = pageTable . get ( i ) ; <START_BUG> if ( ( pageTableEntry . getFrameNumber ( ) ) == ( new Double ( pageNumber ) . intValue ( ) ) ) <END_BUG> found = true ; i ++ ; } return pageTableEntry ; } public PageTableEntry findLeastRecentlyUsed ( ) { } public PageTableEntry get ( double d ) { } }

Fix:
if ( ( pageTableEntry . getPageNumber ( ) ) == ( new Double ( pageNumber ) . intValue ( ) ) )