nus-yam/ex-repair huggingface dataset:
Buggy code:
public class UriTemplateTests { @ Test public void getVariableNames ( ) throws Exception { } @ Test public void expandVarArgs ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void expandVarArgsInvalidAmountVariables ( ) throws Exception { } @ Test public void expandMapDuplicateVariables ( ) throws Exception { } @ Test public void expandMap ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void expandMapInvalidAmountVariables ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void expandMapUnboundVariables ( ) throws Exception { } @ Test public void expandEncoded ( ) throws Exception { UriTemplate template = new UriTemplate ( "http:////example.com////hotel<seq2seq4repair_space>list//{hotel}" ) ; <START_BUG> URI result = template . expand ( "Zrich" ) ; <END_BUG> assertEquals ( "Invalid<seq2seq4repair_space>expanded<seq2seq4repair_space>template" , new URI ( "http:////example.com////hotel%20list//Z%FCrich" ) , result ) ; } @ Test public void matches ( ) throws Exception { } @ Test public void match ( ) throws Exception { } @ Test public void matchDuplicate ( ) throws Exception { } @ Test public void matchMultipleInOneSegment ( ) throws Exception { } @ Test public void queryVariables ( ) throws Exception { } @ Test public void fragments ( ) throws Exception { } }

Fix:
URI result = template . expand ( "Zürich" ) ;
Buggy code:
public class QualiMasterConfigurationSaver extends ConfigurationSaver { private static final EASyLogger LOGGER = Activator . getLogger ( QualiMasterConfigurationSaver . class ) ; private Map < AbstractVariable , AbstractVariable > varMapping ; QualiMasterConfigurationSaver ( Configuration srcConfiguration ) throws ConfigurationException { } private void lazyInit ( ) { } protected Project createProject ( Configuration srcConfiguration ) { } @ Override protected void addLocalVariables ( Project destProject , Configuration srcConfiguration ) { } private ConstraintSyntaxTree createIndexAccess ( DecisionVariableDeclaration decl , Value containerValue , Value value ) { } private ConstraintSyntaxTree searchSequenceValue ( Project project , Value value , Configuration config ) { } private ConstraintSyntaxTree searchSequenceValue ( Project project , Value value , Configuration config , Set < Object > done ) { } @ Override protected ConstraintSyntaxTree createAssignmentConstraint ( Project dstProject , AbstractVariable decl , IDecisionVariable var , Value value ) { Configuration config = var . getConfiguration ( ) ; AbstractVariable dstDecl = varMapping . get ( decl ) ; if ( null == dstDecl ) { dstDecl = decl ; } ConstraintSyntaxTree rightSide = null ; if ( TYPE . isAssignableFrom ( value . getType ( ) ) ) { rightSide = searchSequenceValue ( dstProject , value , config ) ; } if ( null == rightSide ) { <START_BUG> rightSide = new de . uni_hildesheim . sse . model . cst . ConstantValue ( toSaveableValue ( value ) ) ; <END_BUG> } ConstraintSyntaxTree constraint = new de . uni_hildesheim . sse . model . cst . OCLFeatureCall ( deriveOperand ( dstDecl , var ) , OclKeyWords . ASSIGNMENT , rightSide ) ; return constraint ; } @ Override protected void addImports ( Project destProject , Configuration srcConfiguration ) { } @ Override protected boolean isSavingEnabled ( Project destProject , IDecisionVariable var ) { } @ Override protected FreezeBlock createFreezeBlock ( IFreezable [ ] freezables , Project parent ) { } }

Fix:
rightSide = new de . uni_hildesheim . sse . model . cst . ConstantValue ( toSaveableValue ( var , value ) ) ;
Buggy code:
public class EventSQLUtils { private static EventSQLUtils staticInstance ; private static Context appContext ; private final String DB_PATH = "//data//data//sun.bob.simcal//databases//" ; private final String DB_FILENAME = "event.db" ; SQLiteDatabase database ; private EventSQLUtils ( Context context ) { } public static EventSQLUtils getStaticInstance ( Context context ) { } private void initialCopy ( ) { } private void openSQL ( ) { } private void closeSQL ( ) { } public void addEvent ( mEventBean eventBean ) { } public void deleteEvent ( mEventBean eventBean ) { } public void modityEvent ( mEventBean eventBean ) { } public ArrayList < mEventBean > getDayEvent ( int ccyy , int mm , int dd ) { } public ArrayList < mEventBean > getMonthEvent ( int ccyy , int mm ) { openSQL ( ) ; ArrayList < mEventBean > ret = new ArrayList < > ( ) ; <START_BUG> Cursor cursor = database . query ( "events" , new String [ ] { "_id" , "title" , "detail" , "hh" , "minute" , "status" } , "ccyy=?<seq2seq4repair_space>and<seq2seq4repair_space>mm=?" , new String [ ] { String . valueOf ( ccyy ) , String . valueOf ( mm ) } , null , null , null ) ; <END_BUG> mEventBean newBean = null ; while ( cursor . moveToNext ( ) ) { newBean = new mEventBean ( ) ; newBean . set_id ( cursor . getInt ( cursor . getColumnIndex ( "_id" ) ) ) ; newBean . setDay ( cursor . getInt ( cursor . getColumnIndex ( "dd" ) ) ) ; newBean . setMonth ( mm ) ; newBean . setYear ( ccyy ) ; newBean . setHour ( cursor . getInt ( cursor . getColumnIndex ( "hh" ) ) ) ; newBean . setMinute ( cursor . getInt ( cursor . getColumnIndex ( "minute" ) ) ) ; newBean . setTitle ( cursor . getString ( cursor . getColumnIndex ( "title" ) ) ) ; newBean . setDetail ( cursor . getString ( cursor . getColumnIndex ( "detail" ) ) ) ; newBean . setStatus ( cursor . getInt ( cursor . getColumnIndex ( "status" ) ) ) ; ret . add ( newBean ) ; } cursor . close ( ) ; closeSQL ( ) ; return ret ; } public mEventBean getEventById ( int id ) { } }

