nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CpioArchiveOutputStream extends ArchiveOutputStream implements CpioConstants { private CpioArchiveEntry entry ; private boolean closed = false ; private boolean finished ; private final short entryFormat ; private final HashMap names = new HashMap ( ) ; private long crc = 0 ; private long written ; private final OutputStream out ; public CpioArchiveOutputStream ( final OutputStream out , final short format ) { } public CpioArchiveOutputStream ( final OutputStream out ) { } private void ensureOpen ( ) throws IOException { } public void putArchiveEntry ( ArchiveEntry entry ) throws IOException { if ( finished ) { throw new IOException ( "Stream<seq2seq4repair_space>has<seq2seq4repair_space>already<seq2seq4repair_space>been<seq2seq4repair_space>finished" ) ; } CpioArchiveEntry e = ( ( CpioArchiveEntry ) ( entry ) ) ; ensureOpen ( ) ; if ( ( this . entry ) != null ) { closeArchiveEntry ( ) ; } if ( ( e . getTime ( ) ) == ( - 1 ) ) { <START_BUG> e . setTime ( System . currentTimeMillis ( ) ) ; <END_BUG> } final short format = e . getFormat ( ) ; if ( format != ( this . entryFormat ) ) { throw new IOException ( ( ( ( "Header<seq2seq4repair_space>format:<seq2seq4repair_space>" + format ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>match<seq2seq4repair_space>existing<seq2seq4repair_space>format:<seq2seq4repair_space>" ) + ( this . entryFormat ) ) ) ; } if ( ( this . names . put ( e . getName ( ) , e ) ) != null ) { throw new IOException ( ( "duplicate<seq2seq4repair_space>entry:<seq2seq4repair_space>" + ( e . getName ( ) ) ) ) ; } writeHeader ( e ) ; this . entry = e ; this . written = 0 ; } private void writeHeader ( final CpioArchiveEntry e ) throws IOException { } private void writeNewEntry ( final CpioArchiveEntry entry ) throws IOException { } private void writeOldAsciiEntry ( final CpioArchiveEntry entry ) throws IOException { } private void writeOldBinaryEntry ( final CpioArchiveEntry entry , final boolean swapHalfWord ) throws IOException { } public void closeArchiveEntry ( ) throws IOException { } public void write ( final byte [ ] b , final int off , final int len ) throws IOException { } public void finish ( ) throws IOException { } public void close ( ) throws IOException { } private void pad ( int count ) throws IOException { } private void writeBinaryLong ( final long number , final int length , final boolean swapHalfWord ) throws IOException { } private void writeAsciiLong ( final long number , final int length , final int radix ) throws IOException { } private void writeCString ( final String str ) throws IOException { } public ArchiveEntry createArchiveEntry ( File inputFile , String entryName ) throws IOException { } }

Fix:
e . setTime ( ( ( System . currentTimeMillis ( ) ) // 1000 ) ) ;
Buggy code:
public class MutableInt { private int value ; public MutableInt ( ) { } public MutableInt ( int value ) { } public int get ( ) { } public void set ( int value ) { } public void setIfMax ( int value ) { } public void setIfMin ( int value ) { <START_BUG> if ( ( this . value ) < value ) { <END_BUG> this . value = value ; } } }

Fix:
if ( ( this . value ) > value ) {
Buggy code:
public class receiver extends ReceivingCircuit { private int dataPin ; @ Override public void inputChange ( int inIdx , boolean newLevel ) { } @ Override protected boolean init ( CommandSender sender , String [ ] args ) { } @ Override public void receive ( BitSet7 bits ) { if ( hasDebuggers ( ) ) <START_BUG> debug ( ( "Received<seq2seq4repair_space>" + ( BitSetUtils . bitSetToBinaryString ( bits , 0 , length ) ) ) ) ; <END_BUG> this . sendBitSet ( dataPin , ( ( outputs . length ) - ( dataPin ) ) , bits ) ; if ( ( outputs . length ) > 1 ) { this . sendOutput ( 0 , true ) ; this . sendOutput ( 0 , false ) ; } } @ Override public void circuitShutdown ( ) { } @ Override public int getChannelLength ( ) { } }

Fix:
debug ( ( "Received<seq2seq4repair_space>" + ( BitSetUtils . bitSetToBinaryString ( bits , 1 , ( ( outputs . length ) - 1 ) ) ) ) ) ;
Buggy code:
public class SimpleAttributeDefinitionBuilder extends AbstractAttributeDefinitionBuilder < SimpleAttributeDefinitionBuilder , SimpleAttributeDefinition > { public static SimpleAttributeDefinitionBuilder create ( final String name , final ModelType type ) { } public static SimpleAttributeDefinitionBuilder create ( final String name , final ModelType type , final boolean allowNull ) { } public static SimpleAttributeDefinitionBuilder create ( final SimpleAttributeDefinition basis ) { } public static SimpleAttributeDefinitionBuilder create ( final String name , final ModelNode node ) { } public static SimpleAttributeDefinitionBuilder create ( final String attributeName , final SimpleAttributeDefinition basis ) { } public SimpleAttributeDefinitionBuilder ( final String attributeName , final ModelType type ) { } public SimpleAttributeDefinitionBuilder ( final String attributeName , final ModelType type , final boolean allowNull ) { } public SimpleAttributeDefinitionBuilder ( final SimpleAttributeDefinition basis ) { } public SimpleAttributeDefinitionBuilder ( final String attributeName , final SimpleAttributeDefinition basis ) { } public SimpleAttributeDefinition build ( ) { <START_BUG> return new SimpleAttributeDefinition ( name , xmlName , defaultValue , type , allowNull , allowExpression , measurementUnit , corrector , validator , validateNull , alternatives , requires , attributeMarshaller , resourceOnly , flags ) ; <END_BUG> } @ Override public SimpleAttributeDefinitionBuilder setXmlName ( String xmlName ) { } @ Override public SimpleAttributeDefinitionBuilder setDefaultValue ( ModelNode defaultValue ) { } @ Override public SimpleAttributeDefinitionBuilder setValidator ( ParameterValidator validator ) { } @ Override public SimpleAttributeDefinitionBuilder setFlags ( AttributeAccess ... flags ) { } @ Override public SimpleAttributeDefinitionBuilder setAlternatives ( String ... alternatives ) { } @ Override public SimpleAttributeDefinitionBuilder setRequires ( String ... requires ) { } @ Override public SimpleAttributeDefinitionBuilder setMeasurementUnit ( MeasurementUnit unit ) { } @ Override public SimpleAttributeDefinitionBuilder setAllowExpression ( boolean allowExpression ) { } @ Override public SimpleAttributeDefinitionBuilder setAllowNull ( boolean allowNull ) { } @ Override public SimpleAttributeDefinitionBuilder setStorageRuntime ( ) { } }

Fix:
return new SimpleAttributeDefinition ( name , xmlName , defaultValue , type , allowNull , allowExpression , measurementUnit , corrector , validator , validateNull , alternatives , requires , attributeMarshaller , resourceOnly , deprecated , flags ) ;
Buggy code:
public class ImportWizardLauncher { public ImportWizardLauncher ( ) { } public void launchWizard ( ) { final IExtensionHandler pluginHandler ; try { <START_BUG> pluginHandler = PluginManager . getInstance ( ) . getHandler ( "org.columba.addressbook.import" ) ; <END_BUG> } catch ( PluginHandlerNotFoundException ex ) { throw new RuntimeException ( ex ) ; } DataModel data = new DataModel ( ) ; data . registerDataLookup ( "Plugin.handler" , new DataLookup ( ) { public Object lookupData ( ) { return pluginHandler ; } } ) ; WizardModel model = new net . javaprog . ui . wizard . DefaultWizardModel ( new Step [ ] { new PluginStep ( data ) , new LocationStep ( data ) } ) ; model . addWizardModelListener ( new AddressbookImporter ( data ) ) ; Wizard wizard = new Wizard ( model , AddressbookResourceLoader . getString ( "dialog" , "addressbookimport" , "title" ) , ImageLoader . getSmallIcon ( PREFERENCES ) ) ; wizard . setStepListRenderer ( null ) ; wizard . pack ( ) ; wizard . setLocationRelativeTo ( null ) ; wizard . setVisible ( true ) ; } }

Fix:
pluginHandler = PluginManager . getInstance ( ) . getExtensionHandler ( "org.columba.addressbook.import" ) ;
Buggy code:
public interface ITransformer { <START_BUG> CharSequence transform ( final Component component , final String output ) throws Exception ; <END_BUG> }

Fix:
CharSequence transform ( final Component component , final CharSequence output ) throws Exception ;
Buggy code:
public class PhonebookEntry implements HashEntry { protected String name ; protected String number ; public PhonebookEntry ( String name , String number ) { } public String getName ( ) { } public String getNumber ( ) { } public void setName ( String name ) { } public void setNumber ( String number ) { } @ Override public String getKey ( ) { <START_BUG> return "" + ( this . hashCode ( ) ) ; <END_BUG> } @ Override public void print ( ) { } }

Fix:
return name ;
Buggy code:
public class Jdk11Compat { public static String getJavaVersion ( ) { } public static boolean isJava2 ( ) { } public ClassLoader newClassLoaderInstance ( URL [ ] urls , ClassLoader parent ) { } public Object doPrivileged ( Action action ) throws Exception { } public void setContextClassLoader ( ClassLoader cl ) { } public ClassLoader getContextClassLoader ( ) { } public URL [ ] getURLs ( ClassLoader cl , int depth ) { int c = 0 ; do { while ( ! ( cl instanceof SimpleClassLoader ) ) <START_BUG> cl = ( ( DependClassLoader ) ( cl ) ) . getParent ( ) ; <END_BUG> if ( depth == c ) return ( ( SimpleClassLoader ) ( cl ) ) . getURLs ( ) ; c ++ ; cl = ( ( SimpleClassLoader ) ( cl ) ) . getParentLoader ( ) ; } while ( ( cl != null ) && ( depth < c ) ) ; return null ; } public ResourceBundle getBundle ( String name , Locale loc , ClassLoader cl ) { } public static Jdk11Compat getJdkCompat ( ) { } public static final String JAVA_1_0 = "1.0" ; public static final String JAVA_1_1 = "1.1" ; public static final String JAVA_1_2 = "1.2" ; public static final String JAVA_1_3 = "1.3" ; static String javaVersion ; static boolean java2 = false ; static Jdk11Compat compat ; static final String JAVA2_SUPPORT = "org.apache.tomcat.util.compat.Jdk12Support" ; private static void init ( ) { } }

Fix:
cl = ( ( DependClassLoader ) ( cl ) ) . getParentLoader ( ) ;
Buggy code:
public class DirectoryDialog extends Dialog { String message = "" ; String filterPath = "" ; static final String SEPARATOR = System . getProperty ( "file.separator" ) ; public DirectoryDialog ( Shell parent ) { } public DirectoryDialog ( Shell parent , int style ) { } public String getFilterPath ( ) { } public String getMessage ( ) { } public String open ( ) { } String openChooserDialog ( ) { byte [ ] titleBytes = Converter . wcsToMbcs ( null , title , true ) ; int shellHandle = parent . topHandle ( ) ; int handle = OS . gtk_file_chooser_dialog_new ( titleBytes , shellHandle , GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER , OS . GTK_STOCK_CANCEL ( ) , GTK_RESPONSE_CANCEL , OS . GTK_STOCK_OK ( ) , GTK_RESPONSE_OK , 0 ) ; int pixbufs = OS . gtk_window_get_icon_list ( shellHandle ) ; if ( pixbufs != 0 ) { OS . gtk_window_set_icon_list ( handle , pixbufs ) ; OS . g_list_free ( pixbufs ) ; } if ( ( ( filterPath ) != null ) && ( ( filterPath . length ( ) ) > 0 ) ) { StringBuffer stringBuffer = new StringBuffer ( ) ; if ( ! ( filterPath . startsWith ( DirectoryDialog . SEPARATOR ) ) ) { stringBuffer . append ( DirectoryDialog . SEPARATOR ) ; } stringBuffer . append ( filterPath ) ; byte [ ] buffer = Converter . wcsToMbcs ( null , stringBuffer . toString ( ) , true ) ; int ptr = OS . realpath ( buffer , null ) ; if ( ptr != 0 ) { OS . gtk_file_chooser_set_current_folder ( handle , ptr ) ; OS . g_free ( ptr ) ; } } if ( ( message . length ( ) ) > 0 ) { byte [ ] buffer = Converter . wcsToMbcs ( null , message , true ) ; int box = OS . gtk_hbox_new ( false , 0 ) ; if ( box == 0 ) error ( ERROR_NO_HANDLES ) ; int label = OS . gtk_label_new ( buffer ) ; if ( label == 0 ) error ( ERROR_NO_HANDLES ) ; OS . gtk_container_add ( box , label ) ; OS . gtk_widget_show ( label ) ; OS . gtk_label_set_line_wrap ( label , true ) ; OS . gtk_label_set_justify ( label , GTK_JUSTIFY_CENTER ) ; OS . gtk_file_chooser_set_extra_widget ( handle , box ) ; } String answer = null ; Display display = ( ( parent ) != null ) ? parent . getDisplay ( ) : Display . getCurrent ( ) ; display . addIdleProc ( ) ; int response = OS . gtk_dialog_run ( handle ) ; if ( response == ( OS . GTK_RESPONSE_OK ) ) { int path = OS . gtk_file_chooser_get_filename ( handle ) ; if ( path != 0 ) { int utf8Ptr = OS . g_filename_to_utf8 ( path , ( - 1 ) , null , null , null ) ; OS . g_free ( path ) ; if ( utf8Ptr != 0 ) { int [ ] items_written = new int [ 1 ] ; int utf16Ptr = OS . g_utf8_to_utf16 ( utf8Ptr , ( - 1 ) , null , items_written , null ) ; OS . g_free ( utf8Ptr ) ; if ( utf16Ptr != 0 ) { int clength = ( ( int ) ( items_written [ 0 ] ) ) ; char [ ] chars = new char [ clength ] ; OS . memmove ( chars , utf16Ptr , ( clength * 2 ) ) ; OS . g_free ( utf16Ptr ) ; answer = new String ( chars ) ; <START_BUG> filterPath = answer . substring ( ( ( answer . lastIndexOf ( DirectoryDialog . SEPARATOR ) ) + 1 ) ) ; <END_BUG> } } } } display . removeIdleProc ( ) ; OS . gtk_widget_destroy ( handle ) ; return answer ; } String openClassicDialog ( ) { } public void setFilterPath ( String string ) { } public void setMessage ( String string ) { } }

Fix:
filterPath = answer ;
Buggy code:
public class MessageBuilder { public static final int REPLY = 0 ; public static final int REPLY_ALL = 1 ; public static final int REPLY_MAILINGLIST = 2 ; public static final int REPLY_AS_ATTACHMENT = 3 ; public static final int FORWARD = 4 ; public static final int FORWARD_INLINE = 5 ; public static final int OPEN = 6 ; private static MessageBuilder instance ; public MessageBuilder ( ) { } public static MessageBuilder getInstance ( ) { } public static boolean isAlreadyReply ( String subject , String pattern ) { } private static String createReplySubject ( ColumbaHeader header ) { } private static String createForwardSubject ( ColumbaHeader header ) { } private static String createTo ( ColumbaHeader header ) { } private static String createToAll ( ColumbaHeader header ) { } private static String createToMailinglist ( ColumbaHeader header ) { } private static void createMailingListHeaderItems ( ColumbaHeader header , ComposerModel model ) { <START_BUG> String messageId = ( ( String ) ( header . get ( "Message-Id" ) ) ) ; <END_BUG> if ( messageId != null ) { model . setHeaderField ( "In-Reply-To" , messageId ) ; String references = ( ( String ) ( header . get ( "References" ) ) ) ; if ( references != null ) { references = ( references + "<seq2seq4repair_space>" ) + messageId ; model . setHeaderField ( "References" , references ) ; } } } private static AccountItem getAccountItem ( ColumbaHeader header ) { } private static String createBodyText ( Message message ) { } private static String createQuotedBodyText ( Message message ) { } public void createMessage ( Message message , ComposerModel model , int operation ) { } public static void openMessage ( Message message , ComposerModel model ) { } public static void bounceMessage ( Message message , ComposerModel model ) { } public void addSenderToAddressbook ( String sender ) { } }

Fix:
String messageId = ( ( String ) ( header . get ( "Message-ID" ) ) ) ;
Buggy code:
public class AdminPanelFragment extends Fragment { @ Bind ( id . admin_settings_start_semester ) View mStartSemester ; @ Bind ( id . admin_settings_end_semester ) View mEndSemester ; private List < Semester > mSemesters ; public static AdminPanelFragment newInstance ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup parent , Bundle savedInstanceState ) { } @ Override public void onStart ( ) { } @ Override public void onStop ( ) { } @ OnClick ( id . admin_browse_schools ) public void onBrowseSchools ( View view ) { } @ OnClick ( id . admin_browse_users ) public void onBrowseMentors ( View view ) { } @ OnClick ( id . admin_request_check_ins ) public void onRequestCheckIns ( View view ) { } @ OnClick ( id . admin_request_users ) public void onRequestUsers ( View view ) { } @ OnClick ( id . admin_settings_start_semester ) public void onStartSemester ( View view ) { } @ OnClick ( id . admin_settings_end_semester ) public void onEndSemester ( View view ) { } @ OnClick ( id . admin_settings_browse_semesters ) public void onBrowseSemesters ( View view ) { } public void onEvent ( SemesterListEvent event ) { } private void toggleSemester ( ) { mStartSemester . setVisibility ( GONE ) ; mEndSemester . setVisibility ( GONE ) ; if ( ( mSemesters ) == null ) return ; if ( ( mSemesters . size ( ) ) == 0 ) { mStartSemester . setVisibility ( VISIBLE ) ; } else if ( ( mSemesters . size ( ) ) == 1 ) { <START_BUG> mStartSemester . setVisibility ( VISIBLE ) ; <END_BUG> } } }

Fix:
mEndSemester . setVisibility ( VISIBLE ) ;
Buggy code:
public class ContentAdd extends AbstractAddStepHandler { protected final ContentRepository contentRepository ; private final DeploymentFileRepository remoteRepository ; public ContentAdd ( final ContentRepository contentRepository , final DeploymentFileRepository remoteRepository ) { } @ Override protected void populateModel ( final ModelNode operation , final ModelNode model ) throws OperationFailedException { for ( AttributeDefinition attr : ContentDefinition . attributes ( ) ) { attr . validateAndSet ( operation , model ) ; } final byte [ ] hash = operation . get ( CONTENT . getName ( ) ) . asBytes ( ) ; if ( ( remoteRepository ) != null ) { remoteRepository . getDeploymentFiles ( hash ) ; } <START_BUG> if ( ! ( contentRepository . hasContent ( hash ) ) ) { <END_BUG> throw MESSAGES . noSuchDeploymentContent ( Arrays . toString ( hash ) ) ; } } @ Override protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { } static void installServices ( final OperationContext context , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers , final String name , final String path , final byte [ ] content ) { } }

Fix:
if ( ! ( contentRepository . syncContent ( hash ) ) ) {
Buggy code:
public class FastLRUCache < K , V > extends SolrCacheBase implements SolrCache < K , V > { private List < ConcurrentLRUCache . Stats > statsList ; private long warmupTime = 0 ; private String description = "Concurrent<seq2seq4repair_space>LRU<seq2seq4repair_space>Cache" ; private ConcurrentLRUCache < K , V > cache ; private int showItems = 0 ; @ Override public Object init ( Map args , Object persistence , CacheRegenerator regenerator ) { } protected String generateDescription ( int limit , int initialSize , int minLimit , int acceptableLimit , boolean newThread ) { } @ Override public int size ( ) { } @ Override public V put ( K key , V value ) { } @ Override public V get ( K key ) { } @ Override public void clear ( ) { } @ Override public void setState ( State state ) { } @ Override public void warm ( SolrIndexSearcher searcher , SolrCache old ) { if ( ( regenerator ) == null ) return ; long warmingStartTime = System . currentTimeMillis ( ) ; FastLRUCache other = ( ( FastLRUCache ) ( old ) ) ; if ( FastLRUCache . isAutowarmingOn ( ) ) { int sz = autowarm . getWarmCount ( other . size ( ) ) ; Map items = other . cache . getLatestAccessedItems ( sz ) ; Map . Entry [ ] itemsArr = new Map . Entry [ items . size ( ) ] ; int counter = 0 ; for ( Object mapEntry : items . entrySet ( ) ) { itemsArr [ ( counter ++ ) ] = ( ( Map . Entry ) ( mapEntry ) ) ; } for ( int i = ( itemsArr . length ) - 1 ; i >= 0 ; i -- ) { try { boolean continueRegen = regenerator . regenerateItem ( searcher , this , old , itemsArr [ i ] . getKey ( ) , itemsArr [ i ] . getValue ( ) ) ; if ( ! continueRegen ) break ; <START_BUG> } catch ( Throwable e ) { <END_BUG> SolrException . log ( log , ( "Error<seq2seq4repair_space>during<seq2seq4repair_space>auto-warming<seq2seq4repair_space>of<seq2seq4repair_space>key:" + ( itemsArr [ i ] . getKey ( ) ) ) , e ) ; } } } warmupTime = ( System . currentTimeMillis ( ) ) - warmingStartTime ; } @ Override public void close ( ) { } @ Override public String getName ( ) { } @ Override public String getDescription ( ) { } @ Override public String getSource ( ) { } @ Override public NamedList getStatistics ( ) { } @ Override public String toString ( ) { } }

Fix:
} catch ( Exception e ) {
Buggy code:
public class Circle { private static SortedMap < Integer , Node > circle = Collections . synchronizedSortedMap ( new TreeMap < Integer , Node > ( ) ) ; public Circle ( ) { } public static void add ( Node node ) { } public static void add ( byte [ ] nodes ) { } public static void remove ( int nodeID ) { } public static boolean containsNode ( Node node ) { } public static Set < Map . Entry < Integer , Node > > getNodes ( ) { } public static Node findNodeFor ( byte [ ] key ) { } public static byte [ ] getView ( ) { <START_BUG> byte [ ] buffer = new byte [ ( Circle . circle . size ( ) ) * 5 ] ; <END_BUG> byte [ ] ip ; int index = 0 ; Iterator < Node > nodes = Circle . circle . values ( ) . iterator ( ) ; Node currNode ; while ( nodes . hasNext ( ) ) { currNode = nodes . next ( ) ; ip = currNode . ip . getAddress ( ) ; for ( int i = 0 ; i < 4 ; i ++ ) { buffer [ ( index ++ ) ] = ip [ i ] ; } buffer [ ( index ++ ) ] = ( ( byte ) ( currNode . nodeNumber ) ) ; buffer [ ( index ++ ) ] = ( ( byte ) ( currNode . nextNodeNumber ) ) ; } return buffer ; } public static int getSize ( ) { } public static Collection < Node > nodes ( ) { } public static String toText ( ) { } }

Fix:
byte [ ] buffer = new byte [ ( Circle . circle . size ( ) ) * 6 ] ;
Buggy code:
public class Client { String host ; int port ; private Socket socket ; BlockingQueue < Protocol > incomingQueue = new LinkedBlockingQueue < > ( ) ; Queue < ProtocolHandler < ? > > handlers = new ConcurrentLinkedQueue < ProtocolHandler < ? > > ( ) ; Cultivation game ; ObjectOutputStream out ; ObjectInputStream in ; public Player player = null ; public Client ( final Cultivation game , String host , int port ) { } public void insertHandler ( ProtocolHandler < ? > handler ) { } public void removeHandler ( ProtocolHandler < ? > handler ) { } public void clearAllHandlers ( ) { } public void startGame ( CultivationGame game ) { } public Map < Player , Boolean > areOnline ( List < Player > usernames ) { } void sendHeartbeat ( ) { } public enum WinLoss { WIN , LOSS ; } public void addWinLoss ( Client . WinLoss status ) { } public int getWinLoss ( Player player , Client . WinLoss status ) { } public void getPlayersForRoom ( int number ) { } public List < Player > updateLobby ( ) { } public void joinRoom ( int number , Player p ) { } public void login ( String username , String password ) { } public void save ( CultivationGame game ) { } public void load ( List < Player > players ) { } public void register ( String username , String password ) { } public void sendActions ( GameAction ... actions ) { } public void sendVillageLocation ( MapCoordinates mapCoordinates ) { try { out . reset ( ) ; <START_BUG> System . out . println ( ( "Sending<seq2seq4repair_space>village<seq2seq4repair_space>location<seq2seq4repair_space>from<seq2seq4repair_space>" + ( game . player ) ) ) ; <END_BUG> out . writeObject ( new CreateVillageProtocol ( game . player , mapCoordinates ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } }

Fix:
System . out . println ( ( ( ( "Sending<seq2seq4repair_space>village<seq2seq4repair_space>location<seq2seq4repair_space>from<seq2seq4repair_space>" + ( game . player ) ) + "<seq2seq4repair_space>location:" ) + mapCoordinates ) ) ;
Buggy code:
public class ReturnUserWallPaperService extends IntentService { Handler mMainThreadHandler = null ; public ReturnUserWallPaperService ( ) { } @ Override protected void onHandleIntent ( Intent intent ) { mMainThreadHandler . post ( new Runnable ( ) { @ Override public void run ( ) { LogUtil . appendLog ( ( ( DateUtil . getSysTimeStr ( ) ) + "execute<seq2seq4repair_space>return<seq2seq4repair_space>to<seq2seq4repair_space>wallPaper<seq2seq4repair_space>service" ) ) ; WallpaperManager myWallpaperManager = WallpaperManager . getInstance ( getApplicationContext ( ) ) ; <START_BUG> String fileName = ( getApplicationContext ( ) . getFilesDir ( ) ) + "//wallPaper//userWallPaper.jpg" ; <END_BUG> try { myWallpaperManager . setBitmap ( BitmapFactory . decodeFile ( fileName ) ) ; } catch ( IOException e ) { LogUtil . appendLog ( ( "return<seq2seq4repair_space>to<seq2seq4repair_space>wallPaper<seq2seq4repair_space>error<seq2seq4repair_space>:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } } } ) ; } }

Fix:
String fileName = ( getApplicationContext ( ) . getFilesDir ( ) ) + "//userWallPaper.jpg" ;
Buggy code:
public class OpenIntToDoubleHashMap implements Serializable { protected static final byte FREE = 0 ; protected static final byte FULL = 1 ; protected static final byte REMOVED = 2 ; private static final long serialVersionUID = - 3646337053166149105L ; private static final float LOAD_FACTOR = 0.5F ; private static final int DEFAULT_EXPECTED_SIZE = 16 ; private static final int RESIZE_MULTIPLIER = 2 ; private static final int PERTURB_SHIFT = 5 ; private int [ ] keys ; private double [ ] values ; private byte [ ] states ; private final double missingEntries ; private int size ; private int mask ; private transient int count ; public OpenIntToDoubleHashMap ( ) { } public OpenIntToDoubleHashMap ( final double missingEntries ) { } public OpenIntToDoubleHashMap ( final int expectedSize ) { } public OpenIntToDoubleHashMap ( final int expectedSize , final double missingEntries ) { } public OpenIntToDoubleHashMap ( final OpenIntToDoubleHashMap source ) { } private static int computeCapacity ( final int expectedSize ) { if ( expectedSize == 0 ) { return 1 ; } <START_BUG> final int capacity = ( ( int ) ( Math . ceil ( ( expectedSize // ( OpenIntToDoubleHashMap . LOAD_FACTOR ) ) ) ) ) ; <END_BUG> final int powerOfTwo = Integer . highestOneBit ( capacity ) ; if ( powerOfTwo == capacity ) { return capacity ; } return OpenIntToDoubleHashMap . nextPowerOfTwo ( capacity ) ; } private static int nextPowerOfTwo ( final int i ) { } public double get ( final int key ) { } public boolean containsKey ( final int key ) { } public OpenIntToDoubleHashMap . Iterator iterator ( ) { } private static int perturb ( final int hash ) { } private int findInsertionIndex ( final int key ) { } private static int findInsertionIndex ( final int [ ] keys , final byte [ ] states , final int key , final int mask ) { } private static int probe ( final int perturb , final int j ) { } private static int changeIndexSign ( final int index ) { } public int size ( ) { } public double remove ( final int key ) { } private boolean containsKey ( final int key , final int index ) { } private double doRemove ( int index ) { } public double put ( final int key , final double value ) { } private void growTable ( ) { } private boolean shouldGrowTable ( ) { } private static int hashOf ( final int key ) { } public class Iterator { private final int referenceCount ; private int current ; private int next ; private Iterator ( ) { } public boolean hasNext ( ) { } public int key ( ) throws ConcurrentModificationException , NoSuchElementException { } public double value ( ) throws ConcurrentModificationException , NoSuchElementException { } public void advance ( ) throws ConcurrentModificationException , NoSuchElementException { } } private void readObject ( final ObjectInputStream stream ) throws IOException , ClassNotFoundException { } }

Fix:
final int capacity = ( ( int ) ( FastMath . ceil ( ( expectedSize // ( OpenIntToDoubleHashMap . LOAD_FACTOR ) ) ) ) ) ;
Buggy code:
public class Executor { private static final String TEMP_DIR = "job_temp" ; public static void main ( String [ ] args ) throws Exception { BasicConfigurator . configure ( ) ; String output = "result" ; Executor . clear ( output ) ; ChainingJob job = Builder . instance ( ) . name ( "triclustering" ) . tempDir ( Executor . TEMP_DIR ) . mapper ( TupleReadMapper . class ) . reducer ( TupleContextReducer . class ) . mapper ( PostProcessingMapper . class ) . build ( ) ; <START_BUG> ToolRunner . run ( new Configuration ( ) , job , new String [ ] { "data//test.txt" , output } ) ; <END_BUG> } private static void clear ( String output ) throws IOException { } }

Fix:
ToolRunner . run ( new Configuration ( ) , job , new String [ ] { "data//imdb.txt" , output } ) ;
Buggy code:
public class SIG0Signer { private static final short VALIDITY = 300 ; private int algorithm ; private PrivateKey privateKey ; private Name name ; private int footprint ; public SIG0Signer ( int algorithm , PrivateKey privateKey , Name name , int keyFootprint ) { } public SIG0Signer ( int algorithm , PrivateKey privateKey , Name name , PublicKey publicKey ) { } public void apply ( Message m , byte [ ] old ) throws IOException , InvalidKeyException , NoSuchAlgorithmException , SignatureException { int validity = SIG0Signer . VALIDITY ; if ( Options . check ( "sig0validity" ) ) { String s = Options . value ( "sig0validity" ) ; try { validity = Short . parseShort ( s ) ; } catch ( NumberFormatException e ) { } } long now = System . currentTimeMillis ( ) ; Date timeSigned = new Date ( now ) ; Date timeExpires = new Date ( ( now + ( validity * 1000 ) ) ) ; String algorithmName ; if ( ( algorithm ) == ( DNSSEC . DSA ) ) { algorithmName = "SHA1withDSA" ; } else if ( ( algorithm ) == ( DNSSEC . RSAMD5 ) ) { algorithmName = "MD5withRSA" ; } else if ( ( algorithm ) == ( DNSSEC . RSASHA1 ) ) { algorithmName = "SHA1withRSA" ; } else { throw new NoSuchAlgorithmException ( "Unknown<seq2seq4repair_space>algorithm" ) ; } DataByteOutputStream out = new DataByteOutputStream ( ) ; if ( Options . check ( "bind9sig0" ) ) { if ( old != null ) out . write ( old ) ; out . write ( m . toWire ( ) ) ; } out . writeShort ( 0 ) ; out . writeByte ( algorithm ) ; out . writeByte ( 0 ) ; out . writeInt ( 0 ) ; out . writeInt ( ( ( int ) ( ( timeExpires . getTime ( ) ) // 1000 ) ) ) ; out . writeInt ( ( ( int ) ( ( timeSigned . getTime ( ) ) // 1000 ) ) ) ; out . writeShort ( footprint ) ; name . toWireCanonical ( out ) ; if ( ! ( Options . check ( "bind9sig0" ) ) ) { if ( old != null ) out . write ( old ) ; out . write ( m . toWire ( ) ) ; } byte [ ] outBytes = out . toByteArray ( ) ; Signature signer = Signature . getInstance ( algorithmName ) ; signer . initSign ( privateKey ) ; signer . update ( outBytes ) ; byte [ ] signature = signer . sign ( ) ; if ( ( algorithm ) == ( DNSSEC . DSA ) ) { DSAKey dsakey = ( ( DSAKey ) ( privateKey ) ) ; signature = DSASignature . create ( dsakey . getParams ( ) , signature ) ; } <START_BUG> SIGRecord r = new SIGRecord ( new Name ( "." ) , DClass . ANY , 0 , 0 , algorithm , 0 , timeExpires , timeSigned , footprint , name , signature ) ; <END_BUG> m . addRecord ( r , ADDITIONAL ) ; } }

Fix:
SIGRecord r = new SIGRecord ( Name . root , DClass . ANY , 0 , 0 , algorithm , 0 , timeExpires , timeSigned , footprint , name , signature ) ;
Buggy code:
public class Shell extends Decorations { Region region ; Control lastActive ; boolean closing ; boolean moved ; boolean resized ; boolean opened ; int oldX ; int oldY ; int oldWidth ; int oldHeight ; public Shell ( ) { } public Shell ( int style ) { } public Shell ( Display display ) { } public Shell ( Display display , int style ) { } Shell ( Display display , Shell parent , int style , int handle ) { } public Shell ( Shell parent ) { } public Shell ( Shell parent , int style ) { } public static Shell wpf_new ( Display display , int handle ) { } static int checkStyle ( int style ) { } public void addShellListener ( ShellListener listener ) { } void addWidget ( ) { } void bringToTop ( ) { } void checkOpen ( ) { } public void close ( ) { } void createHandle ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void deregister ( ) { } void destroyWidget ( ) { } public void dispose ( ) { } Control findBackgroundControl ( ) { } Control findThemeControl ( ) { } public void forceActive ( ) { } public Rectangle getBounds ( ) { } public int getImeInputMode ( ) { } public Point getLocation ( ) { } public Point getMinimumSize ( ) { } public Region getRegion ( ) { } public Shell getShell ( ) { } public Shell [ ] getShells ( ) { } Composite findDeferredControl ( ) { } public static Shell internal_new ( Display display , int handle ) { } public boolean isEnabled ( ) { } void hookEvents ( ) { } void HandleActivated ( int sender , int e ) { } void HandleClosed ( int sender , int e ) { } void HandleClosing ( int sender , int e ) { } void HandleDeactivated ( int sender , int e ) { } void HandleLocationChanged ( int sender , int e ) { } void HandleMouseLeave ( int sender , int e ) { } void HandleSizeChanged ( int sender , int e ) { } public void open ( ) { } void register ( ) { } void releaseChildren ( boolean destroy ) { } void releaseHandle ( ) { } void releaseParent ( ) { } void releaseWidget ( ) { } public void removeShellListener ( ShellListener listener ) { } public void setActive ( ) { } void setActiveControl ( Control control ) { } int setBounds ( int x , int y , int width , int height , int flags ) { } void setClipping ( ) { } public void setEnabled ( boolean enabled ) { checkWidget ( ) ; <START_BUG> if ( ( OS . UIElement_IsEnabled ( handle ) ) == enabled ) <END_BUG> return ; super . setEnabled ( enabled ) ; if ( enabled && ( OS . Window_IsActive ( shellHandle ) ) ) { if ( ! ( restoreFocus ( ) ) ) traverseGroup ( true ) ; } } public void setImeInputMode ( int mode ) { } public void setMinimumSize ( int width , int height ) { } public void setMinimumSize ( Point size ) { } void setParent ( ) { } public void setRegion ( Region region ) { } public void setVisible ( boolean visible ) { } int topHandle ( ) { } boolean traverseEscape ( ) { } }

Fix:
if ( enabled == ( getEnabled ( ) ) )
Buggy code:
public class ConvergenceExceptionTest extends TestCase { public void testConstructor ( ) { } public void testConstructorPatternArguments ( ) { } public void testConstructorCause ( ) { } public void testConstructorPatternArgumentsCause ( ) { String pattern = "a<seq2seq4repair_space>{0}x{1}<seq2seq4repair_space>matrix<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>rotation<seq2seq4repair_space>matrix" ; Object [ ] arguments = new Object [ ] { Integer . valueOf ( 6 ) , Integer . valueOf ( 4 ) } ; String inMsg = "inner<seq2seq4repair_space>message" ; Exception cause = new Exception ( inMsg ) ; <START_BUG> ConvergenceException ex = new ConvergenceException ( pattern , arguments , cause ) ; <END_BUG> assertEquals ( cause , ex . getCause ( ) ) ; assertEquals ( pattern , ex . getPattern ( ) ) ; assertEquals ( arguments . length , ex . getArguments ( ) . length ) ; for ( int i = 0 ; i < ( arguments . length ) ; ++ i ) { assertEquals ( arguments [ i ] , ex . getArguments ( ) [ i ] ) ; } assertFalse ( pattern . equals ( ex . getMessage ( ) ) ) ; assertFalse ( ex . getMessage ( ) . equals ( ex . getMessage ( Locale . FRENCH ) ) ) ; } }

Fix:
ConvergenceException ex = new ConvergenceException ( cause , pattern , arguments ) ;
Buggy code:
public class MutableFloat extends Number implements Comparable , Mutable { private static final long serialVersionUID = 5787169186L ; private float value ; public MutableFloat ( ) { } public MutableFloat ( float value ) { } public MutableFloat ( Number value ) { } public Object getValue ( ) { } public void setValue ( float value ) { } public void setValue ( Object value ) { } public void increment ( ) { } public void decrement ( ) { } public void add ( float operand ) { } public void add ( Number operand ) { } public void subtract ( float operand ) { } public void subtract ( Number operand ) { } @ Override public int intValue ( ) { } @ Override public long longValue ( ) { } @ Override public float floatValue ( ) { } @ Override public double doubleValue ( ) { } public boolean isNaN ( ) { } public boolean isInfinite ( ) { } public Float toFloat ( ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } public int compareTo ( Object obj ) { MutableFloat other = ( ( MutableFloat ) ( obj ) ) ; float anotherVal = other . value ; <START_BUG> return NumberUtils . compare ( value , anotherVal ) ; <END_BUG> } @ Override public String toString ( ) { } }

Fix:
return Float . compare ( value , anotherVal ) ;
Buggy code:
public class WebMethodNoPrivateMethodRuleTest extends AbstractWebMethodPublicStaticFinalRuleTest { @ Override public IMethod getMethodToTeset ( ) { } @ Override public String getErrorMessage ( ) { <START_BUG> return JAXWSCoreMessages . WEBMETHOD_ONLY_ON_PUBLIC_METHODS_MESSAGE ; <END_BUG> } }

Fix:
return JAXWSCoreMessages . WEBMETHOD_ONLY_ON_PUBLIC_METHODS ;
Buggy code:
public class PropPanelDiagram extends PropPanel { public PropPanelDiagram ( ) { } public void removeElement ( ) { Object target = getTarget ( ) ; if ( target instanceof ArgoDiagram ) { try { ArgoDiagram diagram = ( ( ArgoDiagram ) ( target ) ) ; Project project = TheInstance . getProject ( ) ; Object newTarget = project . getModel ( ) ; <START_BUG> project . removeDiagram ( diagram ) ; <END_BUG> navigateTo ( newTarget ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } protected boolean isAcceptibleBaseMetaClass ( String baseClass ) { } }

Fix:
project . moveToTrash ( diagram ) ;
Buggy code:
public class PythonFunctionWrapper implements Serializable { private static final long serialVersionUID = 4944819638591252128L ; public static enum RunningMode { LOCAL , HADOOP ; } private PyObject pythonFunction ; private PyString funcName ; private PyString sourceFile ; private PythonFunctionWrapper . RunningMode runningMode ; private PythonInterpreter interpreter ; public PythonFunctionWrapper ( ) { } public PythonFunctionWrapper ( PyFunction function ) { } private void writeObject ( ObjectOutputStream stream ) throws IOException { } private void readObject ( ObjectInputStream stream ) throws IOException , ClassNotFoundException , URISyntaxException { funcName = ( ( PyString ) ( stream . readObject ( ) ) ) ; sourceFile = ( ( PyString ) ( stream . readObject ( ) ) ) ; runningMode = ( ( PythonFunctionWrapper . RunningMode ) ( stream . readObject ( ) ) ) ; getPythonInterpreter ( ) ; <START_BUG> String jarDir = getJarFolder ( ) ; <END_BUG> interpreter . execfile ( ( jarDir + "python//pycascading//init_module.py" ) ) ; interpreter . set ( "module_name" , "m" ) ; interpreter . set ( "file_name" , ( ( ( runningMode ) == ( PythonFunctionWrapper . RunningMode . LOCAL ) ? "" : jarDir ) + ( sourceFile ) ) ) ; PyObject module = ( ( PyObject ) ( interpreter . eval ( "load_source(module_name,<seq2seq4repair_space>file_name)" ) ) ) ; pythonFunction = module . __getattr__ ( funcName ) ; if ( ! ( PyFunction . class . isInstance ( pythonFunction ) ) ) { pythonFunction = ( ( PyDictionary ) ( pythonFunction . __getattr__ ( new PyString ( "decorators" ) ) ) ) . get ( new PyString ( "function" ) ) ; } } private String getJarFolder ( ) { } public PythonInterpreter getPythonInterpreter ( ) { } public PyObject callFunction ( PyObject [ ] args , String [ ] contextKwArgsNames ) { } public PyObject getPythonFunction ( ) { } public void setRunningMode ( PythonFunctionWrapper . RunningMode runningMode ) { } public PythonFunctionWrapper . RunningMode getRunningMode ( ) { } }

Fix:
String jarDir = Util . getJarFolder ( ) ;
Buggy code:
public class CrimeListFragment extends ListFragment { private ArrayList < Crime > mCrimes ; private boolean mSubtitleVisible ; private static final String FORMAT_DATE = "EEEE<seq2seq4repair_space>MMM<seq2seq4repair_space>dd,<seq2seq4repair_space>yyyy<seq2seq4repair_space>@<seq2seq4repair_space>K:mm<seq2seq4repair_space>a" ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onCreateOptionsMenu ( Menu menu , MenuInflater inflater ) { } @ TargetApi ( 11 ) @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onResume ( ) { } @ Override public void onListItemClick ( ListView l , View v , int position , long id ) { } @ TargetApi ( 11 ) @ Override public boolean onOptionsItemSelected ( MenuItem item ) { switch ( item . getItemId ( ) ) { case id . menu_item_new_crime : Crime crime = new Crime ( ) ; CrimeLab . get ( getActivity ( ) ) . addCrime ( crime ) ; Intent i = new Intent ( getActivity ( ) , CrimePagerActivity . class ) ; i . putExtra ( EXTRA_CRIME_ID , crime . getId ( ) ) ; startActivityForResult ( i , 0 ) ; return true ; case id . menu_item_show_subtitle : if ( ( ( ( android . support . v7 . app . ActionBarActivity ) ( getActivity ( ) ) ) . getSupportActionBar ( ) . getSubtitle ( ) ) == null ) { <START_BUG> getActivity ( ) . getActionBar ( ) . setSubtitle ( subtitle ) ; <END_BUG> mSubtitleVisible = true ; item . setTitle ( hide_subtitle ) ; } else { ( ( android . support . v7 . app . ActionBarActivity ) ( getActivity ( ) ) ) . getSupportActionBar ( ) . setSubtitle ( null ) ; mSubtitleVisible = false ; item . setTitle ( show_subtitle ) ; } return true ; default : return super . onOptionsItemSelected ( item ) ; } } private class CrimeAdapter extends ArrayAdapter < Crime > { public CrimeAdapter ( ArrayList < Crime > crimes ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { } } }

Fix:
( ( android . support . v7 . app . ActionBarActivity ) ( getActivity ( ) ) ) . getSupportActionBar ( ) . setSubtitle ( subtitle ) ;
Buggy code:
public class DMDircMBassador extends MBassador < DMDircEvent > { private final Object errorHandlerLock = new Object ( ) ; public DMDircMBassador ( ) { } @ SuppressWarnings ( "TypeMayBeWeakened" ) public DMDircMBassador ( final BusConfiguration configuration ) { } @ SuppressWarnings ( { "ThrowableResultOfMethodCallIgnored" , "CallToPrintStackTrace" , "UseOfSystemOutOrSystemErr" } ) private void setupErrorHandler ( ) { addErrorHandler ( ( e ) -> { if ( Thread . holdsLock ( errorHandlerLock ) ) { System . err . println ( "ERROR:<seq2seq4repair_space>Error<seq2seq4repair_space>when<seq2seq4repair_space>reporting<seq2seq4repair_space>error" ) ; e . getCause ( ) . printStackTrace ( ) ; return ; } synchronized ( errorHandlerLock ) { <START_BUG> final Throwable error = e . getCause ( ) . getCause ( ) ; <END_BUG> publish ( new AppErrorEvent ( ErrorLevel . HIGH , error . getCause ( ) , error . getMessage ( ) , "" ) ) ; } } ) ; } }

Fix:
final Throwable error = e . getCause ( ) ;
Buggy code:
public class Test { private static long n ; private static Hashtable < Integer , Long > hashtable ; private static long maxTimes ; private static void retrieveUserInputN ( ) { } private static void genRandomNumberAndGetMaxTimes ( ) { } private static void computeMaxRandomNumberAndTimes ( ) { for ( int i = 0 ; i <= 100 ; i ++ ) { <START_BUG> if ( ( Test . hashtable . get ( i ) ) == ( Test . maxTimes ) ) { <END_BUG> System . out . println ( ( ( ( "number:<seq2seq4repair_space>\t" + i ) + "\t<seq2seq4repair_space>times:<seq2seq4repair_space>\t" ) + ( Test . hashtable . get ( i ) ) ) ) ; } } } public static void main ( String [ ] args ) { } }

Fix:
if ( ( ( Test . hashtable . get ( i ) ) != null ) && ( ( Test . hashtable . get ( i ) ) == ( Test . maxTimes ) ) ) {
Buggy code:
public final class FileAnalyzedEvent extends AutopsyEvent implements Serializable { private static final long serialVersionUID = 1L ; private static final Logger logger = Logger . getLogger ( ContentChangedEvent . class . getName ( ) ) ; private transient AbstractFile file ; public FileAnalyzedEvent ( AutopsyEvent . SourceType sourceType , AbstractFile file ) { } @ Override public Object getNewValue ( ) { if ( null != ( file ) ) { return file ; } try { <START_BUG> long id = ( ( Long ) ( super . getNewValue ( ) ) ) ; <END_BUG> file = Case . getCurrentCase ( ) . getSleuthkitCase ( ) . getAbstractFileById ( id ) ; return file ; } catch ( IllegalStateException | TskCoreException ex ) { FileAnalyzedEvent . logger . log ( Level . SEVERE , "Error<seq2seq4repair_space>doing<seq2seq4repair_space>lazy<seq2seq4repair_space>load<seq2seq4repair_space>for<seq2seq4repair_space>remote<seq2seq4repair_space>event" , ex ) ; return null ; } } }

Fix:
long id = ( ( Long ) ( super . getOldValue ( ) ) ) ;
Buggy code:
public class RecoveredElement { public RecoveredElement parent ; public int bracketBalance ; public boolean foundOpeningBrace ; protected Parser recoveringParser ; public RecoveredElement ( RecoveredElement parent , int bracketBalance ) { } public RecoveredElement ( RecoveredElement parent , int bracketBalance , Parser parser ) { } public RecoveredElement add ( AbstractMethodDeclaration methodDeclaration , int bracketBalance ) { } public RecoveredElement add ( Block nestedBlockDeclaration , int bracketBalance ) { } public RecoveredElement add ( FieldDeclaration fieldDeclaration , int bracketBalance ) { } public RecoveredElement add ( ImportReference importReference , int bracketBalance ) { } public RecoveredElement add ( LocalDeclaration localDeclaration , int bracketBalance ) { } public RecoveredElement add ( Statement statement , int bracketBalance ) { } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalance ) { } public int depth ( ) { } public RecoveredInitializer enclosingInitializer ( ) { } public RecoveredMethod enclosingMethod ( ) { } public RecoveredType enclosingType ( ) { } public Parser parser ( ) { } public AstNode parseTree ( ) { } public void preserveEnclosingBlocks ( ) { } public int previousAvailableLineEnd ( int position ) { Parser parser = this . parser ( ) ; if ( parser == null ) return position ; Scanner scanner = parser . scanner ; if ( ( scanner . lineEnds ) == null ) return position ; <START_BUG> int index = scanner . searchLineNumber ( position ) ; <END_BUG> if ( index < 2 ) return position ; int previousLineEnd = scanner . lineEnds [ ( index - 2 ) ] ; char [ ] source = scanner . source ; for ( int i = previousLineEnd + 1 ; i < position ; i ++ ) { if ( ! ( ( ( source [ i ] ) == '<seq2seq4repair_space>' ) || ( ( source [ i ] ) == '\t' ) ) ) return position ; } return previousLineEnd ; } public int sourceEnd ( ) { } protected String tabString ( int tab ) { } public RecoveredElement topElement ( ) { } public String toString ( ) { } public String toString ( int tab ) { } public RecoveredType type ( ) { } public void updateBodyStart ( int bodyStart ) { } public void updateFromParserState ( ) { } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { } public RecoveredElement updateOnOpeningBrace ( int braceEnd ) { } public void updateParseTree ( ) { } public void updateSourceEndIfNecessary ( int sourceEnd ) { } }

Fix:
int index = scanner . getLineNumber ( position ) ;
Buggy code:
public class EmbeddedDatabaseFactory { private static Log logger = LogFactory . getLog ( EmbeddedDatabaseFactory . class ) ; private String databaseName ; private DataSourceFactory dataSourceFactory ; private EmbeddedDatabaseConfigurer databaseConfigurer ; private DatabasePopulator databasePopulator ; private EmbeddedDatabase database ; public EmbeddedDatabaseFactory ( ) { } public void setDatabaseName ( String name ) { } public void setDatabaseType ( EmbeddedDatabaseType type ) { } public void setDatabaseConfigurer ( EmbeddedDatabaseConfigurer configurer ) { } public void setDatabasePopulator ( DatabasePopulator populator ) { <START_BUG> Assert . notNull ( populator , "The<seq2seq4repair_space>TestDatabasePopulator<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; <END_BUG> databasePopulator = populator ; } public void setDataSourceFactory ( DataSourceFactory dataSourceFactory ) { } public EmbeddedDatabase getDatabase ( ) { } private void initDatabase ( ) { } private DataSource createDataSource ( ) { } private void populateDatabase ( ) { } class EmbeddedDataSourceProxy implements EmbeddedDatabase { private DataSource dataSource ; public EmbeddedDataSourceProxy ( DataSource dataSource ) { } public Connection getConnection ( ) throws SQLException { } public Connection getConnection ( String username , String password ) throws SQLException { } public int getLoginTimeout ( ) throws SQLException { } public PrintWriter getLogWriter ( ) throws SQLException { } public void setLoginTimeout ( int seconds ) throws SQLException { } public void setLogWriter ( PrintWriter out ) throws SQLException { } public boolean isWrapperFor ( Class < ? > iface ) throws SQLException { } public < T > T unwrap ( Class < T > iface ) throws SQLException { } public void shutdown ( ) { } } private void shutdownDatabase ( ) { } }

Fix:
Assert . notNull ( populator , "The<seq2seq4repair_space>DatabasePopulator<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ;