nus-yam/ex-repair huggingface dataset:
Buggy code:
public class User { private static Random randGen = new Random ( 1234 ) ; private String username ; private String passwd ; private int credit ; private ListADT < Product > wishList ; public User ( String username , String passwd , int credit ) { } public boolean checkLogin ( String username , String passwd ) { } public void addToWishList ( Product product ) { } public Product removeFromWishList ( String productName ) { } public void printWishList ( PrintStream printStream ) { } public boolean buy ( String productName ) throws InsufficientCreditException { for ( int i = 0 ; i < ( wishList . size ( ) ) ; i ++ ) { <START_BUG> if ( wishList . get ( i ) . equals ( productName ) ) { <END_BUG> if ( ( wishList . get ( i ) . getPrice ( ) ) <= ( credit ) ) { credit -= wishList . get ( i ) . getPrice ( ) ; wishList . remove ( i ) ; return true ; } else { throw new InsufficientCreditException ( ) ; } } } return false ; } public int getCredit ( ) { } public ListADT < Product > generateStock ( ) { } }

Fix:
if ( wishList . get ( i ) . getName ( ) . equals ( productName ) ) {
Buggy code:
public class MenuAdminFragment extends ListFragment implements LoaderManager . LoaderCallbacks < Cursor > { public static final String TAG = MenuAdminFragment . class . getSimpleName ( ) ; public static final String ARG_TRUCK_ID = "truck_id" ; private MenuAdminAdapter adapter ; private MenuItem actionMenu ; private MenuAdminServiceHelper serviceHelper ; public static MenuAdminFragment newInstance ( String truckId ) { } @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } @ Override public void onPause ( ) { } @ Override public void onCreateOptionsMenu ( Menu menu , MenuInflater inflater ) { } @ Override public void onDestroyOptionsMenu ( ) { } @ Override public Loader < Cursor > onCreateLoader ( int id , Bundle args ) { String truckId = args . getString ( MenuAdminFragment . ARG_TRUCK_ID ) ; <START_BUG> WhereClause whereClause = new WhereClause . Builder ( ) . where ( ID , EQUALS , truckId ) . build ( ) ; <END_BUG> String [ ] projection = Query . PROJECTION ; Uri uri = Contract . syncFromNetwork ( MENU_URI ) ; return new android . support . v4 . content . CursorLoader ( getActivity ( ) , uri , projection , whereClause . selection , whereClause . selectionArgs , null ) ; } @ Override public void onLoadFinished ( Loader < Cursor > loader , Cursor data ) { } @ Override public void onLoaderReset ( Loader < Cursor > loader ) { } }

Fix:
WhereClause whereClause = new WhereClause . Builder ( ) . where ( TRUCK_ID , EQUALS , truckId ) . build ( ) ;
Buggy code:
public class LoadFileCmd implements Command { private AppContext _context = null ; private File _file = null ; public LoadFileCmd ( AppContext context , File file ) { } public void execute ( ) { if ( ! ( _file . exists ( ) ) ) { String message = _context . getResources ( ) . getMessage ( getClass ( ) , "noFile" , new Object [ ] { _file . toString ( ) } ) ; _context . getEventBus ( ) . postEvent ( new org . apache . tools . ant . gui . event . ErrorEvent ( _context , message ) ) ; } else { try { <START_BUG> ProjectProxy project = new ProjectProxy ( _file ) ; <END_BUG> _context . setProject ( project ) ; } catch ( IOException ex ) { String message = _context . getResources ( ) . getMessage ( getClass ( ) , "loadError" , new Object [ ] { _file . toString ( ) } ) ; _context . getEventBus ( ) . postEvent ( new org . apache . tools . ant . gui . event . ErrorEvent ( _context , message ) ) ; } } } }

Fix:
ProjectProxy project = new ProjectProxy ( _context , _file ) ;
Buggy code:
public class AnchorModifier extends AbstractTestElement implements Serializable , PreProcessor { private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; private static Random rand = new Random ( ) ; public AnchorModifier ( ) { } public void process ( ) { JMeterContext context = getThreadContext ( ) ; Sampler sam = context . getCurrentSampler ( ) ; SampleResult res = context . getPreviousResult ( ) ; HTTPSamplerBase sampler = null ; HTTPSampleResult result = null ; if ( ( ( res == null ) || ( ! ( sam instanceof HTTPSamplerBase ) ) ) || ( ! ( res instanceof HTTPSampleResult ) ) ) { AnchorModifier . log . info ( ( "Can't<seq2seq4repair_space>apply<seq2seq4repair_space>HTML<seq2seq4repair_space>Link<seq2seq4repair_space>Parser<seq2seq4repair_space>when<seq2seq4repair_space>the<seq2seq4repair_space>previous" + "<seq2seq4repair_space>sampler<seq2seq4repair_space>run<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>an<seq2seq4repair_space>HTTP<seq2seq4repair_space>Request." ) ) ; return ; } else { sampler = ( ( HTTPSamplerBase ) ( sam ) ) ; result = ( ( HTTPSampleResult ) ( res ) ) ; } List potentialLinks = new ArrayList ( ) ; String responseText = "" ; try { <START_BUG> responseText = new String ( result . getResponseData ( ) , "8859_1" ) ; <END_BUG> } catch ( UnsupportedEncodingException e ) { } Document html ; try { int index = responseText . indexOf ( "<" ) ; if ( index == ( - 1 ) ) { index = 0 ; } html = ( ( Document ) ( HtmlParsingUtils . getDOM ( responseText . substring ( index ) ) ) ) ; } catch ( SAXException e ) { return ; } addAnchorUrls ( html , result , sampler , potentialLinks ) ; addFormUrls ( html , result , sampler , potentialLinks ) ; addFramesetUrls ( html , result , sampler , potentialLinks ) ; if ( ( potentialLinks . size ( ) ) > 0 ) { HTTPSamplerBase url = ( ( HTTPSamplerBase ) ( potentialLinks . get ( AnchorModifier . rand . nextInt ( potentialLinks . size ( ) ) ) ) ) ; sampler . setDomain ( url . getDomain ( ) ) ; sampler . setPath ( url . getPath ( ) ) ; if ( url . getMethod ( ) . equals ( POST ) ) { PropertyIterator iter = sampler . getArguments ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Argument arg = ( ( Argument ) ( iter . next ( ) . getObjectValue ( ) ) ) ; modifyArgument ( arg , url . getArguments ( ) ) ; } } else { sampler . setArguments ( url . getArguments ( ) ) ; } sampler . setProtocol ( url . getProtocol ( ) ) ; return ; } return ; } private void modifyArgument ( Argument arg , Arguments args ) { } public void addConfigElement ( ConfigElement config ) { } private void addFormUrls ( Document html , HTTPSampleResult result , HTTPSamplerBase config , List potentialLinks ) { } private void addAnchorUrls ( Document html , HTTPSampleResult result , HTTPSamplerBase config , List potentialLinks ) { } private void addFramesetUrls ( Document html , HTTPSampleResult result , HTTPSamplerBase config , List potentialLinks ) { } }

Fix:
responseText = new String ( result . getResponseData ( ) , result . getDataEncoding ( ) ) ;
Buggy code:
public class DefaultLogger implements BuildLogger { private static int LEFT_COLUMN_SIZE = 12 ; protected int msgOutputLevel = Project . MSG_ERR ; private long startTime = System . currentTimeMillis ( ) ; protected boolean emacsMode = false ; protected PrintStream err ; protected PrintStream out ; protected static String formatTime ( long millis ) { } public void setEmacsMode ( boolean emacsMode ) { } public void setErrorPrintStream ( PrintStream err ) { } public void setMessageOutputLevel ( int level ) { } public void setOutputPrintStream ( PrintStream output ) { } public void buildFinished ( BuildEvent event ) { } public void buildStarted ( BuildEvent event ) { } public void messageLogged ( BuildEvent event ) { if ( ( event . getPriority ( ) ) <= ( msgOutputLevel ) ) { StringBuffer message = new StringBuffer ( ) ; if ( ( event . getTask ( ) ) != null ) { <START_BUG> String name = event . getTask ( ) . getTaskName ( ) ; <END_BUG> if ( ! ( emacsMode ) ) { String label = ( "[" + name ) + "]<seq2seq4repair_space>" ; for ( int i = 0 ; i < ( ( DefaultLogger . LEFT_COLUMN_SIZE ) - ( label . length ( ) ) ) ; i ++ ) { message . append ( "<seq2seq4repair_space>" ) ; } message . append ( label ) ; } } message . append ( event . getMessage ( ) ) ; String msg = message . toString ( ) ; if ( ( event . getPriority ( ) ) != ( Project . MSG_ERR ) ) { out . println ( msg ) ; } else { err . println ( msg ) ; } log ( msg ) ; } } public void targetFinished ( BuildEvent event ) { } public void targetStarted ( BuildEvent event ) { } public void taskFinished ( BuildEvent event ) { } public void taskStarted ( BuildEvent event ) { } protected void log ( String message ) { } }

Fix:
String name = event . getTask ( ) . getName ( ) ;
Buggy code:
public final class LibraryApplication extends WicketExampleApplication { public LibraryApplication ( ) { } @ Override protected void init ( ) { } @ Override public ISessionFactory getSessionFactory ( ) { return new ISessionFactory ( ) { <START_BUG> public Session newSession ( Request request ) { <END_BUG> return new LibrarySession ( LibraryApplication . this ) ; } } ; } @ Override public Class < ? extends Page > getHomePage ( ) { } }