Fix:
Cursor cursor = database . query ( "events" , new String [ ] { "_id" , "title" , "detail" , "dd" , "hh" , "minute" , "status" } , "ccyy=?<seq2seq4repair_space>and<seq2seq4repair_space>mm=?" , new String [ ] { String . valueOf ( ccyy ) , String . valueOf ( mm ) } , null , null , null ) ;
Buggy code:
public class NewJMSSubsystemParser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { private static final NewJMSSubsystemParser INSTANCE = new NewJMSSubsystemParser ( ) ; public static NewJMSSubsystemParser getInstance ( ) { } private NewJMSSubsystemParser ( ) { } @ Override public void writeContent ( final XMLExtendedStreamWriter writer , final SubsystemMarshallingContext context ) throws XMLStreamException { } @ Override public void readElement ( final XMLExtendedStreamReader reader , final List < ModelNode > updates ) throws XMLStreamException { } static void processJMSTopic ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > updates ) throws XMLStreamException { } static void processJMSQueue ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > updates ) throws XMLStreamException { } static void processConnectionFactory ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > updates ) throws XMLStreamException { } static ModelNode processConnectors ( final XMLExtendedStreamReader reader ) throws XMLStreamException { final ModelNode connectors = new ModelNode ( ) ; while ( ( reader . hasNext ( ) ) && ( ( reader . nextTag ( ) ) != ( XMLStreamConstants . END_ELEMENT ) ) ) { String name = null ; String backup = null ; int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { final String value = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; switch ( attribute ) { case CONNECTOR_NAME : { name = value . trim ( ) ; break ; } case CommonAttributes . CONNECTOR_BACKUP_NAME : { backup = value . trim ( ) ; break ; } default : { throw ParseUtils . unexpectedAttribute ( reader , i ) ; } } } if ( name == null ) { throw ParseUtils . missingRequired ( reader , Collections . singleton ( CONNECTOR_NAME ) ) ; } final Element element = Element . forName ( reader . getLocalName ( ) ) ; if ( element != ( Element . CONNECTOR_REF ) ) { throw ParseUtils . unexpectedElement ( reader ) ; } ParseUtils . requireNoContent ( reader ) ; <START_BUG> final ModelNode connector = connectors . get ( name ) ; <END_BUG> if ( backup != null ) { connector . get ( CommonAttributes . CONNECTOR_BACKUP_NAME ) . set ( backup ) ; } } return connectors ; } static void parseElementText ( final XMLExtendedStreamReader reader , final Element element , final ModelNode node ) throws XMLStreamException { } }

Fix:
final ModelNode connector = connectors . get ( name ) . setEmptyObject ( ) ;
Buggy code:
public class Projection extends SpelNodeImpl { public Projection ( Token payload ) { } @ Override public TypedValue getValueInternal ( ExpressionState state ) throws EvaluationException { TypedValue op = state . getActiveContextObject ( ) ; Object operand = op . getValue ( ) ; if ( operand instanceof Map ) { Map < ? , ? > mapdata = ( ( Map < ? , ? > ) ( operand ) ) ; List < Object > result = new ArrayList < Object > ( ) ; mapdata . entrySet ( ) ; for ( Map . Entry entry : mapdata . entrySet ( ) ) { try { <START_BUG> state . pushActiveContextObject ( new TypedValue ( new KeyValuePair ( entry . getKey ( ) , entry . getValue ( ) ) , TypeDescriptor . valueOf ( KeyValuePair . class ) ) ) ; <END_BUG> result . add ( getChild ( 0 ) . getValueInternal ( state ) . getValue ( ) ) ; } finally { state . popActiveContextObject ( ) ; } } return new TypedValue ( result , TypeDescriptor . valueOf ( Map . class ) ) ; } else if ( operand instanceof List ) { List < Object > data = new ArrayList < Object > ( ) ; data . addAll ( ( ( Collection < ? > ) ( operand ) ) ) ; List < Object > result = new ArrayList < Object > ( ) ; int idx = 0 ; for ( Object element : data ) { try { state . pushActiveContextObject ( new TypedValue ( element , TypeDescriptor . valueOf ( op . getTypeDescriptor ( ) . getType ( ) ) ) ) ; state . enterScope ( "index" , idx ) ; result . add ( getChild ( 0 ) . getValueInternal ( state ) . getValue ( ) ) ; } finally { state . exitScope ( ) ; state . popActiveContextObject ( ) ; } idx ++ ; } return new TypedValue ( result , op . getTypeDescriptor ( ) ) ; } else { throw new org . springframework . expression . spel . SpelException ( SpelMessages . PROJECTION_NOT_SUPPORTED_ON_TYPE , operand . getClass ( ) . getName ( ) ) ; } } @ Override public String toStringAST ( ) { } }

Fix:
state . pushActiveContextObject ( new TypedValue ( entry , TypeDescriptor . valueOf ( Map . Entry . class ) ) ) ;
Buggy code:
public class HeaderContributor extends AbstractHeaderContributor { private static final String returnLocationWithContextPath ( String location ) { if ( ( location . startsWith ( "http:////" ) ) || ( location . startsWith ( "https:////" ) ) ) { return location ; } else { <START_BUG> StringBuilder b = new StringBuilder ( ) ; <END_BUG> String contextPath = Application . get ( ) . getApplicationSettings ( ) . getContextPath ( ) ; if ( contextPath == null ) { contextPath = ( ( wicket . protocol . http . WebRequestCycle ) ( wicket . RequestCycle . get ( ) ) ) . getWebRequest ( ) . getContextPath ( ) ; if ( contextPath == null ) { contextPath = "" ; } } b . append ( contextPath ) ; if ( ( ! ( contextPath . endsWith ( "//" ) ) ) && ( ! ( location . startsWith ( "//" ) ) ) ) { b . append ( "//" ) ; } b . append ( location ) ; return b . toString ( ) ; } } private static final long serialVersionUID = 1L ; public static final HeaderContributor forCss ( final String location , final String media ) { } public static final HeaderContributor forCss ( final String location ) { } public static final HeaderContributor forCss ( final ResourceReference reference , final String media ) { } public static final HeaderContributor forCss ( final ResourceReference reference ) { } public static final HeaderContributor forJavaScript ( final String location ) { } public static final HeaderContributor forCss ( final Class scope , final String path , final String media ) { } public static final HeaderContributor forCss ( final Class scope , final String path ) { } public static final HeaderContributor forJavaScript ( final Class scope , final String path ) { } public static final HeaderContributor forJavaScript ( final ResourceReference reference ) { } private List headerContributors = null ; public HeaderContributor ( ) { } public HeaderContributor ( IHeaderContributor headerContributor ) { } public final void addContributor ( final IHeaderContributor headerContributor ) { } public final void addContributor ( final int index , final IHeaderContributor headerContributor ) { } public final void addCssReference ( final Class scope , final String path ) { } public final void addJavaScriptReference ( final Class scope , final String path ) { } public final IHeaderContributor [ ] getHeaderContributors ( ) { } private void checkHeaderContributors ( ) { } }

