nus-yam/ex-repair huggingface dataset:
Buggy code:
public class AppProtectionPreferenceFragment extends PreferenceFragment { private static final String PREFERENCE_CATEGORY_BLOCKED = "preference_category_blocked" ; private MasterSecret masterSecret ; private CheckBoxPreference disablePassphrase ; @ Override public void onCreate ( Bundle paramBundle ) { } @ Override public void onResume ( ) { super . onResume ( ) ; <START_BUG> ( ( org . smssecure . smssecure . ApplicationPreferencesActivity ) ( getActivity ( ) ) ) . getSupportActionBar ( ) . setTitle ( preferences__app_protection ) ; <END_BUG> initializePlatformSpecificOptions ( ) ; initializeTimeoutSummary ( ) ; disablePassphrase . setChecked ( ( ! ( SMSSecurePreferences . isPasswordDisabled ( getActivity ( ) ) ) ) ) ; } private void initializePlatformSpecificOptions ( ) { } private void initializeTimeoutSummary ( ) { } private class BlockedContactsClickListener implements Preference . OnPreferenceClickListener { @ Override public boolean onPreferenceClick ( Preference preference ) { } } private class ChangePassphraseClickListener implements Preference . OnPreferenceClickListener { @ Override public boolean onPreferenceClick ( Preference preference ) { } } private class PassphraseIntervalClickListener implements Preference . OnPreferenceClickListener , HmsPickerDialogFragment . HmsPickerDialogHandler { @ Override public boolean onPreferenceClick ( Preference preference ) { } @ Override public void onDialogHmsSet ( int reference , int hours , int minutes , int seconds ) { } } private class DisablePassphraseClickListener implements Preference . OnPreferenceChangeListener { @ Override public boolean onPreferenceChange ( final Preference preference , Object newValue ) { } } private static CharSequence getPassphraseSummary ( Context context ) { } private static CharSequence getScreenSecuritySummary ( Context context ) { } public static CharSequence getSummary ( Context context ) { } }

Fix:
( ( org . smssecure . smssecure . ApplicationPreferencesActivity ) ( getActivity ( ) ) ) . getSupportActionBar ( ) . setTitle ( preferences__privacy ) ;
Buggy code:
public class TestPositiveScoresOnlyCollector extends LuceneTestCase { private static final class SimpleScorer extends Scorer { private int idx = - 1 ; public SimpleScorer ( Weight weight ) { } @ Override public float score ( ) { } @ Override public int freq ( ) { } @ Override public int docID ( ) { } @ Override public int nextDoc ( ) { } @ Override public int advance ( int target ) { } @ Override public long cost ( ) { } } private static final float [ ] scores = new float [ ] { 0.7767749F , - 1.7839992F , 8.9925785F , 7.9608946F , - 0.07948637F , 2.6356435F , 7.4950366F , 7.1490803F , - 8.108544F , 4.961808F , 2.2423935F , - 7.285586F , 4.6699767F } ; public void testNegativeScores ( ) throws Exception { int numPositiveScores = 0 ; for ( int i = 0 ; i < ( TestPositiveScoresOnlyCollector . scores . length ) ; i ++ ) { if ( ( TestPositiveScoresOnlyCollector . scores [ i ] ) > 0 ) { ++ numPositiveScores ; } } Directory directory = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , directory ) ; writer . addDocument ( new Document ( ) ) ; writer . commit ( ) ; IndexReader ir = writer . getReader ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> IndexSearcher searcher = newSearcher ( ir ) ; Weight fake = new TermQuery ( new Term ( "fake" , "weight" ) ) . createWeight ( searcher ) ; Scorer s = new TestPositiveScoresOnlyCollector . SimpleScorer ( fake ) ; TopDocsCollector < ScoreDoc > tdc = TopScoreDocCollector . create ( TestPositiveScoresOnlyCollector . scores . length , true ) ; Collector c = new PositiveScoresOnlyCollector ( tdc ) ; LeafCollector ac = c . getLeafCollector ( ir . leaves ( ) . get ( 0 ) ) ; ac . setScorer ( s ) ; while ( ( s . nextDoc ( ) ) != ( DocIdSetIterator . NO_MORE_DOCS ) ) { ac . collect ( 0 ) ; } TopDocs td = tdc . topDocs ( ) ; ScoreDoc [ ] sd = td . scoreDocs ; assertEquals ( numPositiveScores , td . totalHits ) ; for ( int i = 0 ; i < ( sd . length ) ; i ++ ) { assertTrue ( ( "only<seq2seq4repair_space>positive<seq2seq4repair_space>scores<seq2seq4repair_space>should<seq2seq4repair_space>return:<seq2seq4repair_space>" + ( sd [ i ] . score ) ) , ( ( sd [ i ] . score ) > 0 ) ) ; } ir . close ( ) ; directory . close ( ) ; } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public final class ScheduledThreadPoolService implements Service < ScheduledExecutorService > { private final InjectedValue < ThreadFactory > threadFactoryValue = new InjectedValue < ThreadFactory > ( ) ; private ScheduledThreadPoolExecutor executor ; private ScheduledExecutorService value ; private StopContext context ; private final int maxThreads ; private final TimeSpec keepAlive ; public ScheduledThreadPoolService ( final int maxThreads , final TimeSpec keepAlive ) { } public synchronized void start ( final StartContext context ) throws StartException { executor = new ScheduledThreadPoolService . ExecutorImpl ( 0 , threadFactoryValue . getValue ( ) ) ; <START_BUG> executor . setMaximumPoolSize ( maxThreads ) ; <END_BUG> if ( ( keepAlive ) != null ) executor . setKeepAliveTime ( keepAlive . getDuration ( ) , keepAlive . getUnit ( ) ) ; value = JBossExecutors . protectedScheduledExecutorService ( executor ) ; } public synchronized void stop ( final StopContext context ) { } public synchronized ScheduledExecutorService getValue ( ) throws IllegalStateException { } public Injector < ThreadFactory > getThreadFactoryInjector ( ) { } private class ExecutorImpl extends ScheduledThreadPoolExecutor { ExecutorImpl ( final int corePoolSize , final ThreadFactory threadFactory ) { } protected void terminated ( ) { } } }

Fix:
executor . setCorePoolSize ( maxThreads ) ;
Buggy code:
public class Bulls { public static int countBulls ( int [ ] guessNum , int [ ] compNum ) { } public static void helpBull ( int [ ] compNumber ) { <START_BUG> System . out . println ( "bull" ) ; <END_BUG> } }