Fix:
public Session newSession ( final Request request ) {
Buggy code:
public class DisjunctionMaxQuery extends Query implements Iterable < Query > { private ArrayList < Query > disjuncts = new ArrayList < Query > ( ) ; private float tieBreakerMultiplier = 0.0F ; public DisjunctionMaxQuery ( float tieBreakerMultiplier ) { } public DisjunctionMaxQuery ( Collection < Query > disjuncts , float tieBreakerMultiplier ) { } public void add ( Query query ) { } public void add ( Collection < Query > disjuncts ) { } public Iterator < Query > iterator ( ) { } protected class DisjunctionMaxWeight extends Weight { protected Similarity similarity ; protected ArrayList < Weight > weights = new ArrayList < Weight > ( ) ; public DisjunctionMaxWeight ( Searcher searcher ) throws IOException { } @ Override public Query getQuery ( ) { } @ Override public float getValue ( ) { } @ Override public float sumOfSquaredWeights ( ) throws IOException { } @ Override public void normalize ( float norm ) { } @ Override public Scorer scorer ( IndexReader reader , boolean scoreDocsInOrder , boolean topScorer ) throws IOException { Scorer [ ] scorers = new Scorer [ weights . size ( ) ] ; int idx = 0 ; for ( Weight w : weights ) { Scorer subScorer = w . scorer ( reader , true , false ) ; <START_BUG> if ( ( subScorer != null ) && ( ( subScorer . nextDoc ( ) ) != ( DocIdSetIterator . NO_MORE_DOCS ) ) ) { <END_BUG> scorers [ ( idx ++ ) ] = subScorer ; } } if ( idx == 0 ) return null ; DisjunctionMaxScorer result = new DisjunctionMaxScorer ( this , tieBreakerMultiplier , similarity , scorers , idx ) ; return result ; } @ Override public Explanation explain ( IndexReader reader , int doc ) throws IOException { } } @ Override public Weight createWeight ( Searcher searcher ) throws IOException { } @ Override public Query rewrite ( IndexReader reader ) throws IOException { } @ Override @ SuppressWarnings ( "unchecked" ) public Object clone ( ) { } @ Override public void extractTerms ( Set < Term > terms ) { } @ Override public String toString ( String field ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } }

Fix:
if ( subScorer != null ) {
Buggy code:
public final class ResourceAdaptersAdd extends AbstractSubsystemAdd < ResourceAdaptersSubsystemElement > { private static final long serialVersionUID = - 874698675049495644L ; private ResourceAdapters resourceAdapters ; public ResourceAdapters getDatasources ( ) { } public void setResourceAdapters ( ResourceAdapters resourceAdapters ) { } protected ResourceAdaptersAdd ( ) { } protected < P > void applyUpdate ( UpdateContext updateContext , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { } @ Override protected void applyUpdateBootAction ( final BootUpdateContext updateContext ) { applyUpdate ( updateContext , NULL , null ) ; <START_BUG> updateContext . addDeploymentProcessor ( INIT_ME , new org . jboss . as . connector . deployers . processors . ResourceAdaptersAttachingProcessor ( resourceAdapters ) , RESOURCE_ADAPTERS_ATTACHING_PROCESSOR ) ; <END_BUG> } protected ResourceAdaptersSubsystemElement createSubsystemElement ( ) { } }

Fix:
updateContext . addDeploymentProcessor ( PARSE , PARSE_RESOURCE_ADAPTERS , new org . jboss . as . connector . deployers . processors . ResourceAdaptersAttachingProcessor ( resourceAdapters ) ) ;
Buggy code:
public class KafkaUtilsTest { private KafkaTestBroker broker ; private SimpleConsumer simpleConsumer ; private KafkaConfig config ; private BrokerHosts brokerHosts ; @ Before public void setup ( ) { } @ After public void shutdown ( ) { } @ Test ( expected = FailedFetchException . class ) public void topicDoesNotExist ( ) throws Exception { } @ Test ( expected = FailedFetchException . class ) public void brokerIsDown ( ) throws Exception { } @ Test public void fetchMessage ( ) throws Exception { } @ Test ( expected = FailedFetchException . class ) public void fetchMessagesWithInvalidOffsetAndDefaultHandlingDisabled ( ) throws Exception { } <START_BUG> @ Test ( expected = UpdateOffsetException . class ) <END_BUG> public void fetchMessagesWithInvalidOffsetAndDefaultHandlingEnabled ( ) throws Exception { config = new KafkaConfig ( brokerHosts , "newTopic" ) ; String value = "test" ; createTopicAndSendMessage ( value ) ; KafkaUtils . fetchMessages ( config , simpleConsumer , new Partition ( Broker . fromString ( broker . getBrokerConnectionString ( ) ) , 0 ) , ( - 99 ) ) ; } @ Test public void getOffsetFromConfigAndDontForceFromStart ( ) { } @ Test public void getOffsetFromConfigAndFroceFromStart ( ) { } @ Test public void generateTuplesWithoutKeyAndKeyValueScheme ( ) { } @ Test public void generateTuplesWithKeyAndKeyValueScheme ( ) { } @ Test public void generateTupelsWithValueScheme ( ) { } @ Test public void generateTuplesWithValueSchemeAndKeyValueMessage ( ) { } private ByteBufferMessageSet getLastMessage ( ) { } private void runGetValueOnlyTuplesTest ( ) { } private void createTopicAndSendMessage ( ) { } private void createTopicAndSendMessage ( String value ) { } private void createTopicAndSendMessage ( String key , String value ) { } @ Test public void assignOnePartitionPerTask ( ) { } @ Test public void assignTwoPartitionsPerTask ( ) { } @ Test public void assignAllPartitionsToOneTask ( ) { } public void runPartitionToTaskMappingTest ( int numPartitions , int partitionsPerTask ) { } @ Test public void moreTasksThanPartitions ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void assignInvalidTask ( ) { } }

Fix:
@ Test ( expected = TopicOffsetOutOfRangeException . class )
Buggy code:
public class CovReport extends CovBase { private String format = null ; private File tofile = null ; private String type = null ; private Integer percent = null ; private String filters = null ; private File snapshot = null ; private Path sourcePath = null ; private boolean includeSource = true ; private Path coveragePath = null ; private CovReport . Reference reference = null ; public static class ReportFormat extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public void setFormat ( CovReport . ReportFormat value ) { } public static class ReportType extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public void setType ( CovReport . ReportType value ) { } public void setIncludesource ( boolean value ) { } public void setPercent ( Integer value ) { } public void setFilters ( String values ) { } public Path createSourcepath ( ) { } public void setSnapshot ( File value ) { } public void setTofile ( File value ) { } public Path createCoveragepath ( ) { } public CovReport . Reference createReference ( ) { } public CovReport ( ) { } protected void checkOptions ( ) throws BuildException { if ( ( tofile ) == null ) { throw new BuildException ( "'tofile'<seq2seq4repair_space>attribute<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set." ) ; } if ( ( snapshot ) == null ) { throw new BuildException ( "'snapshot'<seq2seq4repair_space>attribute<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set." ) ; } if ( ( getHome ( ) ) == null ) { throw new BuildException ( "'home'<seq2seq4repair_space>attribute<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set<seq2seq4repair_space>to<seq2seq4repair_space>JProbe<seq2seq4repair_space>home<seq2seq4repair_space>directory" ) ; } <START_BUG> File jar = findJar ( "coverage//coverage.jar" ) ; <END_BUG> if ( ! ( jar . exists ( ) ) ) { throw new BuildException ( ( "Cannot<seq2seq4repair_space>find<seq2seq4repair_space>Coverage<seq2seq4repair_space>directory:<seq2seq4repair_space>" + ( getHome ( ) ) ) ) ; } if ( ( ( reference ) != null ) && ( ! ( "xml" . equals ( format ) ) ) ) { log ( "Ignored<seq2seq4repair_space>reference.<seq2seq4repair_space>It<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>in<seq2seq4repair_space>non<seq2seq4repair_space>XML<seq2seq4repair_space>report." ) ; reference = null ; } } public void execute ( ) throws BuildException { } protected String [ ] getParameters ( ) { } public class Reference { protected Path classPath ; protected ReportFilters filters ; public Path createClasspath ( ) { } public ReportFilters createFilters ( ) { } protected void createEnhancedXMLReport ( ) throws BuildException { } } }

Fix:
File jar = findCoverageJar ( ) ;
Buggy code:
public class MigrationDialog extends CommonDialog { private ReportDocumentContext reportRenderContext ; private JLabel warningLabel ; private JEditorPane textArea ; private int fromVersion ; private int toVersion ; public MigrationDialog ( ) { } public MigrationDialog ( final Frame owner ) throws HeadlessException { } public MigrationDialog ( final Dialog owner ) throws HeadlessException { } protected void init ( ) { } protected void performInitialResize ( ) { } protected String getDialogId ( ) { } protected Document createDescriptionText ( ) throws IOException , BadLocationException { } protected Component createContentPane ( ) { } public void performMigration ( final ReportDesignerContext designerContext , final ReportDocumentContext reportRenderContext ) { this . reportRenderContext = reportRenderContext ; toVersion = ClassicEngineBoot . computeCurrentVersionId ( ) ; final MasterReport masterReportElement = this . reportRenderContext . getContextRoot ( ) ; final Integer compatibilityLevel = masterReportElement . getCompatibilityLevel ( ) ; if ( compatibilityLevel == null ) { fromVersion = toVersion ; } else { fromVersion = compatibilityLevel ; } setupFromReportVersion ( ) ; if ( ( super . performEdit ( ) ) == false ) { return ; } <START_BUG> if ( ( SaveReportAction . saveReport ( designerContext , reportRenderContext , this ) ) == false ) { <END_BUG> return ; } final CompatibilityUpdater updater = new CompatibilityUpdater ( ) ; updater . performUpdate ( reportRenderContext . getContextRoot ( ) ) ; } protected boolean validateInputs ( final boolean onConfirm ) { } private void setupFromReportVersion ( ) { } }

Fix:
if ( ( new SaveReportAction ( ) . saveReport ( designerContext , reportRenderContext , this ) ) == false ) {
Buggy code:
public class UrlUtils { private UrlUtils ( ) { } public static boolean isRelative ( final String url ) { } public static String rewriteToContextRelative ( String url , RequestCycle requestCycle ) { if ( UrlUtils . isRelative ( url ) ) { <START_BUG> return requestCycle . getUrlRenderer ( ) . renderContextPathRelativeUrl ( url ) ; <END_BUG> } else { return url ; } } public static String normalizePath ( String path ) { } }

Fix:
return requestCycle . getUrlRenderer ( ) . renderContextRelativeUrl ( url ) ;
Buggy code:
public abstract class AbstractDataSource implements DataSource { protected final Log logger = LogFactory . getLog ( getClass ( ) ) ; public int getLoginTimeout ( ) throws SQLException { } public void setLoginTimeout ( int timeout ) throws SQLException { } public PrintWriter getLogWriter ( ) { } public void setLogWriter ( PrintWriter pw ) throws SQLException { } @ SuppressWarnings ( "unchecked" ) public < T > T unwrap ( Class < T > iface ) throws SQLException { } public boolean isWrapperFor ( Class < ? > iface ) throws SQLException { } public Logger getParentLogger ( ) { <START_BUG> return Logger . getGlobal ( ) ; <END_BUG> } }

Fix:
return Logger . getLogger ( Logger . GLOBAL_LOGGER_NAME ) ;
Buggy code:
public final class GZipTestCase extends AbstractTestCase { public void testGzipCreation ( ) throws Exception { } public void testGzipUnarchive ( ) throws Exception { } public void testCorruptedInput ( ) throws Exception { InputStream in = null ; OutputStream out = null ; CompressorInputStream cin = null ; try { in = new FileInputStream ( getFile ( "bla.tgz" ) ) ; out = new ByteArrayOutputStream ( ) ; IOUtils . copy ( in , out ) ; in . close ( ) ; out . close ( ) ; byte [ ] data = ( ( ByteArrayOutputStream ) ( out ) ) . toByteArray ( ) ; in = new ByteArrayInputStream ( data , 0 , ( ( data . length ) - 1 ) ) ; cin = new CompressorStreamFactory ( ) . createCompressorInputStream ( "gz" , in ) ; out = new ByteArrayOutputStream ( ) ; try { IOUtils . copy ( cin , out ) ; fail ( "Expected<seq2seq4repair_space>an<seq2seq4repair_space>exception" ) ; } catch ( IOException ioex ) { } } finally { if ( out != null ) { out . close ( ) ; } if ( cin != null ) { <START_BUG> in . close ( ) ; <END_BUG> } if ( in != null ) { in . close ( ) ; } } } }

Fix:
cin . close ( ) ;
Buggy code:
public class CatalogInteractor { private static final Logger LOGGER = LoggerFactory . getLogger ( CatalogInteractor . class ) ; private CSWAdapter adapter ; private Configuration config ; public CatalogInteractor ( Configuration config ) { } public String executeGetRecords ( int maxRecords , int startPos ) throws OXFException , ExceptionReport { } private String execute ( ParameterContainer paramCon , Operation op ) throws OXFException , ExceptionReport { } public long getNumberOfRecords ( ) throws IOException , IllegalStateException , XmlException , HttpClientException { GetRecordsDocument xb_getRecordsDocument = Factory . newInstance ( ) ; GetRecordsType xb_getRecords = xb_getRecordsDocument . addNewGetRecords ( ) ; xb_getRecords . setService ( SERVICE_TYPE ) ; xb_getRecords . setVersion ( CSWAdapter . SUPPORTED_VERSIONS [ 0 ] ) ; xb_getRecords . setResultType ( HITS ) ; QueryType xb_query = QueryType . Factory . newInstance ( ) ; List < QName > typeNameList = new ArrayList < > ( ) ; typeNameList . add ( new QName ( CSWAdapter . NAMESPACE , "Record" ) ) ; xb_query . setTypeNames ( typeNameList ) ; AbstractQueryType abstractQuery = xb_getRecords . addNewAbstractQuery ( ) ; abstractQuery . set ( xb_query ) ; XmlUtil . qualifySubstitutionGroup ( xb_getRecords . getAbstractQuery ( ) , type . getDocumentElementName ( ) , QueryType . type ) ; String request = xb_getRecordsDocument . xmlText ( new XmlOptions ( ) . setSavePrettyPrint ( ) ) ; SimpleHttpClient httpClient = new SimpleHttpClient ( 20000 ) ; String cswUrl = config . getUrlCSW ( ) ; HttpResponse response = httpClient . executePost ( cswUrl , request , TEXT_XML ) ; GetRecordsResponseDocument doc = GetRecordsResponseDocument . Factory . parse ( response . getEntity ( ) . getContent ( ) ) ; BigInteger numberOfRecordsMatched = doc . getGetRecordsResponse ( ) . getSearchResults ( ) . getNumberOfRecordsMatched ( ) ; <START_BUG> return numberOfRecordsMatched . longValueExact ( ) ; <END_BUG> } public String executeGetRecordsById ( String recordID ) throws OXFException , ExceptionReport { } }

Fix:
return numberOfRecordsMatched . longValue ( ) ;
Buggy code:
public class PGPController { public static final int GPG = 0 ; public static final int PGP2 = 1 ; public static final int PGP5 = 2 ; public static final int PGP6 = 3 ; public static final int DECRYPT_ACTION = 0 ; public static final int ENCRYPT_ACTION = 1 ; public static final int SIGN_ACTION = 2 ; public static final int VERIFY_ACTION = 3 ; public static final int ENCRYPTSIGN_ACTION = 4 ; private int type ; private String path ; private String id ; private int exitVal ; private boolean save = false ; private static PGPController myInstance ; private String pgpMessage ; private Map passwords ; private DefaultUtil [ ] utils = new DefaultUtil [ ] { new GnuPGUtil ( ) } ; protected PGPController ( ) { } public static PGPController getInstance ( ) { } public int getReturnValue ( ) { } public InputStream decrypt ( InputStream cryptMessage , PGPItem item ) throws PGPException { } public void verifySignature ( InputStream message , InputStream signature , PGPItem item ) throws PGPException { } public InputStream encrypt ( InputStream message , PGPItem item ) { } public InputStream sign ( InputStream pgpMessage , PGPItem item ) { } public String sign ( String pgpMessage , PGPItem item ) { } private boolean getPassphrase ( PGPItem item ) { String passphrase = item . getPassphrase ( ) ; boolean save = false ; boolean ret = false ; PasswordDialog dialog = new PasswordDialog ( ) ; if ( ( passphrase . length ( ) ) == 0 ) { <START_BUG> dialog . showDialog ( item . get ( "id" ) , "" , false ) ; <END_BUG> if ( dialog . success ( ) ) { passphrase = new String ( dialog . getPassword ( ) , 0 , dialog . getPassword ( ) . length ) ; item . setPassphrase ( passphrase ) ; save = dialog . getSave ( ) ; ret = true ; } } return ret ; } private boolean checkError ( int exitVal , PGPItem item ) { } public InputStream getPGPResultStream ( ) { } public InputStream getPGPErrorStream ( ) { } public String getPgpMessage ( ) { } }

Fix:
dialog . showDialog ( ( "PGP-" + ( item . get ( "id" ) ) ) , "" , false ) ;
Buggy code:
@ DirtiesContext @ RunWith ( SpringJUnit4ClassRunner . class ) @ WebAppConfiguration @ ContextConfiguration ( classes = { RootConfig . class , PersistenceConfig . class } , loader = AnnotationConfigWebContextLoader . class ) @ Transactional @ Rollback public class SummaryServiceTest { @ Autowired private SummaryService summaryService ; @ Test public void testPeriodGetStartEndDate ( ) { } @ Test public void testMonthStartEndDate ( ) { } @ Test public void getTestSummary ( ) throws Exception { <START_BUG> List < WorkingWeekDTO > summary = summaryService . getSummaryForPeriod ( 25 , 2016 , 1 ) ; <END_BUG> System . out . println ( summary ) ; System . out . println ( "=========" ) ; System . out . println ( getPeriodWeekOfYear ( 2016 , 0 , 1 ) ) ; } }

Fix:
List < WorkingWeekDTO > summary = summaryService . getSummaryForMonth ( 25 , 2016 , 1 ) ;
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "4.1" ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return "4.2" ;
Buggy code:
public class ViewUnit { public static Bitmap capture ( View view , float width , float height ) { <START_BUG> Bitmap bitmap = Bitmap . createBitmap ( ( ( int ) ( width ) ) , ( ( int ) ( height ) ) , ARGB_8888 ) ; <END_BUG> bitmap . eraseColor ( WHITE ) ; Canvas canvas = new Canvas ( bitmap ) ; int left = view . getScrollX ( ) ; int top = view . getScrollY ( ) ; int status = canvas . save ( ) ; canvas . translate ( ( - left ) , ( - top ) ) ; float scale = width // ( view . getWidth ( ) ) ; canvas . scale ( scale , scale , left , top ) ; view . draw ( canvas ) ; canvas . restoreToCount ( status ) ; Paint alphaPaint = new Paint ( ) ; alphaPaint . setColor ( TRANSPARENT ) ; canvas . drawRect ( 0.0F , 0.0F , 1.0F , height , alphaPaint ) ; canvas . drawRect ( ( width - 1.0F ) , 0.0F , width , height , alphaPaint ) ; canvas . drawRect ( 0.0F , 0.0F , width , 1.0F , alphaPaint ) ; canvas . drawRect ( 0.0F , ( height - 1.0F ) , width , height , alphaPaint ) ; canvas . setBitmap ( null ) ; return bitmap ; } public static float dp2px ( Context context , float dp ) { } public static int getStatusBarHeight ( Context context ) { } public static int getWindowHeight ( Context context ) { } public static int getWindowWidth ( Context context ) { } public static int getBrightness ( Context context ) { } public static void setBrightness ( Activity activity , int value ) { } public static void autoBrightness ( Context context ) { } No newline ; at end ; of file ; }

Fix:
Bitmap bitmap = Bitmap . createBitmap ( ( ( int ) ( width ) ) , ( ( int ) ( height ) ) , RGB_565 ) ;
Buggy code:
public class DungBeetleContentProvider extends ContentProvider { public static final String AUTHORITY = "org.mobisocial.db" ; public static final Uri CONTENT_URI = Uri . parse ( ( "content:////" + ( DungBeetleContentProvider . AUTHORITY ) ) ) ; static final String TAG = "DungBeetleContentProvider" ; static final boolean DBG = true ; public static final String SUPER_APP_ID = "edu.stanford.mobisocial.dungbeetle" ; private DBHelper mHelper ; private IdentityProvider mIdent ; public DungBeetleContentProvider ( ) { } @ Override protected void finalize ( ) throws Throwable { } @ Override public int delete ( Uri uri , String selection , String [ ] selectionArgs ) { final String appId = getCallingActivityId ( ) ; if ( appId == null ) { Log . d ( DungBeetleContentProvider . TAG , "No<seq2seq4repair_space>AppId<seq2seq4repair_space>for<seq2seq4repair_space>calling<seq2seq4repair_space>activity.<seq2seq4repair_space>Ignoring<seq2seq4repair_space>query." ) ; return 0 ; } <START_BUG> String appSelection = ( DbObjects . APP_ID ) + "=<seq2seq4repair_space>?" ; <END_BUG> String [ ] appSelectionArgs = new String [ ] { appId } ; selection = DBHelper . andClauses ( selection , appSelection ) ; selectionArgs = DBHelper . andArguments ( selectionArgs , appSelectionArgs ) ; String [ ] projection = new String [ ] { DbObject . _ID } ; int count = 0 ; Cursor c = mHelper . getReadableDatabase ( ) . query ( TABLE , projection , selection , selectionArgs , null , null , null ) ; if ( ( c != null ) && ( c . moveToFirst ( ) ) ) { count = c . getCount ( ) ; long [ ] hashes = new long [ count ] ; int i = 0 ; do { hashes [ ( i ++ ) ] = c . getLong ( 0 ) ; } while ( c . moveToNext ( ) ) ; Helpers . sendToFeed ( getContext ( ) , DeleteObj . from ( hashes ) , uri ) ; } return count ; } @ Override public String getType ( Uri uri ) { } private Uri uriWithId ( Uri uri , long id ) { } @ Override public Uri insert ( Uri uri , ContentValues values ) { } @ Override public boolean onCreate ( ) { } @ Override public Cursor query ( Uri uri , String [ ] projection , String selection , String [ ] selectionArgs , String sortOrder ) { } @ Override public int update ( Uri uri , ContentValues values , String selection , String [ ] selectionArgs ) { } public DBHelper getDatabaseHelper ( ) { } private boolean match ( Uri uri , String ... regexes ) { } private String getCallingActivityId ( ) { } static void notifyDependencies ( DBHelper helper , ContentResolver resolver , String feedName ) { } public DBHelper getDBHelper ( ) { } }

Fix:
String appSelection = ( DbObject . APP_ID ) + "=<seq2seq4repair_space>?" ;
Buggy code:
public abstract class GameObjects { private int x ; private int y ; private int angle ; private Image sprite ; public GameObjects ( ) { } public int getX ( ) { } public int getY ( ) { } public int getAngle ( ) { } public Image getSprite ( ) { } public void setX ( int x ) { } public void setY ( int y ) { } public void setAngle ( int nAngle ) { if ( ( nAngle > 0 ) && ( nAngle > 360 ) ) { <START_BUG> this . angle = angle ; <END_BUG> } } public void setSprite ( Image sprite ) { } }

Fix:
this . angle = nAngle ;
Buggy code:
public class GUI { private JFrame frame ; private JList < String > jlist ; private Socket socket ; private String username ; public static void main ( String [ ] args ) { EventQueue . invokeLater ( new Runnable ( ) { public void run ( ) { String username = JOptionPane . showInputDialog ( "Input<seq2seq4repair_space>username:" ) ; SimpleVideoChat svc = new SimpleVideoChat ( ) ; Server server = new Server ( 30000 , svc ) ; if ( svc . soundCheck ( ) ) { server . start ( ) ; } else { JOptionPane . showMessageDialog ( null , "No<seq2seq4repair_space>sound<seq2seq4repair_space>input<seq2seq4repair_space>detected." ) ; System . exit ( 1 ) ; } Socket socket = null ; try { <START_BUG> socket = new Socket ( "localhost" , 40000 ) ; <END_BUG> String s = "username:" + username ; socket . getOutputStream ( ) . write ( s . getBytes ( ) ) ; } catch ( IOException e ) { System . out . println ( e ) ; System . exit ( 1 ) ; } GUI gui = new GUI ( socket , username ) ; gui . frame . setVisible ( true ) ; ServerListener sl = new ServerListener ( socket , svc , gui ) ; sl . start ( ) ; } } ) ; } public GUI ( Socket socket , String username ) { } private void initialize ( ) { } public void updateList ( ArrayList < String > list ) { } }

Fix:
socket = new Socket ( "192.168.0.17" , 40000 ) ;
Buggy code:
public class RenderOverviewPageRuleProvider extends WindupRuleProvider { private static final String VAR_APPLICATION_REPORTS = "applicationReports" ; private static final String OUTPUT_FILENAME = "index.html" ; private static final String TEMPLATE_PATH = "//reports//templates//overview.ftl" ; @ Inject private Furnace furnace ; @ Override public RulePhase getPhase ( ) { } @ Override public List < Class < ? extends WindupRuleProvider > > getClassDependencies ( ) { } @ Override public Configuration getConfiguration ( GraphContext context ) { <START_BUG> FreeMarkerOperation generateReportOperation = FreeMarkerOperation . create ( RenderOverviewPageRuleProvider . TEMPLATE_PATH , RenderOverviewPageRuleProvider . OUTPUT_FILENAME , RenderOverviewPageRuleProvider . VAR_APPLICATION_REPORTS ) ; <END_BUG> return ConfigurationBuilder . begin ( ) . addRule ( ) . when ( Query . find ( ApplicationReportModel . class ) . as ( RenderOverviewPageRuleProvider . VAR_APPLICATION_REPORTS ) ) . perform ( generateReportOperation ) ; } }

Fix:
FreeMarkerOperation generateReportOperation = FreeMarkerOperation . create ( furnace , RenderOverviewPageRuleProvider . TEMPLATE_PATH , RenderOverviewPageRuleProvider . OUTPUT_FILENAME , RenderOverviewPageRuleProvider . VAR_APPLICATION_REPORTS ) ;
Buggy code:
public class TestJmxMonitoredMap extends LuceneTestCase { private int port = 0 ; private JMXConnector connector ; private MBeanServerConnection mbeanServer ; private JmxMonitoredMap < String , SolrInfoMBean > monitoredMap ; @ Override @ Before public void setUp ( ) throws Exception { super . setUp ( ) ; int retries = 5 ; for ( int i = 0 ; i < retries ; i ++ ) { try { ServerSocket server = new ServerSocket ( 0 ) ; try { port = server . getLocalPort ( ) ; } finally { server . close ( ) ; } try { LocateRegistry . createRegistry ( port ) ; } catch ( RemoteException e ) { throw e ; } String url = ( "service:jmx:rmi://////jndi//rmi:////:" + ( port ) ) + "//solrjmx" ; JmxConfiguration config = new JmxConfiguration ( true , null , url ) ; <START_BUG> monitoredMap = new JmxMonitoredMap < String , SolrInfoMBean > ( null , config ) ; <END_BUG> JMXServiceURL u = new JMXServiceURL ( url ) ; connector = JMXConnectorFactory . connect ( u ) ; mbeanServer = connector . getMBeanServerConnection ( ) ; break ; } catch ( Exception e ) { if ( retries == ( i + 1 ) ) { throw e ; } } } } @ Override @ After public void tearDown ( ) throws Exception { } @ Test public void testPutRemoveClear ( ) throws Exception { } private class MockInfoMBean implements SolrInfoMBean { public String getName ( ) { } public Category getCategory ( ) { } public String getDescription ( ) { } public URL [ ] getDocs ( ) { } public String getVersion ( ) { } public String getSource ( ) { } @ SuppressWarnings ( "unchecked" ) public NamedList getStatistics ( ) { } public String getSourceId ( ) { } } }

Fix:
monitoredMap = new JmxMonitoredMap < String , SolrInfoMBean > ( null , "" , config ) ;
Buggy code:
public class ProcessTaskManager implements Runnable { Compiler compiler ; private int unitIndex ; private Thread processingThread ; volatile int currentIndex ; volatile int availableIndex ; volatile int size ; volatile int sleepCount ; CompilationUnitDeclaration [ ] units ; public static int PROCESSED_QUEUE_SIZE = 12 ; public ProcessTaskManager ( Compiler compiler ) { } private synchronized void addNextUnit ( CompilationUnitDeclaration newElement ) { } public CompilationUnitDeclaration removeNextUnit ( ) { } public void run ( ) { } public void shutdown ( ) { try { Thread t = null ; synchronized ( this ) { if ( ( this . processingThread ) != null ) { t = this . processingThread ; this . processingThread = null ; notifyAll ( ) ; } } if ( t != null ) <START_BUG> t . join ( ) ; <END_BUG> } catch ( InterruptedException ignored ) { } } }

Fix:
t . join ( 250 ) ;
Buggy code:
public class StreamGeneratorFactory { private static final String METHOD_EXPECTED_OPTIONS = "expectedOptions" ; private final File destination ; public StreamGeneratorFactory ( File destination ) { } public StreamGenerator createTest ( String testName , CommandLine cliOptions ) throws Exception { } public List < Option > getTestOptions ( String testName ) throws Exception { } private Class < ? > findTest ( String testName ) { <START_BUG> Reflections reflections = new Reflections ( ) ; <END_BUG> Set < Class < ? > > classes = reflections . getTypesAnnotatedWith ( RSPTest . class ) ; Optional < Class < ? > > r = classes . stream ( ) . filter ( ( c ) -> c . getSimpleName ( ) . equals ( testName ) ) . findFirst ( ) ; if ( r . isPresent ( ) ) { return r . get ( ) ; } else { return null ; } } }

Fix:
Reflections reflections = new Reflections ( "io.github.yabench.streams" ) ;
Buggy code:
@ Controller @ RequestMapping ( "//owners//{ownerId}//edit" ) @ SessionAttributes ( types = Owner . class ) public class EditOwnerForm { private final Clinic clinic ; @ Autowired public EditOwnerForm ( Clinic clinic ) { } @ InitBinder public void setAllowedFields ( WebDataBinder dataBinder ) { <START_BUG> dataBinder . setDisallowedFields ( "id" ) ; <END_BUG> } @ RequestMapping ( method = RequestMethod . GET ) public String setupForm ( @ PathVariable ( "ownerId" ) int ownerId , Model model ) { } @ RequestMapping ( method = RequestMethod . PUT ) public String processSubmit ( @ ModelAttribute Owner owner , BindingResult result , SessionStatus status ) { } }

Fix:
dataBinder . setDisallowedFields ( new String [ ] { "id" } ) ;
Buggy code:
public class ReloadCommand extends PrivilegesCommand { public ReloadCommand ( Privileges plugin ) { } @ Override public void runCommand ( CommandSender sender , List < String > args ) { <START_BUG> plugin . registerConfiguration ( ) ; <END_BUG> plugin . registerPermissions ( ) ; sender . sendMessage ( ( ( ChatColor . BLUE ) + "Privileges<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>reloaded." ) ) ; } }

Fix:
plugin . registerConfiguration ( true ) ;
Buggy code:
class WebDeploymentActivator { static void activate ( final String defaultHost , final SharedWebMetaDataBuilder sharedWebBuilder , final SharedTldsMetaDataBuilder sharedTldsBuilder , final BootUpdateContext updateContext ) { updateContext . addDeploymentProcessor ( STRUCTURE , STRUCTURE_WAR_DEPLOYMENT_INIT , new WarDeploymentInitializingProcessor ( ) ) ; updateContext . addDeploymentProcessor ( STRUCTURE , STRUCTURE_WAR_DEPLOYMENT , new org . jboss . as . web . deployment . WarStructureDeploymentProcessor ( sharedWebBuilder . create ( ) , sharedTldsBuilder . create ( ) ) ) ; updateContext . addDeploymentProcessor ( PARSE , PARSE_ANNOTATION_INDEX_WAR , new WarAnnotationIndexProcessor ( ) ) ; <START_BUG> updateContext . addDeploymentProcessor ( MODULARIZE , MODULARIZE_WAR , new WarModuleConfigProcessor ( ) ) ; <END_BUG> updateContext . addDeploymentProcessor ( PARSE , PARSE_WEB_DEPLOYMENT , new WebParsingDeploymentProcessor ( ) ) ; updateContext . addDeploymentProcessor ( PARSE , PARSE_WEB_DEPLOYMENT_FRAGMENT , new WebFragmentParsingDeploymentProcessor ( ) ) ; updateContext . addDeploymentProcessor ( PARSE , PARSE_JBOSS_WEB_DEPLOYMENT , new JBossWebParsingDeploymentProcessor ( ) ) ; updateContext . addDeploymentProcessor ( PARSE , PARSE_TLD_DEPLOYMENT , new TldParsingDeploymentProcessor ( ) ) ; updateContext . addDeploymentProcessor ( DEPENDENCIES , DEPENDENCIES_WAR_MODULE , new WarClassloadingDependencyProcessor ( ) ) ; updateContext . addDeploymentProcessor ( POST_MODULE , POST_MODULE_ANNOTATION_WAR , new WarAnnotationDeploymentProcessor ( ) ) ; updateContext . addDeploymentProcessor ( INSTALL , INSTALL_SERVLET_INIT_DEPLOYMENT , new ServletContainerInitializerDeploymentProcessor ( ) ) ; updateContext . addDeploymentProcessor ( INSTALL , INSTALL_WAR_METADATA , new WarMetaDataProcessor ( ) ) ; updateContext . addDeploymentProcessor ( INSTALL , INSTALL_WAR_DEPLOYMENT , new WarDeploymentProcessor ( defaultHost ) ) ; } }

Fix:
updateContext . addDeploymentProcessor ( CONFIGURE_MODULE , CONFIGURE_MODULE_WAR , new WarModuleConfigProcessor ( ) ) ;
Buggy code:
public class AddToDoItemDialog extends JFrame implements ActionListener { public static final String [ ] PRIORITIES = new String [ ] { "High" , "Medium" , "Low" } ; protected JTextField _headline = new JTextField ( ) ; protected JComboBox _priority = new JComboBox ( AddToDoItemDialog . PRIORITIES ) ; protected JTextField _moreinfo = new JTextField ( ) ; protected JTextArea _description = new JTextArea ( ) ; protected JButton _addButton = new JButton ( "Add" ) ; protected JButton _cancelButton = new JButton ( "Cancel" ) ; public AddToDoItemDialog ( ) { } public void actionPerformed ( ActionEvent e ) { if ( ( e . getSource ( ) ) == ( _addButton ) ) { Designer dsgr = Designer . TheDesigner ; String head = _headline . getText ( ) ; int pri = ToDoItem . HIGH_PRIORITY ; switch ( _priority . getSelectedIndex ( ) ) { case 0 : pri = ToDoItem . HIGH_PRIORITY ; break ; case 1 : pri = ToDoItem . MED_PRIORITY ; break ; case 2 : pri = ToDoItem . LOW_PRIORITY ; break ; } String desc = _description . getText ( ) ; String more = _moreinfo . getText ( ) ; <START_BUG> Set offs = new Set ( ) ; <END_BUG> ToDoItem item = new ToDoItem ( dsgr , head , pri , desc , more , offs ) ; dsgr . getToDoList ( ) . addElement ( item ) ; hide ( ) ; dispose ( ) ; } if ( ( e . getSource ( ) ) == ( _cancelButton ) ) { hide ( ) ; dispose ( ) ; } } }

Fix:
VectorSet offs = new VectorSet ( ) ;
Buggy code:
public class CompilationAndWeavingContextTest extends TestCase { public void testEnteringPhase ( ) { } public void testDoubleEntry ( ) { CompilationAndWeavingContext . enteringPhase ( 1 , "XYZ" ) ; CompilationAndWeavingContext . enteringPhase ( 2 , "ABC" ) ; <START_BUG> assertEquals ( "when<seq2seq4repair_space>fiddling<seq2seq4repair_space>XYZ\nwhen<seq2seq4repair_space>mucking<seq2seq4repair_space>about<seq2seq4repair_space>with<seq2seq4repair_space>ABC\n" , CompilationAndWeavingContext . getCurrentContext ( ) ) ; <END_BUG> } public void testEntryEntryExit ( ) { } public void testEntryExitTop ( ) { } protected void setUp ( ) throws Exception { } private static class MyContextFormatter implements ContextFormatter { private String prefix ; public MyContextFormatter ( String prefix ) { } public String formatEntry ( int phaseId , Object data ) { } } }

Fix:
assertEquals ( "when<seq2seq4repair_space>mucking<seq2seq4repair_space>about<seq2seq4repair_space>with<seq2seq4repair_space>ABC\nwhen<seq2seq4repair_space>fiddling<seq2seq4repair_space>XYZ\n" , CompilationAndWeavingContext . getCurrentContext ( ) ) ;
Buggy code:
public class LoginActivity extends Activity { private static final String [ ] DUMMY_CREDENTIALS = new String [ ] { "test@test.ru:test" , "foo@example.com:hello" , "bar@example.com:world" } ; private AutoCompleteTextView mEmailView ; private EditText mPasswordView ; private View mProgressView ; private View mLoginFormView ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void clearControls ( ) { } private void postData ( ) { EditText edEmail = ( ( EditText ) ( findViewById ( email ) ) ) ; EditText edPassword = ( ( EditText ) ( findViewById ( password ) ) ) ; String password = edPassword . getText ( ) . toString ( ) ; String email = edEmail . getText ( ) . toString ( ) ; if ( ( password . equals ( "" ) ) || ( email . equals ( "" ) ) ) { Toast . makeText ( this , "Please<seq2seq4repair_space>enter<seq2seq4repair_space>in<seq2seq4repair_space>all<seq2seq4repair_space>required<seq2seq4repair_space>fields." , LENGTH_LONG ) . show ( ) ; return ; } WebServiceTask wst = new WebServiceTask ( WebServiceTask . POST_TASK , this , "Posting<seq2seq4repair_space>data..." ) ; wst . addNameValuePair ( "email" , email ) ; wst . addNameValuePair ( "password" , password ) ; <START_BUG> wst . execute ( new String [ ] { ( Constants . getServiceUrl ( ) ) + "//group" } ) ; <END_BUG> } }

Fix:
wst . execute ( new String [ ] { ( Constants . getServiceUrl ( ) ) + "//user" } ) ;
Buggy code:
public class ConcernReader { IConfigurer config ; GraphConverterUtil convertor ; public ConcernReader ( IConfigurer config , GraphConverterUtil convertor ) { } public HashMap < String , Set < String > > getConcernList ( boolean getMethod ) { } protected List < String > getNames ( String [ ] calledMethods , boolean getMethod ) { List < String > result = new ArrayList < String > ( calledMethods . length ) ; for ( int i = 0 ; i < ( calledMethods . length ) ; i ++ ) { if ( ! ( "" . equals ( calledMethods [ i ] ) ) ) if ( getMethod ) result . add ( Integer . toString ( convertor . mapNode ( pathToMethodName ( config . convertPathName ( calledMethods [ i ] ) ) ) ) ) ; else <START_BUG> result . add ( Integer . toString ( convertor . mapNode ( pathToFileName ( config . convertPathName ( calledMethods [ i ] ) ) ) ) ) ; <END_BUG> } return result ; } public String pathToFileName ( String path ) { } public String pathToMethodName ( String path , boolean filePlusColonFormat ) { } public String pathToMethodName ( String path ) { } }

Fix:
result . add ( Integer . toString ( convertor . mapNode ( config . convertPathName ( pathToFileName ( calledMethods [ i ] ) ) ) ) ) ;
Buggy code:
public class StatisticPieChartFragment extends Fragment { private XYMultipleSeriesDataset mDataset = new XYMultipleSeriesDataset ( ) ; private static int [ ] COLORS = new int [ ] { Color . GREEN , Color . BLUE , Color . MAGENTA , Color . CYAN , Color . RED , Color . YELLOW } ; private CategorySeries mSeries = new CategorySeries ( "" ) ; private DefaultRenderer mRenderer = new DefaultRenderer ( ) ; private GraphicalView mChartView ; LinearLayout linearLayout ; public HashMap < String , Double > data = new HashMap < String , Double > ( ) ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } @ Override public void onSaveInstanceState ( Bundle outState ) { } private void initControls ( View v ) { linearLayout = ( ( LinearLayout ) ( v . findViewById ( piechart ) ) ) ; <START_BUG> data = ( ( HashMap < String , Double > ) ( getArguments ( ) . getSerializable ( INTENT_EXTRA_DATA_PIE ) ) ) ; <END_BUG> } private void createChart ( ) { } }

Fix:
data = ( ( HashMap < String , Double > ) ( getArguments ( ) . getSerializable ( FRAGMENT_DATA_PIE ) ) ) ;
Buggy code:
@ Service @ Transactional ( readOnly = true ) public class PerusahaanServiceImpl implements PerusahaanService { @ Autowired private PelangganService pelangganService ; @ Autowired private PerusahaanRepository perusahaanRepository ; @ Autowired private PegawaiRepository pegawaiRepository ; @ Autowired private PembayaranRepository pembayaranRepository ; @ Autowired private PelangganRepository pelangganRepository ; @ Autowired private Validator validator ; @ Override @ Transactional ( readOnly = false ) public Perusahaan save ( Perusahaan domain ) throws UncompatibleTypeException { } @ Override @ Transactional ( readOnly = false ) public void delete ( Perusahaan domain ) { } @ Override public Perusahaan getOne ( int id ) throws EntityNotExistException { } @ Override public Perusahaan getByKode ( String kode ) throws EntityNotExistException { } @ Override public List < PerusahaanEntity > getAll ( ) { } @ Override public void setMapLocation ( Perusahaan perusahaan , float latitude , float longitude ) throws ApplicationException { } @ Override @ Transactional ( readOnly = false ) public Operator regist ( Perusahaan perusahaan ) throws EntityNotExistException , UncompatibleTypeException { } private int getAvailableId ( ) { } @ Override public long countTagihanBulanBerjalan ( Perusahaan perusahaan ) { } @ Override public long countTagihanBulanBerjalan ( Perusahaan perusahaan , Date tanggalAwal , Date tanggalAkhir ) { } @ Override public long countEstimasiPemasukanBulanan ( Perusahaan perusahaan ) { } @ Override public long countEstimasiTagihanBulanan ( Perusahaan perusahaan ) { } @ Override public long countTotalAkumulasiTunggakan ( Perusahaan perusahaan ) { <START_BUG> return pelangganRepository . summarizeTotalAkumulasiTunggakan ( perusahaan . toEntity ( ) ) ; <END_BUG> } @ Override public long countPemasukanBulanBerjalan ( Perusahaan perusahaan ) { } }

Fix:
return pelangganRepository . summarizeTotalAkumulasiTunggakan ( perusahaan . toEntity ( ) , AKTIF ) ;