nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class AbstractSpringAwareUIProvider extends UIProvider { protected final Logger logger = LoggerFactory . getLogger ( getClass ( ) ) ; private final WebApplicationContext webApplicationContext ; private final Map < String , Class < ? extends UI > > pathToUIMap = new ConcurrentHashMap < String , Class < ? extends UI > > ( ) ; public AbstractSpringAwareUIProvider ( WebApplicationContext webApplicationContext ) { } protected abstract void detectUIs ( ) { } @ Override public Class < ? extends UI > getUIClass ( UIClassSelectionEvent uiClassSelectionEvent ) { } private String extractUIPathFromPathInfo ( String pathInfo ) { if ( ( pathInfo != null ) && ( ( pathInfo . length ( ) ) > 1 ) ) { String path = pathInfo ; final int indexOfBang = path . indexOf ( '!' ) ; if ( indexOfBang > ( - 1 ) ) { <START_BUG> path = path . substring ( 0 , ( indexOfBang - 1 ) ) ; <END_BUG> } if ( path . endsWith ( "//" ) ) { path = path . substring ( 0 , ( ( path . length ( ) ) - 1 ) ) ; } return path ; } return "" ; } protected WebApplicationContext getWebApplicationContext ( ) { } protected void mapPathToUI ( String path , Class < ? extends UI > uiClass ) { } protected Class < ? extends UI > getUIByPath ( String path ) { } @ Override public UI createInstance ( UICreateEvent event ) { } }

Fix:
path = path . substring ( 0 , indexOfBang ) ;
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "4.5-SNAPSHOT-20080617-1818" ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return "4.5-SNAPSHOT-20080626-0650" ;
Buggy code:
public class SocketBindingAdd extends AbstractSocketBindingUpdate { private static final long serialVersionUID = - 4940876367809265620L ; private final String name ; private final String interfaceName ; private final int port ; private boolean fixedPort ; private int multicastPort ; private InetAddress multicastAddress ; public SocketBindingAdd ( final String interfaceName , final String name , final int port ) { } public SocketBindingAdd ( SocketBindingElement original ) { } public AbstractSocketBindingUpdate getCompensatingUpdate ( SocketBindingGroupElement original ) { } protected void applyUpdate ( SocketBindingGroupElement group ) throws UpdateFailedException { } protected < P > void applyUpdate ( UpdateContext updateContext , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { <START_BUG> final ServiceTarget target = updateContext . getBatchBuilder ( ) . subTarget ( ) ; <END_BUG> final UpdateResultHandler . ServiceStartListener < P > listener = new UpdateResultHandler . ServiceStartListener < P > ( resultHandler , param ) ; target . addListener ( listener ) ; SocketBindingService . addService ( target , this ) ; } public String getName ( ) { } public int getPort ( ) { } public boolean isFixedPort ( ) { } public void setFixedPort ( boolean fixedPort ) { } public int getMulticastPort ( ) { } public void setMulticastPort ( int multicastPort ) { } public InetAddress getMulticastAddress ( ) { } public void setMulticastAddress ( InetAddress multicastAddress ) { } public String getInterfaceName ( ) { } }

Fix:
final ServiceTarget target = updateContext . getServiceTarget ( ) . subTarget ( ) ;
Buggy code:
public class IdType { Database db = OpenTenureApplication . getInstance ( ) . getDatabase ( ) ; String code ; String displayValue ; String description ; String status ; @ Override public String toString ( ) { } public String getCode ( ) { } public void setCode ( String code ) { } public String getDisplayValue ( ) { } public void setDisplayValue ( String displayValue ) { } public String getDescription ( ) { } public void setDescription ( String description ) { } public String getStatus ( ) { } public void setStatus ( String status ) { } public int add ( ) { } public int addType ( IdType idType ) { } public List < IdType > getIdTypes ( ) { } public List < String > getDisplayValues ( String localization ) { } public int getIndexByCodeType ( String code ) { } public String getTypebyDisplayValue ( String value ) { ResultSet rs = null ; Connection localConnection = null ; PreparedStatement statement = null ; try { localConnection = db . getConnection ( ) ; <START_BUG> statement = localConnection . prepareStatement ( "SELECT<seq2seq4repair_space>TYPE<seq2seq4repair_space>FROM<seq2seq4repair_space>ID_TYPE<seq2seq4repair_space>CT<seq2seq4repair_space>WHERE<seq2seq4repair_space>DISPLAY_VALUE<seq2seq4repair_space>=<seq2seq4repair_space>?" ) ; <END_BUG> statement . setString ( 1 , value ) ; rs = statement . executeQuery ( ) ; while ( rs . next ( ) ) { return rs . getString ( 1 ) ; } return null ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } catch ( Exception exception ) { exception . printStackTrace ( ) ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { } } if ( statement != null ) { try { statement . close ( ) ; } catch ( SQLException e ) { } } if ( localConnection != null ) { try { localConnection . close ( ) ; } catch ( SQLException e ) { } } } return null ; } public String getDisplayValueByType ( String value ) { } public static IdType getIdType ( String type ) { } public int updadateIdType ( ) { } }

Fix:
statement = localConnection . prepareStatement ( "SELECT<seq2seq4repair_space>TYPE<seq2seq4repair_space>FROM<seq2seq4repair_space>ID_TYPE<seq2seq4repair_space>CT<seq2seq4repair_space>WHERE<seq2seq4repair_space>DISPLAY_VALUE<seq2seq4repair_space>LIKE<seq2seq4repair_space>'%'<seq2seq4repair_space>||<seq2seq4repair_space>?<seq2seq4repair_space>||<seq2seq4repair_space>'%'<seq2seq4repair_space>" ) ;
Buggy code:
public class BinaryVerbHandler implements IVerbHandler { private static Logger logger_ = LoggerFactory . getLogger ( BinaryVerbHandler . class ) ; public void doVerb ( Message message ) { byte [ ] bytes = message . getMessageBody ( ) ; ByteArrayInputStream buffer = new ByteArrayInputStream ( bytes ) ; try { <START_BUG> RowMutation rm = RowMutation . serializer ( ) . deserialize ( new DataInputStream ( buffer ) ) ; <END_BUG> rm . applyBinary ( ) ; WriteResponse response = new WriteResponse ( rm . getTable ( ) , rm . key ( ) , true ) ; Message responseMessage = WriteResponse . makeWriteResponseMessage ( message , response ) ; if ( BinaryVerbHandler . logger_ . isDebugEnabled ( ) ) BinaryVerbHandler . logger_ . debug ( ( ( ( ( ( "binary<seq2seq4repair_space>" + rm ) + "<seq2seq4repair_space>applied.<seq2seq4repair_space>Sending<seq2seq4repair_space>response<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( message . getMessageId ( ) ) ) + "@" ) + ( message . getFrom ( ) ) ) ) ; MessagingService . instance ( ) . sendOneWay ( responseMessage , message . getFrom ( ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } }

Fix:
RowMutation rm = RowMutation . serializer ( ) . deserialize ( new DataInputStream ( buffer ) , message . getVersion ( ) ) ;
Buggy code:
public class myitems extends ActionBarActivity implements NavigationDrawerCallbacks { private Toolbar mToolbar ; private NavigationDrawerFragment mNavigationDrawerFragment ; private RecyclerView mRecyclerView ; private Adapter mAdapter ; private LayoutManager mLayoutManager ; SwipeRefreshLayout swipeRefreshLayout ; List < ItemInfo > iteminfo ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_myitems ) ; NavigationDrawerFragment . mCurrentSelectedPosition = 2 ; mToolbar = ( ( Toolbar ) ( findViewById ( toolbar_actionbar1 ) ) ) ; setSupportActionBar ( mToolbar ) ; getSupportActionBar ( ) . setDisplayShowHomeEnabled ( true ) ; getSupportActionBar ( ) . setTitle ( "My<seq2seq4repair_space>Items" ) ; mRecyclerView = ( ( RecyclerView ) ( findViewById ( my_recycler_view1 ) ) ) ; <START_BUG> mRecyclerView . setHasFixedSize ( true ) ; <END_BUG> mLayoutManager = new LinearLayoutManager ( this ) ; mRecyclerView . setLayoutManager ( mLayoutManager ) ; iteminfo = new ArrayList < ItemInfo > ( ) ; mAdapter = new MainAdapter ( iteminfo ) ; mRecyclerView . setAdapter ( mAdapter ) ; mNavigationDrawerFragment = ( ( NavigationDrawerFragment ) ( getFragmentManager ( ) . findFragmentById ( fragment_drawer1 ) ) ) ; mNavigationDrawerFragment . setup ( fragment_drawer1 , ( ( DrawerLayout ) ( findViewById ( drawer1 ) ) ) , mToolbar ) ; swipeRefreshLayout = ( ( SwipeRefreshLayout ) ( findViewById ( swipe_refresh_layout ) ) ) ; swipeRefreshLayout . setColorSchemeResources ( myPrimaryColor ) ; swipeRefreshLayout . setOnRefreshListener ( new SwipeRefreshLayout . OnRefreshListener ( ) { @ Override public void onRefresh ( ) { refreshPostList ( ) ; } } ) ; refreshPostList ( ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public void onNavigationDrawerItemSelected ( int position ) { } @ Override public void onBackPressed ( ) { } private void refreshPostList ( ) { } public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
mRecyclerView . setHasFixedSize ( false ) ;
Buggy code:
public class AndPattern extends IntersectingPattern { protected SearchPattern [ ] patterns ; int current ; private static int combinedMatchRule ( int matchRule , int matchRule2 ) { int combined = matchRule & matchRule2 ; int compatibility = combined & ( JavaSearchPattern . MATCH_COMPATIBILITY_MASK ) ; if ( compatibility == 0 ) { if ( ( matchRule & ( JavaSearchPattern . MATCH_COMPATIBILITY_MASK ) ) == ( SearchPattern . R_FULL_MATCH ) ) { compatibility = matchRule2 ; } else if ( ( matchRule2 & ( JavaSearchPattern . MATCH_COMPATIBILITY_MASK ) ) == ( SearchPattern . R_FULL_MATCH ) ) { compatibility = matchRule ; } else { compatibility = Math . min ( ( matchRule & ( JavaSearchPattern . MATCH_COMPATIBILITY_MASK ) ) , ( matchRule2 & ( JavaSearchPattern . MATCH_COMPATIBILITY_MASK ) ) ) ; } } <START_BUG> return ( ( ( combined & ( ( ( ( SearchPattern . R_EXACT_MATCH ) | ( SearchPattern . R_PREFIX_MATCH ) ) | ( SearchPattern . R_PATTERN_MATCH ) ) | ( SearchPattern . R_REGEXP_MATCH ) ) ) | ( combined & ( SearchPattern . R_CASE_SENSITIVE ) ) ) | compatibility ) | ( combined & ( SearchPattern . R_CAMELCASE_MATCH ) ) ; <END_BUG> } public AndPattern ( SearchPattern leftPattern , SearchPattern rightPattern ) { } SearchPattern currentPattern ( ) { } protected boolean hasNextQuery ( ) { } protected void resetQuery ( ) { } }

Fix:
return ( ( ( combined & ( ( ( ( SearchPattern . R_EXACT_MATCH ) | ( SearchPattern . R_PREFIX_MATCH ) ) | ( SearchPattern . R_PATTERN_MATCH ) ) | ( SearchPattern . R_REGEXP_MATCH ) ) ) | ( combined & ( SearchPattern . R_CASE_SENSITIVE ) ) ) | compatibility ) | ( combined & ( R_CAMEL_CASE_MATCH ) ) ;
Buggy code:
public class VimsonGenerator implements Closeable , Flushable { public VimsonGenerator ( OutputStream out ) { } public VimsonGenerator ( OutputStream out , Charset charset ) { } public void writeString ( CharSequence value ) throws IOException { } public void writeRaw ( CharSequence value ) throws IOException { } public void writeBoolean ( boolean value ) throws IOException { } public void writeFloat ( float value ) throws IOException { } public void writeFloat ( double value ) throws IOException { } public void writeNumber ( byte value ) throws IOException { } public void writeNumber ( short value ) throws IOException { } public void writeNumber ( int value ) throws IOException { } public void writeNumber ( long value ) throws IOException { } public void writeObject ( Object value ) throws IOException { } public void writeObjectField ( CharSequence fieldName , Object value ) throws IOException { } public void writeStringField ( CharSequence fieldName , CharSequence value ) throws IOException { } public void writeFloatField ( CharSequence fieldName , float value ) throws IOException { } public void writeFloatField ( CharSequence fieldName , double value ) throws IOException { } public void writeNumberField ( CharSequence fieldName , byte value ) throws IOException { } public void writeNumberField ( CharSequence fieldName , short value ) throws IOException { } public void writeNumberField ( CharSequence fieldName , int value ) throws IOException { } public void writeNumberField ( CharSequence fieldName , long value ) throws IOException { } public void writeBooleanField ( CharSequence fieldName , boolean value ) throws IOException { } public void writeFieldName ( CharSequence fieldName ) throws IOException { } public void writeDictionaryFieldStart ( CharSequence fieldName ) throws IOException { } public void writeStartDictionary ( ) throws IOException { } public void writeEndDictionary ( ) throws IOException { } public void writeListFieldStart ( CharSequence fieldName ) throws IOException { } public void writeStartList ( ) throws IOException { } public void writeEndList ( ) throws IOException { } public void setObjectCodec ( ObjectCodec codec ) { } public ObjectCodec getObjectCodec ( ) { } @ Override public void flush ( ) throws IOException { } @ Override public void close ( ) throws IOException { } private static enum Context { LIST , DICTIONARY ; } private void write ( CharSequence value ) throws IOException { <START_BUG> this . out . write ( value . toString ( ) . getBytes ( this . charset ) ) ; <END_BUG> } private boolean shouldWriteComma ( ) { } private final OutputStream out ; private final Charset charset ; private final Deque < VimsonGenerator . Context > context = new ArrayDeque < VimsonGenerator . Context > ( ) ; private ObjectCodec codec ; }

Fix:
this . out . write ( ( value != null ? value : "" ) . toString ( ) . getBytes ( this . charset ) ) ;
Buggy code:
public class MultipleEventParserTest { @ Test public void eventOrderingTest ( ) { EventParser [ ] parsers = new EventParser [ 3 ] ; InputStream trace1 = new MultipleEventParserTest . FakeTraceStream ( 0 ) ; InputStream trace2 = new MultipleEventParserTest . FakeTraceStream ( 60 ) ; InputStream trace3 = new MultipleEventParserTest . FakeTraceStream ( 30 ) ; EventScheduler scheduler = new EventScheduler ( ) ; Machine machine1 = new Machine ( scheduler , "cherne" ) ; Machine machine2 = new Machine ( scheduler , "palhaco" ) ; Machine machine3 = new Machine ( scheduler , "abelhinha" ) ; DDGClient client1 = new DDGClient ( scheduler , 1 , machine1 , null ) ; DDGClient client2 = new DDGClient ( scheduler , 2 , machine2 , null ) ; DDGClient client3 = new DDGClient ( scheduler , 3 , machine3 , null ) ; parsers [ 0 ] = new ddg . emulator . FileSystemEventParser ( trace1 , client1 ) ; parsers [ 1 ] = new ddg . emulator . FileSystemEventParser ( trace2 , client2 ) ; parsers [ 2 ] = new ddg . emulator . FileSystemEventParser ( trace3 , client3 ) ; EventParser multipleSourceParser = new ddg . emulator . MultipleEventParser ( parsers ) ; Event currentEvent = multipleSourceParser . getNextEvent ( ) ; Event nextEvent = null ; while ( ( nextEvent = multipleSourceParser . getNextEvent ( ) ) != null ) { <START_BUG> assertTrue ( currentEvent . getTheScheduledTime ( ) . isEarlierThan ( nextEvent . getTheScheduledTime ( ) ) ) ; <END_BUG> currentEvent = nextEvent ; } } @ Test public void eventsDeliveredCountTest ( ) { } private static class FakeTraceStream extends InputStream { private final String [ ] operations = new String [ ] { "read" , "write" , "open" , "close" } ; private final Random random = new Random ( ) ; private int remainingEvents ; private long nextTimeStamp = System . currentTimeMillis ( ) ; private InputStream currentEventStream ; public FakeTraceStream ( int numberOfEvents ) { } @ Override public int read ( ) throws IOException { } private InputStream generateNextEventStream ( ) { } } public static void main ( String [ ] args ) throws IOException { } }

Fix:
assertTrue ( ( ( currentEvent . getTheScheduledTime ( ) . compareTo ( nextEvent . getTheScheduledTime ( ) ) ) <= 0 ) ) ;
Buggy code:
public class QualifiedTypeReference extends TypeReference { public char [ ] [ ] tokens ; public long [ ] sourcePositions ; public QualifiedTypeReference ( char [ ] [ ] sources , long [ ] poss ) { } public TypeReference copyDims ( int dim ) { } protected TypeBinding findNextTypeBinding ( int tokenIndex , Scope scope , PackageBinding packageBinding ) { } protected TypeBinding getTypeBinding ( Scope scope ) { if ( ( this . resolvedType ) != null ) return this . resolvedType ; Binding binding = scope . getPackage ( this . tokens ) ; if ( ( binding != null ) && ( ! ( binding . isValidBinding ( ) ) ) ) return ( ( ReferenceBinding ) ( binding ) ) ; PackageBinding packageBinding = ( binding == null ) ? null : ( ( PackageBinding ) ( binding ) ) ; boolean isClassScope = ( scope . kind ) == ( Scope . CLASS_SCOPE ) ; ReferenceBinding qualifiedType = null ; for ( int i = ( packageBinding == null ) ? 0 : packageBinding . compoundName . length , max = this . tokens . length ; i < max ; i ++ ) { findNextTypeBinding ( i , scope , packageBinding ) ; if ( ! ( this . resolvedType . isValidBinding ( ) ) ) return this . resolvedType ; if ( isClassScope ) if ( ( ( ClassScope ) ( scope ) ) . detectHierarchyCycle ( this . resolvedType , this , null ) ) return null ; ReferenceBinding currentType = ( ( ReferenceBinding ) ( this . resolvedType ) ) ; if ( currentType . isGenericType ( ) ) { qualifiedType = scope . environment ( ) . createRawType ( currentType , qualifiedType ) ; } else if ( qualifiedType != null ) { boolean rawQualified ; if ( ( rawQualified = qualifiedType . isRawType ( ) ) && ( ! ( currentType . isStatic ( ) ) ) ) { qualifiedType = scope . environment ( ) . createRawType ( ( ( ReferenceBinding ) ( currentType . erasure ( ) ) ) , qualifiedType ) ; } else if ( rawQualified || ( qualifiedType . isParameterizedType ( ) ) ) { <START_BUG> qualifiedType = scope . createParameterizedType ( ( ( ReferenceBinding ) ( currentType . erasure ( ) ) ) , null , qualifiedType ) ; <END_BUG> } else { qualifiedType = currentType ; } } else { qualifiedType = currentType ; } } this . resolvedType = qualifiedType ; return this . resolvedType ; } public char [ ] [ ] getTypeName ( ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void traverse ( ASTVisitor visitor , ClassScope scope ) { } }

Fix:
qualifiedType = scope . environment ( ) . createParameterizedType ( ( ( ReferenceBinding ) ( currentType . erasure ( ) ) ) , null , qualifiedType ) ;
Buggy code:
public class PointcutResidueTestCase extends WeaveTestCase { public PointcutResidueTestCase ( String name ) { } String [ ] none = new String [ 0 ] ; public void testArgResidue1 ( ) throws IOException { } public void testArgResidue2 ( ) throws IOException { } public void testArgResidue3 ( ) throws IOException { } public void testMultiArgState ( ) throws IOException { } public void testAdd ( ) throws IOException { } public void testNot ( ) throws IOException { } public void testState ( ) throws IOException { } public void testNoResidueArgs ( ) throws IOException { } public void testCflowState ( ) throws IOException { } private void checkDynamicWeave ( String label , String pointcutSource ) throws IOException { } private void checkMultiArgWeave ( String label , String pointcutSource ) throws IOException { } private void checkWeave ( String label , String filename , String pointcutSource , String [ ] formalTypes , String [ ] formalNames ) throws IOException { final Pointcut sp = Pointcut . fromString ( pointcutSource ) ; final Pointcut rp = sp . resolve ( new SimpleScope ( world , SimpleScope . makeFormalBindings ( TypeX . forNames ( formalTypes ) , formalNames ) ) ) ; <START_BUG> ShadowMunger pp = new BcelAdvice ( AdviceKind . Before , rp , Member . method ( TypeX . forName ( "Aspect" ) , Modifier . STATIC , "ajc_before_0" , Member . typesToSignature ( VOID , TypeX . forNames ( formalTypes ) ) ) , 0 , ( - 1 ) , ( - 1 ) , null , null ) ; <END_BUG> ResolvedTypeX inAspect = world . resolve ( "Aspect" ) ; CrosscuttingMembers xcut = new CrosscuttingMembers ( inAspect ) ; inAspect . crosscuttingMembers = xcut ; ShadowMunger cp = pp . concretize ( inAspect , world , null ) ; xcut . addConcreteShadowMunger ( cp ) ; weaveTest ( new String [ ] { filename } , label , xcut . getShadowMungers ( ) ) ; checkSerialize ( rp ) ; } public void weaveTest ( String name , String outName , ShadowMunger planner ) throws IOException { } public void checkSerialize ( Pointcut p ) throws IOException { } }

Fix:
ShadowMunger pp = new BcelAdvice ( AdviceKind . Before , rp , Member . method ( TypeX . forName ( "Aspect" ) , Modifier . STATIC , "ajc_before_0" , Member . typesToSignature ( VOID , TypeX . forNames ( formalTypes ) , false ) ) , 0 , ( - 1 ) , ( - 1 ) , null , null ) ;
Buggy code:
public class GeoElementGraphicsAdapter extends geogebra . common . kernel . geos . GeoElementGraphicsAdapter { private Application app ; public GeoElementGraphicsAdapter ( AbstractApplication appl ) { } public BufferedImage getFillImage ( ) { } public void setImageFileName ( String fileName ) { if ( fileName . equals ( this . imageFileName ) ) return ; this . imageFileName = fileName ; if ( fileName . startsWith ( "//geogebra" ) ) { ImageElement im = ( ( ImageManager ) ( app . getImageManager ( ) ) ) . getImageResource ( imageFileName ) ; <START_BUG> image = ImageManager . toBufferedImage ( im ) ; <END_BUG> } else { image = app . getExternalImageAdapter ( fileName ) ; } } }

Fix:
image = new geogebra . web . awt . BufferedImage ( ImageManager . toBufferedImage ( im ) ) ;
Buggy code:
public class ProxyListFragment extends BaseDialogFragment implements LoaderManager . LoaderCallbacks < List < ProxyEntity > > , IBaseFragment { private static final String TAG = ProxyListFragment . class . getSimpleName ( ) ; int mCurCheckPosition = 0 ; private ProxiesListAdapter proxiesListAdapter ; private Loader < List < ProxyEntity > > loader ; @ InjectView ( id . progress ) RelativeLayout progress ; @ InjectView ( id . empty_message_section ) RelativeLayout emptySection ; @ InjectView ( android . R . id . empty ) TextView emptyText ; @ InjectView ( android . R . id . list ) ListView listView ; @ Optional @ InjectView ( id . proxy_footer_textview ) TextView footerTextView ; @ Optional @ InjectView ( id . dialog_cancel ) Button cancelDialogButton ; private FragmentMode fragmentMode ; private static final int LOADER_PROXYDB = 1 ; private WiFiAPConfig wiFiAPConfig ; private APLNetworkId aplNetworkId ; public static ProxyListFragment newInstance ( int sectionNumber ) { } public static ProxyListFragment newInstance ( int sectionNumber , FragmentMode mode , APLNetworkId aplNetworkId ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onResume ( ) { } public void refreshUI ( ) { } @ Override public Loader < List < ProxyEntity > > onCreateLoader ( int i , Bundle bundle ) { } @ Override public void onLoadFinished ( Loader < List < ProxyEntity > > listLoader , List < ProxyEntity > dbProxies ) { } private void refreshLoaderResults ( List < ProxyEntity > dbProxies ) { } @ Override public void onLoaderReset ( Loader < List < ProxyEntity > > listLoader ) { } void showDetails ( int index ) { } void selectProxy ( int index ) { } @ Override public void onDestroyView ( ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public void onCreateOptionsMenu ( Menu menu , MenuInflater inflater ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { switch ( item . getItemId ( ) ) { case id . menu_add_new_proxy : <START_BUG> Intent addNewProxyIntent = new Intent ( getActivity ( ) , ProxyDetailFragment . class ) ; <END_BUG> addNewProxyIntent . addFlags ( FLAG_ACTIVITY_CLEAR_TOP ) ; addNewProxyIntent . addFlags ( FLAG_ACTIVITY_NEW_TASK ) ; startActivity ( addNewProxyIntent ) ; return true ; } return super . onOptionsItemSelected ( item ) ; } }

Fix:
Intent addNewProxyIntent = new Intent ( getActivity ( ) , ProxyDetailActivity . class ) ;
Buggy code:
public class Builder { private final AudioContext ac ; private final UGen ugen ; private final Map < String , UGen > map ; private Builder ( AudioContext ac , UGen ugen , Map < String , UGen > map ) { } public AudioContext getAc ( ) { } public UGen getUgen ( ) { } public static Builder build ( AudioContext ac , UGen out ) { } public Builder prepend ( UGen ugen ) { this . ugen . addInput ( ugen ) ; <START_BUG> return new Builder ( ac , this . ugen , this . map ) ; <END_BUG> } public Builder label ( String label ) { } public UGen get ( String label ) { } public Collection < UGen > all ( ) { } }

Fix:
return new Builder ( ac , ugen , this . map ) ;
Buggy code:
public class P4Add extends P4Base { private int changelist ; private String addCmd = "" ; private Vector filesets = new Vector ( ) ; private int cmdLength = 450 ; public void setCommandlength ( int len ) throws BuildException { } public void setChangelist ( int changelist ) throws BuildException { } public void addFileset ( FileSet set ) { } public void execute ( ) throws BuildException { if ( ( P4View ) != null ) { addCmd = P4View ; } P4CmdOpts = ( ( changelist ) > 0 ) ? "-c<seq2seq4repair_space>" + ( changelist ) : "" ; StringBuffer filelist = new StringBuffer ( ) ; for ( int i = 0 ; i < ( filesets . size ( ) ) ; i ++ ) { FileSet fs = ( ( FileSet ) ( filesets . elementAt ( i ) ) ) ; <START_BUG> DirectoryScanner ds = fs . getDirectoryScanner ( project ) ; <END_BUG> String [ ] srcFiles = ds . getIncludedFiles ( ) ; if ( srcFiles != null ) { for ( int j = 0 ; j < ( srcFiles . length ) ; j ++ ) { File f = new File ( ds . getBasedir ( ) , srcFiles [ j ] ) ; filelist . append ( "<seq2seq4repair_space>" ) . append ( '"' ) . append ( f . getAbsolutePath ( ) ) . append ( '"' ) ; if ( ( filelist . length ( ) ) > ( cmdLength ) ) { execP4Add ( filelist ) ; filelist . setLength ( 0 ) ; } } if ( ( filelist . length ( ) ) > 0 ) { execP4Add ( filelist ) ; } } else { log ( "No<seq2seq4repair_space>files<seq2seq4repair_space>specified<seq2seq4repair_space>to<seq2seq4repair_space>add!" , MSG_WARN ) ; } } } private void execP4Add ( StringBuffer list ) { } }

Fix:
DirectoryScanner ds = fs . getDirectoryScanner ( getProject ( ) ) ;
Buggy code:
public class EnclosureResolver implements IComponentResolver { private static final long serialVersionUID = 1L ; public boolean resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { if ( tag . isEnclosureTag ( ) ) { String id = ( ( Component . AUTO_COMPONENT_PREFIX ) + "enclosure-" ) + ( container . getPage ( ) . getAutoIndex ( ) ) ; final Enclosure enclosure = new Enclosure ( container , id , tag . getString ( CHILD_ATTRIBUTE ) ) ; <START_BUG> enclosure . autoAdded ( ) ; <END_BUG> return true ; } return false ; } }

Fix:
enclosure . render ( markupStream ) ;
Buggy code:
public class Load implements Command { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final boolean expandTree = JMeterUtils . getPropDefault ( "onload.expandtree" , true ) ; private static Set commands = new HashSet ( ) ; public Load ( ) { } public Set getActionNames ( ) { } public void doAction ( ActionEvent e ) { } static void loadProjectFile ( ActionEvent e , File f , boolean merging ) { } public static boolean insertLoadedTree ( int id , HashTree tree , boolean merging ) throws Exception , IllegalUserActionException { if ( tree == null ) { throw new Exception ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>TestPlan<seq2seq4repair_space>-<seq2seq4repair_space>see<seq2seq4repair_space>log<seq2seq4repair_space>file" ) ; } boolean isTestPlan = ( tree . getArray ( ) [ 0 ] ) instanceof TestPlan ; GuiPackage guiInstance = GuiPackage . getInstance ( ) ; if ( isTestPlan && ( ! merging ) ) { <START_BUG> guiInstance . getTreeModel ( ) . clearTestPlan ( ( ( TestElement ) ( tree . getArray ( ) [ 0 ] ) ) ) ; <END_BUG> } if ( merging ) { TestElement te = ( ( TestElement ) ( tree . getArray ( ) [ 0 ] ) ) ; if ( ! ( ( te instanceof WorkBench ) || ( te instanceof TestPlan ) ) ) { boolean ok = MenuFactory . canAddTo ( guiInstance . getCurrentNode ( ) , te ) ; if ( ! ok ) { String name = te . getName ( ) ; String className = te . getClass ( ) . getName ( ) ; className = className . substring ( ( ( className . lastIndexOf ( "." ) ) + 1 ) ) ; throw new IllegalUserActionException ( ( ( ( ( "Can't<seq2seq4repair_space>merge<seq2seq4repair_space>" + name ) + "<seq2seq4repair_space>(" ) + className ) + ")<seq2seq4repair_space>here" ) ) ; } } } HashTree newTree = guiInstance . addSubTree ( tree ) ; guiInstance . updateCurrentGui ( ) ; guiInstance . getMainFrame ( ) . getTree ( ) . setSelectionPath ( new TreePath ( ( ( org . apache . jmeter . gui . tree . JMeterTreeNode ) ( newTree . getArray ( ) [ 0 ] ) ) . getPath ( ) ) ) ; tree = guiInstance . getCurrentSubTree ( ) ; ActionEvent actionEvent = null ; if ( ! merging ) { actionEvent = new ActionEvent ( tree . get ( tree . getArray ( ) [ ( ( tree . size ( ) ) - 1 ) ] ) , id , ActionNames . SUB_TREE_LOADED ) ; } else { actionEvent = new ActionEvent ( tree . get ( tree . getArray ( ) [ ( ( tree . size ( ) ) - 1 ) ] ) , id , ActionNames . SUB_TREE_MERGED ) ; } ActionRouter . getInstance ( ) . actionPerformed ( actionEvent ) ; if ( ( Load . expandTree ) && ( ! merging ) ) { JTree jTree = guiInstance . getMainFrame ( ) . getTree ( ) ; for ( int i = 0 ; i < ( jTree . getRowCount ( ) ) ; i ++ ) { jTree . expandRow ( i ) ; } } return isTestPlan ; } public static boolean insertLoadedTree ( int id , HashTree tree ) throws Exception , IllegalUserActionException { } }

Fix:
guiInstance . clearTestPlan ( ( ( TestElement ) ( tree . getArray ( ) [ 0 ] ) ) ) ;
Buggy code:
public class ItemListFragmentTest extends ActivityInstrumentationTestCase2 < EventDetailsActivity > { private ItemListFragment listFragment = new ItemListFragment ( ) ; private EventDetailsActivity activity ; private List < EventItem > itemLists = new ArrayList < EventItem > ( ) ; private EventItem eventItem ; private ParseFile image = new ParseFile ( "image" . getBytes ( ) ) ; private EventDetailItemListAdapter adapter ; private View view ; private TextView itemName ; private TextView itemDescription ; private CircularImageView itemImage ; private TextView itemPreviousBid ; private TextView itemNewBid ; public ItemListFragmentTest ( ) { } public void setUp ( ) throws Exception { super . setUp ( ) ; Intent intent = new Intent ( ) ; intent . putExtra ( "EVENT_ID" , "string" ) ; setActivityIntent ( intent ) ; activity = getActivity ( ) ; eventItem = new EventItem ( ) ; eventItem . setName ( "itemName" ) ; eventItem . setDescription ( "itemDescription" ) ; eventItem . setPreviousBid ( 20 ) ; eventItem . setNewBid ( 40 ) ; eventItem . setImage ( image ) ; itemLists . add ( eventItem ) ; <START_BUG> adapter = new EventDetailItemListAdapter ( activity , itemLists ) ; <END_BUG> view = adapter . getView ( 0 , null , null ) ; activity . getFragmentManager ( ) . beginTransaction ( ) . add ( container , listFragment ) . commit ( ) ; activity . runOnUiThread ( new Runnable ( ) { @ Override public void run ( ) { activity . getFragmentManager ( ) . executePendingTransactions ( ) ; } } ) ; } public void testPreconditions ( ) { } public void testFragmentListView_notnull ( ) { } public void testFragment_added ( ) { } public void testAdapterView_contents ( ) { } public void tearDown ( ) throws Exception { } }

Fix:
adapter = new EventDetailItemListAdapter ( activity , itemLists , true ) ;
Buggy code:
public class BlockedJobsDialog extends IconAndMessageDialog { protected static BlockedJobsDialog singleton ; private NewProgressViewer viewer ; private String blockedTaskName = null ; private Job blockingJob ; private Button cancelSelected ; private Cursor arrowCursor ; private Cursor waitCursor ; private IProgressMonitor blockingMonitor ; private JobTreeElement blockedElement = new BlockedJobsDialog . BlockedUIElement ( ) ; private class BlockedUIElement extends JobTreeElement { Object [ ] getChildren ( ) { } String getDisplayString ( ) { } public Image getDisplayImage ( ) { } Object getParent ( ) { } boolean hasChildren ( ) { } boolean isActive ( ) { } boolean isJobInfo ( ) { } public void cancel ( ) { } public boolean isCancellable ( ) { } } public static BlockedJobsDialog createBlockedDialog ( Shell parentShell , IProgressMonitor blockedMonitor , IStatus reason , String taskName ) { } public static void clear ( IProgressMonitor monitor ) { } private BlockedJobsDialog ( Shell parentShell , IProgressMonitor blocking , IStatus blockingStatus ) { } protected Control createDialogArea ( Composite parent ) { } void showJobDetails ( Composite parent ) { } private ProgressTreeContentProvider getContentProvider ( ) { <START_BUG> return new ProgressTreeContentProvider ( viewer , ( ! ( Policy . DEBUG_SHOW_SYSTEM_JOBS ) ) ) { <END_BUG> public Object [ ] getElements ( Object inputElement ) { Object [ ] elements = super . getElements ( inputElement ) ; Object [ ] result = new Object [ ( elements . length ) + 1 ] ; System . arraycopy ( elements , 0 , result , 1 , elements . length ) ; result [ 0 ] = blockedElement ; return result ; } } ; } private void clearCursors ( ) { } private void clearCursor ( Control control ) { } protected void configureShell ( Shell shell ) { } private void setMessage ( String messageString ) { } protected Image getImage ( ) { } public IProgressMonitor getProgressMonitor ( ) { } public boolean close ( IProgressMonitor monitor ) { } public boolean close ( ) { } protected Control createButtonBar ( Composite parent ) { } void setBlockedTaskName ( String taskName ) { } }

Fix:
return new ProgressTreeContentProvider ( viewer , Policy . DEBUG_SHOW_SYSTEM_JOBS ) {
Buggy code:
@ module public class AnalyticsModule extends KrollModule { protected static final String PROPERTY_APP_NAV = "app.nav" ; protected static final String PROPERTY_APP_TIMED = "app.timed" ; protected static final String PROPERTY_APP_FEATURE = "app.feature" ; protected static final String PROPERTY_APP_SETTINGS = "app.settings" ; protected static final String PROPERTY_APP_USER = "app.user" ; public AnalyticsModule ( TiContext tiContext ) { } @ method public void addEvent ( String type , String event , @ argument ( optional = true ) KrollDict data ) { } protected void localAddEvent ( String type , String event , KrollDict data ) { } @ method public void navEvent ( String from , String to , @ argument ( optional = true ) String event , @ argument ( optional = true ) KrollDict data ) { } @ method public void timedEvent ( String event , Object start , Object stop , int duration , @ argument ( optional = true ) KrollDict data ) { KrollDict payload = new KrollDict ( ) ; payload . put ( PROPERTY_EVENT , event ) ; if ( start instanceof Number ) { payload . put ( PROPERTY_START , ( ( Number ) ( start ) ) . longValue ( ) ) ; } else if ( start instanceof KrollDate ) { payload . put ( PROPERTY_START , ( ( KrollDate ) ( start ) ) . getTime ( ) ) ; } else { throw new IllegalArgumentException ( "start<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>long<seq2seq4repair_space>or<seq2seq4repair_space>Date." ) ; } if ( stop instanceof Number ) { payload . put ( PROPERTY_STOP , ( ( Number ) ( stop ) ) . longValue ( ) ) ; } else if ( stop instanceof KrollDate ) { <START_BUG> payload . put ( PROPERTY_STOP , ( ( KrollDate ) ( start ) ) . getTime ( ) ) ; <END_BUG> } else { throw new IllegalArgumentException ( "stop<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>long<seq2seq4repair_space>or<seq2seq4repair_space>Date." ) ; } payload . put ( PROPERTY_DURATION , duration ) ; payload . put ( PROPERTY_DATA , data ) ; localAddEvent ( AnalyticsModule . PROPERTY_APP_TIMED , payload . getString ( PROPERTY_EVENT ) , payload ) ; } @ method public void featureEvent ( String event , @ argument ( optional = true ) KrollDict data ) { } @ method public void settingsEvent ( String event , @ argument ( optional = true ) KrollDict data ) { } @ method public void userEvent ( String event , @ argument ( optional = true ) KrollDict data ) { } }

Fix:
payload . put ( PROPERTY_STOP , ( ( KrollDate ) ( stop ) ) . getTime ( ) ) ;
Buggy code:
public final class Parameters implements Serializable , Cloneable { private static final Object [ ] EMPTY_ARRAY = new Object [ 0 ] ; private Map < Object , List < Object > > parameters = new HashMap < > ( ) ; public boolean contains ( final Object key ) { } public void replace ( final Object oldKey , final Object newKey ) { <START_BUG> this . set ( newKey , this . parameters . remove ( oldKey ) ) ; <END_BUG> } public < S , E > List < E > get ( final Traverser . Admin < S > traverser , final Object key , final Supplier < E > defaultValue ) { } public < E > List < E > get ( final Object key , final Supplier < E > defaultValue ) { } public Object remove ( final Object key ) { } public < S > Object [ ] getKeyValues ( final Traverser . Admin < S > traverser , final Object ... exceptKeys ) { } public Map < Object , List < Object > > getRaw ( final Object ... exceptKeys ) { } public void set ( final Object ... keyValues ) { } public void integrateTraversals ( final TraversalParent step ) { } public < S , E > List < Admin < S , E > > getTraversals ( ) { } public Parameters clone ( ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
this . parameters . put ( newKey , this . parameters . remove ( oldKey ) ) ;
Buggy code:
@ SuppressCodecs ( { "Memory" , "Direct" } ) @ Slow public class TestNorms extends LuceneTestCase { final String byteTestField = "normsTestByte" ; class CustomNormEncodingSimilarity extends DefaultSimilarity { @ Override public byte encodeNormValue ( float f ) { } @ Override public float decodeNormValue ( byte b ) { } @ Override public float lengthNorm ( FieldInvertState state ) { } } public void testCustomEncoder ( ) throws Exception { } public void testMaxByteNorms ( ) throws IOException { Directory dir = newFSDirectory ( _TestUtil . getTempDir ( "TestNorms.testMaxByteNorms" ) ) ; buildIndex ( dir ) ; AtomicReader open = SlowCompositeReaderWrapper . wrap ( DirectoryReader . open ( dir ) ) ; NumericDocValues normValues = open . simpleNormValues ( byteTestField ) ; assertNotNull ( normValues ) ; for ( int i = 0 ; i < ( open . maxDoc ( ) ) ; i ++ ) { StoredDocument document = open . document ( i ) ; int expected = Integer . parseInt ( document . get ( byteTestField ) ) ; <START_BUG> assertEquals ( ( ( byte ) ( expected ) ) , normValues . get ( i ) ) ; <END_BUG> } open . close ( ) ; dir . close ( ) ; } public void buildIndex ( Directory dir ) throws IOException { } public class MySimProvider extends PerFieldSimilarityWrapper { Similarity delegate = new DefaultSimilarity ( ) ; @ Override public float queryNorm ( float sumOfSquaredWeights ) { } @ Override public Similarity get ( String field ) { } @ Override public float coord ( int overlap , int maxOverlap ) { } } public static class ByteEncodingBoostSimilarity extends Similarity { @ Override public long computeNorm ( FieldInvertState state ) { } @ Override public SimWeight computeWeight ( float queryBoost , CollectionStatistics collectionStats , TermStatistics ... termStats ) { } @ Override public ExactSimScorer exactSimScorer ( SimWeight weight , AtomicReaderContext context ) throws IOException { } @ Override public SloppySimScorer sloppySimScorer ( SimWeight weight , AtomicReaderContext context ) throws IOException { } } }

Fix:
assertEquals ( ( ( byte ) ( expected ) ) , ( ( byte ) ( normValues . get ( i ) ) ) ) ;
Buggy code:
public class MethodRenderer extends Renderer { protected final ExecutableMemberDoc methodDoc ; protected MethodRenderer ( UMLDiagram diagram , ExecutableMemberDoc methodDoc ) { } protected boolean includeMethod ( ) { } protected IndentingPrintWriter writeNameTo ( IndentingPrintWriter out ) { } protected IndentingPrintWriter writeParametersTo ( IndentingPrintWriter out ) { if ( config . includeMethodParams ( ) ) { String separator = "" ; for ( Parameter parameter : methodDoc . parameters ( ) ) { out . append ( separator ) ; if ( config . includeMethodParamNames ( ) ) { out . append ( parameter . name ( ) ) ; if ( config . includeMethodParamTypes ( ) ) { out . append ( ':' ) ; } } if ( config . includeMethodParamTypes ( ) ) { <START_BUG> out . append ( parameter . type ( ) . simpleTypeName ( ) ) ; <END_BUG> } separator = ",<seq2seq4repair_space>" ; } } return out ; } protected IndentingPrintWriter writeTo ( IndentingPrintWriter out ) { } private boolean isConstructor ( ) { } private boolean isDefaultConstructor ( ) { } private boolean isDefaultAndOnlyConstructor ( ) { } private boolean isAbstract ( ) { } private static MethodDoc findMethod ( ClassDoc classDoc , String methodName , String flatSignature ) { } private boolean isMethodFromExcludedClass ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object other ) { } }

Fix:
out . append ( parameter . type ( ) . simpleTypeName ( ) ) . append ( parameter . type ( ) . dimension ( ) ) ;
Buggy code:
public abstract class AbstractStringEnumSet < E extends TokenizableEnum > extends AbstractCollection < E > implements Serializable , Set < E > { private static final long serialVersionUID = 34398390989170000L + 99 ; private String bitmap ; private transient boolean _is$Frozen = false ; public final boolean is$Frozen ( ) { } protected final void verify$Not$Frozen ( ) { } public void freeze ( ) { } protected abstract int getMaxOrdinal ( ) { } public AbstractStringEnumSet ( ) { } public AbstractStringEnumSet ( String bitmap ) { } public String getBitmap ( ) { } public static String bitmapOf ( TokenizableEnum [ ] arg ) { } @ Override public int size ( ) { } @ Override public boolean isEmpty ( ) { } @ Override public boolean contains ( Object o ) { } protected boolean contains ( String token ) { } protected void add ( String token ) { } @ Override public boolean add ( E e ) { } @ Override public boolean remove ( Object o ) { } @ Override public void clear ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object o ) { } protected static class SetOfEnumsIterator < E extends TokenizableEnum > implements Iterator < E > { private final E [ ] values ; private final String bitmap ; private int index = 0 ; private static final ConcurrentHashMap < String , TokenizableEnum > lookupTable = new ConcurrentHashMap < String , TokenizableEnum > ( ) ; public SetOfEnumsIterator ( E [ ] values , String bitmap ) { } @ Override public boolean hasNext ( ) { <START_BUG> return ( bitmap . length ( ) ) <= ( index ) ; <END_BUG> } @ Override public E next ( ) { } @ Override public void remove ( ) { } } }

Fix:
return ( index ) < ( bitmap . length ( ) ) ;
Buggy code:
@ Component public class FacilityRepository { private Logger logger = Logger . getLogger ( FacilityRepository . class ) ; private CqlTemplate cqlTemplate ; @ Autowired public FacilityRepository ( @ Qualifier ( "SHRCassandraTemplate" ) CqlTemplate cqlOperations ) { } public Observable < Facility > find ( String facilityId ) { } private Facility read ( Row result ) { } public Observable < Facility > save ( final Facility facility ) { Insert insert = buildInsertStatement ( facility ) ; Observable < ResultSet > saveObservable = Observable . from ( cqlTemplate . executeAsynchronously ( insert ) ) ; return saveObservable . flatMap ( new rx . functions . Func1 < ResultSet , Observable < Facility > > ( ) { @ Override public Observable < Facility > call ( ResultSet rows ) { return Observable . just ( facility ) ; } } , new rx . functions . Func1 < Throwable , Observable < Facility > > ( ) { @ Override public Observable < Facility > call ( Throwable throwable ) { logger . error ( throwable . getMessage ( ) ) ; return Observable . error ( throwable ) ; } } , new rx . functions . Func0 < Observable < Facility > > ( ) { @ Override public Observable < Facility > call ( ) { <START_BUG> return Observable . just ( facility ) ; <END_BUG> } } ) ; } private Insert buildInsertStatement ( Facility facility ) { } }

Fix:
return Observable . just ( null ) ;
Buggy code:
public class TestAllFilesHaveChecksumFooter extends LuceneTestCase { public void test ( ) throws Exception { Directory dir = newDirectory ( ) ; IndexWriterConfig conf = newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) ; conf . setCodec ( new Lucene46Codec ( ) ) ; RandomIndexWriter riw = new RandomIndexWriter ( random ( ) , dir , conf ) ; Document doc = new Document ( ) ; Field idField = newStringField ( "id" , "" , NO ) ; Field bodyField = newTextField ( "body" , "" , NO ) ; Field dvField = new NumericDocValuesField ( "dv" , 5 ) ; doc . add ( idField ) ; doc . add ( bodyField ) ; doc . add ( dvField ) ; for ( int i = 0 ; i < 100 ; i ++ ) { idField . setStringValue ( Integer . toString ( i ) ) ; bodyField . setStringValue ( TestUtil . randomUnicodeString ( random ( ) ) ) ; riw . addDocument ( doc ) ; if ( ( random ( ) . nextInt ( 7 ) ) == 0 ) { riw . commit ( ) ; } if ( ( random ( ) . nextInt ( 20 ) ) == 0 ) { riw . deleteDocuments ( new Term ( "id" , Integer . toString ( i ) ) ) ; } } <START_BUG> riw . close ( ) ; <END_BUG> checkHeaders ( dir ) ; dir . close ( ) ; } private void checkHeaders ( Directory dir ) throws IOException { } }

Fix:
riw . shutdown ( ) ;
Buggy code:
public class Asteroid extends Actor { private int frame ; public Polygon polygon ; private boolean isSplit = false ; public int numberPoints ; public double rotation ; public double rotationspeed ; public int size ; private Random r = new Random ( ) ; public Asteroid ( Dictator d , int initRad , Position a , Movement b ) { } private Polygon makeAsteroid ( double radius ) { } public void update ( Dictator d ) { } public Position getPosition ( ) { } public int getFrame ( ) { } public void draw ( Graphics2D g , Dictator d ) { g . rotate ( rotation ) ; <START_BUG> g . setColor ( Color . RED ) ; <END_BUG> g . drawPolygon ( polygon ) ; g . fillPolygon ( polygon ) ; } public void collided ( Actor a , Dictator dic ) { } public String toString ( ) { } public Asteroid split ( Dictator dic ) { } }

Fix:
g . setColor ( Color . WHITE ) ;
Buggy code:
public class ModuleApplicationProcessorTestCase { static final ArchivePath MANIFEST = ArchivePaths . create ( "META-INF" , "MANIFEST.MF" ) ; @ Test public void testAddManifestToJavaArchive ( ) { } @ Test public void testAddManifestToWebArchive ( ) { } private void checkManifest ( Archive < ? > archive , ModuleApplicationArchiveProcessor processor ) { Node node = archive . get ( ModuleApplicationProcessorTestCase . MANIFEST ) ; Assert . assertNotNull ( node ) ; Manifest mf = ManifestUtils . getOrCreateManifest ( archive ) ; Attributes attributes = mf . getMainAttributes ( ) ; String value = attributes . getValue ( "Dependencies" ) ; Set < String > deps = new HashSet < String > ( ) ; for ( String dep : value . split ( "," ) ) { deps . add ( dep . trim ( ) ) ; } Assert . assertEquals ( 9 , deps . size ( ) ) ; Assert . assertTrue ( deps . contains ( "org.jboss.arquillian.api" ) ) ; Assert . assertTrue ( deps . contains ( "org.jboss.arquillian.junit" ) ) ; Assert . assertTrue ( deps . contains ( "org.jboss.arquillian.protocol.jmx" ) ) ; Assert . assertTrue ( deps . contains ( "org.jboss.arquillian.spi" ) ) ; Assert . assertTrue ( deps . contains ( "org.jboss.modules" ) ) ; Assert . assertTrue ( deps . contains ( "org.jboss.msc" ) ) ; Assert . assertTrue ( deps . contains ( "org.jboss.shrinkwrap.api" ) ) ; Assert . assertTrue ( deps . contains ( "org.jboss.shrinkwrap.impl" ) ) ; <START_BUG> Assert . assertTrue ( deps . contains ( "junit.junit" ) ) ; <END_BUG> } }

Fix:
Assert . assertTrue ( deps . contains ( "org.junit" ) ) ;