Fix:
System . out . println ( "**2*" ) ;
Buggy code:
public class LRUMemoryMapState < T > implements ITupleCollection , Snapshottable < T > , MapState < T > { LRUMemoryMapState . LRUMemoryMapStateBacking < OpaqueValue > _backing ; SnapshottableMap < T > _delegate ; public LRUMemoryMapState ( int cacheSize , String id ) { } public T update ( ValueUpdater updater ) { } public void set ( T o ) { } public T get ( ) { } public void beginCommit ( Long txid ) { } public void commit ( Long txid ) { } public Iterator < List < Object > > getTuples ( ) { } public List < T > multiUpdate ( List < List < Object > > keys , List < ValueUpdater > updaters ) { } public void multiPut ( List < List < Object > > keys , List < T > vals ) { } public List < T > multiGet ( List < List < Object > > keys ) { } public static class Factory implements StateFactory { String _id ; int _maxSize ; public Factory ( int maxSize ) { } @ Override public State makeState ( Map conf , IMetricsContext metrics , int partitionIndex , int numPartitions ) { <START_BUG> return new LRUMemoryMapState ( _maxSize , ( ( _id ) + partitionIndex ) ) ; <END_BUG> } } static ConcurrentHashMap < String , Map < List < Object > , Object > > _dbs = new ConcurrentHashMap < String , Map < List < Object > , Object > > ( ) ; static class LRUMemoryMapStateBacking < T > implements ITupleCollection , IBackingMap < T > { public static void clearAll ( ) { } Map < List < Object > , T > db ; Long currTx ; public LRUMemoryMapStateBacking ( int cacheSize , String id ) { } @ Override public List < T > multiGet ( List < List < Object > > keys ) { } @ Override public void multiPut ( List < List < Object > > keys , List < T > vals ) { } @ Override public Iterator < List < Object > > getTuples ( ) { } } }

