nus-yam/ex-repair huggingface dataset:
Buggy code:
public final class StringsTest extends TestCase { public void test ( ) { } public void testBeforeFirst ( ) { } public void testAfterFirst ( ) { } public void testAfterLast ( ) { } public void testBeforeLastPathComponent ( ) { } public void testCapitalize ( ) { } public void testEscapeMarkup ( ) { } public void testEscapeMarkupWhiteSpace ( ) { } public void testEscapeMarkupUnicode ( ) throws UnsupportedEncodingException { } public void testReplaceHtmlEscapeNumber ( ) throws UnsupportedEncodingException { } private String convertNonASCIIString ( String str ) throws UnsupportedEncodingException { } public void testFirstPathComponent ( ) { } public void testIsEmpty ( ) { } public void testIsTrue ( ) throws StringValueConversionException { } public void testReplaceAll ( ) { } public void testSplit ( ) { } public void testStripEnding ( ) { } public void testToBoolean ( ) throws StringValueConversionException { } public void testToChar ( ) throws StringValueConversionException { } public void testToMultilineMarkup ( ) { } public void testToString ( ) { assertNull ( Strings . toString ( ( ( Object ) ( null ) ) ) ) ; assertEquals ( "" , Strings . toString ( "" ) ) ; assertEquals ( "<Null<seq2seq4repair_space>Throwable>" , Strings . toString ( null ) ) ; try { throw new IllegalArgumentException ( "Foo" ) ; } catch ( IllegalArgumentException e ) { final String toString = Strings . toString ( ( ( Object ) ( e ) ) ) ; String before = Strings . beforeFirst ( toString , '\n' ) . trim ( ) ; <START_BUG> assertEquals ( "Root<seq2seq4repair_space>cause:" , before ) ; <END_BUG> } } public void testToStringThrowable ( ) { } private void assertEquals ( String [ ] expected , String [ ] actual ) { } private String stringValue ( String [ ] arrayOfStrings ) { } }

Fix:
assertEquals ( "Message:<seq2seq4repair_space>Foo" , before ) ;
Buggy code:
public class DatabaseConnector { private static ArrayList < Connection > connections ; private static int maxNumberOfConnections ; public static DatabaseConnector . DbConnectionParameters connectionParameters ; public static class DbConnectionParameters { public String host = Secrets . HANA_IP_VPN ; public int port = Secrets . HANA_PORT ; public String dbName = "" ; public String userName = Secrets . HANA_USER ; public String password = Secrets . HANA_PASSWORD ; public String defaultSchema = "Meetup" ; public DbConnectionParameters ( ) { } public DbConnectionParameters ( String host , int port , String dbName , String userName , String password , String defaultSchema ) { } public DbConnectionParameters ( String host , int port , String dbName , String userName , String password ) { } public DbConnectionParameters ( String host , String dbName , String password , String defaultSchema ) { } public DbConnectionParameters ( String host , String dbName , String password ) { } public String getHost ( ) { } public void setHost ( String host ) { } public int getPort ( ) { } public void setPort ( int port ) { } public String getDbName ( ) { } public void setDbName ( String dbName ) { } public String getUserName ( ) { } public void setUserName ( String userName ) { } public String getPassword ( ) { } public void setPassword ( String password ) { } public String getDefaultSchema ( ) { } public void setDefaultSchema ( String defaultSchema ) { } } public static void setup ( DatabaseConnector . DbConnectionParameters connectionParameters , int maximumNumberOfConnections ) { } public static void setup ( int maximumNumberOfConnections ) { } public static Connection getNewConnection ( ) throws ClassNotFoundException , SQLException { if ( ( ( DatabaseConnector . connectionParameters ) == null ) || ( ( DatabaseConnector . connections . size ( ) ) >= ( DatabaseConnector . maxNumberOfConnections ) ) ) { <START_BUG> return null ; <END_BUG> } Class . forName ( "com.sap.db.jdbc.Driver" ) ; String url ; url = ( ( ( ( ( "jdbc:sap:////" + ( DatabaseConnector . connectionParameters . host ) ) + ":" ) + ( DatabaseConnector . connectionParameters . port ) ) + "//" ) + ( DatabaseConnector . connectionParameters . dbName ) ) + ";" ; Connection connection = DriverManager . getConnection ( url , DatabaseConnector . connectionParameters . userName , DatabaseConnector . connectionParameters . password ) ; if ( connection != null ) { DatabaseConnector . connections . add ( connection ) ; } Statement schemaStmt = connection . createStatement ( ) ; schemaStmt . execute ( "SET<seq2seq4repair_space>SCHEMA<seq2seq4repair_space>MEETUP" ) ; return connection ; } public static void closeConnection ( Connection connection ) throws SQLException { } No newline ; at end ; of file ; }

Fix:
throw new IllegalStateException ( ( "Can't<seq2seq4repair_space>create<seq2seq4repair_space>new<seq2seq4repair_space>connection,<seq2seq4repair_space>have<seq2seq4repair_space>" + ( DatabaseConnector . connections . size ( ) ) ) ) ;
Buggy code:
public class OutboxFolder extends CachedMHFolder { private SendListManager [ ] sendListManager = new SendListManager [ 2 ] ; private int actSender ; private boolean isSending ; protected OutboxFolder . OutboxHeaderCache cache ; public OutboxFolder ( FolderItem item ) { } public AbstractHeaderCache getHeaderCacheInstance ( ) { } public ColumbaMessage getMessage ( Object uid ) throws Exception { if ( ( aktMessage ) != null ) { if ( aktMessage . getUID ( ) . equals ( uid ) ) { <START_BUG> log . info ( "using<seq2seq4repair_space>already<seq2seq4repair_space>cached<seq2seq4repair_space>message.." ) ; <END_BUG> return aktMessage ; } } String source = getMessageSource ( uid ) ; ColumbaMessage message = new ColumbaMessage ( MessageParser . parse ( new CharSequenceSource ( source ) ) ) ; message . setUID ( uid ) ; SendableHeader header = ( ( SendableHeader ) ( getHeaderList ( ) . get ( uid ) ) ) ; SendableMessage sendableMessage = new SendableMessage ( ) ; sendableMessage . setHeader ( header ) ; sendableMessage . setMimePartTree ( message . getMimePartTree ( ) ) ; sendableMessage . setStringSource ( source ) ; aktMessage = sendableMessage ; return sendableMessage ; } private void swapListManagers ( ) throws Exception { } public void stoppedSending ( ) { } public void save ( ) throws Exception { } public boolean supportsAddMessage ( ) { } class OutboxHeaderCache extends LocalHeaderCache { public OutboxHeaderCache ( CachedFolder folder ) { } public ColumbaHeader createHeaderInstance ( ) { } protected void loadHeader ( ColumbaHeader h ) throws Exception { } protected void saveHeader ( ColumbaHeader h ) throws Exception { } } }

