nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class AbstractNumberConverter < N extends Number > extends AbstractConverter < N > { private static final long serialVersionUID = 1L ; public abstract NumberFormat getNumberFormat ( Locale locale ) { } protected N parse ( Object value , final double min , final double max , Locale locale ) { } @ Override <START_BUG> public String convertToString ( final Number value , Locale locale ) { <END_BUG> NumberFormat fmt = getNumberFormat ( locale ) ; if ( fmt != null ) { return fmt . format ( value ) ; } return value . toString ( ) ; } }

Fix:
public String convertToString ( final Number value , final Locale locale ) {
Buggy code:
public class ChannelSocket { private CoreSocket sock = new CoreSocket ( ) ; private int headmod = 0 ; private int channel = 0 ; private byte xormask = 0 ; private boolean needflush = true ; private boolean dirty = false ; private byte [ ] sndbuf = new byte [ ( 1024 * 1024 ) + 12 ] ; private byte [ ] rcvbuf = new byte [ ( 1024 * 1024 ) + 12 ] ; private byte [ ] caster = new byte [ ( 1024 * 1024 ) + 12 ] ; private byte [ ] sndhdr = new byte [ 10 ] ; private static final byte [ ] EMPTY = new byte [ 0 ] ; private byte [ ] [ ] vector = new byte [ ] [ ] { ChannelSocket . EMPTY , ChannelSocket . EMPTY , ChannelSocket . EMPTY , ChannelSocket . EMPTY } ; private int [ ] offs = new int [ ] { 0 , 0 , 0 } ; private int [ ] lens = new int [ ] { 0 , 0 , 0 } ; public ChannelSocket ( ) { } private synchronized void exit ( ) { } private static void XOR ( byte [ ] b , int off , int len , byte mask ) { } public synchronized boolean write ( int event , int wparam , int lparam , byte [ ] data , int off , int len , boolean flush ) { } public boolean write ( int event , int wparam , int lparam , byte [ ] data , boolean flush ) { } public boolean write ( int event , int wparam , int lparam , byte [ ] data ) { } public boolean write ( ChannelMsg msg ) { } public synchronized void flush ( ) { } public synchronized ChannelMsg read ( ) { if ( dirty ) { sock . flush ( ) ; dirty = false ; } int needed = sock . read ( null ) ; int length = needed - 10 ; byte [ ] cache = rcvbuf ; if ( needed < 0 ) return null ; if ( needed > ( rcvbuf . length ) ) { cache = new byte [ needed ] ; } int readed = sock . read ( cache , 0 , needed ) ; if ( readed < 0 ) { return null ; } ChannelMsg msg = new ChannelMsg ( ) ; msg . event = CoreEncode . decode16u_lsb ( cache , 0 ) ; msg . wparam = CoreEncode . decode32i_lsb ( cache , 2 ) ; msg . lparam = CoreEncode . decode32i_lsb ( cache , 6 ) ; if ( length > 0 ) { msg . data = new byte [ length ] ; System . arraycopy ( cache , 10 , msg . data , 0 , length ) ; <START_BUG> if ( ( msg . wparam ) == ( ChannelInst . ITMT_DATA ) ) { <END_BUG> ChannelSocket . XOR ( msg . data , 0 , length , xormask ) ; } } cache = null ; return msg ; } public synchronized boolean attach ( String ip , int port , int channel , int header , int timeout ) { } public void quit ( ) { } public int getChannelId ( ) { } public synchronized boolean setFlushMode ( boolean newNeedFlush ) { } public boolean send ( int hid , byte [ ] data , int off , int len , int limit , boolean useudp ) { } public boolean send ( int hid , byte [ ] data , int limit ) { } public boolean send ( int hid , byte [ ] data ) { } public boolean close ( int hid , int code ) { } public synchronized boolean groupcast ( int [ ] hids , int count , byte [ ] data , int off , int len , int limit ) { } public boolean groupcast ( int [ ] hids , int count , byte [ ] data ) { } public boolean channel ( int ch , byte [ ] data , int off , int len ) { } public boolean channel ( int ch , byte [ ] data ) { } public void setXorMask ( int mask ) { } protected void finalize ( ) throws Throwable { } }

Fix:
if ( ( msg . event ) == ( ChannelInst . ITMT_DATA ) ) {
Buggy code:
class ImportDeclaration extends SourceRefElement implements IImportDeclaration { protected ImportDeclaration ( ImportContainer parent , String name ) { } public boolean equals ( Object o ) { } protected boolean equalsDOMNode ( IDOMNode node ) { } public int getElementType ( ) { } public int getFlags ( ) throws JavaModelException { } public String getHandleMemento ( ) { StringBuffer buff = new StringBuffer ( ( ( JavaElement ) ( getParent ( ) ) ) . getHandleMemento ( ) ) ; <START_BUG> buff . append ( getElementName ( ) ) ; <END_BUG> if ( ( this . occurrenceCount ) > 1 ) { buff . append ( JavaElement . JEM_COUNT ) ; buff . append ( this . occurrenceCount ) ; } return buff . toString ( ) ; } protected char getHandleMementoDelimiter ( ) { } public IJavaElement getPrimaryElement ( boolean checkOwner ) { } public boolean isOnDemand ( ) { } public String readableName ( ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } }

Fix:
escapeMementoName ( buff , getElementName ( ) ) ;
Buggy code:
public class RejectTransformationDescriptionBuilder extends AbstractTransformationDescriptionBuilder implements TransformationDescriptionBuilder { protected RejectTransformationDescriptionBuilder ( PathElement pathElement ) { } @ Override public TransformationDescription build ( ) { final AttributeTransformationDescriptionBuilderImpl . AttributeTransformationDescriptionBuilderRegistry empty = new AttributeTransformationDescriptionBuilderImpl . AttributeTransformationDescriptionBuilderRegistry ( ) ; <START_BUG> return buildDefault ( REJECT , true , empty ) ; <END_BUG> } }

Fix:
return buildDefault ( REJECT_AND_WARN , true , empty ) ;
Buggy code:
public class ShelfRepositoryTest { private ShelfRepository shelfRepository ; Shelf shelf ; Book book1 ; Book book2 ; CD cd ; BookCollection col ; @ Before public void createElement ( ) { book1 = new Book ( "Book1" , "Author1" ) ; book2 = new Book ( "Book2" , "Author2" ) ; col = new BookCollection ( "Collection<seq2seq4repair_space>of<seq2seq4repair_space>Books" ) ; col . addElement ( book1 ) ; col . addElement ( book2 ) ; cd = new CD ( "CD1" , 20 ) ; shelf = new Shelf ( 10 ) ; shelf . add ( col ) ; shelf . add ( cd ) ; shelfRepository = new InMemoryShelfRepository ( ) ; <START_BUG> shelfRepository . insert ( shelf ) ; <END_BUG> } @ Test public void shouldReturnIdElement ( ) { } @ Test public void shouldRemoveAnElement ( ) { } }

Fix:
shelfRepository . add ( shelf ) ;
Buggy code:
public class OptimizedObjFigure extends ObjFigure { protected Set < BigDecimalPoint > pointSet ; public OptimizedObjFigure ( ObjFigure parent ) { } public static Set < BigDecimalPoint > makeSet ( Iterator < Point > iterator ) { } protected Face makeFaceFromSet ( Face face , List < BigDecimalPoint > list ) { } private Integer getNewPosition ( List < BigDecimalPoint > convertedSet , Integer lastIndex ) { } @ Override public String toString ( ) { if ( ( ( points ) == null ) || ( ( points . size ( ) ) == 0 ) ) return "Null" ; else { pointSet = OptimizedObjFigure . makeSet ( points . iterator ( ) ) ; <START_BUG> String result = commentsToString ( ) ; <END_BUG> if ( ! ( result . isEmpty ( ) ) ) { result += "\n\n" ; } for ( Iterator < BigDecimalPoint > iterator = pointSet . iterator ( ) ; iterator . hasNext ( ) ; ) { BigDecimalPoint point = iterator . next ( ) ; result += point . toString ( ) ; if ( iterator . hasNext ( ) ) result += "\n" ; } if ( ( ( faces ) != null ) && ( ( faces . size ( ) ) > 0 ) ) { result += "\n\n" ; ArrayList < BigDecimalPoint > list = new ArrayList ( pointSet ) ; for ( Iterator < Face > iterator = faces . iterator ( ) ; iterator . hasNext ( ) ; ) { result += faceToString ( makeFaceFromSet ( iterator . next ( ) , list ) ) ; if ( iterator . hasNext ( ) ) { result += "\n" ; } } } return result ; } } @ Override protected ObjComment printExtracts ( ) { } }

Fix:
String result = getComments ( ) ;
Buggy code:
public class SecurityClientIT extends AbstractLiveOakSecurityTest { private static final String APPS_REALM = "liveoak-apps" ; private SecurityClient client ; private static String token ; @ Before public void securityClient ( ) throws Exception { KeycloakConfig config = new KeycloakConfig ( ) ; <START_BUG> config . setBaseUrl ( BASE_SECURITY_ADMIN_URL ) ; <END_BUG> this . client = new SecurityClient ( config ) ; if ( ( SecurityClientIT . token ) == null ) { browser . navigate ( ) . to ( BASE_ADMIN_URL ) ; performLoginWithConfirm ( "admin" , "admin" ) ; SecurityClientIT . token = authToken ( ) ; } } @ After public void cleanup ( ) throws Exception { } @ Test ( expected = ResourceProcessingException . class ) public void realmApplicationsFailsWithBadRealmName ( ) throws Exception { } @ Test ( expected = ResourceProcessingException . class ) public void badRealmApplicationRequest ( ) throws Exception { } @ Test public void realmApplications ( ) throws Exception { } @ Test public void updateApplication ( ) throws Exception { } @ Test ( expected = ResourceProcessingException . class ) public void applicationRolesFailsWithBadAppName ( ) throws Exception { } @ Test ( expected = ResourceProcessingException . class ) public void createApplicationRoleFailsWithBadAppName ( ) throws Exception { } @ Test public void applicationRoles ( ) throws Exception { } @ Test public void scopeMappings ( ) throws Exception { } private void verifyApps ( int count ) throws Exception { } private void verifyAppRoles ( String app , int count ) throws Exception { } }

Fix:
config . setBaseUrl ( BASE_SECURITY_URL ) ;
Buggy code:
public abstract class Definer extends DefBase { private String name ; private String classname ; private File file ; private String resource ; private int format = Definer . Format . PROPERTIES ; private boolean definerSet = false ; private int onError = Definer . OnError . FAIL ; private String adapter ; private String adaptTo ; private Class adapterClass ; private Class adaptToClass ; public static class OnError extends EnumeratedAttribute { public static final int FAIL = 0 ; public static final int REPORT = 1 ; public static final int IGNORE = 2 ; public OnError ( ) { } public OnError ( String value ) { } public String [ ] getValues ( ) { } } public static class Format extends EnumeratedAttribute { public static final int PROPERTIES = 0 ; public static final int XML = 1 ; public String [ ] getValues ( ) { } } public void setOnError ( Definer . OnError onError ) { } public void setFormat ( Definer . Format format ) { } public String getName ( ) { } public File getFile ( ) { } public String getResource ( ) { } public void execute ( ) throws BuildException { } private URL fileToURL ( ) { } private URL resourceToURL ( ClassLoader classLoader ) { } protected void loadProperties ( ClassLoader al , URL url ) { } private void loadAntlib ( ClassLoader classLoader , URL url ) { try { <START_BUG> Antlib antlib = Antlib . createAntlib ( getProject ( ) , url ) ; <END_BUG> antlib . setClassLoader ( classLoader ) ; antlib . setURI ( getUri ( ) ) ; antlib . perform ( ) ; } catch ( BuildException ex ) { Location exLocation = ex . getLocation ( ) ; if ( exLocation == null ) { throw ex ; } throw new BuildException ( ( ( ( ( "Error<seq2seq4repair_space>executing<seq2seq4repair_space>antlib" + ( System . getProperty ( "line.separator" ) ) ) + ( exLocation . toString ( ) ) ) + "<seq2seq4repair_space>" ) + ( ex . getMessage ( ) ) ) ) ; } } public void setFile ( File file ) { } public void setResource ( String res ) { } public void setName ( String name ) { } public String getClassname ( ) { } public void setClassname ( String classname ) { } public void setAdapter ( String adapter ) { } protected void setAdapterClass ( Class adapterClass ) { } public void setAdaptTo ( String adaptTo ) { } protected void setAdaptToClass ( Class adaptToClass ) { } protected void addDefinition ( ClassLoader al , String name , String classname ) throws BuildException { } private void tooManyDefinitions ( ) { } }

Fix:
Antlib antlib = Antlib . createAntlib ( getProject ( ) , url , getUri ( ) ) ;
Buggy code:
public class Trithemius { static char [ ] alphabet = new char [ ] { 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' , 'j' , 'k' , 'l' , 'm' , 'n' , 'o' , 'p' , 'q' , 'r' , 's' , 't' , 'u' , 'v' , 'w' , 'x' , 'y' , 'z' } ; static String CIPHER_FROM = "Ciphertext<seq2seq4repair_space>from<seq2seq4repair_space>file<seq2seq4repair_space>or<seq2seq4repair_space>stdin<seq2seq4repair_space>(f//s)?<seq2seq4repair_space>" ; static String CIPHER_TO = "Ciphertext<seq2seq4repair_space>to<seq2seq4repair_space>file<seq2seq4repair_space>or<seq2seq4repair_space>stdout<seq2seq4repair_space>(f//s)?<seq2seq4repair_space>" ; static String PLAIN_FROM = "Plaintext<seq2seq4repair_space>from<seq2seq4repair_space>file<seq2seq4repair_space>or<seq2seq4repair_space>stdin<seq2seq4repair_space>(f//s)?<seq2seq4repair_space>" ; static String PLAIN_TO = "Plaintext<seq2seq4repair_space>to<seq2seq4repair_space>file<seq2seq4repair_space>or<seq2seq4repair_space>stdout<seq2seq4repair_space>(f//s)?<seq2seq4repair_space>" ; static String DONT_KNOW = "Don't<seq2seq4repair_space>know<seq2seq4repair_space>what<seq2seq4repair_space>'%s'<seq2seq4repair_space>means." ; static String FILE_ERROR = "File<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>located<seq2seq4repair_space>or<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>used.<seq2seq4repair_space>Try<seq2seq4repair_space>again." ; public static void main ( String [ ] args ) { } public static int decipher ( Scanner input , PrintStream output , int initialOffset ) { <START_BUG> int currentOffset = initialOffset ; <END_BUG> int numChars = 0 ; while ( input . hasNextLine ( ) ) { String thisLine = input . nextLine ( ) . toLowerCase ( ) ; for ( int i = 0 ; i < ( thisLine . length ( ) ) ; i ++ ) { if ( Character . isLetter ( thisLine . charAt ( i ) ) ) { int thisIndex = Trithemius . findIndex ( thisLine . charAt ( i ) ) ; if ( thisIndex >= 0 ) { output . print ( Trithemius . shiftLetter ( currentOffset , thisLine . charAt ( i ) ) ) ; currentOffset = ( currentOffset + 1 ) % 26 ; numChars ++ ; } } else { if ( ( thisLine . charAt ( i ) ) == '%' ) { return numChars ; } output . print ( thisLine . charAt ( i ) ) ; } } output . println ( ) ; } return numChars ; } public static int encipher ( Scanner input , PrintStream output , int initialOffset ) { } public static Scanner askForSource ( String message ) throws FileNotFoundException { } public static PrintStream askForDestination ( String message ) throws FileNotFoundException { } public static int askForOffset ( String message ) { } public static File askForFile ( String message ) throws FileNotFoundException { } public static char shiftLetter ( int byOffset , char c ) { } public static int findIndex ( char c ) { } No newline ; at end ; of file ; }

Fix:
int currentOffset = ( ( ( - 1 ) * initialOffset ) + 26 ) % 26 ;
Buggy code:
public class XmlBeautifier implements PostProcessor { private final Log log = LogFactory . getLog ( getClass ( ) ) ; private String [ ] fileExtensions = new String [ ] { ".xml" , ".xsl" , ".xsd" , ".wsdd" , ".wsdl" } ; public void setFileExtensions ( final String [ ] fileExtensions ) { } public void beforeWriteAndClose ( final FileHandle info ) { <START_BUG> if ( isXmlFile ( info . getTargetFile ( ) . getAbsolutePath ( ) ) ) { <END_BUG> try { final String bufferedString = info . getBuffer ( ) . toString ( ) . trim ( ) ; final int indEncoding = bufferedString . indexOf ( "encoding" ) ; final int indEndHeader = bufferedString . indexOf ( "?>" ) ; String readEncoding = null ; Document doc = null ; if ( ( ( bufferedString . startsWith ( "<?xml" ) ) && ( indEncoding > 0 ) ) && ( indEncoding < indEndHeader ) ) { readEncoding = info . getFileEncoding ( ) ; doc = parseDocument ( bufferedString , readEncoding ) ; } else { doc = parseDocument ( bufferedString , null ) ; } TransformerFactory tfactory = TransformerFactory . newInstance ( ) ; try { tfactory . setAttribute ( "indent-number" , new Integer ( 2 ) ) ; } catch ( IllegalArgumentException ignored ) { } tfactory . setURIResolver ( new URIResolver ( ) { public Source resolve ( String href , String base ) throws TransformerException { return new Source ( ) { public String getSystemId ( ) { return "" ; } public void setSystemId ( String systemId ) { } } ; } } ) ; Transformer serializer ; try { serializer = tfactory . newTransformer ( ) ; if ( ( doc . getDoctype ( ) ) != null ) { String systemValue = doc . getDoctype ( ) . getSystemId ( ) ; String publicID = doc . getDoctype ( ) . getPublicId ( ) ; serializer . setOutputProperty ( OutputKeys . DOCTYPE_SYSTEM , systemValue ) ; serializer . setOutputProperty ( OutputKeys . DOCTYPE_PUBLIC , publicID ) ; } serializer . setOutputProperty ( OutputKeys . INDENT , "yes" ) ; serializer . setOutputProperty ( "{http:////xml.apache.org//xslt}indent-amount" , "2" ) ; serializer . setOutputProperty ( OutputKeys . ENCODING , info . getFileEncoding ( ) ) ; serializer . setErrorListener ( new ErrorListener ( ) { public void error ( TransformerException arg0 ) throws TransformerException { } public void fatalError ( TransformerException arg0 ) throws TransformerException { } public void warning ( TransformerException arg0 ) throws TransformerException { } } ) ; ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; serializer . transform ( new DOMSource ( doc ) , new StreamResult ( new OutputStreamWriter ( byteArrayOutputStream , info . getFileEncoding ( ) ) ) ) ; String string = byteArrayOutputStream . toString ( info . getFileEncoding ( ) ) ; info . setBuffer ( new StringBuffer ( string ) ) ; } catch ( TransformerException e ) { log . error ( e . getMessage ( ) , e ) ; } } catch ( final Exception e ) { log . error ( e . getMessage ( ) , e ) ; } } } private Document parseDocument ( String bufferedString , String encoding ) throws Exception { } public boolean isXmlFile ( final String absolutePath ) { } public void afterClose ( final FileHandle impl ) { } }

Fix:
if ( isXmlFile ( info . getAbsolutePath ( ) ) ) {
Buggy code:
public class Rectangle2D implements Shape { private double x ; private double y ; private double width ; private double height ; public Rectangle2D ( double x , double y , double width , double height ) { } public double getX ( ) { } public double getY ( ) { } public double getWidth ( ) { } public double getHeight ( ) { } @ Override public boolean contains ( double x , double y ) { } @ Override public boolean contains ( double x , double y , double w , double h ) { } @ Override public boolean contains ( Shape s ) { } @ Override public Rectangle getBounds ( ) { } @ Override public Rectangle2D getBounds2D ( ) { } @ Override public boolean intersects ( double x , double y , double w , double h ) { } @ Override public boolean intersects ( Shape s ) { if ( s instanceof Rectangle2D ) { Rectangle2D r2 = ( ( Rectangle2D ) ( s ) ) ; <START_BUG> return intersects ( r2 . getX ( ) , r2 . getY ( ) , r2 . getWidth ( ) , r2 . getHeight ( ) ) ; <END_BUG> } else if ( s instanceof Circle ) { Circle c = ( ( Circle ) ( s ) ) ; return c . intersects ( this ) ; } return false ; } @ Override public void move ( Coordinate2D c ) { } }

Fix:
return ( intersects ( r2 . getX ( ) , r2 . getY ( ) , r2 . getWidth ( ) , r2 . getHeight ( ) ) ) || ( r2 . intersects ( x , y , width , height ) ) ;
Buggy code:
public class RunManager { private static final String TAG = "RunManager" ; public static final String ACTION_LOCATION = "com.rayeldatu.android.runtracker.ACTION_LOCATION" ; private static RunManager sRunManager ; private Context mAppContext ; private LocationManager mLocationManager ; private static final String TEST_PROVIDER = "TEST_PROVIDER" ; private RunManager ( Context appContext ) { } public static RunManager get ( Context c ) { } private PendingIntent getLocationPendingIntent ( boolean shouldCreate ) { Intent broadcast = new Intent ( RunManager . ACTION_LOCATION ) ; int flags = ( shouldCreate ) ? 0 : PendingIntent . FLAG_NO_CREATE ; <START_BUG> return PendingIntent . getBroadcast ( mAppContext , 0 , broadcast , 0 ) ; <END_BUG> } public void startLocationUpdates ( ) { } public void stopLocationUpdates ( ) { } private void broadcastLocation ( Location location ) { } public boolean isTrackingRun ( ) { } }

Fix:
return PendingIntent . getBroadcast ( mAppContext , 0 , broadcast , flags ) ;
Buggy code:
public final class ExtensionCommandRegistry extends AbstractCommandRegistry { protected List activeKeyConfigurationDefinitions ; protected List categoryDefinitions ; protected List commandDefinitions ; protected List contextBindingDefinitions ; private IExtensionRegistry extensionRegistry ; protected List imageBindingDefinitions ; protected List keyConfigurationDefinitions ; protected List keySequenceBindingDefinitions ; public ExtensionCommandRegistry ( IExtensionRegistry extensionRegistry ) { } private void load ( ) throws IOException { } private String getPluginId ( IConfigurationElement configurationElement ) { } private void readActiveKeyConfigurationDefinition ( IConfigurationElement configurationElement ) { } private void readCategoryDefinition ( IConfigurationElement configurationElement ) { } private void readCommandDefinition ( IConfigurationElement configurationElement ) { } private void readContextBindingDefinition ( IConfigurationElement configurationElement ) { <START_BUG> IContextBindingDefinition contextBindingDefinition = Persistence . readContextBindingDefinition ( new org . eclipse . ui . internal . util . ConfigurationElementMemento ( configurationElement ) , getPluginId ( configurationElement ) ) ; <END_BUG> if ( contextBindingDefinition != null ) contextBindingDefinitions . add ( contextBindingDefinition ) ; } private void readImageBindingDefinition ( IConfigurationElement configurationElement ) { } private void readKeyConfigurationDefinition ( IConfigurationElement configurationElement ) { } private void readKeySequenceBindingDefinition ( IConfigurationElement configurationElement ) { } }

Fix:
IActivityBindingDefinition contextBindingDefinition = Persistence . readContextBindingDefinition ( new org . eclipse . ui . internal . util . ConfigurationElementMemento ( configurationElement ) , getPluginId ( configurationElement ) ) ;
Buggy code:
public class CompanyMapper { public Company getCompanyById ( int id , Connection con ) { } public int createCompany ( String company_name , String country_code , Connection con ) { String SQL = "insert<seq2seq4repair_space>into<seq2seq4repair_space>companies<seq2seq4repair_space>values<seq2seq4repair_space>(?,?,?,?)" ; PreparedStatement statement = null ; try { statement = con . prepareStatement ( SQL ) ; int nextCompanyId = getNextCompanyId ( con ) ; statement . setInt ( 1 , nextCompanyId ) ; statement . setString ( 2 , company_name ) ; <START_BUG> statement . setString ( 3 , "N//A" ) ; <END_BUG> statement . setString ( 4 , country_code ) ; statement . executeUpdate ( ) ; return nextCompanyId ; } catch ( Exception e ) { System . out . println ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>createCompany" ) ; } finally { if ( statement != null ) try { statement . close ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } if ( con != null ) try { con . close ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } return - 1 ; } public void updateCompanyLogo ( String filename , int id , Connection con ) { } public int getNextCompanyId ( Connection con ) { } public ArrayList getCompanies ( Connection con ) { } public ArrayList getCompanyNames ( String query , int company_id , Connection con ) { } public int getCompanyIdByName ( String name ) { } }

Fix:
statement . setString ( 3 , null ) ;
Buggy code:
public class LoginActivity extends AppCompatActivity implements LoaderCallbacks < Cursor > { private static final int REQUEST_READ_CONTACTS = 0 ; private static final String [ ] DUMMY_CREDENTIALS = new String [ ] { "foo@example.com:hello" , "bar@example.com:world" } ; private Context context = this ; private AutoCompleteTextView mAccountView ; private EditText mPasswordView ; private View mProgressView ; private View mLoginFormView ; private TextView register ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void populateAutoComplete ( ) { } private boolean mayRequestContacts ( ) { } @ Override public void onRequestPermissionsResult ( int requestCode , @ NonNull String [ ] permissions , @ NonNull int [ ] grantResults ) { } private void attemptLogin ( ) { mAccountView . setError ( null ) ; mPasswordView . setError ( null ) ; String account = mAccountView . getText ( ) . toString ( ) ; String password = mPasswordView . getText ( ) . toString ( ) ; boolean cancel = false ; View focusView = null ; <START_BUG> if ( ( ! ( TextUtils . isEmpty ( password ) ) ) || ( ! ( TextCheck . validPwd ( password ) ) ) ) { <END_BUG> mPasswordView . setError ( getString ( error_invalid_password ) ) ; focusView = mPasswordView ; cancel = true ; } if ( TextUtils . isEmpty ( account ) ) { mAccountView . setError ( getString ( error_field_required ) ) ; focusView = mAccountView ; cancel = true ; } else if ( ( ! ( TextCheck . validHandset ( account ) ) ) && ( ! ( TextCheck . validEmail ( account ) ) ) ) { mAccountView . setError ( getString ( error_invalid_email ) ) ; focusView = mAccountView ; cancel = true ; } if ( cancel ) { focusView . requestFocus ( ) ; } else { showProgress ( true ) ; HttpClient httpClient = BaseApp . getHttpClient ( ) ; UserApiInterface i = httpClient . getUserApiInterface ( ) ; Call < User > loginCall = i . login ( account , password ) ; loginCall . enqueue ( new LoginActivity . LoginCallBack ( ) ) ; } } @ TargetApi ( VERSION_CODES . HONEYCOMB_MR2 ) private void showProgress ( final boolean show ) { } @ Override public Loader < Cursor > onCreateLoader ( int i , Bundle bundle ) { } @ Override public void onLoadFinished ( Loader < Cursor > cursorLoader , Cursor cursor ) { } @ Override public void onLoaderReset ( Loader < Cursor > cursorLoader ) { } private void addAccountToAutoComplete ( List < String > emailAddressCollection ) { } private interface ProfileQuery { String [ ] PROJECTION = new String [ ] { Email . ADDRESS , Email . IS_PRIMARY } ; int ADDRESS = 0 ; int IS_PRIMARY = 1 ; } private class LoginCallBack implements Callback < User > { @ Override public void onResponse ( Call < User > call , Response < User > response ) { } @ Override public void onFailure ( Call < User > call , Throwable t ) { } } }

Fix:
if ( ( TextUtils . isEmpty ( password ) ) || ( ! ( TextCheck . validPwd ( password ) ) ) ) {
Buggy code:
public class CasePossibleNumbersForCell extends CaseRule { private static final long serialVersionUID = 174002227L ; public CasePossibleNumbersForCell ( ) { } public String getImageName ( ) { } public BoardState autoGenerateCases ( BoardState cur , Point pointSelected ) { Contradiction contra = new ContradictionBoardStateViolated ( ) ; <START_BUG> for ( int i = 1 ; i < 9 ; i ++ ) { <END_BUG> BoardState modified = cur . copy ( ) ; modified . getBoardCells ( ) [ pointSelected . y ] [ pointSelected . x ] = i ; if ( ( contra . checkContradictionRaw ( modified ) ) == null ) { continue ; } BoardState tmp = cur . addTransitionFrom ( ) ; tmp . setCaseSplitJustification ( this ) ; tmp . setCellContents ( pointSelected . x , pointSelected . y , i ) ; tmp . endTransition ( ) ; } return Legup . getCurrentState ( ) ; } public String checkCaseRuleRaw ( BoardState state ) { } public boolean startDefaultApplicationRaw ( BoardState state ) { } public boolean doDefaultApplicationRaw ( BoardState state , PuzzleModule pm , Point location ) { } }

Fix:
for ( int i = 1 ; i <= 9 ; i ++ ) {
Buggy code:
class CodeSnippetToCuMapper implements EvaluationConstants { public char [ ] cuSource ; public int lineNumberOffset = 0 ; public int startPosOffset = 0 ; private char [ ] codeSnippet ; private char [ ] packageName ; private char [ ] [ ] imports ; char [ ] className ; private char [ ] varClassName ; private char [ ] [ ] localVarNames ; private char [ ] [ ] localVarTypeNames ; private int [ ] localVarModifiers ; private char [ ] declaringTypeName ; public CodeSnippetToCuMapper ( char [ ] codeSnippet , char [ ] packageName , char [ ] [ ] imports , char [ ] className , char [ ] varClassName , char [ ] [ ] localVarNames , char [ ] [ ] localVarTypeNames , int [ ] localVarModifiers , char [ ] declaringTypeName ) { } private void buildCUSource ( ) { } public ICompletionRequestor getCompletionRequestor ( final ICompletionRequestor originalRequestor ) { } public char [ ] getCUSource ( ) { } public int getEvaluationType ( int lineNumber ) { } public char [ ] getImport ( int lineNumber ) { <START_BUG> int importStartLine = ( ( this . lineNumberOffset ) - 2 ) - ( this . imports . length ) ; <END_BUG> return this . imports [ ( lineNumber - importStartLine ) ] ; } public ISelectionRequestor getSelectionRequestor ( final ISelectionRequestor originalRequestor ) { } }

Fix:
int importStartLine = ( ( this . lineNumberOffset ) - 1 ) - ( this . imports . length ) ;
Buggy code:
public class IosAlert implements PushModel { private final String title ; private final String body ; private final String title_loc_key ; private final String [ ] title_loc_args ; private final String action_loc_key ; private final String loc_key ; private final String [ ] loc_args ; private final String launch_image ; private IosAlert ( String title , String body , String title_loc_key , String [ ] title_loc_args , String action_loc_key , String loc_key , String [ ] loc_args , String launch_image ) { } public static IosAlert . Builder newBuilder ( ) { } @ Override public JsonElement toJSON ( ) { JsonObject json = new JsonObject ( ) ; if ( StringUtils . isNotEmpty ( title ) ) { json . addProperty ( "title" , title ) ; } <START_BUG> if ( StringUtils . isNotEmpty ( title ) ) { <END_BUG> json . addProperty ( "body" , body ) ; } if ( StringUtils . isNotEmpty ( title_loc_key ) ) { json . addProperty ( "title-loc-key" , title_loc_key ) ; if ( ( null != ( title_loc_args ) ) && ( ( title_loc_args . length ) > 0 ) ) { JsonArray args = new JsonArray ( ) ; for ( int i = 0 ; i < ( title_loc_args . length ) ; i ++ ) { args . add ( new JsonPrimitive ( title_loc_args [ i ] ) ) ; } json . add ( "title-loc-args" , args ) ; } } if ( StringUtils . isNotEmpty ( action_loc_key ) ) { json . addProperty ( "action-loc-key" , action_loc_key ) ; } if ( StringUtils . isNotEmpty ( loc_key ) ) { json . addProperty ( "loc-key" , loc_key ) ; if ( ( null != ( loc_args ) ) && ( ( loc_args . length ) > 0 ) ) { JsonArray args = new JsonArray ( ) ; for ( int i = 0 ; i < ( loc_args . length ) ; i ++ ) { args . add ( new JsonPrimitive ( loc_args [ i ] ) ) ; } json . add ( "loc-args" , args ) ; } } if ( StringUtils . isNotEmpty ( launch_image ) ) { json . addProperty ( "launch-image" , launch_image ) ; } return json ; } @ Override public String toString ( ) { } public static class Builder { private String title ; private String body ; private String title_loc_key ; private String [ ] title_loc_args ; private String action_loc_key ; private String loc_key ; private String [ ] loc_args ; private String launch_image ; public IosAlert . Builder setTitleAndBody ( String title , String body ) { } public IosAlert . Builder setTitleLoc ( String title_loc_key , String ... title_loc_args ) { } public IosAlert . Builder setActionLocKey ( String action_loc_key ) { } public IosAlert . Builder setLoc ( String loc_key , String ... loc_args ) { } public IosAlert . Builder setLaunchImage ( String launch_image ) { } public IosAlert build ( ) { } } }

Fix:
if ( StringUtils . isNotEmpty ( body ) ) {
Buggy code:
@ SuppressWarnings ( "UnusedDeclaration" ) public class CommandManager { private List < CommandDescription > commandDescriptions = new ArrayList < CommandDescription > ( ) ; public CommandManager ( boolean registerCommands ) { } @ SuppressWarnings ( "SpellCheckingInspection" ) public void registerCommands ( ) { } public List < CommandDescription > getCommandDescriptions ( ) { } public int getCommandDescriptionCount ( ) { } public FoundCommandResult findCommand ( CommandParts queryReference ) { if ( ( queryReference . getCount ( ) ) <= 0 ) return null ; for ( CommandDescription commandDescription : this . commandDescriptions ) { if ( ! ( commandDescription . isSuitableLabel ( queryReference ) ) ) <START_BUG> return null ; <END_BUG> return commandDescription . findCommand ( queryReference ) ; } return null ; } }

Fix:
continue ;
Buggy code:
public class Scale extends Control { public Scale ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( int index ) { <START_BUG> state |= HANDLE ; <END_BUG> fixedHandle = OS . g_object_new ( display . gtk_fixed_get_type ( ) , 0 ) ; if ( ( fixedHandle ) == 0 ) error ( ERROR_NO_HANDLES ) ; OS . gtk_fixed_set_has_window ( fixedHandle , true ) ; int hAdjustment = OS . gtk_adjustment_new ( 0 , 0 , 100 , 1 , 10 , 0 ) ; if ( hAdjustment == 0 ) error ( ERROR_NO_HANDLES ) ; if ( ( ( style ) & ( SWT . HORIZONTAL ) ) != 0 ) { handle = OS . gtk_hscale_new ( hAdjustment ) ; } else { handle = OS . gtk_vscale_new ( hAdjustment ) ; } if ( ( handle ) == 0 ) error ( ERROR_NO_HANDLES ) ; OS . gtk_container_add ( fixedHandle , handle ) ; OS . gtk_scale_set_digits ( handle , 0 ) ; OS . gtk_scale_set_draw_value ( handle , false ) ; } void hookEvents ( ) { } public int getIncrement ( ) { } public int getMaximum ( ) { } public int getMinimum ( ) { } public int getPageIncrement ( ) { } public int getSelection ( ) { } int gtk_value_changed ( int adjustment ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setIncrement ( int value ) { } public void setMaximum ( int value ) { } public void setMinimum ( int value ) { } public void setPageIncrement ( int value ) { } public void setSelection ( int value ) { } }

Fix:
state |= ( HANDLE ) | ( THEME_BACKGROUND ) ;
Buggy code:
public class HQ extends AttackBuilding { private LinkedList < BeaverTask > tasks ; boolean attacking ; private int buildCooldown ; private boolean shouldRun ; HashSet < MapLocation > destroyedTowers ; MapLocation defaultRallyLoc ; private int buildingCount ; public HQ ( RobotController rc ) throws GameActionException { } @ Override public void run ( ) throws GameActionException { } private enum Symmetry { ROTATION , X_REFLECTION , Y_REFLECTION ; } private HQ . Symmetry findSymmetry ( ) { } private void analyzeTowers ( ) throws GameActionException { } private void fillBuildingPath ( ) throws GameActionException { <START_BUG> boolean [ ] [ ] visited = new boolean [ 2 * ( GameConstants . MAP_MAX_WIDTH ) ] [ 2 * ( GameConstants . MAP_MAX_HEIGHT ) ] ; <END_BUG> LinkedList < MapLocation > queue = new LinkedList < MapLocation > ( ) ; queue . offer ( allyHQ ) ; visited [ ( ( allyHQ . x ) - ( mapOffsetX ) ) ] [ ( ( allyHQ . y ) - ( mapOffsetY ) ) ] = true ; while ( ( ! ( queue . isEmpty ( ) ) ) && ( ( buildingCount ) <= ( Constants . MAXIMUM_BUILDINGS ) ) ) { MapLocation cur = queue . poll ( ) ; if ( ( cur != ( allyHQ ) ) && ( ( rc . senseTerrainTile ( cur ) ) == ( TerrainTile . NORMAL ) ) ) { broadcastLocation ( ( ( Channels . buildPath ) + ( buildingCount ) ) , cur ) ; ( buildingCount ) ++ ; } for ( int i = 1 ; i < 8 ; i += 2 ) { MapLocation next = cur . add ( directions [ i ] ) ; if ( ( ( ! ( visited [ ( ( next . x ) - ( mapOffsetX ) ) ] [ ( ( next . y ) - ( mapOffsetY ) ) ] ) ) && ( rc . canSenseLocation ( next ) ) ) && ( ( rc . senseTerrainTile ( next ) ) != ( TerrainTile . OFF_MAP ) ) ) { visited [ ( ( next . x ) - ( mapOffsetX ) ) ] [ ( ( next . y ) - ( mapOffsetY ) ) ] = true ; queue . offer ( next ) ; } } } rc . broadcast ( buildPathLength , buildingCount ) ; System . out . println ( ( "Building<seq2seq4repair_space>count:<seq2seq4repair_space>" + ( buildingCount ) ) ) ; } private MapLocation findRallyPoint ( ) { } private void submitBeaverTask ( BeaverTask task ) { } private void sendBeaverTasks ( ) throws GameActionException { } private void manageSpawnsAndBuildings ( ) throws GameActionException { } @ Override public void transferSupplies ( ) throws GameActionException { } }

Fix:
boolean [ ] [ ] visited = new boolean [ Constants . MAP_WIDTH ] [ Constants . MAP_HEIGHT ] ;
Buggy code:
public class Intersection { private final Goban goban ; private final int x ; private final int y ; private StoneChain stoneChain ; public Intersection ( Goban goban , int x , int y ) { } public int getX ( ) { } public int getY ( ) { } public StoneChain getStoneChain ( ) { } public void setStoneChain ( StoneChain stoneChain ) { } public boolean isEmpty ( ) { } public Set < StoneChain > getAdjacentStoneChains ( ) { } public List < Intersection > getEmptyNeighbors ( ) { List < Intersection > emptyNeighbors = new ArrayList < Intersection > ( ) ; int [ ] dx = new int [ ] { - 1 , 0 , 1 , 0 } ; int [ ] dy = new int [ ] { 0 , - 1 , 0 , 1 } ; assert ( dx . length ) == ( dy . length ) : "dx<seq2seq4repair_space>and<seq2seq4repair_space>dy<seq2seq4repair_space>should<seq2seq4repair_space>have<seq2seq4repair_space>the<seq2seq4repair_space>same<seq2seq4repair_space>length" ; <START_BUG> for ( int i = 0 ; i < ( ( dx . length ) - 1 ) ; i ++ ) { <END_BUG> int newX = ( x ) + ( dx [ i ] ) ; int newY = ( y ) + ( dy [ i ] ) ; if ( goban . isInGoban ( newX , newY ) ) { Intersection adjIntersection = goban . getIntersection ( newX , newY ) ; if ( adjIntersection . isEmpty ( ) ) { emptyNeighbors . add ( adjIntersection ) ; } } } return emptyNeighbors ; } }

Fix:
for ( int i = 0 ; i < ( dx . length ) ; i ++ ) {
Buggy code:
public class BinaryReader2D { public static short [ ] [ ] readRowRange ( String fname , Range rows , int globalColCount , ByteOrder endianness , boolean divideByShortMax , TransformationFunction function ) { try ( FileChannel fc = ( ( FileChannel ) ( Files . newByteChannel ( Paths . get ( fname ) , StandardOpenOption . READ ) ) ) ) { int dataTypeSize = Short . BYTES ; long pos = ( ( ( long ) ( rows . getStartIndex ( ) ) ) * globalColCount ) * dataTypeSize ; final long extent = ( ( ( long ) ( rows . getLength ( ) ) ) * globalColCount ) * dataTypeSize ; int maps = ( ( int ) ( extent // ( ( long ) ( Integer . MAX_VALUE ) ) ) ) ; if ( ( extent % ( ( long ) ( Integer . MAX_VALUE ) ) ) > 0 ) ++ maps ; MappedByteBuffer [ ] mappedByteBuffers = new MappedByteBuffer [ maps ] ; for ( int i = 0 ; i < ( maps - 1 ) ; ++ i ) { mappedByteBuffers [ i ] = fc . map ( FileChannel . MapMode . READ_ONLY , ( pos + ( ( ( long ) ( i ) ) * ( Integer . MAX_VALUE ) ) ) , Integer . MAX_VALUE ) ; mappedByteBuffers [ i ] . order ( endianness ) ; } mappedByteBuffers [ ( maps - 1 ) ] = fc . map ( FileChannel . MapMode . READ_ONLY , ( pos + ( ( ( long ) ( maps - 1 ) ) * ( Integer . MAX_VALUE ) ) ) , ( extent - ( ( maps - 1 ) * ( ( long ) ( Integer . MAX_VALUE ) ) ) ) ) ; mappedByteBuffers [ ( maps - 1 ) ] . order ( endianness ) ; int rowCount = rows . getLength ( ) ; short [ ] [ ] rowBlock = new short [ rowCount ] [ ] ; double tmp ; for ( int i = 0 ; i < rowCount ; ++ i ) { short [ ] rowBlockRow = rowBlock [ i ] = new short [ globalColCount ] ; for ( int j = 0 ; j < globalColCount ; ++ j ) { long procLocalPnum = ( ( ( long ) ( i ) ) * globalColCount ) + j ; long procLocalBytePosition = procLocalPnum * dataTypeSize ; int bufferIdx = ( ( int ) ( procLocalBytePosition // ( Integer . MAX_VALUE ) ) ) ; <START_BUG> int bufferLocalBytePosition = ( ( int ) ( procLocalBytePosition % ( Integer . MAX_VALUE ) ) ) ; <END_BUG> tmp = ( mappedByteBuffers [ bufferIdx ] . getShort ( bufferLocalBytePosition ) ) * ( divideByShortMax ? 1.0 // ( Short . MAX_VALUE ) : 1.0 ) ; assert ( tmp == ( - 1.0 ) ) || ( ( tmp >= 0.0 ) && ( tmp <= 1.0 ) ) ; if ( function != null ) { tmp = function . transform ( tmp ) ; } rowBlockRow [ j ] = ( ( short ) ( tmp * ( Short . MAX_VALUE ) ) ) ; } } return rowBlock ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return null ; } public static short [ ] [ ] readConstant ( Range rows , int globalColCount , double w ) { } }

Fix:
int bufferLocalBytePosition = ( ( int ) ( procLocalBytePosition - ( ( ( long ) ( bufferIdx ) ) * ( Integer . MAX_VALUE ) ) ) ) ;
Buggy code:
public class TriggerFluidContainerLevel extends BCStatement implements ITriggerExternal { public enum TriggerType { BELOW_25 ( 0.25F ) , BELOW_50 ( 0.5F ) , BELOW_75 ( 0.75F ) ; public final float level ; private TriggerType ( float level ) { } } public TriggerFluidContainerLevel . TriggerType type ; public TriggerFluidContainerLevel ( TriggerFluidContainerLevel . TriggerType type ) { } @ Override public int maxParameters ( ) { } @ Override public String getDescription ( ) { } @ Override public boolean isTriggerActive ( TileEntity tile , ForgeDirection side , IStatementContainer statementContainer , IStatementParameter [ ] parameters ) { if ( tile instanceof IFluidHandler ) { IFluidHandler container = ( ( IFluidHandler ) ( tile ) ) ; FluidStack searchedFluid = null ; <START_BUG> if ( ( ( parameters != null ) && ( ( parameters . length ) >= 1 ) ) && ( ( parameters [ 0 ] . getItemStack ( ) ) != null ) ) { <END_BUG> searchedFluid = FluidContainerRegistry . getFluidForFilledItem ( parameters [ 0 ] . getItemStack ( ) ) ; } if ( searchedFluid != null ) { searchedFluid . amount = 1 ; } FluidTankInfo [ ] liquids = container . getTankInfo ( side ) ; if ( ( liquids == null ) || ( ( liquids . length ) == 0 ) ) { return false ; } for ( FluidTankInfo c : liquids ) { if ( ( c . fluid ) == null ) { if ( searchedFluid == null ) { return true ; } return ( container . fill ( side , searchedFluid , false ) ) > 0 ; } if ( ( searchedFluid == null ) || ( searchedFluid . isFluidEqual ( c . fluid ) ) ) { float percentage = ( ( float ) ( c . fluid . amount ) ) // ( ( float ) ( c . capacity ) ) ; return percentage < ( type . level ) ; } } } return false ; } @ Override public int getIconIndex ( ) { } }

Fix:
if ( ( ( ( parameters != null ) && ( ( parameters . length ) >= 1 ) ) && ( ( parameters [ 0 ] ) != null ) ) && ( ( parameters [ 0 ] . getItemStack ( ) ) != null ) ) {
Buggy code:
public abstract class AbstractMenuGenerator { protected XmlElement menuRoot ; protected XmlIO xmlFile ; protected AbstractFrameController frameController ; public AbstractMenuGenerator ( AbstractFrameController frameController , String path ) { } public String getString ( String sPath , String sName , String sID ) { } public abstract XmlElement getMenuRoot ( ) { } public abstract String getRootElementName ( ) { } public void extendMenuFromFile ( String path ) { } public void extendMenu ( XmlElement menuExtension ) { } private void createExtension ( XmlElement menu , XmlElement menuExtension , String extensionName ) { } protected JMenu createMenu ( XmlElement menuElement ) { } protected void createMenuEntries ( JMenu menu , ListIterator it ) { boolean lastWasSeparator = false ; while ( it . hasNext ( ) ) { XmlElement next = ( ( XmlElement ) ( it . next ( ) ) ) ; String name = next . getName ( ) ; if ( name . equals ( "menuitem" ) ) { if ( ( next . getAttribute ( "action" ) ) != null ) { try { BasicAction action = ( ( ActionPluginHandler ) ( pluginManager . getHandler ( "org.columba.core.action" ) ) ) . getAction ( next . getAttribute ( "action" ) , frameController ) ; if ( action != null ) { menu . add ( action ) ; lastWasSeparator = false ; } } catch ( Exception e ) { <START_BUG> log . error ( e ) ; <END_BUG> } } else if ( ( next . getAttribute ( "checkboxaction" ) ) != null ) { try { CheckBoxAction action = ( ( CheckBoxAction ) ( ( ( ActionPluginHandler ) ( pluginManager . getHandler ( "org.columba.core.action" ) ) ) . getAction ( next . getAttribute ( "checkboxaction" ) , frameController ) ) ) ; if ( action != null ) { JCheckBoxMenuItem menuitem = new JCheckBoxMenuItem ( action ) ; menu . add ( menuitem ) ; action . setCheckBoxMenuItem ( menuitem ) ; lastWasSeparator = false ; } } catch ( Exception e ) { log . error ( ( ( e + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( next . getAttribute ( "checkboxaction" ) ) ) ) ; } } else if ( ( next . getAttribute ( "imenu" ) ) != null ) { try { IMenu imenu = ( ( ActionPluginHandler ) ( pluginManager . getHandler ( "org.columba.core.action" ) ) ) . getIMenu ( next . getAttribute ( "imenu" ) , frameController ) ; if ( imenu != null ) menu . add ( imenu ) ; lastWasSeparator = false ; } catch ( Exception e ) { e . printStackTrace ( ) ; log . error ( e ) ; } } } else if ( name . equals ( "separator" ) ) { if ( ! lastWasSeparator ) menu . addSeparator ( ) ; lastWasSeparator = true ; } else if ( name . equals ( "menu" ) ) { menu . add ( createSubMenu ( next ) ) ; lastWasSeparator = false ; } } if ( lastWasSeparator ) { menu . remove ( ( ( menu . getMenuComponentCount ( ) ) - 1 ) ) ; } } protected JMenu createSubMenu ( XmlElement menuElement ) { } }

Fix:
log . error ( ( ( e + ":<seq2seq4repair_space>" ) + ( next . getAttribute ( "action" ) ) ) ) ;
Buggy code:
public class VAJImport extends VAJTask { protected Vector filesets = new Vector ( ) ; protected boolean importSources = true ; protected boolean importResources = true ; protected boolean importClasses = false ; protected String importProject = null ; protected boolean useDefaultExcludes = true ; public void setDefaultexcludes ( boolean useDefaultExcludes ) { } public void setImportClasses ( boolean importClasses ) { } public void setImportResources ( boolean importResources ) { } public void setImportSources ( boolean importSources ) { } public void setProject ( String projectName ) { } public void addFileset ( FileSet set ) { } public void execute ( ) throws TaskException { } protected void importFileset ( FileSet fileset ) { <START_BUG> DirectoryScanner ds = fileset . getDirectoryScanner ( this . project ) ; <END_BUG> if ( ( ds . getIncludedFiles ( ) . length ) == 0 ) { return ; } String [ ] includes = null ; String [ ] excludes = null ; try { Class directoryScanner = ds . getClass ( ) ; Field includesField = directoryScanner . getDeclaredField ( "includes" ) ; includesField . setAccessible ( true ) ; includes = ( ( String [ ] ) ( includesField . get ( ds ) ) ) ; Field excludesField = directoryScanner . getDeclaredField ( "excludes" ) ; excludesField . setAccessible ( true ) ; excludes = ( ( String [ ] ) ( excludesField . get ( ds ) ) ) ; } catch ( NoSuchFieldException nsfe ) { throw new TaskException ( ( "DirectoryScanner.includes<seq2seq4repair_space>or<seq2seq4repair_space>.excludes<seq2seq4repair_space>missing" + ( nsfe . getMessage ( ) ) ) ) ; } catch ( IllegalAccessException iae ) { throw new TaskException ( "Access<seq2seq4repair_space>to<seq2seq4repair_space>DirectoryScanner.includes<seq2seq4repair_space>or<seq2seq4repair_space>.excludes<seq2seq4repair_space>not<seq2seq4repair_space>allowed" ) ; } getUtil ( ) . importFiles ( importProject , ds . getBasedir ( ) , includes , excludes , importClasses , importResources , importSources , useDefaultExcludes ) ; } }

Fix:
DirectoryScanner ds = fileset . getDirectoryScanner ( this . getProject ( ) ) ;