Fix:
return new LRUMemoryMapState ( _maxSize , _id ) ;
Buggy code:
public class ExpressionStatement extends Statement { public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor ( ExpressionStatement . class , "expression" , Expression . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Expression expression = null ; ExpressionStatement ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Expression getExpression ( ) { if ( ( this . expression ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . expression ) == null ) { preLazyInit ( ) ; this . expression = new MethodInvocation ( this . ast ) ; postLazyInit ( this . expression , ExpressionStatement . EXPRESSION_PROPERTY ) ; } } } return this . expression ; } public void setExpression ( Expression expression ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
public class ExtraFieldUtilsTestCase extends TestCase implements UnixStat { private AsiExtraField m_field ; private UnrecognizedExtraField m_dummy ; private byte [ ] m_data ; private byte [ ] m_local ; public ExtraFieldUtilsTestCase ( final String name ) { } public void setUp ( ) { m_field = new AsiExtraField ( ) ; m_field . setMode ( 493 ) ; m_field . setDirectory ( true ) ; m_dummy = new UnrecognizedExtraField ( ) ; <START_BUG> m_dummy . setHeaderId ( new ZipShort ( 1 ) ) ; <END_BUG> m_dummy . setLocalFileDataData ( new byte [ 0 ] ) ; m_dummy . setCentralDirectoryData ( new byte [ ] { 0 } ) ; m_local = m_field . getLocalFileDataData ( ) ; final byte [ ] dummyLocal = m_dummy . getLocalFileDataData ( ) ; m_data = new byte [ ( ( 4 + ( m_local . length ) ) + 4 ) + ( dummyLocal . length ) ] ; System . arraycopy ( m_field . getHeaderID ( ) . getBytes ( ) , 0 , m_data , 0 , 2 ) ; System . arraycopy ( m_field . getLocalFileDataLength ( ) . getBytes ( ) , 0 , m_data , 2 , 2 ) ; System . arraycopy ( m_local , 0 , m_data , 4 , m_local . length ) ; System . arraycopy ( m_dummy . getHeaderID ( ) . getBytes ( ) , 0 , m_data , ( 4 + ( m_local . length ) ) , 2 ) ; System . arraycopy ( m_dummy . getLocalFileDataLength ( ) . getBytes ( ) , 0 , m_data , ( ( 4 + ( m_local . length ) ) + 2 ) , 2 ) ; System . arraycopy ( dummyLocal , 0 , m_data , ( ( 4 + ( m_local . length ) ) + 4 ) , dummyLocal . length ) ; } public void testParse ( ) throws Exception { } public void testMerge ( ) { } }

Fix:
m_dummy . setHeaderID ( new ZipShort ( 1 ) ) ;
Buggy code:
public class XMLJUnitResultFormatter implements JUnitResultFormatter , XMLConstants { private static final String UNKNOWN = "unknown" ; private static DocumentBuilder getDocumentBuilder ( ) { } private Document doc ; private Element rootElement ; private Hashtable testElements = new Hashtable ( ) ; private Hashtable failedTests = new Hashtable ( ) ; private Hashtable testStarts = new Hashtable ( ) ; private OutputStream out ; public XMLJUnitResultFormatter ( ) { } public void setOutput ( OutputStream out ) { } public void setSystemOutput ( String out ) { } public void setSystemError ( String out ) { } public void startTestSuite ( JUnitTest suite ) { } private String getHostname ( ) { } public void endTestSuite ( JUnitTest suite ) throws BuildException { } public void startTest ( Test t ) { } public void endTest ( Test test ) { if ( ! ( testStarts . containsKey ( test ) ) ) { startTest ( test ) ; } Element currentTest = null ; if ( ! ( failedTests . containsKey ( test ) ) ) { currentTest = doc . createElement ( TESTCASE ) ; String n = JUnitVersionHelper . getTestCaseName ( test ) ; currentTest . setAttribute ( ATTR_NAME , ( n == null ? XMLJUnitResultFormatter . UNKNOWN : n ) ) ; <START_BUG> currentTest . setAttribute ( ATTR_CLASSNAME , test . getClass ( ) . getName ( ) ) ; <END_BUG> rootElement . appendChild ( currentTest ) ; testElements . put ( test , currentTest ) ; } else { currentTest = ( ( Element ) ( testElements . get ( test ) ) ) ; } Long l = ( ( Long ) ( testStarts . get ( test ) ) ) ; currentTest . setAttribute ( ATTR_TIME , ( "" + ( ( ( System . currentTimeMillis ( ) ) - ( l . longValue ( ) ) ) // 1000.0 ) ) ) ; } public void addFailure ( Test test , Throwable t ) { } public void addFailure ( Test test , AssertionFailedError t ) { } public void addError ( Test test , Throwable t ) { } private void formatError ( String type , Test test , Throwable t ) { } private void formatOutput ( String type , String output ) { } }

Fix:
currentTest . setAttribute ( ATTR_CLASSNAME , JUnitVersionHelper . getTestCaseClassName ( test ) ) ;
Buggy code:
public class MagazineArchiveActivity extends ActionBarActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public static class MagazineArchiveFragment extends Fragment { public MagazineArchiveFragment ( ) { } ArrayList < Issue > magazines = null ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { final View rootView = inflater . inflate ( fragment_magazine_archive , container , false ) ; magazines = Publisher . getIssuesFromFilesystem ( ) ; GridView gridview = ( ( GridView ) ( rootView . findViewById ( magazineArchiveGridView ) ) ) ; gridview . setAdapter ( new MagazineArchiveActivity . MagazineArchiveFragment . ImageAdapter ( rootView . getContext ( ) ) ) ; gridview . setOnItemClickListener ( new AdapterView . OnItemClickListener ( ) { public void onItemClick ( AdapterView < ? > parent , View v , int position , long id ) { <START_BUG> String magazineTitle = Publisher . parseIssueJson ( magazines . get ( position ) ) . get ( "title" ) . getAsString ( ) ; <END_BUG> Toast . makeText ( rootView . getContext ( ) , magazineTitle , LENGTH_SHORT ) . show ( ) ; } } ) ; return rootView ; } public class ImageAdapter extends BaseAdapter { private Context mContext ; public ImageAdapter ( Context c ) { } public int getCount ( ) { } public Object getItem ( int position ) { } public long getItemId ( int position ) { } int coverWidth = ( ( int ) ( TypedValue . applyDimension ( COMPLEX_UNIT_DIP , ( ( float ) ( 100 ) ) , getResources ( ) . getDisplayMetrics ( ) ) ) ) ; int coverHeight = ( ( int ) ( TypedValue . applyDimension ( COMPLEX_UNIT_DIP , ( ( float ) ( 141 ) ) , getResources ( ) . getDisplayMetrics ( ) ) ) ) ; public View getView ( int position , View convertView , ViewGroup parent ) { } } } }

Fix:
String magazineTitle = magazines . get ( position ) . getTitle ( ) ;
Buggy code:
public class StreamInitiateVerbHandler implements IVerbHandler { private static Logger logger = LoggerFactory . getLogger ( StreamInitiateVerbHandler . class ) ; public void doVerb ( Message message ) { } public LinkedHashMap < PendingFile , PendingFile > getContextMapping ( PendingFile [ ] remoteFiles ) throws IOException { LinkedHashMap < PendingFile , PendingFile > mapping = new LinkedHashMap < PendingFile , PendingFile > ( ) ; for ( PendingFile remote : remoteFiles ) { <START_BUG> Descriptor remotedesc = remote . getDescriptor ( ) ; <END_BUG> Table table = Table . open ( remotedesc . ksname ) ; ColumnFamilyStore cfStore = table . getColumnFamilyStore ( remotedesc . cfname ) ; Descriptor localdesc = Descriptor . fromFilename ( cfStore . getFlushPath ( ) ) ; mapping . put ( remote , new PendingFile ( localdesc , remote ) ) ; } return mapping ; } private void addStreamContext ( InetAddress host , PendingFile pendingFile , FileStatus streamStatus ) { } }

Fix:
Descriptor remotedesc = remote . desc ;
Buggy code:
public class DistanceFacetsExample implements Closeable { final DoubleRange ONE_KM = new DoubleRange ( "<<seq2seq4repair_space>1<seq2seq4repair_space>km" , 0.0 , true , 1.0 , false ) ; final DoubleRange TWO_KM = new DoubleRange ( "<<seq2seq4repair_space>2<seq2seq4repair_space>km" , 0.0 , true , 2.0 , false ) ; final DoubleRange FIVE_KM = new DoubleRange ( "<<seq2seq4repair_space>5<seq2seq4repair_space>km" , 0.0 , true , 5.0 , false ) ; final DoubleRange TEN_KM = new DoubleRange ( "<<seq2seq4repair_space>10<seq2seq4repair_space>km" , 0.0 , true , 10.0 , false ) ; private final Directory indexDir = new RAMDirectory ( ) ; private IndexSearcher searcher ; private final FacetsConfig config = new FacetsConfig ( ) ; public static final double ORIGIN_LATITUDE = 40.7143528 ; public static final double ORIGIN_LONGITUDE = - 74.0059731 ; public static final double EARTH_RADIUS_KM = 6371.01 ; public DistanceFacetsExample ( ) { } public void index ( ) throws IOException { IndexWriter writer = new IndexWriter ( indexDir , new org . apache . lucene . index . IndexWriterConfig ( FacetExamples . EXAMPLES_VER , new org . apache . lucene . analysis . core . WhitespaceAnalyzer ( FacetExamples . EXAMPLES_VER ) ) ) ; Document doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . DoubleField ( "latitude" , 40.759011 , Store . NO ) ) ; doc . add ( new org . apache . lucene . document . DoubleField ( "longitude" , ( - 73.9844722 ) , Store . NO ) ) ; writer . addDocument ( doc ) ; doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . DoubleField ( "latitude" , 40.718266 , Store . NO ) ) ; doc . add ( new org . apache . lucene . document . DoubleField ( "longitude" , ( - 74.007819 ) , Store . NO ) ) ; writer . addDocument ( doc ) ; doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . DoubleField ( "latitude" , 40.7051157 , Store . NO ) ) ; doc . add ( new org . apache . lucene . document . DoubleField ( "longitude" , ( - 74.0088305 ) , Store . NO ) ) ; writer . addDocument ( doc ) ; searcher = new IndexSearcher ( DirectoryReader . open ( writer , true ) ) ; <START_BUG> writer . close ( ) ; <END_BUG> } private ValueSource getDistanceValueSource ( ) { } public static Filter getBoundingBoxFilter ( double originLat , double originLng , double maxDistanceKM ) { } public FacetResult search ( ) throws IOException { } public TopDocs drillDown ( DoubleRange range ) throws IOException { } @ Override public void close ( ) throws IOException { } @ SuppressWarnings ( "unchecked" ) public static void main ( String [ ] args ) throws Exception { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class FilterSave extends JDialogCentered { private enum FilterSaveAction { SAVE , CANCEL ; } private final EventList < String > filters ; private final List < String > defaultFilters = new ArrayList < String > ( ) ; private final JComboBox jName ; private final JButton jSave ; private String returnString ; public FilterSave ( final JFrame jFrame ) { } String show ( final List < String > filters , final List < String > defaultFilters ) { } private boolean validate ( ) { String name = ( ( String ) ( jName . getSelectedItem ( ) ) ) ; if ( name == null ) { JOptionPane . showMessageDialog ( this . getDialog ( ) , GuiShared . get ( ) . noFilterName ( ) , GuiShared . get ( ) . saveFilter ( ) , JOptionPane . PLAIN_MESSAGE ) ; return false ; } if ( name . isEmpty ( ) ) { JOptionPane . showMessageDialog ( this . getDialog ( ) , GuiShared . get ( ) . noFilterName ( ) , GuiShared . get ( ) . saveFilter ( ) , JOptionPane . PLAIN_MESSAGE ) ; return false ; } for ( String filter : defaultFilters ) { if ( filter . toLowerCase ( ) . equals ( name . toLowerCase ( ) ) ) { JOptionPane . showMessageDialog ( this . getDialog ( ) , GuiShared . get ( ) . overwriteDefaultFilter ( ) , GuiShared . get ( ) . saveFilter ( ) , JOptionPane . PLAIN_MESSAGE ) ; return false ; } } try { filters . getReadWriteLock ( ) . readLock ( ) . lock ( ) ; if ( filters . contains ( name ) ) { int nReturn = JOptionPane . showConfirmDialog ( this . getDialog ( ) , GuiShared . get ( ) . overwrite ( ) , GuiShared . get ( ) . overwriteFilter ( ) , JOptionPane . YES_NO_OPTION , JOptionPane . PLAIN_MESSAGE ) ; if ( nReturn == ( JOptionPane . NO_OPTION ) ) { return false ; } } } finally { <START_BUG> filters . getReadWriteLock ( ) . readLock ( ) . lock ( ) ; <END_BUG> } return true ; } @ Override protected JComponent getDefaultFocus ( ) { } @ Override protected JButton getDefaultButton ( ) { } @ Override protected void windowShown ( ) { } @ Override protected void save ( ) { } @ Override public void setVisible ( final boolean b ) { } private class ListenerClass implements ActionListener { @ Override public void actionPerformed ( final ActionEvent e ) { } } private static class Filterator implements TextFilterator < String > { @ Override public void getFilterStrings ( final List < String > baseList , final String element ) { } } }

Fix:
filters . getReadWriteLock ( ) . readLock ( ) . unlock ( ) ;
Buggy code:
public abstract class ClearCase extends Task { private static final String CLEARTOOL_EXE = "cleartool" ; public static final String COMMAND_UPDATE = "update" ; public static final String COMMAND_CHECKOUT = "checkout" ; public static final String COMMAND_CHECKIN = "checkin" ; public static final String COMMAND_UNCHECKOUT = "uncheckout" ; private String m_ClearToolDir = "" ; private String m_viewPath = null ; public final void setClearToolDir ( String dir ) { <START_BUG> m_ClearToolDir = project . translatePath ( dir ) ; <END_BUG> } public final void setViewPath ( String viewPath ) { } public String getViewPath ( ) { } protected final String getClearToolCommand ( ) { } protected int run ( Commandline cmd ) throws TaskException { } }

Fix:
m_ClearToolDir = getProject ( ) . translatePath ( dir ) ;
Buggy code:
public class ReturnStatement extends Statement { public Expression expression ; public boolean isSynchronized ; public SubRoutineStatement [ ] subroutines ; public boolean isAnySubRoutineEscaping = false ; public LocalVariableBinding saveValueVariable ; public ReturnStatement ( Expression expr , int s , int e ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void generateReturnBytecode ( CodeStream codeStream ) { } public void generateStoreSaveValueIfNecessary ( CodeStream codeStream ) { } public boolean needValue ( ) { } public void prepareSaveValueLocation ( TryStatement targetTryStatement ) { } public StringBuffer printStatement ( int tab , StringBuffer output ) { } public void resolve ( BlockScope scope ) { MethodScope methodScope = scope . methodScope ( ) ; MethodBinding methodBinding ; TypeBinding methodType = ( ( methodScope . referenceContext ) instanceof AbstractMethodDeclaration ) ? ( methodBinding = ( ( AbstractMethodDeclaration ) ( methodScope . referenceContext ) ) . binding ) == null ? null : methodBinding . returnType : VoidBinding ; TypeBinding expressionType ; if ( methodType == ( VoidBinding ) ) { if ( ( expression ) == null ) return ; if ( ( expressionType = expression . resolveType ( scope ) ) != null ) scope . problemReporter ( ) . attemptToReturnNonVoidExpression ( this , expressionType ) ; return ; } if ( ( expression ) == null ) { if ( methodType != null ) scope . problemReporter ( ) . shouldReturn ( methodType , this ) ; return ; } expression . setExpectedType ( methodType ) ; if ( ( expressionType = expression . resolveType ( scope ) ) == null ) return ; if ( expressionType == ( VoidBinding ) ) { scope . problemReporter ( ) . attemptToReturnVoidValue ( this ) ; return ; } if ( methodType == null ) return ; if ( methodType != expressionType ) scope . compilationUnitScope ( ) . recordTypeConversion ( methodType , expressionType ) ; if ( ( expression . isConstantValueOfTypeAssignableToType ( expressionType , methodType ) ) || ( expressionType . isCompatibleWith ( methodType ) ) ) { expression . computeConversion ( scope , methodType , expressionType ) ; if ( expressionType . needsUncheckedConversion ( methodType ) ) { <START_BUG> scope . problemReporter ( ) . unsafeRawConversion ( this . expression , expressionType , methodType ) ; <END_BUG> } return ; } else if ( scope . isBoxingCompatibleWith ( expressionType , methodType ) ) { expression . computeConversion ( scope , methodType , expressionType ) ; return ; } scope . problemReporter ( ) . typeMismatchError ( expressionType , methodType , expression ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
scope . problemReporter ( ) . unsafeTypeConversion ( this . expression , expressionType , methodType ) ;
Buggy code:
class LayoutReconciliation { private final Scrollable scrollable ; private final Composite adapter ; LayoutReconciliation ( Composite adapter , Scrollable scrollable ) { } void run ( ) { <START_BUG> if ( ( adapter . getParent ( ) . getLayout ( ) ) instanceof StackLayout ) { <END_BUG> reconcileStackLayout ( ) ; } } private void reconcileStackLayout ( ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( adapter . getParent ( ) ) != null ) && ( ( adapter . getParent ( ) . getLayout ( ) ) instanceof StackLayout ) ) {
Buggy code:
public class BlueprintExtender implements BundleActivator , SynchronousBundleListener { private static final Logger LOGGER = LoggerFactory . getLogger ( BlueprintExtender . class ) ; private BundleContext context ; private ScheduledExecutorService executors ; private Map < Bundle , BlueprintContainerImpl > containers ; private BlueprintEventDispatcher eventDispatcher ; private NamespaceHandlerRegistry handlers ; public void start ( BundleContext context ) { BlueprintExtender . LOGGER . debug ( "Starting<seq2seq4repair_space>blueprint<seq2seq4repair_space>extender..." ) ; this . context = context ; <START_BUG> eventDispatcher = new BlueprintEventDispatcher ( context ) ; <END_BUG> handlers = new NamespaceHandlerRegistryImpl ( context ) ; executors = Executors . newScheduledThreadPool ( 3 ) ; containers = new HashMap < Bundle , BlueprintContainerImpl > ( ) ; context . addBundleListener ( this ) ; Bundle [ ] bundles = context . getBundles ( ) ; for ( Bundle b : bundles ) { if ( ( b . getState ( ) ) == ( Bundle . ACTIVE ) ) { checkBundle ( b ) ; } else if ( ( b . getState ( ) ) == ( Bundle . STARTING ) ) { String activationPolicyHeader = ( ( String ) ( b . getHeaders ( ) . get ( Constants . BUNDLE_ACTIVATIONPOLICY ) ) ) ; if ( ( activationPolicyHeader != null ) && ( activationPolicyHeader . startsWith ( Constants . ACTIVATION_LAZY ) ) ) { checkBundle ( b ) ; } } } BlueprintExtender . LOGGER . debug ( "Blueprint<seq2seq4repair_space>extender<seq2seq4repair_space>started" ) ; } public void stop ( BundleContext context ) { } private List < Bundle > getBundlesToDestroy ( ) { } private static int getServiceUsage ( ServiceReference ref ) { } public void bundleChanged ( BundleEvent event ) { } private void destroyContext ( Bundle bundle ) { } private void checkBundle ( Bundle bundle ) { } private boolean isCompatible ( Bundle bundle ) { } private boolean hasWildcards ( String path ) { } private void addEntry ( Bundle bundle , String path , List < Object > pathList ) { } private void addEntries ( Bundle bundle , String path , String filePattern , List < Object > pathList ) { } }

Fix:
eventDispatcher = new BlueprintEventDispatcher ( context , executors ) ;
Buggy code:
public class IaasPolicyTest { private IaasPolicy policy ; private NodeSource nodeSource ; private RMCore rmCore ; private Scheduler scheduler ; private SchedulerState schedulerState ; @ Before public void setUp ( ) throws Exception { } @ Test public void genericInformationAtJobLevel_startsAndStopsInstance ( ) throws Exception { } @ Test public void genericInformationAtTaskLevel_startsAndStopsInstance ( ) throws Exception { } @ Test public void genericInformationAndShutdownAtTaskLevel_startsAndStopsInstanceWhenTaskFinished ( ) throws Exception { } @ Test public void genericInformationAtJobLevelAndShutdownAtTaskLevel_startsAndStopsInstanceWhenTaskFinished ( ) throws Exception { } @ Test public void genericInformationAtJobLevelAndShutdownAtTaskLevel_Inheritance_startsAndStopsInstanceWhenTaskFinished ( ) throws Exception { } @ Test public void genericInformationAtTaskLevels_startsAndStopsInstanceWhenSecondTaskFinished ( ) throws Exception { } @ Test public void twoTasksDeployingTwoInstances_StartsTwoInstances ( ) throws Exception { } @ Test public void eligibleTasksButAlreadyProvisionned ( ) throws Exception { } @ Test public void severalInstancesRequired ( ) throws Exception { } @ Test public void notTheRequiredNodeSource ( ) throws Exception { } @ Test public void instanceCreatedAfterJobExecution ( ) throws Exception { } @ Test public void genericInformationInheritance ( ) throws Exception { } private Map < String , String > createGenericInformation ( String token ) { } private TaskInfo createTaskInfo ( InternalTask task ) { } private void verifyInstanceCreated ( ) { } private void verifyInstanceDestroyed ( ) { } private void verifyInstancesCreated ( int nbOfInstances ) { } private void verifyTotalNumberOfInstanceCreated ( int nbOfCalls ) { } private void verifyInstancesDestroyed ( int nb ) { } private LinkedList < Node > createAliveNodes ( String ... tokens ) throws ProActiveException { } private LinkedList < Node > createAliveNodes ( int nb , String token ) throws ProActiveException { } private JobInfoImpl createJobInfo ( JobState jobState ) { } private InternalTask createTask ( int jobId , int taskId ) { InternalTask task1 = new InternalScriptTask ( ) ; <START_BUG> task1 . setId ( TaskIdImpl . createTaskId ( new JobIdImpl ( jobId , Integer . toString ( jobId ) ) , ( "task" + taskId ) , taskId , false ) ) ; <END_BUG> return task1 ; } }

Fix:
task1 . setId ( TaskIdImpl . createTaskId ( new JobIdImpl ( jobId , Integer . toString ( jobId ) ) , ( "task" + taskId ) , taskId ) ) ;
Buggy code:
public class CFCallNumber extends CordovaPlugin { @ Override public boolean execute ( String action , JSONArray args , CallbackContext callbackContext ) throws JSONException { String number = args . getString ( 0 ) ; if ( ( number . startsWith ( "tel:" ) ) == false ) { number = String . format ( "tel:%s" , number ) ; } if ( ( ( ( TelephonyManager ) ( cordova . getActivity ( ) . getSystemService ( Context . TELEPHONY_SERVICE ) ) ) . getPhoneType ( ) ) == ( TelephonyManager . PHONE_TYPE_NONE ) ) { callbackContext . error ( "NoFeatureCallSupported" ) ; } try { Intent intent = new Intent ( Intent . ACTION_CALL ) ; <START_BUG> intent . setData ( Uri . parse ( Uri . encode ( number ) ) ) ; <END_BUG> cordova . getActivity ( ) . startActivity ( intent ) ; callbackContext . success ( ) ; } catch ( Exception e ) { callbackContext . error ( "CouldNotCallPhoneNumber" ) ; } return true ; } }

Fix:
intent . setData ( Uri . parse ( number ) ) ;
Buggy code:
public class XMLElementImpl < T extends XMLIdentifiableElement , P extends XMLElement > { protected StringType id ; protected P parent ; public void setId ( String id ) throws XMLException { if ( ! ( validate ( id ) ) ) <START_BUG> throw new XMLException ( "Invalid<seq2seq4repair_space>identifier" ) ; <END_BUG> this . id = new StringType ( id ) ; } public String getId ( ) { } public boolean setParent ( P parent ) { } public P getParent ( ) { } public boolean compare ( T other ) { } protected boolean validate ( String id ) { } }

Fix:
throw new XMLException ( ( "Invalid<seq2seq4repair_space>identifier:<seq2seq4repair_space>" + id ) ) ;
Buggy code:
public final class Main { private Main ( ) { } public static void main ( String [ ] args ) { SecurityActions . setSystemProperty ( "log4j.defaultInitOverride" , "true" ) ; new BridgeRepositorySelector ( ) . start ( ) ; StdioContext . install ( ) ; final StdioContext context = StdioContext . create ( new NullInputStream ( ) , new org . jboss . stdio . LoggingOutputStream ( Logger . getLogger ( "stdout" ) , Level . INFO ) , new org . jboss . stdio . LoggingOutputStream ( Logger . getLogger ( "stderr" ) , Level . ERROR ) ) ; StdioContext . setStdioContextSelector ( new org . jboss . stdio . SimpleStdioContextSelector ( context ) ) ; try { Module . registerURLStreamHandlerFactoryModule ( Module . getBootModuleLoader ( ) . loadModule ( ModuleIdentifier . create ( "org.jboss.vfs" ) ) ) ; <START_BUG> ServerEnvironment serverEnvironment = Main . determineEnvironment ( args , new Properties ( SecurityActions . getSystemProperties ( ) ) , SecurityActions . getSystemEnvironment ( ) , STANADALONE ) ; <END_BUG> if ( serverEnvironment == null ) { Main . abort ( null ) ; } else { final Bootstrap bootstrap = Factory . newInstance ( ) ; final Bootstrap . Configuration configuration = new Bootstrap . Configuration ( ) ; configuration . setServerEnvironment ( serverEnvironment ) ; configuration . setModuleLoader ( Module . getBootModuleLoader ( ) ) ; bootstrap . bootstrap ( configuration , Collections . < ServiceActivator > emptyList ( ) ) . get ( ) ; return ; } } catch ( Throwable t ) { Main . abort ( t ) ; } } private static void abort ( Throwable t ) { } public static ServerEnvironment determineEnvironment ( String [ ] args , Properties systemProperties , Map < String , String > systemEnvironment , ServerEnvironment . LaunchType launchType ) { } private static URL makeURL ( String urlspec ) throws MalformedURLException { } }

Fix:
ServerEnvironment serverEnvironment = Main . determineEnvironment ( args , new Properties ( SecurityActions . getSystemProperties ( ) ) , SecurityActions . getSystemEnvironment ( ) , STANDALONE ) ;
Buggy code:
class ProgressInfoItem extends Composite { static String STOP_IMAGE_KEY = "org.eclipse.ui.internal.progress.PROGRESS_STOP" ; static String DISABLED_STOP_IMAGE_KEY = "org.eclipse.ui.internal.progress.DISABLED_PROGRESS_STOP" ; static String CLEAR_FINISHED_JOB_KEY = "org.eclipse.ui.internal.progress.CLEAR_FINISHED_JOB" ; static String DISABLED_CLEAR_FINISHED_JOB_KEY = "org.eclipse.ui.internal.progress.DISABLED_CLEAR_FINISHED_JOB" ; static String DEFAULT_JOB_KEY = "org.eclipse.ui.internal.progress.PROGRESS_DEFAULT" ; static String DARK_COLOR_KEY = "org.eclipse.ui.internal.progress.PROGRESS_DARK_COLOR" ; JobTreeElement info ; Label progressLabel ; ToolBar actionBar ; ToolItem actionButton ; List taskEntries = new ArrayList ( 0 ) ; private ProgressBar progressBar ; private Label jobImageLabel ; static final int MAX_PROGRESS_HEIGHT = 12 ; static final int MIN_ICON_SIZE = 16 ; private static final String EMPTY_STRING = "" ; private static final String TEXT_KEY = "Text" ; private static final String ACTION_KEY = "Action" ; interface IndexListener { public void selectPrevious ( ) { } public void selectNext ( ) { } public void select ( ) { } } ProgressInfoItem . IndexListener indexListener ; private int currentIndex ; private boolean selected ; private MouseAdapter mouseListener ; public ProgressInfoItem ( Composite parent , int style , JobTreeElement progressInfo ) { } protected void createChildren ( ) { } private void setLayoutsForNoProgress ( ) { } protected void cancelOrRemove ( ) { } private Image getInfoImage ( ) { } private String getMainTitle ( ) { } protected String getJobNameAndStatus ( ) { } String getJobInfoFinishedString ( Job job , boolean withTime ) { } private String getTimeString ( ) { } void refresh ( ) { } private boolean isCompleted ( ) { } private JobInfo [ ] getJobInfos ( ) { } private boolean isRunning ( ) { } private int getPercentDone ( ) { } private void setToolBarImages ( ) { } void createProgressBar ( int style ) { } void setLinkText ( Job linkJob , String taskString , int index ) { } private void updateText ( String taskString , Link link ) { } public void setColor ( int i ) { } private void setAllForegrounds ( Color color ) { } private void setAllBackgrounds ( Color color ) { setBackground ( color ) ; progressLabel . setBackground ( color ) ; actionBar . setBackground ( color ) ; jobImageLabel . setBackground ( color ) ; Iterator taskEntryIterator = taskEntries . iterator ( ) ; while ( taskEntryIterator . hasNext ( ) ) { <START_BUG> ( ( Link ) ( taskEntryIterator . next ( ) ) ) . setBackground ( actionBar . getDisplay ( ) . getSystemColor ( COLOR_CYAN ) ) ; <END_BUG> } } void setButtonFocus ( ) { } void selectWidgets ( boolean select ) { } void setIndexListener ( ProgressInfoItem . IndexListener indexListener ) { } boolean isSelected ( ) { } }

Fix:
( ( Link ) ( taskEntryIterator . next ( ) ) ) . setBackground ( color ) ;
Buggy code:
public abstract class AbstractCall implements ICall , IValued { protected ICodePosition position ; public IValue instance ; public IArguments arguments ; public IMethod method ; protected IType type ; protected GenericData genericData ; protected GenericData getGenericData ( ) { } @ Override public boolean isPrimitive ( ) { } @ Override public IType getType ( ) { } @ Override public IValue withType ( IType type ) { } @ Override public boolean isType ( IType type ) { } @ Override public int getTypeMatch ( IType type ) { } @ Override public void setValue ( IValue value ) { } @ Override public IValue getValue ( ) { } @ Override public void setArguments ( IArguments arguments ) { } @ Override public IArguments getArguments ( ) { } @ Override public void resolveTypes ( MarkerList markers , IContext context ) { } @ Override public void checkTypes ( MarkerList markers , IContext context ) { if ( ( this . instance ) != null ) { this . instance . checkTypes ( markers , context ) ; } if ( ( this . method ) != null ) { this . method . checkArguments ( markers , this . position , context , this . instance , this . arguments , this . getGenericData ( ) ) ; } <START_BUG> this . arguments . check ( markers , context ) ; <END_BUG> } @ Override public void check ( MarkerList markers , IContext context ) { } @ Override public IValue foldConstants ( ) { } @ Override public void writeExpression ( MethodWriter writer ) throws BytecodeException { } @ Override public void writeStatement ( MethodWriter writer ) throws BytecodeException { } @ Override public void writeJump ( MethodWriter writer , Label dest ) throws BytecodeException { } @ Override public void writeInvJump ( MethodWriter writer , Label dest ) throws BytecodeException { } @ Override public String toString ( ) { } }

Fix:
this . arguments . checkTypes ( markers , context ) ;
Buggy code:
public class MoveRangeAfterJumpCommand extends CommandAroundJump { private final Class < ? extends Selector > _selectorClass ; public MoveRangeAfterJumpCommand ( Editor editor , Class < ? extends Selector > selectorClass ) { } @ Override public void afterJump ( final int jumpTargetOffset ) { final Runnable runnable = new Runnable ( ) { @ Override public void run ( ) { TextRange sourceRange = EditorUtils . getRangeOf ( _selectorClass , _editor ) ; boolean noNeedToMove = sourceRange . contains ( getOffsetBeforeJump ( ) ) ; if ( noNeedToMove ) { _editor . getCaretModel ( ) . moveToOffset ( getOffsetBeforeJump ( ) ) ; return ; } int textSourceStartOffset = sourceRange . getStartOffset ( ) ; EditorUtils . copyRange ( _selectorClass , _editor ) ; if ( textSourceStartOffset > ( getOffsetBeforeJump ( ) ) ) { deleteTextSource ( ) ; pasteClipboardToOffset ( ) ; } else { pasteClipboardToOffset ( ) ; <START_BUG> _editor . getCaretModel ( ) . moveToOffset ( textSourceStartOffset ) ; <END_BUG> deleteTextSource ( ) ; _editor . getCaretModel ( ) . moveToOffset ( getOffsetBeforeJump ( ) ) ; EditorUtils . selectRangeOf ( _selectorClass , _editor ) ; } } private void deleteTextSource ( ) { EditorUtils . selectRangeOf ( _selectorClass , _editor ) ; EditorModificationUtil . deleteSelectedText ( _editor ) ; } private void pasteClipboardToOffset ( ) { _editor . getCaretModel ( ) . moveToOffset ( getOffsetBeforeJump ( ) ) ; TextRange [ ] tr = EditorCopyPasteHelperImpl . getInstance ( ) . pasteFromClipboard ( _editor ) ; EditorUtils . selectTextRange ( _editor , tr ) ; } } ; ApplicationManager . getApplication ( ) . runWriteAction ( AppUtil . getRunnableWrapper ( runnable , _editor ) ) ; } }

Fix:
_editor . getCaretModel ( ) . moveToOffset ( jumpTargetOffset ) ;
Buggy code:
public class CflowPointcut extends Pointcut { private Pointcut entry ; private boolean isBelow ; private int [ ] freeVars ; public static final ResolvedPointcutDefinition CFLOW_MARKER = new ResolvedPointcutDefinition ( null , 0 , null , TypeX . NONE , Pointcut . makeMatchesNothing ( RESOLVED ) ) ; public CflowPointcut ( Pointcut entry , boolean isBelow , int [ ] freeVars ) { } public FuzzyBoolean match ( Shadow shadow ) { } public void write ( DataOutputStream s ) throws IOException { s . writeByte ( CFLOW ) ; entry . write ( s ) ; s . writeBoolean ( isBelow ) ; <START_BUG> FileUtil . writeIntArray ( s , freeVars ) ; <END_BUG> writeLocation ( s ) ; } public static Pointcut read ( DataInputStream s , ISourceContext context ) throws IOException { } public void resolveBindings ( IScope scope , Bindings bindings ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { } public Test findResidue ( Shadow shadow , ExposedState state ) { } public Pointcut concretize1 ( ResolvedTypeX inAspect , IntMap bindings ) { } }

Fix:
FileUtil . writeIntArray ( freeVars , s ) ;
Buggy code:
public class DsXmlDeploymentParsingProcessor implements DeploymentUnitProcessor { static final AttachmentKey < AttachmentList < DataSources > > DATA_SOURCES_ATTACHMENT_KEY = AttachmentKey . createList ( DataSources . class ) ; private static final String [ ] LOCATIONS = new String [ ] { "WEB-INF" , "META-INF" } ; public DsXmlDeploymentParsingProcessor ( ) { } @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } private Set < VirtualFile > dataSources ( final DeploymentUnit deploymentUnit ) { final VirtualFile deploymentRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) . getRoot ( ) ; if ( ( deploymentRoot == null ) || ( ! ( deploymentRoot . exists ( ) ) ) ) { return Collections . emptySet ( ) ; } <START_BUG> final String deploymentRootName = deploymentRoot . getLowerCaseName ( ) ; <END_BUG> if ( deploymentRootName . endsWith ( "-ds.xml" ) ) { return Collections . singleton ( deploymentRoot ) ; } final Set < VirtualFile > ret = new HashSet < VirtualFile > ( ) ; for ( String location : DsXmlDeploymentParsingProcessor . LOCATIONS ) { final VirtualFile loc = deploymentRoot . getChild ( location ) ; if ( loc . exists ( ) ) { for ( final VirtualFile file : loc . getChildren ( ) ) { if ( file . getName ( ) . endsWith ( "-ds.xml" ) ) { ret . add ( file ) ; } } } } return ret ; } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
final String deploymentRootName = deploymentRoot . getName ( ) . toLowerCase ( ) ;
Buggy code:
public class GuidGenerator { private static Logger logger_ = LoggerFactory . getLogger ( GuidGenerator . class ) ; private static Random myRand ; private static SecureRandom mySecureRand ; private static String s_id ; private static SafeMessageDigest md5 = null ; public static String guid ( ) { ByteBuffer array = GuidGenerator . guidAsBytes ( ) ; StringBuilder sb = new StringBuilder ( ) ; <START_BUG> for ( int j = ( array . position ( ) ) + ( array . arrayOffset ( ) ) ; j < ( array . limit ( ) ) ; ++ j ) { <END_BUG> int b = ( array . array ( ) [ j ] ) & 255 ; if ( b < 16 ) sb . append ( '0' ) ; sb . append ( Integer . toHexString ( b ) ) ; } return GuidGenerator . convertToStandardFormat ( sb . toString ( ) ) ; } public static String guidToString ( byte [ ] bytes ) { } public static ByteBuffer guidAsBytes ( ) { } private static String convertToStandardFormat ( String valueAfterMD5 ) { } }

Fix:
for ( int j = ( array . position ( ) ) + ( array . arrayOffset ( ) ) ; j < ( ( array . limit ( ) ) + ( array . arrayOffset ( ) ) ) ; ++ j ) {
Buggy code:
public class AckleyObjective extends ObjectiveFunction < DoubleVectorIndividual > { public static final String P_NUM_DIMENSIONS = "numDimensions" ; private final int numDimensions ; public AckleyObjective ( final Parameters parameters , final String base ) { } @ Override public double fitness ( final DoubleVectorIndividual ind ) { assert ind != null ; assert ( ind . size ( ) ) == ( numDimensions ) ; double sumA = 0 ; double sumB = 0 ; for ( final DoubleGene x : ind . getGenome ( ) ) { sumA += Math . pow ( x . value , 2 ) ; sumB += Math . cos ( ( ( 2.0 * ( Math . PI ) ) * ( x . value ) ) ) ; } assert repOK ( ) ; <START_BUG> return ( - 20 ) * ( Math . exp ( ( ( ( ( ( - 0.2 ) * ( Math . sqrt ( ( sumA // ( ind . size ( ) ) ) ) ) ) - ( Math . exp ( ( sumB // ( ind . size ( ) ) ) ) ) ) + 20 ) + ( Math . E ) ) ) ) ; <END_BUG> } @ Override public void setGeneration ( int i ) { } @ Override public int getNumDimensions ( ) { } @ Override public final boolean repOK ( ) { } @ Override public boolean equals ( final Object o ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
return ( ( ( ( - 20 ) * ( Math . exp ( ( ( - 0.2 ) * ( Math . sqrt ( ( sumA // ( ind . size ( ) ) ) ) ) ) ) ) ) - ( Math . exp ( ( sumB // ( ind . size ( ) ) ) ) ) ) + 20 ) + ( Math . E ) ;
Buggy code:
public class Tomcat { private static StringManager sm = StringManager . getManager ( "org.apache.tomcat.startup" ) ; Tomcat ( ) { } void setHelper ( XmlMapper xh ) { } void setConnectorHelper ( XmlMapper xh ) { xh . addRule ( "ContextManager//Connector" , xh . objectCreate ( null , "className" ) ) ; <START_BUG> xh . addRule ( "ContextManager//Connector" , xh . setParent ( "setContextManager" ) ) ; <END_BUG> xh . addRule ( "ContextManager//Connector" , xh . addChild ( "addServerConnector" , "org.apache.tomcat.core.ServerConnector" ) ) ; xh . addRule ( "ContextManager//Connector//Parameter" , xh . methodSetter ( "setProperty" , 2 ) ) ; xh . addRule ( "ContextManager//Connector//Parameter" , xh . methodParam ( 0 , "name" ) ) ; xh . addRule ( "ContextManager//Connector//Parameter" , xh . methodParam ( 1 , "value" ) ) ; } void setLogHelper ( XmlMapper xh ) { } void setSecurityManager ( XmlMapper xh ) { } File getConfigFile ( ContextManager cm ) { } public void execute ( String [ ] args ) throws Exception { } public static void main ( String [ ] args ) { } void stopTomcat ( ) { } String configFile = null ; static final String DEFAULT_CONFIG = "conf//server.xml" ; boolean doStop = false ; public static void printUsage ( ) { } public boolean processArgs ( String [ ] args ) { } }

Fix:
xh . addRule ( "ContextManager//Connector" , xh . setParent ( "setServer" , "java.lang.Object" ) ) ;
Buggy code:
public class CERTRecord extends Record { public static final int PKIX = 1 ; public static final int SPKI = 2 ; public static final int PGP = 3 ; public static final int URL = 253 ; public static final int OID = 254 ; private static CERTRecord member = new CERTRecord ( ) ; private short certType ; private short keyTag ; private byte alg ; private byte [ ] cert ; private CERTRecord ( ) { } private CERTRecord ( Name name , short dclass , int ttl ) { } static CERTRecord getMember ( ) { } public CERTRecord ( Name name , short dclass , int ttl , int certType , int keyTag , int alg , byte [ ] cert ) { } Record rrFromWire ( Name name , short type , short dclass , int ttl , int length , DataByteInputStream in ) throws IOException { } Record rdataFromString ( Name name , short dclass , int ttl , MyStringTokenizer st , Name origin ) throws TextParseException { CERTRecord rec = new CERTRecord ( name , dclass , ttl ) ; rec . certType = ( ( short ) ( Integer . parseInt ( nextString ( st ) ) ) ) ; rec . keyTag = ( ( short ) ( Integer . parseInt ( nextString ( st ) ) ) ) ; rec . alg = ( ( byte ) ( Integer . parseInt ( nextString ( st ) ) ) ) ; <START_BUG> rec . cert = base64 . fromString ( st . remainingTokens ( ) ) ; <END_BUG> return rec ; } public String rdataToString ( ) { } public short getCertType ( ) { } public short getKeyTag ( ) { } public byte getAlgorithm ( ) { } public byte [ ] getCert ( ) { } void rrToWire ( DataByteOutputStream out , Compression c , boolean canonical ) { } }

Fix:
rec . cert = base64 . fromString ( remainingStrings ( st ) ) ;