Fix:
log . fine ( "using<seq2seq4repair_space>already<seq2seq4repair_space>cached<seq2seq4repair_space>message.." ) ;
Buggy code:
public class ASTNodeFinder { private CompilationUnitDeclaration unit ; public ASTNodeFinder ( CompilationUnitDeclaration unit ) { } public FieldDeclaration findField ( IField fieldHandle ) { } public Initializer findInitializer ( IInitializer initializerHandle ) { } public AbstractMethodDeclaration findMethod ( IMethod methodHandle ) { TypeDeclaration typeDecl = findType ( ( ( IType ) ( methodHandle . getParent ( ) ) ) ) ; if ( typeDecl == null ) return null ; AbstractMethodDeclaration [ ] methods = typeDecl . methods ; if ( methods != null ) { char [ ] selector = methodHandle . getElementName ( ) . toCharArray ( ) ; String [ ] parameterTypeSignatures = methodHandle . getParameterTypes ( ) ; int parameterCount = parameterTypeSignatures . length ; nextMethod : for ( int i = 0 , length = methods . length ; i < length ; i ++ ) { AbstractMethodDeclaration method = methods [ i ] ; if ( CharOperation . equals ( selector , method . selector ) ) { Argument [ ] args = method . arguments ; if ( ( args != null ) && ( ( args . length ) == parameterCount ) ) { for ( int j = 0 ; j < parameterCount ; j ++ ) { TypeReference type = args [ j ] . type ; <START_BUG> String signature = org . eclipse . jdt . internal . core . Util . typeSignature ( type ) ; <END_BUG> if ( ! ( signature . equals ( parameterTypeSignatures [ j ] ) ) ) { continue nextMethod ; } } return method ; } } } } return null ; } public TypeDeclaration findType ( IType typeHandle ) { } }

Fix:
String signature = Util . typeSignature ( type ) ;
Buggy code:
public class Java8StreamTest { static NullOutputStream nout = new NullOutputStream ( ) ; static long start = 0 ; static long end = 0 ; static long elapsed = 0 ; static double e = 0.0 ; static double [ ] t = new double [ 100 ] ; static DescriptiveStatistics d = new DescriptiveStatistics ( ) ; static double min = 0 ; static double max = 0 ; static double mean = 0 ; static double stddev = 0 ; public static void runtest ( Boolean x ) { } public static void main ( String [ ] args ) { boolean p = false ; if ( ( args . length ) > 0 ) { p = true ; } System . out . println ( "Java8<seq2seq4repair_space>Stream<seq2seq4repair_space>Test" ) ; <START_BUG> for ( int j = 0 ; j < 100 ; j ++ ) { <END_BUG> Java8StreamTest . runtest ( false ) ; } for ( int j = 0 ; j < 100 ; j ++ ) { Java8StreamTest . runtest ( p ) ; Java8StreamTest . t [ j ] = Java8StreamTest . e ; } for ( int j = 0 ; j < 100 ; j ++ ) { Java8StreamTest . d . addValue ( Java8StreamTest . t [ j ] ) ; } Java8StreamTest . min = Java8StreamTest . d . getMin ( ) ; Java8StreamTest . max = Java8StreamTest . d . getMax ( ) ; Java8StreamTest . mean = Java8StreamTest . d . getMean ( ) ; Java8StreamTest . stddev = Java8StreamTest . d . getStandardDeviation ( ) ; System . out . println ( ) ; System . out . printf ( "min<seq2seq4repair_space>=<seq2seq4repair_space>%.2f<seq2seq4repair_space>ns\n" , Java8StreamTest . min ) ; System . out . printf ( "max<seq2seq4repair_space>=<seq2seq4repair_space>%.2f<seq2seq4repair_space>ns\n" , Java8StreamTest . max ) ; System . out . printf ( "mean<seq2seq4repair_space>=<seq2seq4repair_space>%.2f<seq2seq4repair_space>ns\n" , Java8StreamTest . mean ) ; System . out . printf ( "stddev<seq2seq4repair_space>=<seq2seq4repair_space>%.2f<seq2seq4repair_space>ns\n" , Java8StreamTest . stddev ) ; } }

Fix:
for ( int j = 0 ; j < 3 ; j ++ ) {
Buggy code:
public class StrLookupTest extends TestCase { public void testNoneLookup ( ) { } public void testSystemProperiesLookup ( ) { } public void testMapLookup ( ) { Map < String , Object > map = new HashMap < String , Object > ( ) ; map . put ( "key" , "value" ) ; <START_BUG> map . put ( "number" , new Integer ( 2 ) ) ; <END_BUG> assertEquals ( "value" , StrLookup . mapLookup ( map ) . lookup ( "key" ) ) ; assertEquals ( "2" , StrLookup . mapLookup ( map ) . lookup ( "number" ) ) ; assertEquals ( null , StrLookup . mapLookup ( map ) . lookup ( null ) ) ; assertEquals ( null , StrLookup . mapLookup ( map ) . lookup ( "" ) ) ; assertEquals ( null , StrLookup . mapLookup ( map ) . lookup ( "other" ) ) ; } public void testMapLookup_nullMap ( ) { } }

Fix:
map . put ( "number" , Integer . valueOf ( 2 ) ) ;
Buggy code:
public class UsersApi extends BaseApi { private static final String TAG = UsersApi . class . getSimpleName ( ) ; @ Inject public UsersApi ( Context context ) { } public String awaitAccessToken ( String foursquareAuthorizationCode ) { <START_BUG> String url = new Uri . Builder ( ) . scheme ( getString ( gf_api_host_scheme ) ) . encodedAuthority ( getString ( gf_api_host ) ) . appendEncodedPath ( getString ( gf_api_path ) ) . appendEncodedPath ( getString ( gf_api_app_users_path ) ) . appendEncodedPath ( getString ( gf_api_app_users_register_with_foursquare_path ) ) . appendQueryParameter ( "foursquare-authorization-code" , foursquareAuthorizationCode ) . build ( ) . toString ( ) ; <END_BUG> String json = RequestBuilder . newInstance ( url ) . setMethod ( GET ) . setHeader ( ACCEPT , APPLICATION_JSON . getMimeType ( ) ) . setHeader ( ACCEPT_LANGUAGE , getClientAcceptLanguage ( ) ) . setHeader ( ACCEPT_CHARSET , UTF_8 . getValue ( ) ) . makeForResult ( ) ; if ( json != null ) { ApiResponse < AccessToken > apiResponse = parse ( json , AccessToken . class ) ; if ( ( apiResponse . getError ( ) ) == null ) return apiResponse . getResponse ( ) . getToken ( ) ; else { Log . e ( UsersApi . TAG , ( "Response<seq2seq4repair_space>error<seq2seq4repair_space>->" + ( apiResponse . getError ( ) ) ) ) ; throw new ApiException ( apiResponse . getError ( ) . getErrorMessage ( ) ) ; } } else { Log . e ( UsersApi . TAG , "Null<seq2seq4repair_space>response" ) ; throw new ApiException ( getString ( grayfox_api_request_error ) ) ; } } public User awaitSelfUser ( String accessToken ) { } No newline ; at end ; of file ; }

Fix:
String url = new Uri . Builder ( ) . scheme ( getString ( gf_api_host_scheme ) ) . encodedAuthority ( getString ( gf_api_host ) ) . appendEncodedPath ( getString ( gf_api_path ) ) . appendEncodedPath ( getString ( gf_api_app_users_path ) ) . appendEncodedPath ( getString ( gf_api_app_users_register_with_foursquare_path ) ) . appendQueryParameter ( "authorization-code" , foursquareAuthorizationCode ) . build ( ) . toString ( ) ;
Buggy code:
public class RestAPI extends ModelMaker { public void init ( ClubApplication app ) { Spark . get ( "//protected//hello" , ( request , response ) -> { String name = getUser ( request ) . getName ( ) . getFullName ( ) ; <START_BUG> return ( "Hello<seq2seq4repair_space>" + name ) + "!" ; <END_BUG> } ) ; } }

Fix:
return ( "Hello<seq2seq4repair_space>" + name ) + "!<seq2seq4repair_space>You<seq2seq4repair_space>need<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>invited<seq2seq4repair_space>to<seq2seq4repair_space>use<seq2seq4repair_space>this<seq2seq4repair_space>application." ;
Buggy code:
public class SlidingWindowMinAccumulator extends AbstractSlidingWindowAccumulator { public SlidingWindowMinAccumulator ( final int windowSize ) { } @ Override public Double getResult ( ) { <START_BUG> double min = Double . MAX_VALUE ; <END_BUG> synchronized ( fifo ) { for ( Object o : fifo ) { min = Math . min ( min , ( ( Double ) ( o ) ) ) ; } } return ( fifo . size ( ) ) == 0 ? Double . NaN : min ; } }

Fix:
double min = Double . POSITIVE_INFINITY ;
Buggy code:
public class TestPersianAnalyzer extends BaseTokenStreamTestCase { public void testResourcesAvailable ( ) { } public void testBehaviorVerbs ( ) throws Exception { } public void testBehaviorVerbsDefective ( ) throws Exception { } public void testBehaviorNouns ( ) throws Exception { } public void testBehaviorNonPersian ( ) throws Exception { } public void testReusableTokenStream ( ) throws Exception { } public void testCustomStopwords ( ) throws Exception { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new PersianAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } }

Fix:
checkRandomData ( random ( ) , new PersianAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class ReconcileContext { private ReconcileWorkingCopyOperation operation ; private CompilationUnit workingCopy ; public ReconcileContext ( ReconcileWorkingCopyOperation operation , CompilationUnit workingCopy ) { } public org . eclipse . jdt . core . dom . CompilationUnit getAST3 ( ) throws JavaModelException { if ( ( ( this . operation . astLevel ) != ( AST . JLS3 ) ) || ( ! ( this . operation . resolveBindings ) ) ) { ASTParser parser = ASTParser . newParser ( AST . JLS3 ) ; parser . setCompilerOptions ( workingCopy . getJavaProject ( ) . getOptions ( true ) ) ; if ( JavaProject . hasJavaNature ( workingCopy . getJavaProject ( ) . getProject ( ) ) ) parser . setResolveBindings ( true ) ; parser . setStatementsRecovery ( ( ( ( this . operation . reconcileFlags ) & ( ICompilationUnit . ENABLE_STATEMENTS_RECOVERY ) ) != 0 ) ) ; parser . setBindingsRecovery ( ( ( ( this . operation . reconcileFlags ) & ( ICompilationUnit . ENABLE_BINDINGS_RECOVERY ) ) != 0 ) ) ; parser . setSource ( workingCopy ) ; return ( ( org . eclipse . jdt . core . dom . CompilationUnit ) ( parser . createAST ( this . operation . progressMonitor ) ) ) ; } <START_BUG> return this . operation . makeConsistent ( this . workingCopy , null ) ; <END_BUG> } public int getASTLevel ( ) { } public boolean isResolvingBindings ( ) { } public IJavaElementDelta getDelta ( ) { } public CategorizedProblem [ ] getProblems ( String markerType ) { } public ICompilationUnit getWorkingCopy ( ) { } public void resetAST ( ) { } public void putProblems ( String markerType , CategorizedProblem [ ] problems ) { } }

Fix:
return this . operation . makeConsistent ( this . workingCopy ) ;
Buggy code:
public class DiscoverUtility { private static Logger log = Logger . getLogger ( DiscoverUtility . class ) ; public static DSpaceObject getSearchScope ( Context context , HttpServletRequest request ) throws IllegalStateException , SQLException { } public static DiscoverQuery getDiscoverQuery ( Context context , HttpServletRequest request , DSpaceObject scope , boolean enableFacet ) { } public static DiscoverQuery getDiscoverAutocomplete ( Context context , HttpServletRequest request , DSpaceObject scope ) { } private static List < String > setupBasicQuery ( Context context , DiscoveryConfiguration discoveryConfiguration , HttpServletRequest request , DiscoverQuery queryArgs ) { String query = request . getParameter ( "query" ) ; if ( StringUtils . isNotBlank ( query ) ) { queryArgs . setQuery ( query ) ; } List < String > defaultFilterQueries = discoveryConfiguration . getDefaultFilterQueries ( ) ; if ( defaultFilterQueries != null ) { for ( String f : defaultFilterQueries ) { <START_BUG> queryArgs . addFacetQuery ( f ) ; <END_BUG> } } List < String [ ] > filters = DiscoverUtility . getFilters ( request ) ; List < String > userFilters = new ArrayList < String > ( ) ; for ( String [ ] f : filters ) { try { String newFilterQuery = SearchUtils . getSearchService ( ) . toFilterQuery ( context , f [ 0 ] , f [ 1 ] , f [ 2 ] ) . getFilterQuery ( ) ; if ( newFilterQuery != null ) { queryArgs . addFilterQueries ( newFilterQuery ) ; userFilters . add ( newFilterQuery ) ; } } catch ( SQLException e ) { DiscoverUtility . log . error ( LogManager . getHeader ( context , "Error<seq2seq4repair_space>in<seq2seq4repair_space>discovery<seq2seq4repair_space>while<seq2seq4repair_space>setting<seq2seq4repair_space>up<seq2seq4repair_space>user<seq2seq4repair_space>facet<seq2seq4repair_space>query" , ( ( ( ( ( "filter_field:<seq2seq4repair_space>" + ( f [ 0 ] ) ) + ",filter_type:" ) + ( f [ 1 ] ) ) + ",filer_value:" ) + ( f [ 2 ] ) ) ) , e ) ; } } return userFilters ; } private static void setPagination ( HttpServletRequest request , DiscoverQuery queryArgs , DiscoveryConfiguration discoveryConfiguration ) { } private static void setFacet ( Context context , HttpServletRequest request , DSpaceObject scope , DiscoverQuery queryArgs , DiscoveryConfiguration discoveryConfiguration , List < String > userFilters ) { } public static List < String [ ] > getFilters ( HttpServletRequest request ) { } }

Fix:
queryArgs . addFilterQueries ( f ) ;
Buggy code:
public class PackageFragmentRoot extends Openable implements IPackageFragmentRoot { protected IResource fResource ; protected PackageFragmentRoot ( IResource resource , IJavaProject project ) { } protected PackageFragmentRoot ( IResource resource , IJavaProject project , String path ) { } public void attachSource ( IPath zipPath , IPath rootPath , IProgressMonitor monitor ) throws JavaModelException { } protected boolean computeChildren ( OpenableElementInfo info ) throws JavaModelException { } protected void computeFolderChildren ( IContainer folder , String prefix , ArrayList vChildren ) throws JavaModelException { } protected OpenableElementInfo createElementInfo ( ) { } public IPackageFragment createPackageFragment ( String name , boolean force , IProgressMonitor monitor ) throws JavaModelException { } protected int determineKind ( IResource underlyingResource ) throws JavaModelException { } public boolean equals ( Object o ) { } public boolean exists ( ) { } <START_BUG> protected boolean generateInfos ( OpenableElementInfo info , IProgressMonitor pm , Map newElements , IResource underlyingResource , IProblemRequestor problemRequestor ) throws JavaModelException { <END_BUG> ( ( PackageFragmentRootInfo ) ( info ) ) . setRootKind ( determineKind ( underlyingResource ) ) ; return computeChildren ( info ) ; } protected char getHandleMementoDelimiter ( ) { } public int getKind ( ) throws JavaModelException { } public Object [ ] getNonJavaResources ( ) throws JavaModelException { } public IPackageFragment getPackageFragment ( String packageName ) { } protected String getPackageName ( IFolder folder ) throws JavaModelException { } public IPath getPath ( ) { } public IClasspathEntry getRawClasspathEntry ( ) throws JavaModelException { } public IResource getResource ( ) { } public IPath getSourceAttachmentPath ( ) throws JavaModelException { } public IPath getSourceAttachmentRootPath ( ) throws JavaModelException { } public IResource getUnderlyingResource ( ) throws JavaModelException { } public int hashCode ( ) { } public boolean isArchive ( ) { } public boolean isExternal ( ) { } protected boolean isOnClasspath ( ) { } protected void openWhenClosed ( IProgressMonitor pm , IBuffer buffer ) throws JavaModelException { } public void refreshChildren ( ) { } public IJavaElement rootedAt ( IJavaProject project ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } }

Fix:
protected boolean generateInfos ( OpenableElementInfo info , IProgressMonitor pm , Map newElements , IResource underlyingResource ) throws JavaModelException {
Buggy code:
public class Matrix { private StringProperty name ; private final IntegerProperty numRows ; private final IntegerProperty numCols ; private final ObjectProperty < LocalDate > createdDate ; private ObjectProperty < double [ ] [ ] > data ; public Matrix ( ) { } public Matrix ( String name , double [ ] [ ] data ) { } public String getName ( ) { } public void setName ( String name ) { } public StringProperty nameProperty ( ) { } public int getNumRows ( ) { } public void setNumRows ( int numRows ) { } public IntegerProperty numRowsProperty ( ) { } public int getNumCols ( ) { } public void setNumCols ( int numCols ) { } public IntegerProperty numColsProperty ( ) { } public LocalDate getCreatedDate ( ) { } public void setCreatedDate ( LocalDate createdDate ) { } public ObjectProperty < LocalDate > createdDateProperty ( ) { } public double [ ] [ ] getData ( ) { } public double [ ] getRow ( int row ) { } public double getCell ( int row , int col ) { } public boolean save ( ) { String [ ] buffer = new String [ ( this . numRows . get ( ) ) + 3 ] ; buffer [ 0 ] = this . name . get ( ) ; buffer [ 1 ] = this . createdDate . get ( ) . toString ( ) ; buffer [ 2 ] = ( ( this . numRows . get ( ) ) + "," ) + ( this . numCols . get ( ) ) ; for ( int i = 3 ; i < ( ( this . numRows . get ( ) ) + 3 ) ; ++ i ) { StringBuilder line = new StringBuilder ( ) ; double [ ] row = this . getRow ( ( i - 3 ) ) ; for ( double val : row ) { line . append ( val ) ; line . append ( "," ) ; } buffer [ i ] = line . toString ( ) ; } try { File matrixFile = new File ( ( ( ".//" + ( this . name . get ( ) ) ) + ".matrix" ) ) ; if ( ! ( matrixFile . exists ( ) ) ) { matrixFile . createNewFile ( ) ; } FileWriter fw = new FileWriter ( matrixFile . getAbsoluteFile ( ) ) ; BufferedWriter bw = new BufferedWriter ( fw ) ; for ( String line : buffer ) { <START_BUG> bw . append ( line ) ; <END_BUG> } bw . close ( ) ; return true ; } catch ( IOException e ) { e . printStackTrace ( ) ; return false ; } } }

Fix:
bw . append ( ( line + "\n" ) ) ;
Buggy code:
public class TracerouteListAdapter extends ArrayAdapter < Traceroute > { private Context context ; private Traceroute [ ] values ; public TracerouteListAdapter ( Context context , Traceroute [ ] values ) { } public View getView ( int pos , View convertView , ViewGroup parent ) { LayoutInflater inflater = ( ( LayoutInflater ) ( context . getSystemService ( context . LAYOUT_INFLATER_SERVICE ) ) ) ; View rowView = inflater . inflate ( row_traceroute , parent , false ) ; TextView hop_number = ( ( TextView ) ( rowView . findViewById ( traceroute_number ) ) ) ; TextView address = ( ( TextView ) ( rowView . findViewById ( traceroute_address ) ) ) ; TextView address_name = ( ( TextView ) ( rowView . findViewById ( traceroute_address_name ) ) ) ; TextView time = ( ( TextView ) ( rowView . findViewById ( traceroute_time ) ) ) ; <START_BUG> if ( ( ( values [ pos ] . getIpAddr ( ) . length ( ) ) > 0 ) || ( ( values [ pos ] . getHostname ( ) . length ( ) ) > 0 ) ) { <END_BUG> hop_number . setText ( Integer . toString ( values [ pos ] . getHopnumber ( ) ) ) ; address . setText ( values [ pos ] . getIpAddr ( ) ) ; address_name . setText ( values [ pos ] . getHostname ( ) ) ; time . setText ( values [ pos ] . getRtt ( ) ) ; } return rowView ; } }

Fix:
if ( ( values [ pos ] . getHostname ( ) . length ( ) ) > 0 ) {
Buggy code:
public class GuiOverlay extends Gui { private Minecraft mc ; private RenderItem itemRenderer ; public static final ResourceLocation texture = new ResourceLocation ( TransformersMod . modid , "textures//gui//mod_icons.png" ) ; public static double speed ; public GuiOverlay ( Minecraft mc ) { } @ SubscribeEvent @ SideOnly ( Side . CLIENT ) public void onRender ( RenderGameOverlayEvent . Pre event ) { int width = event . resolution . getScaledWidth ( ) ; int height = event . resolution . getScaledHeight ( ) ; EntityPlayer player = mc . thePlayer ; <START_BUG> if ( ( ( event . type ) == ( ElementType . JUMPBAR ) ) || ( ( event . type ) == ( ElementType . HOTBAR ) ) ) { <END_BUG> renderNitroAndSpeed ( event , width , height , player ) ; renderKatanaDash ( event , width , height , player ) ; renderShotsLeft ( event , width , height , player ) ; } } public void renderNitroAndSpeed ( RenderGameOverlayEvent . Pre event , int width , int height , EntityPlayer player ) { } public void renderShotsLeft ( RenderGameOverlayEvent . Pre event , int width , int height , EntityPlayer player ) { } public void renderKatanaDash ( RenderGameOverlayEvent . Pre event , int width , int height , EntityPlayer player ) { } public void renderCrossbowAmmo ( RenderGameOverlayEvent . Pre event , int width , int height , EntityPlayer player ) { } No newline ; at end ; of file ; }

Fix:
if ( ( event . type ) == ( ElementType . HOTBAR ) ) {
Buggy code:
public class HeadersMenu extends IMenu implements ActionListener , Observer { private XmlElement element ; private JRadioButtonMenuItem defaultMenuItem ; private JRadioButtonMenuItem customMenuItem ; private JRadioButtonMenuItem allMenuItem ; public HeadersMenu ( FrameMediator controller ) { } public void actionPerformed ( ActionEvent e ) { } public void update ( Observable arg0 , Object arg1 ) { IDefaultItem item = new org . columba . core . config . DefaultItem ( element ) ; <START_BUG> int style = item . getInteger ( "style" , 0 ) ; <END_BUG> switch ( style ) { case 0 : defaultMenuItem . setSelected ( true ) ; break ; case 1 : customMenuItem . setSelected ( true ) ; break ; case 2 : allMenuItem . setSelected ( true ) ; break ; } } }

Fix:
int style = item . getIntegerWithDefault ( "style" , 0 ) ;
Buggy code:
public class PrefixLevel1NameBufferLevel1TypeCompletionTestCase extends AbstractGeneratedAddressCompleterTest { @ Test public void testStringValues ( ) { assertAllCandidates ( Arrays . asList ( "last3" , "link3" , "other3" ) ) ; assertSelectedCandidates ( Arrays . asList ( "last3" , "link3" ) ) ; assertBufferPrefix ( ".//" ) ; <START_BUG> assertContextPrefix ( "link1=link2" ) ; <END_BUG> } @ Override protected int getPrefixLevel ( ) { } }

Fix:
assertContextPrefix ( "//link1=link2" ) ;
Buggy code:
public class DotExporter { public static Dot convert ( Network network ) { Dot dot = new Dot ( "network" , true ) ; for ( PhysicalEntity physicalEntity : network . getPhysicalEntities ( ) ) { dot . addNode ( new Node ( physicalEntity . getId ( ) , new HashMap ( ) ) ) ; } for ( Interaction interaction : network . getInteractions ( ) ) { dot . addNode ( new Node ( interaction . getId ( ) , new HashMap ( ) ) ) ; } for ( Interaction interaction : network . getInteractions ( ) ) { switch ( interaction . getType ( ) ) { case REACTION : Reaction reaction = ( ( Reaction ) ( interaction ) ) ; for ( String product : reaction . getProducts ( ) ) { dot . addEdge ( new org . opencb . biodata . formats . graph . dot . Edge ( reaction . getId ( ) , product ) ) ; } for ( String reactant : reaction . getReactants ( ) ) { dot . addEdge ( new org . opencb . biodata . formats . graph . dot . Edge ( reactant , reaction . getId ( ) ) ) ; } break ; case CATALYSIS : Catalysis catalysis = ( ( Catalysis ) ( interaction ) ) ; for ( String controller : catalysis . getControllers ( ) ) { dot . addEdge ( new org . opencb . biodata . formats . graph . dot . Edge ( controller , catalysis . getId ( ) ) ) ; } for ( String process : catalysis . getControlledProcesses ( ) ) { dot . addEdge ( new org . opencb . biodata . formats . graph . dot . Edge ( catalysis . getId ( ) , process ) ) ; } break ; case REGULATION : Regulation regulation = ( ( Regulation ) ( interaction ) ) ; for ( String controller : regulation . getControllers ( ) ) { dot . addEdge ( new org . opencb . biodata . formats . graph . dot . Edge ( controller , regulation . getId ( ) ) ) ; } for ( String process : regulation . getControlledProcesses ( ) ) { dot . addEdge ( new org . opencb . biodata . formats . graph . dot . Edge ( regulation . getId ( ) , process ) ) ; } break ; case COLOCALIZATION : break ; default : break ; } } for ( PhysicalEntity physicalEntity : network . getPhysicalEntities ( ) ) { for ( Xref xref : physicalEntity . getXrefs ( ) ) { <START_BUG> String xrefName = ( ( xref . getSource ( ) ) + ":" ) + ( xref . getId ( ) ) ; <END_BUG> dot . addNode ( new Node ( xrefName , new HashMap ( ) ) ) ; dot . addEdge ( new org . opencb . biodata . formats . graph . dot . Edge ( xrefName , physicalEntity . getId ( ) ) ) ; } } for ( PhysicalEntity physicalEntity : network . getPhysicalEntities ( ) ) { for ( CellularLocation cellularLocation : physicalEntity . getCellularLocation ( ) ) { dot . addNode ( new Node ( cellularLocation . getName ( ) , new HashMap ( ) ) ) ; dot . addEdge ( new org . opencb . biodata . formats . graph . dot . Edge ( cellularLocation . getName ( ) , physicalEntity . getId ( ) ) ) ; for ( Ontology ontology : cellularLocation . getOntologies ( ) ) { String ontologyName = ( ( ontology . getSource ( ) ) + ":" ) + ( ontology . getId ( ) ) ; dot . addNode ( new Node ( ontologyName , new HashMap ( ) ) ) ; dot . addEdge ( new org . opencb . biodata . formats . graph . dot . Edge ( ontologyName , cellularLocation . getName ( ) ) ) ; } } } return dot ; } }

Fix:
String xrefName = ( ( xref . getSource ( ) ) + "_" ) + ( xref . getId ( ) ) ;
Buggy code:
public class JUnitCoreTest { public static class Fail { @ Test public void kaboom ( ) { } } @ Test public void failureCausesExitCodeOf1 ( ) throws Exception { } @ Test public void missingClassCausesExitCodeOf1 ( ) throws Exception { } public static class Succeed { @ Test public void peacefulSilence ( ) { } } @ Test public void successCausesExitCodeOf0 ( ) throws Exception { } private void runClass ( String className , int returnCode ) throws IOException , InterruptedException { String java = ( ( ( ( System . getProperty ( "java.home" ) ) + ( File . separator ) ) + "bin" ) + ( File . separator ) ) + "java" ; <START_BUG> String classPath = ( ( getClass ( ) . getClassLoader ( ) . getResource ( "." ) . getFile ( ) ) + ";" ) + ( System . getProperty ( "java.class.path" ) ) ; <END_BUG> String [ ] cmd = new String [ ] { java , "-cp" , classPath , "org.junit.runner.JUnitCore" , className } ; Process process = Runtime . getRuntime ( ) . exec ( cmd ) ; InputStream input = process . getInputStream ( ) ; while ( ( input . read ( ) ) != ( - 1 ) ) ; assertEquals ( returnCode , process . waitFor ( ) ) ; } public static Test suite ( ) { } }

Fix:
String classPath = ( ( getClass ( ) . getClassLoader ( ) . getResource ( "." ) . getFile ( ) ) + ( File . pathSeparator ) ) + ( System . getProperty ( "java.class.path" ) ) ;
Buggy code:
public class Memtable implements Comparable < Memtable > , IFlushable { private static final Logger logger = LoggerFactory . getLogger ( Memtable . class ) ; private boolean isFrozen ; private final int THRESHOLD = ( ( DatabaseDescriptor . getMemtableThroughput ( ) ) * 1024 ) * 1024 ; private final int THRESHOLD_COUNT = ( ( int ) ( ( ( DatabaseDescriptor . getMemtableOperations ( ) ) * 1024 ) * 1024 ) ) ; private final AtomicInteger currentThroughput = new AtomicInteger ( 0 ) ; private final AtomicInteger currentOperations = new AtomicInteger ( 0 ) ; private final long creationTime ; private final ConcurrentNavigableMap < DecoratedKey , ColumnFamily > columnFamilies = new ConcurrentSkipListMap < DecoratedKey , ColumnFamily > ( ) ; private final IPartitioner partitioner ; private final ColumnFamilyStore cfs ; public Memtable ( ColumnFamilyStore cfs , IPartitioner partitioner ) { } public int compareTo ( Memtable rhs ) { } public int getCurrentThroughput ( ) { } public int getCurrentOperations ( ) { } boolean isThresholdViolated ( ) { } boolean isFrozen ( ) { } void freeze ( ) { } void put ( DecoratedKey key , ColumnFamily columnFamily ) { } private void resolve ( DecoratedKey key , ColumnFamily cf ) { } public String contents ( ) { } private SSTableReader writeSortedContents ( ) throws IOException { } public void flushAndSignal ( final CountDownLatch latch , ExecutorService sorter , final ExecutorService writer ) { } public String toString ( ) { } public Iterator < Map . Entry < DecoratedKey , ColumnFamily > > getEntryIterator ( DecoratedKey startWith ) { } public boolean isClean ( ) { } public String getTableName ( ) { <START_BUG> return cfs . getTable ( ) . name ; <END_BUG> } public static IColumnIterator getSliceIterator ( final DecoratedKey key , final ColumnFamily cf , SliceQueryFilter filter , AbstractType typeComparator ) { } public static IColumnIterator getNamesIterator ( final DecoratedKey key , final ColumnFamily cf , final NamesQueryFilter filter ) { } public ColumnFamily getColumnFamily ( DecoratedKey key ) { } void clearUnsafe ( ) { } public boolean isExpired ( ) { } }

Fix:
return cfs . table . name ;
Buggy code:
class XSDKeyrefTraverser extends XSDAbstractIDConstraintTraverser { public XSDKeyrefTraverser ( XSDHandler handler , XSAttributeChecker gAttrCheck ) { } void traverse ( Element krElem , XSElementDecl element , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) { Object [ ] attrValues = fAttrChecker . checkAttributes ( krElem , false , schemaDoc ) ; QName krName = ( ( QName ) ( attrValues [ XSAttributeChecker . ATTIDX_NAME ] ) ) ; String kName = ( ( String ) ( attrValues [ XSAttributeChecker . ATTIDX_REF ] ) ) ; UniqueOrKey key = ( ( UniqueOrKey ) ( fSchemaHandler . getGlobalDecl ( schemaDoc , IDENTITYCONSTRAINT_TYPE , krName ) ) ) ; if ( key == null ) { fAttrChecker . returnAttrArray ( attrValues , schemaDoc ) ; return ; } KeyRef keyRef = new KeyRef ( krName . localpart , key ) ; <START_BUG> traverseIdentityConstraint ( keyRef , krElem , schemaDoc ) ; <END_BUG> grammar . addIDConstraintDecl ( element , keyRef ) ; fAttrChecker . returnAttrArray ( attrValues , schemaDoc ) ; } }

Fix:
traverseIdentityConstraint ( keyRef , krElem , schemaDoc , attrValues ) ;
Buggy code:
class XSDUniqueOrKeyTraverser extends XSDAbstractIDConstraintTraverser { public XSDUniqueOrKeyTraverser ( XSDHandler handler , XSAttributeChecker gAttrCheck ) { } void traverse ( Element uElem , XSElementDecl element , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) { Object [ ] attrValues = fAttrChecker . checkAttributes ( uElem , false , schemaDoc ) ; String uName = ( ( String ) ( attrValues [ XSAttributeChecker . ATTIDX_NAME ] ) ) ; if ( uName == null ) { <START_BUG> reportSchemaError ( "s4s-att-must-appear" , new Object [ ] { DOMUtil . getLocalName ( uElem ) , SchemaSymbols . ATT_NAME } ) ; <END_BUG> fAttrChecker . returnAttrArray ( attrValues , schemaDoc ) ; return ; } UniqueOrKey uniqueOrKey = null ; if ( DOMUtil . getLocalName ( uElem ) . equals ( ELT_UNIQUE ) ) { uniqueOrKey = new UniqueOrKey ( uName , element . fName , IdentityConstraint . UNIQUE ) ; } else { uniqueOrKey = new UniqueOrKey ( uName , element . fName , IdentityConstraint . KEY ) ; } traverseIdentityConstraint ( uniqueOrKey , uElem , schemaDoc , attrValues ) ; grammar . addIDConstraintDecl ( element , uniqueOrKey ) ; fAttrChecker . returnAttrArray ( attrValues , schemaDoc ) ; } }

Fix:
reportSchemaError ( "s4s-att-must-appear" , new Object [ ] { DOMUtil . getLocalName ( uElem ) , SchemaSymbols . ATT_NAME } , uElem ) ;
Buggy code:
public class WicketLinkTagHandler extends BaseMarkupFilter implements IComponentResolver { private static final long serialVersionUID = 1L ; public static final String LINK = "link" ; public static final String AUTOLINK_ID = "_autolink_" ; private ArrayListStack < Boolean > autolinkStatus ; private boolean autolinking = true ; public WicketLinkTagHandler ( ) { } public void setAutomaticLinking ( final boolean enable ) { } @ Override protected final MarkupElement nextTag ( ComponentTag tag ) throws ParseException { } protected boolean analyzeAutolinkCondition ( final ComponentTag tag ) { } private final boolean checkRef ( String ref ) { } public Component resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { if ( tag instanceof WicketTag ) { WicketTag wtag = ( ( WicketTag ) ( tag ) ) ; if ( ( wtag . isLinkTag ( ) ) && ( ( wtag . getNamespace ( ) ) != null ) ) { <START_BUG> final String id = ( tag . getId ( ) ) + ( container . getPage ( ) . getAutoIndex ( ) ) ; <END_BUG> tag . setId ( id ) ; return new TransparentWebMarkupContainer ( id ) ; } } return null ; } }

Fix:
String id = ( ( tag . getId ( ) ) + "-" ) + ( container . getPage ( ) . getAutoIndex ( ) ) ;
Buggy code:
public class FromClause { private final ArrayList < Object > items ; private final boolean containsAtLeastOnePattern ; protected FromClause ( ) { } protected FromClause ( Collection < Object > items , boolean containsAtLeastOnePattern ) { } public static FromClause fromJsonExpression ( Object jsonExpression ) throws InvalidQueryException { } public List < Object > items ( ) { } public boolean isPotentiallyMissingAnyMetrics ( Set < String > metricNames ) { } public boolean matchesMetricName ( String metricName ) { for ( Object item : items ) { if ( item instanceof String ) { if ( metricName . equals ( item ) ) { return true ; } } else { Pattern pattern = ( ( Pattern ) ( item ) ) ; <START_BUG> if ( pattern . matcher ( metricName ) . matches ( ) ) { <END_BUG> return true ; } } } return false ; } public JsonArray findMatchingMetrics ( JsonArray metrics ) { } }

Fix:
if ( pattern . matcher ( metricName ) . find ( ) ) {
Buggy code:
public class ConfigurationAction extends ActionBase { static final Logger logger = Logger . getLogger ( ConfigurationAction . class ) ; static final String INTERNAL_DEBUG_ATTR = "debug" ; boolean attachment = false ; public void begin ( ExecutionContext ec , String name , Attributes attributes ) { String debugAttrib = attributes . getValue ( ConfigurationAction . INTERNAL_DEBUG_ATTR ) ; <START_BUG> if ( ( ( debugAttrib == null ) || ( debugAttrib . equals ( "" ) ) ) || ( debugAttrib . equals ( "null" ) ) ) { <END_BUG> getLogger ( ) . debug ( ( ( "Ignoring<seq2seq4repair_space>" + ( ConfigurationAction . INTERNAL_DEBUG_ATTR ) ) + "<seq2seq4repair_space>attribute." ) ) ; } else { LoggerRepository repository = ( ( LoggerRepository ) ( ec . getObject ( 0 ) ) ) ; ConfiguratorBase . attachTemporaryConsoleAppender ( repository ) ; getLogger ( ) . debug ( "Starting<seq2seq4repair_space>internal<seq2seq4repair_space>logs<seq2seq4repair_space>on<seq2seq4repair_space>console." ) ; attachment = true ; } } public void end ( ExecutionContext ec , String name ) { } }

Fix:
if ( ( ( ( debugAttrib == null ) || ( debugAttrib . equals ( "" ) ) ) || ( debugAttrib . equals ( "false" ) ) ) || ( debugAttrib . equals ( "null" ) ) ) {
Buggy code:
public class CreateQuizServlet extends HttpServlet { private static final long serialVersionUID = 1L ; public CreateQuizServlet ( ) { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { if ( ( request . getCharacterEncoding ( ) ) == null ) { request . setCharacterEncoding ( "UTF8" ) ; } ServletContext application = this . getServletContext ( ) ; QuizBank quizBank = ( ( QuizBank ) ( application . getAttribute ( "QuizBank" ) ) ) ; HttpSession session = request . getSession ( ) ; User user = ( ( User ) ( session . getAttribute ( "User" ) ) ) ; int id = 0 ; String quiz_name = request . getParameter ( "name" ) ; int creator = user . getUserID ( ) ; boolean random = ( ( request . getParameter ( "random" ) ) != null ) ? true : false ; boolean correct = ( ( request . getParameter ( "correction" ) ) != null ) ? true : false ; boolean multi = ( ( request . getParameter ( "multiple" ) ) != null ) ? true : false ; String description = request . getParameter ( "description" ) ; Date createdDate = null ; Quiz quiz = new Quiz ( id , quiz_name , creator , random , correct , multi , description , createdDate ) ; session . setAttribute ( "Quiz" , quiz ) ; session . setAttribute ( "QuestionNumber" , 1 ) ; <START_BUG> RequestDispatcher rd = request . getRequestDispatcher ( "CreateQuestion.html" ) ; <END_BUG> rd . forward ( request , response ) ; } }

Fix:
RequestDispatcher rd = request . getRequestDispatcher ( "CreateQuestion.jsp" ) ;
Buggy code:
@ Singleton @ Path ( "//session" ) public class Sessions { public Sessions ( AccountService accountService ) { } @ PUT @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public Response loginUser ( String jsonString , @ Context HttpHeaders headers ) { } @ GET @ Produces ( MediaType . APPLICATION_JSON ) public Response isAuthenticated ( @ Context HttpHeaders headers ) { } @ DELETE @ Produces ( MediaType . APPLICATION_JSON ) public Response logoutUser ( @ Context HttpHeaders headers ) { final String sessionID = TokenManager . getSIDStringFromHeaders ( headers ) ; if ( accountService . logoutUser ( sessionID ) ) return WebErrorManager . okRaw ( "You<seq2seq4repair_space>have<seq2seq4repair_space>succesfully<seq2seq4repair_space>logged<seq2seq4repair_space>out." ) . cookie ( TokenManager . getNewNullCookie ( ) ) . build ( ) ; else <START_BUG> return WebErrorManager . ok ( "You<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>logged<seq2seq4repair_space>in." ) ; <END_BUG> } @ TestOnly public void setAccountService ( AccountService newMockService ) { } private AccountService accountService ; }

Fix:
return WebErrorManager . okRaw ( "You<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>logged<seq2seq4repair_space>in." ) . cookie ( TokenManager . getNewNullCookie ( ) ) . build ( ) ;
Buggy code:
public class TokenFilterTest extends BuildFileTest { public TokenFilterTest ( String name ) { } public void setUp ( ) { } public void tearDown ( ) { } public void testTokenfilter ( ) throws IOException { } public void testTrimignore ( ) throws IOException { } public void testStringTokenizer ( ) throws IOException { } public void testUnixLineOutput ( ) throws IOException { } public void testDosLineOutput ( ) throws IOException { } public void testFileTokenizer ( ) throws IOException { } public void testReplaceString ( ) throws IOException { } public void testReplaceStrings ( ) throws IOException { } public void testContainsString ( ) throws IOException { } public void testReplaceRegex ( ) throws IOException { } public void testFilterReplaceRegex ( ) throws IOException { } public void testHandleDollerMatch ( ) throws IOException { } public void testTrimFile ( ) throws IOException { } public void testTrimFileByLine ( ) throws IOException { } public void testFilterReplaceString ( ) throws IOException { } public void testFilterReplaceStrings ( ) throws IOException { } public void testContainsRegex ( ) throws IOException { } public void testFilterContainsRegex ( ) throws IOException { } public void testContainsRegex2 ( ) throws IOException { } public void testDeleteCharacters ( ) throws IOException { } public void testScriptFilter ( ) throws IOException { } public void testScriptFilter2 ( ) throws IOException { } public void testCustomTokenFilter ( ) throws IOException { } private boolean hasScript ( String test ) { } private boolean hasRegex ( String test ) { } private void assertStringContains ( String string , String contains ) { } private void assertStringNotContains ( String string , String contains ) { } private String getFileString ( String filename ) throws IOException { Reader r = null ; try { r = new FileReader ( getProject ( ) . resolveFile ( filename ) ) ; <START_BUG> return FileUtils . newFileUtils ( ) . readFully ( r ) ; <END_BUG> } finally { try { r . close ( ) ; } catch ( Throwable ignore ) { } } } private String getFileString ( String target , String filename ) throws IOException { } private void expectFileContains ( String name , String contains ) throws IOException { } private void expectFileContains ( String target , String name , String contains ) throws IOException { } public static class Capitalize implements TokenFilter . Filter { public String filter ( String token ) { } } }

Fix:
return FileUtils . readFully ( r ) ;
Buggy code:
public class RaDeploymentParsingProcessor implements DeploymentUnitProcessor { public RaDeploymentParsingProcessor ( ) { } @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final VirtualFile deploymentRoot = phaseContext . getAttachment ( DEPLOYMENT_ROOT ) ; if ( ( deploymentRoot == null ) || ( ! ( deploymentRoot . exists ( ) ) ) ) return ; final String deploymentRootName = deploymentRoot . getName ( ) ; if ( ! ( deploymentRootName . endsWith ( ".rar" ) ) ) { return ; } VirtualFile serviceXmlFile = deploymentRoot . getChild ( "//META-INF//ra.xml" ) ; InputStream xmlStream = null ; Connector result = null ; try { if ( ( serviceXmlFile != null ) && ( serviceXmlFile . exists ( ) ) ) { xmlStream = serviceXmlFile . openStream ( ) ; result = new RaParser ( ) . parse ( xmlStream ) ; if ( result == null ) throw new DeploymentUnitProcessingException ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>service<seq2seq4repair_space>xml<seq2seq4repair_space>[" + serviceXmlFile ) + "]" ) ) ; } File root = deploymentRoot . getPhysicalFile ( ) ; URL url = root . toURI ( ) . toURL ( ) ; String deploymentName = deploymentRoot . getName ( ) . substring ( 0 , deploymentRoot . getName ( ) . indexOf ( ".rar" ) ) ; ConnectorXmlDescriptor xmlDescriptor = new ConnectorXmlDescriptor ( result , root , url , deploymentName ) ; <START_BUG> phaseContext . putAttachment ( ATTACHMENT_KEY , xmlDescriptor ) ; <END_BUG> } catch ( Exception e ) { throw new DeploymentUnitProcessingException ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>service<seq2seq4repair_space>xml<seq2seq4repair_space>[" + serviceXmlFile ) + "]" ) , e ) ; } finally { VFSUtils . safeClose ( xmlStream ) ; } } }

Fix:
phaseContext . getDeploymentUnitContext ( ) . putAttachment ( ATTACHMENT_KEY , xmlDescriptor ) ;
Buggy code:
public class ConstructorDefImpl < T > implements ConstructorDef < T > { private final ConstructorArg [ ] args ; private final String className ; public ConstructorDefImpl ( String className , ConstructorArg [ ] args , boolean injectable ) throws ClassHierarchyException { } @ Override public ConstructorArg [ ] getArgs ( ) { } @ Override public String getClassName ( ) { } private String join ( String sep , Object [ ] vals ) { } @ Override public String toString ( ) { } @ Override public boolean takesParameters ( ClassNode < ? > [ ] paramTypes ) { } private boolean equalsIgnoreOrder ( ConstructorDef < ? > def ) { } @ Override public boolean equals ( Object o ) { } @ Override public boolean isMoreSpecificThan ( ConstructorDef < ? > def ) { for ( int i = 0 ; i < ( def . getArgs ( ) . length ) ; i ++ ) { boolean found = false ; for ( int j = 0 ; j < ( this . getArgs ( ) . length ) ; j ++ ) { if ( getArgs ( ) [ j ] . equals ( def . getArgs ( ) [ i ] ) ) { found = true ; break ; } } <START_BUG> if ( found == false ) <END_BUG> return false ; } return ( getArgs ( ) . length ) > ( def . getArgs ( ) . length ) ; } @ Override public int compareTo ( ConstructorDef < ? > o ) { } }

Fix:
if ( ! found )