Fix:
StringBuffer b = new StringBuffer ( ) ;
Buggy code:
public class TestOrdValues extends FunctionTestSetup { @ BeforeClass public static void beforeClass ( ) throws Exception { } @ Test public void testOrdFieldRank ( ) throws Exception { } @ Test public void testReverseOrdFieldRank ( ) throws Exception { } private void doTestRank ( String field , boolean inOrder ) throws Exception { } @ Test public void testOrdFieldExactScore ( ) throws Exception { } @ Test public void testReverseOrdFieldExactScore ( ) throws Exception { } private void doTestExactScore ( String field , boolean inOrder ) throws Exception { IndexReader r = DirectoryReader . open ( dir ) ; IndexSearcher s = new IndexSearcher ( r ) ; ValueSource vs ; if ( inOrder ) { vs = new OrdFieldSource ( field ) ; } else { vs = new ReverseOrdFieldSource ( field ) ; } Query q = new FunctionQuery ( vs ) ; TopDocs td = s . search ( q , null , 1000 ) ; assertEquals ( "All<seq2seq4repair_space>docs<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>matched!" , N_DOCS , td . totalHits ) ; ScoreDoc [ ] sd = td . scoreDocs ; for ( int i = 0 ; i < ( sd . length ) ; i ++ ) { float score = sd [ i ] . score ; String id = s . getIndexReader ( ) . document ( sd [ i ] . doc ) . get ( ID_FIELD ) ; log ( ( ( ( "--------<seq2seq4repair_space>" + i ) + ".<seq2seq4repair_space>Explain<seq2seq4repair_space>doc<seq2seq4repair_space>" ) + id ) ) ; log ( s . explain ( q , sd [ i ] . doc ) ) ; <START_BUG> float expectedScore = ( N_DOCS ) - i ; <END_BUG> assertEquals ( ( ( ( ( ( "score<seq2seq4repair_space>of<seq2seq4repair_space>result<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>shuould<seq2seq4repair_space>be<seq2seq4repair_space>" ) + expectedScore ) + "<seq2seq4repair_space>!=<seq2seq4repair_space>" ) + score ) , expectedScore , score , TEST_SCORE_TOLERANCE_DELTA ) ; String expectedId = ( inOrder ) ? id2String ( ( ( N_DOCS ) - i ) ) : id2String ( ( i + 1 ) ) ; assertTrue ( ( ( ( ( ( "id<seq2seq4repair_space>of<seq2seq4repair_space>result<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>shuould<seq2seq4repair_space>be<seq2seq4repair_space>" ) + expectedId ) + "<seq2seq4repair_space>!=<seq2seq4repair_space>" ) + score ) , expectedId . equals ( id ) ) ; } r . close ( ) ; } public void testEqualsNull ( ) throws Exception { } }

Fix:
float expectedScore = ( ( N_DOCS ) - i ) - 1 ;
Buggy code:
public class ShowAllContact extends HttpServlet { private static final long serialVersionUID = 1L ; public ShowAllContact ( ) { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { System . out . println ( "SContactShowAll::doGet" ) ; ApplicationContext ac = WebApplicationContextUtils . getWebApplicationContext ( getServletContext ( ) ) ; <START_BUG> IDAOContact daoContact = ( ( IDAOContact ) ( ac . getBean ( "daocontact" ) ) ) ; <END_BUG> String dbOutput = daoContact . getAllContacts ( ) ; String responseUrl = ( "//" + "accueil.jsp" ) + ( ServerUtils . getNewParameter ( "dbOutputRaw" , dbOutput ) ) ; RequestDispatcher rd = getServletContext ( ) . getRequestDispatcher ( responseUrl ) ; rd . forward ( request , response ) ; } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } }

Fix:
IDAOContact daoContact = ( ( IDAOContact ) ( ac . getBean ( "daoContactProperty" ) ) ) ;
Buggy code:
public class DB_Check { public static void doChecks ( Connection conn ) throws SQLException { Statement stmt = conn . createStatement ( ) ; ResultSet rs = stmt . executeQuery ( ( "SELECT<seq2seq4repair_space>CS.CONSTRAINTNAME,<seq2seq4repair_space>" + ( ( "CS.TABLEID,<seq2seq4repair_space>CS.SCHEMAID,<seq2seq4repair_space>CK.CHECKDEFINITION<seq2seq4repair_space>FROM<seq2seq4repair_space>SYS.SYSCONSTRAINTS<seq2seq4repair_space>CS,<seq2seq4repair_space>" + "SYS.SYSCHECKS<seq2seq4repair_space>CK<seq2seq4repair_space>WHERE<seq2seq4repair_space>CS.CONSTRAINTID<seq2seq4repair_space>=<seq2seq4repair_space>" ) + "CK.CONSTRAINTID<seq2seq4repair_space>AND<seq2seq4repair_space>CS.STATE<seq2seq4repair_space>!=<seq2seq4repair_space>'D'<seq2seq4repair_space>ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>CS.TABLEID" ) ) ) ; boolean firstTime = true ; while ( rs . next ( ) ) { String tableId = rs . getString ( 2 ) ; String tableName = dblook . lookupTableId ( tableId ) ; if ( dblook . isExcludedTable ( tableName ) ) continue ; if ( firstTime ) { Logs . reportString ( "----------------------------------------------" ) ; <START_BUG> Logs . reportMessage ( "CSLOOK_ChecksHeader" ) ; <END_BUG> Logs . reportString ( "----------------------------------------------\n" ) ; } StringBuffer chkString = DB_Check . createCheckString ( tableName , rs ) ; Logs . writeToNewDDL ( chkString . toString ( ) ) ; Logs . writeStmtEndToNewDDL ( ) ; Logs . writeNewlineToNewDDL ( ) ; firstTime = false ; } stmt . close ( ) ; rs . close ( ) ; return ; } private static StringBuffer createCheckString ( String tableName , ResultSet aCheck ) throws SQLException { } }

Fix:
Logs . reportMessage ( "DBLOOK_ChecksHeader" ) ;
Buggy code:
public class CompletionOnQualifiedAllocationExpression extends QualifiedAllocationExpression { public TypeBinding resolveType ( BlockScope scope ) { if ( ( arguments ) != null ) { int argsLength = arguments . length ; for ( int a = argsLength ; ( -- a ) >= 0 ; ) arguments [ a ] . resolveType ( scope ) ; } if ( ( enclosingInstance ) != null ) { TypeBinding enclosingType = enclosingInstance . resolveType ( scope ) ; if ( ( enclosingType == null ) || ( ! ( enclosingType instanceof ReferenceBinding ) ) ) { throw new CompletionNodeFound ( ) ; } this . resolvedType = ( ( SingleTypeReference ) ( type ) ) . resolveTypeEnclosing ( scope , ( ( ReferenceBinding ) ( enclosingType ) ) ) ; if ( ! ( ( this . resolvedType ) instanceof ReferenceBinding ) ) throw new CompletionNodeFound ( ) ; if ( this . resolvedType . isInterface ( ) ) this . resolvedType = scope . getJavaLangObject ( ) ; } else { <START_BUG> this . resolvedType = type . resolveType ( scope ) ; <END_BUG> if ( ! ( ( this . resolvedType ) instanceof ReferenceBinding ) ) throw new CompletionNodeFound ( ) ; } throw new CompletionNodeFound ( this , this . resolvedType , scope ) ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { } }

Fix:
this . resolvedType = type . resolveType ( scope , true ) ;
Buggy code:
public class GamePanel extends JPanel implements MouseListener , MouseMotionListener , Runnable { public static int WIDTH ; public static int HEIGHT ; private Thread thread ; private boolean running ; private int FPS = 120 ; private long targetTime = 1000 // ( FPS ) ; private BufferedImage image ; private Graphics2D g ; private static Menu menu ; private static Level level ; private static GodLevel godLevel ; private static int state = 0 ; public static void main ( String [ ] args ) { } public GamePanel ( ) { } public void addNotify ( ) { } public void run ( ) { } public void update ( ) { } public void draw ( ) { } public void drawToScreen ( ) { } public static void setLevel ( int lv ) { } public void mouseDragged ( MouseEvent e ) { } public void mouseMoved ( MouseEvent e ) { } public void mouseClicked ( MouseEvent e ) { } public void mouseEntered ( MouseEvent e ) { } public void mouseExited ( MouseEvent e ) { } public void mousePressed ( MouseEvent e ) { try { if ( ( GamePanel . state ) == 0 ) GamePanel . menu . click ( e . getX ( ) , e . getY ( ) ) ; else if ( ( GamePanel . state ) == 1 ) GamePanel . level . click ( e . getX ( ) , e . getY ( ) ) ; else if ( ( GamePanel . state ) == 2 ) <START_BUG> GamePanel . godLevel . mouse ( e . getX ( ) , e . getY ( ) ) ; <END_BUG> } catch ( Exception ex ) { } } public void mouseReleased ( MouseEvent e ) { } }

Fix:
GamePanel . godLevel . click ( e . getX ( ) , e . getY ( ) ) ;
Buggy code:
public class AccountActivity extends AccountAuthenticatorActivity { private static final String LOG_TAG = "AccountActivity" ; private static final String DEFAULT_SERVER = "https:////auth.services.mozilla.com//" ; private AccountManager mAccountManager ; private Context mContext ; private String username ; private String password ; private String key ; private String server ; private EditText serverInput ; private EditText usernameInput ; private EditText passwordInput ; private EditText synckeyInput ; private CheckBox serverCheckbox ; private Button connectButton ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onStart ( ) { } public void cancelClickHandler ( View target ) { <START_BUG> moveTaskToBack ( true ) ; <END_BUG> } public void connectClickHandler ( View target ) { } private void enableCredEntry ( boolean toEnable ) { } private TextWatcher makeInputValidator ( ) { } private boolean validateInputs ( ) { } private void authCallback ( ) { } public static Intent createAccount ( Context context , AccountManager accountManager , String username , String syncKey , String password , String serverURL ) { } private void authFailure ( ) { } private void authSuccess ( ) { } private void activateView ( View view , boolean toActivate ) { } }

Fix:
finish ( ) ;
Buggy code:
public class EJBSecurityManagerDatabaseImpl implements EJBSecurityManager { public boolean isValid ( Principal principal , Object credential ) { if ( credential == null ) return false ; Connection con = null ; try { InitialContext initial = new InitialContext ( ) ; <START_BUG> DataSource ds = ( ( DataSource ) ( initial . lookup ( "SecurityDS" ) ) ) ; <END_BUG> con = ds . getConnection ( ) ; PreparedStatement statement = con . prepareStatement ( "select<seq2seq4repair_space>pass<seq2seq4repair_space>from<seq2seq4repair_space>sec_access<seq2seq4repair_space>where<seq2seq4repair_space>name=?" ) ; statement . setString ( 1 , principal . getName ( ) ) ; ResultSet rs = statement . executeQuery ( ) ; String dbCredential = null ; if ( rs . next ( ) ) dbCredential = rs . getString ( 1 ) ; rs . close ( ) ; statement . close ( ) ; if ( dbCredential == null ) return false ; return dbCredential . trim ( ) . equals ( credential . toString ( ) . trim ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new EJBException ( e ) ; } finally { try { if ( con != null ) con . close ( ) ; } catch ( Exception e ) { } } } }

Fix:
DataSource ds = ( ( DataSource ) ( initial . lookup ( "java://SecurityDS" ) ) ) ;
Buggy code:
public abstract class AbstractQueueDecorator < E > extends AbstractCollectionDecorator < E > implements Queue < E > { private static final long serialVersionUID = - 2629815475789577029L ; protected AbstractQueueDecorator ( ) { } protected AbstractQueueDecorator ( final Queue < E > queue ) { } @ Override protected Queue < E > decorated ( ) { } <START_BUG> public boolean offer ( E obj ) { <END_BUG> return decorated ( ) . offer ( obj ) ; } public E poll ( ) { } public E peek ( ) { } public E element ( ) { } public E remove ( ) { } }

Fix:
public boolean offer ( final E obj ) {
Buggy code:
public class RestClientService extends AbstractClientService { protected HttpClient httpClient ; public RestClientService ( RestClientContainer container , RemoteServiceClientRegistration registration ) { } protected Object invokeRemoteCall ( final IRemoteCall call , final IRemoteCallable callable ) throws ECFException { <START_BUG> String uri = prepareEndpoint ( call , callable ) ; <END_BUG> HttpMethod httpMethod = createAndPrepareHttpMethod ( uri , call , callable ) ; String responseBody = null ; int responseCode = - 1 ; try { responseCode = httpClient . executeMethod ( httpMethod ) ; if ( responseCode == ( HttpStatus . SC_OK ) ) { responseBody = httpMethod . getResponseBodyAsString ( ) ; if ( responseBody == null ) throw new RestException ( "Invalid<seq2seq4repair_space>server<seq2seq4repair_space>response" , responseCode ) ; } else handleException ( NLS . bind ( "Http<seq2seq4repair_space>response<seq2seq4repair_space>not<seq2seq4repair_space>OK.<seq2seq4repair_space>URL={0},<seq2seq4repair_space>responseCode={1}" , uri , new Integer ( responseCode ) ) , null , responseCode ) ; } catch ( HttpException e ) { handleException ( "Transport<seq2seq4repair_space>HttpException" , e , responseCode ) ; } catch ( IOException e ) { handleException ( "Transport<seq2seq4repair_space>IOException" , e , responseCode ) ; } Object result = null ; try { result = processResponse ( uri , call , callable , convertResponseHeaders ( httpMethod . getResponseHeaders ( ) ) , responseBody ) ; } catch ( NotSerializableException e ) { handleException ( NLS . bind ( "Exception<seq2seq4repair_space>deserializing<seq2seq4repair_space>response.<seq2seq4repair_space>URL={0},<seq2seq4repair_space>responseCode={1}" , uri , new Integer ( responseCode ) ) , e , responseCode ) ; } return result ; } protected void handleException ( String message , Throwable e , int responseCode ) throws RestException { } protected void setupTimeouts ( HttpClient httpClient , IRemoteCall call , IRemoteCallable callable ) { } private Map convertResponseHeaders ( Header [ ] headers ) { } protected void addRequestHeaders ( HttpMethod httpMethod , IRemoteCall call , IRemoteCallable callable ) { } protected HttpMethod createAndPrepareHttpMethod ( String uri , IRemoteCall call , IRemoteCallable callable ) throws RestException { } protected HttpMethod prepareDeleteMethod ( String uri , IRemoteCall call , IRemoteCallable callable ) throws RestException { } protected HttpMethod preparePutMethod ( String uri , IRemoteCall call , IRemoteCallable callable ) throws NotSerializableException { } protected HttpMethod preparePostMethod ( String uri , IRemoteCall call , IRemoteCallable callable ) throws NotSerializableException { } protected HttpMethod prepareGetMethod ( String uri , IRemoteCall call , IRemoteCallable callable ) throws NotSerializableException { } protected NameValuePair [ ] toNameValuePairs ( String uri , IRemoteCall call , IRemoteCallable callable ) throws NotSerializableException { } protected void setupAuthenticaton ( HttpClient httpClient , HttpMethod method ) { } }

Fix:
String uri = prepareEndpointAddress ( call , callable ) ;
Buggy code:
public class ConfigXmlParser { private LocationFactory locationFactory ; private DecoratorFactory decoratorFactory ; private TagFactory tagFactory ; private TransformerFactory transformerFactory ; public Collection < Location > buildLocations ( Collection < Location > agentLocations ) { } public Collection < Location > parse ( String xmlAsString ) { } private Collection < Location > parseList ( Node n ) { } private Collection < Location > parseLocation ( Node n ) { } private Collection < Decorator > parseDecorator ( Node n ) { } private Decorator parseTag ( final Node n , String method ) { } private void callSetterMethod ( Object obj , String field , String value ) { Method m = null ; try { <START_BUG> m = obj . getClass ( ) . getDeclaredMethod ( ( "set" + ( StringUtils . capitalize ( field ) ) ) , String . class ) ; <END_BUG> m . invoke ( obj , value ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } public LocationFactory getLocationFactory ( ) { } public void setLocationFactory ( LocationFactory locationFactory ) { } public DecoratorFactory getDecoratorFactory ( ) { } public void setDecoratorFactory ( DecoratorFactory decoratorFactory ) { } public TagFactory getTagFactory ( ) { } public void setTagFactory ( TagFactory tagFactory ) { } public TransformerFactory getTransformerFactory ( ) { } public void setTransformerFactory ( TransformerFactory transformerFactory ) { } }

Fix:
m = obj . getClass ( ) . getMethod ( ( "set" + ( StringUtils . capitalize ( field ) ) ) , String . class ) ;
Buggy code:
public class DateTimeField extends FormComponentPanel < Date > { public static enum AM_PM { AM ( "AM" ) , PM ( "PM" ) ; private String value ; AM_PM ( final String name ) { } @ Override public String toString ( ) { } } private static final long serialVersionUID = 1L ; protected static final String DATE = "date" ; protected static final String HOURS = "hours" ; protected static final String MINUTES = "minutes" ; protected static final String AM_OR_PM_CHOICE = "amOrPmChoice" ; private static final String AM_OR_PM = "amOrPm" ; private static final IConverter < Integer > MINUTES_CONVERTER = new ZeroPaddingIntegerConverter ( 2 ) ; private DropDownChoice < DateTimeField . AM_PM > amOrPmChoice ; private DateTimeField . AM_PM amOrPm = DateTimeField . AM_PM . AM ; private DateTextField dateField ; private Date date ; private TextField < Integer > hoursField ; private Integer hours ; private TextField < Integer > minutesField ; private Integer minutes ; public DateTimeField ( final String id ) { } public DateTimeField ( final String id , final IModel < Date > model ) { } protected final DateTextField getDateTextField ( ) { } public final DateTimeField . AM_PM getAmOrPm ( ) { } public final Date getDate ( ) { } public final Integer getHours ( ) { } public final Integer getMinutes ( ) { } protected void configure ( Map < String , Object > widgetProperties ) { } @ Override public String getInput ( ) { } public final void setAmOrPm ( final DateTimeField . AM_PM amOrPm ) { } public final void setDate ( final Date date ) { } public final void setHours ( final Integer hours ) { } public final void setMinutes ( final Integer minutes ) { } protected TimeZone getClientTimeZone ( ) { } @ Override protected void convertInput ( ) { } protected DateTextField newDateTextField ( String id , PropertyModel < Date > dateFieldModel ) { <START_BUG> return DateTextField . forShortStyle ( id , dateFieldModel ) ; <END_BUG> } @ Override protected void onBeforeRender ( ) { } protected boolean use12HourFormat ( ) { } private int getMaximumHours ( ) { } private int getMaximumHours ( boolean use12HourFormat ) { } private class HoursValidator extends RangeValidator < Integer > { private static final long serialVersionUID = 1L ; public HoursValidator ( ) { } } protected DatePicker newDatePicker ( ) { } }

Fix:
return DateTextField . forShortStyle ( id , dateFieldModel , false ) ;
Buggy code:
public class OperatorProvider extends AProvider implements IOperatorsProvider { private Map < Integer , IMinimalMethodSymbol > builtInOperators ; public OperatorProvider ( ISymbolFactory theSymbolFactory , IOverloadResolver theOverloadResolver , StandardConstraintAndVariables standardConstraintAndVariables ) { } @ Override public Map < Integer , IMinimalMethodSymbol > getOperators ( ) { } private void createOperators ( ) { } private void addOperatorLists ( ) { } private void defineLogicOperators ( ) { } private void defineAssignmentOperators ( ) { IFunctionType function ; IVariable lhs = std . variableTLhs ; IVariable rhs = std . variableTRhs ; <START_BUG> IVariable rtn = std . variableTReturn ; <END_BUG> IOverloadBindings collection = createBindings ( lhs , rhs , rtn ) ; collection . addLowerRefBound ( StandardConstraintAndVariables . T_LHS , new ch . tsphp . tinsphp . common . inference . constraints . TypeVariableConstraint ( StandardConstraintAndVariables . T_RHS ) ) ; function = symbolFactory . createFunctionType ( "=" , collection , Arrays . asList ( lhs , rhs ) , rtn ) ; addToOperators ( Assign , function ) ; } private void defineBitLevelOperators ( ) { } private void defineComparisonOperators ( ) { } private void defineTernaryOperator ( ) { } private void defineArithmeticOperators ( ) { } private void createDivOperators ( ) { } private void createModuloOperators ( ) { } private void createUnaryArithmeticOperators ( ) { } private void defineDotOperator ( ) { } private void defineInstanceOfOperator ( ) { } private void defineCloneAndNewOperator ( ) { } private void defineAtAndCastOperator ( ) { } private void addToBinaryOperators ( Pair < String , Integer > operator , ITypeSymbol leftBound , ITypeSymbol rightBound , ITypeSymbol returnBound ) { } private void addToUnaryOperators ( Pair < String , Integer > operator , ITypeSymbol formalBound , ITypeSymbol returnBound ) { } private void addToOperators ( int operatorType , IFunctionType functionTypeSymbol ) { } }

Fix:
IVariable rtn = symbolFactory . createVariable ( RETURN_VARIABLE_NAME , StandardConstraintAndVariables . T_LHS ) ;
Buggy code:
public class LocalHeaderCache extends AbstractHeaderCache { protected AbstractMessageFolder folder ; private static final Logger LOG = Logger . getLogger ( "org.columba.mail.folder.headercache" ) ; private static final int WEEK = ( ( ( 1000 * 60 ) * 60 ) * 24 ) * 7 ; private boolean configurationChanged ; public LocalHeaderCache ( AbstractLocalFolder folder ) { } public StatusObservable getObservable ( ) { } public HeaderList getHeaderList ( ) throws IOException { } public boolean needToSync ( int capacity ) { } public void load ( ) throws Exception { LocalHeaderCache . LOG . fine ( ( "loading<seq2seq4repair_space>header-cache=" + ( headerFile ) ) ) ; try { reader = new ObjectReader ( headerFile ) ; int capacity = ( ( Integer ) ( reader . readObject ( ) ) ) . intValue ( ) ; LocalHeaderCache . LOG . fine ( ( "capacity=" + capacity ) ) ; boolean needToRelease = false ; headerList = new HeaderList ( capacity ) ; if ( ( getObservable ( ) ) != null ) { getObservable ( ) . setMessage ( ( ( ( folder . getName ( ) ) + ":<seq2seq4repair_space>" ) + ( MailResourceLoader . getString ( "statusbar" , "message" , "load_headers" ) ) ) ) ; getObservable ( ) . setMax ( capacity ) ; getObservable ( ) . resetCurrent ( ) ; } int nextUid = - 1 ; folder . setMessageFolderInfo ( new MailboxInfo ( ) ) ; for ( int i = 0 ; i < capacity ; i ++ ) { if ( ( getObservable ( ) ) != null ) { getObservable ( ) . setCurrent ( i ) ; } ColumbaHeader h = createHeaderInstance ( ) ; loadHeader ( h ) ; headerList . add ( h , ( ( Integer ) ( h . get ( "columba.uid" ) ) ) ) ; if ( h . getFlags ( ) . getRecent ( ) ) { h . getFlags ( ) . setRecent ( false ) ; } if ( ! ( h . getFlags ( ) . getSeen ( ) ) ) { folder . getMessageFolderInfo ( ) . incUnseen ( ) ; } folder . getMessageFolderInfo ( ) . incExists ( ) ; int aktUid = ( ( Integer ) ( h . get ( "columba.uid" ) ) ) . intValue ( ) ; if ( nextUid < aktUid ) { nextUid = aktUid ; } } nextUid ++ ; LocalHeaderCache . LOG . info ( ( "next<seq2seq4repair_space>UID<seq2seq4repair_space>for<seq2seq4repair_space>new<seq2seq4repair_space>messages<seq2seq4repair_space>=" + nextUid ) ) ; ( ( AbstractLocalFolder ) ( folder ) ) . setNextMessageUid ( nextUid ) ; } catch ( Exception e ) { <START_BUG> LocalHeaderCache . LOG . severe ( e . getMessage ( ) ) ; <END_BUG> if ( Main . DEBUG ) { e . printStackTrace ( ) ; } } finally { reader . close ( ) ; } } public void save ( ) throws Exception { } private void sync ( ) throws IOException { } protected void loadHeader ( ColumbaHeader h ) throws Exception { } protected void saveHeader ( ColumbaHeader h ) throws Exception { } private boolean isOlderThanOneWeek ( Date arg0 , Date arg1 ) { } }

Fix:
LocalHeaderCache . LOG . severe ( "Error<seq2seq4repair_space>loading<seq2seq4repair_space>local<seq2seq4repair_space>header<seq2seq4repair_space>cache!" ) ;
Buggy code:
public class TextImageDisplayScreenConverter implements ScreenConverter { @ Override public String getName ( Screen screen ) { } private String getScreenType ( ImageScreenDetails imageScreenDetails ) { <START_BUG> if ( ABOVE_TEXT . equals ( imageScreenDetails . getImagePosition ( ) ) ) { <END_BUG> if ( imageScreenDetails . isHasCaption ( ) ) { return CLICKABLE_IMAGE_TEXT_DISPLAY . getName ( ) ; } else { return IMAGE_TEXT_DISPLAY . getName ( ) ; } } else { if ( imageScreenDetails . isHasCaption ( ) ) { return TEXT_CLICKABLE_IMAGE_DISPLAY . getName ( ) ; } else { return TEXT_IMAGE_DISPLAY . getName ( ) ; } } } }

Fix:
if ( ABOVE_TEXT . getName ( ) . equals ( imageScreenDetails . getImagePosition ( ) ) ) {
Buggy code:
public class NotificationHelper implements Observer { private static final String TAG = "NotificationHelper" ; private int notificationID ; private int appIcon ; private String title ; private Context context ; private PendingIntent clickPendingIntent ; private PendingIntent launchPendingIntent ; private SharedState state ; public NotificationHelper ( Context context , int appIcon , String title , SharedState state ) { } public void kill ( ) { } private void initIntents ( ) { } public void notify ( long eventTime , boolean isRunning ) { initIntents ( ) ; Bitmap bg = BitmapFactory . decodeResource ( context . getResources ( ) , state . getIconID ( ) ) ; Notification . Builder builder = new Notification . Builder ( context ) ; if ( ! isRunning ) { String timeString = state . toString ( ) ; builder . addAction ( ic_media_play , "" , clickPendingIntent ) . setContentTitle ( timeString ) . setContentText ( title ) ; } else { builder . addAction ( ic_media_pause , "" , clickPendingIntent ) . setWhen ( eventTime ) . setUsesChronometer ( true ) . setShowWhen ( true ) ; } <START_BUG> Notification notification = builder . setOngoing ( true ) . setLocalOnly ( true ) . setSmallIcon ( appIcon ) . addAction ( appIcon , title , launchPendingIntent ) . extend ( new Notification . WearableExtender ( ) . setHintHideIcon ( true ) . setContentAction ( 0 ) . setCustomSizePreset ( SIZE_LARGE ) . setBackground ( bg ) ) . build ( ) ; <END_BUG> NotificationManager notifyManager = ( ( NotificationManager ) ( context . getSystemService ( NOTIFICATION_SERVICE ) ) ) ; notifyManager . notify ( notificationID , notification ) ; } @ Override public void update ( Observable observable , Object data ) { } }

Fix:
Notification notification = builder . setOngoing ( true ) . setLocalOnly ( true ) . setSmallIcon ( appIcon ) . addAction ( appIcon , title , launchPendingIntent ) . extend ( new Notification . WearableExtender ( ) . setHintHideIcon ( true ) . setContentAction ( 0 ) . setBackground ( bg ) ) . build ( ) ;
Buggy code:
public class MeanShiftCanopyCreatorMapper extends Mapper < WritableComparable < ? > , VectorWritable , Text , MeanShiftCanopy > { private static final Pattern UNDERSCORE_PATTERN = Pattern . compile ( "_" ) ; private static int nextCanopyId = - 1 ; private DistanceMeasure measure ; @ Override protected void map ( WritableComparable < ? > key , VectorWritable point , Context context ) throws IOException , InterruptedException { <START_BUG> MeanShiftCanopy canopy = new MeanShiftCanopy ( point . get ( ) , ( ( MeanShiftCanopyCreatorMapper . nextCanopyId ) ++ ) , measure ) ; <END_BUG> context . write ( new Text ( key . toString ( ) ) , canopy ) ; } @ Override protected void setup ( Context context ) throws IOException , InterruptedException { } }

Fix:
MeanShiftCanopy canopy = MeanShiftCanopy . initialCanopy ( point . get ( ) , ( ( MeanShiftCanopyCreatorMapper . nextCanopyId ) ++ ) , measure ) ;
Buggy code:
public final class JavaBeansType extends AbstractType { private final Class < ? > _javaClass ; public JavaBeansType ( Class < ? > javaCls , BackendTypesystem ts ) { } private static BackendType [ ] superTypes ( Class < ? > javaCls , BackendTypesystem ts ) { } void init ( BackendTypesystem ts ) { for ( Method mtd : _javaClass . getMethods ( ) ) { if ( ( mtd . getDeclaringClass ( ) ) == ( Object . class ) ) continue ; final List < BackendType > paramTypes = new ArrayList < BackendType > ( ) ; paramTypes . add ( this ) ; for ( Class < ? > cls : mtd . getParameterTypes ( ) ) { paramTypes . add ( ts . getRootTypesystem ( ) . findType ( cls ) ) ; } <START_BUG> register ( new QualifiedName ( mtd . getName ( ) ) , new JavaOperation ( mtd , paramTypes , null ) ) ; <END_BUG> } for ( Field field : _javaClass . getFields ( ) ) { final int mod = field . getModifiers ( ) ; if ( ( ( Modifier . isPublic ( mod ) ) && ( Modifier . isStatic ( mod ) ) ) && ( Modifier . isFinal ( mod ) ) ) { try { register ( new JavaBeansStaticProperty ( field , this , ts . getRootTypesystem ( ) . findType ( field . getType ( ) ) , JavaBuiltinConverterFactory . getConverter ( field . getType ( ) ) ) ) ; } catch ( Exception e ) { ErrorHandler . handle ( e ) ; } } } final Object [ ] enumValues = _javaClass . getEnumConstants ( ) ; if ( enumValues != null ) { for ( Object o : enumValues ) { final Enum < ? > curEnum = ( ( Enum < ? > ) ( o ) ) ; register ( new JavaBeansStaticProperty ( this , ts . getRootTypesystem ( ) . findType ( curEnum ) , curEnum . name ( ) , curEnum ) ) ; } } } @ Override public Object create ( ) { } @ Override public String toString ( ) { } @ Override public boolean equals ( Object other ) { } }

Fix:
register ( new QualifiedName ( mtd . getName ( ) ) , new JavaOperation ( mtd , paramTypes , ts . findType ( mtd . getReturnType ( ) ) , null ) ) ;
Buggy code:
public class LocaleComboBoxRenderer extends DefaultListCellRenderer { public LocaleComboBoxRenderer ( ) { } public Component getListCellRendererComponent ( JList list , Object value , int index , boolean isSelected , boolean hasFocus ) { JLabel label = ( ( JLabel ) ( super . getListCellRendererComponent ( list , value , index , isSelected , hasFocus ) ) ) ; <START_BUG> label . setText ( ( ( Locale ) ( value ) ) . getDisplayName ( ) ) ; <END_BUG> return label ; } }

Fix:
label . setText ( ( ( Locale ) ( value ) ) . getDisplayName ( ( ( Locale ) ( value ) ) ) ) ;
Buggy code:
public class RecoveredUnit extends RecoveredElement { public CompilationUnitDeclaration unitDeclaration ; public RecoveredImport [ ] imports ; public int importCount ; public RecoveredType [ ] types ; public int typeCount ; public RecoveredUnit ( CompilationUnitDeclaration unitDeclaration , int bracketBalance , Parser parser ) { } public RecoveredElement add ( AbstractMethodDeclaration methodDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( FieldDeclaration fieldDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( ImportReference importReference , int bracketBalanceValue ) { } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { } public AstNode parseTree ( ) { } public int sourceEnd ( ) { } public String toString ( int tab ) { StringBuffer result = new StringBuffer ( tabString ( tab ) ) ; result . append ( "Recovered<seq2seq4repair_space>unit:<seq2seq4repair_space>[\n" ) ; <START_BUG> result . append ( unitDeclaration . toString ( ( tab + 1 ) ) ) ; <END_BUG> result . append ( tabString ( ( tab + 1 ) ) ) ; result . append ( "]" ) ; if ( ( this . imports ) != null ) { for ( int i = 0 ; i < ( this . importCount ) ; i ++ ) { result . append ( "\n" ) ; result . append ( this . imports [ i ] . toString ( ( tab + 1 ) ) ) ; } } if ( ( this . types ) != null ) { for ( int i = 0 ; i < ( this . typeCount ) ; i ++ ) { result . append ( "\n" ) ; result . append ( this . types [ i ] . toString ( ( tab + 1 ) ) ) ; } } return result . toString ( ) ; } public CompilationUnitDeclaration updatedCompilationUnitDeclaration ( ) { } public void updateParseTree ( ) { } public void updateSourceEndIfNecessary ( int sourceEnd ) { } }

Fix:
result . append ( unitDeclaration . print ( ( tab + 1 ) , result ) ) ;
Buggy code:
public class EntityBeanAssociatingInterceptor extends AbstractEJBInterceptor { public static final InterceptorFactory FACTORY = new ImmediateInterceptorFactory ( new EntityBeanAssociatingInterceptor ( ) ) ; @ Override public Object processInvocation ( final InterceptorContext context ) throws Exception { final EntityBeanComponent component = getComponent ( context , EntityBeanComponent . class ) ; final Object primaryKey = context . getPrivateData ( PRIMARY_KEY_CONTEXT_KEY ) ; if ( primaryKey == null ) { throw EjbMessages . MESSAGES . primaryKeyIsNull ( ) ; } final EntityBeanComponentInstance instance ; try { instance = component . getCache ( ) . get ( primaryKey ) ; if ( instance . isRemoved ( ) ) { component . getCache ( ) . release ( instance , true ) ; <START_BUG> throw EjbMessages . MESSAGES . instaceWasRemoved ( component . getComponentName ( ) , primaryKey ) ; <END_BUG> } } catch ( javax . ejb e ) { if ( ( context . getPrivateData ( InvocationType . class ) ) == ( InvocationType . TIMER ) ) { throw new org . jboss . as . ejb3 . timerservice . spi . BeanRemovedException ( e ) ; } throw e ; } try { context . putPrivateData ( ComponentInstance . class , instance ) ; return context . proceed ( ) ; } catch ( Exception ex ) { if ( ( component . getApplicationException ( ex . getClass ( ) , context . getMethod ( ) ) ) != null ) { throw ex ; } if ( ( ex instanceof ConcurrentAccessTimeoutException ) || ( ex instanceof ConcurrentAccessException ) ) { throw ex ; } if ( ( ex instanceof RuntimeException ) || ( ex instanceof RemoteException ) ) { if ( EjbLogger . ROOT_LOGGER . isTraceEnabled ( ) ) EjbLogger . ROOT_LOGGER . trace ( ( ( "Discarding<seq2seq4repair_space>bean<seq2seq4repair_space>" + primaryKey ) + "<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>exception" ) , ex ) ; instance . discard ( ) ; } throw ex ; } catch ( final Error e ) { if ( EjbLogger . ROOT_LOGGER . isTraceEnabled ( ) ) EjbLogger . ROOT_LOGGER . trace ( ( ( "Discarding<seq2seq4repair_space>bean<seq2seq4repair_space>" + primaryKey ) + "<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>error" ) , e ) ; instance . discard ( ) ; throw e ; } catch ( final Throwable t ) { if ( EjbLogger . ROOT_LOGGER . isTraceEnabled ( ) ) EjbLogger . ROOT_LOGGER . trace ( ( ( "Discarding<seq2seq4repair_space>bean<seq2seq4repair_space>" + primaryKey ) + "<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>Throwable" ) , t ) ; instance . discard ( ) ; throw new RuntimeException ( t ) ; } finally { context . putPrivateData ( ComponentInstance . class , null ) ; } } }

Fix:
throw EjbMessages . MESSAGES . instanceWasRemoved ( component . getComponentName ( ) , primaryKey ) ;
Buggy code:
public class NetCommand { protected boolean _traceCommandLine = false ; protected Commandline _commandLine ; protected Execute _exe ; protected boolean _failOnError ; protected Task _owner ; protected String _program ; protected String _title ; public NetCommand ( Task owner , String title , String program ) throws TaskException { } public void setFailOnError ( boolean b ) { } public void setTraceCommandLine ( boolean b ) { } public boolean getFailFailOnError ( ) { } public void addArgument ( String argument ) { } public void runCommand ( ) throws TaskException { } protected void logError ( String msg ) { } protected void logVerbose ( String msg ) { } protected void prepareExecutor ( ) throws TaskException { <START_BUG> File dir = _owner . getProject ( ) . getBaseDir ( ) ; <END_BUG> ExecuteStreamHandler handler = new org . apache . tools . ant . taskdefs . LogStreamHandler ( _owner , Project . MSG_INFO , Project . MSG_WARN ) ; _exe = new Execute ( handler , null ) ; _exe . setAntRun ( _owner . getProject ( ) ) ; _exe . setWorkingDirectory ( dir ) ; } }

Fix:
File dir = _owner . getBaseDirectory ( ) ;