nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Transformer { private List < String > BSSIDList ; private List < String > BSSIDListCopy ; private Set < String > BSSIDSet ; private List < Map < String , String > > instancesList ; private Set < String > roomSet ; private String relation ; private InstanceParser instanceParser ; private int missingValue = 0 ; private int testDataPct = 0 ; public static String CLASS_LABEL = "classLabel" ; public Transformer ( ) { } private void ini ( ) { } public List < String > getBSSIDList ( ) { } public void readFile ( File inputDataFile ) throws Exception { } private void parseSingleArffFile ( File arffFile ) throws Exception { List < String > lines = FileUtils . readLines ( arffFile ) ; for ( String line : lines ) { if ( ( line . trim ( ) . length ( ) ) == 0 ) continue ; if ( line . trim ( ) . startsWith ( "@" ) ) { if ( line . contains ( "@relation" ) ) { if ( relation . equalsIgnoreCase ( ( "_" + ( line . substring ( ( ( line . indexOf ( 'n' ) ) + 2 ) ) ) ) ) ) { } else { relation += "_" + ( line . substring ( ( ( line . indexOf ( 'n' ) ) + 2 ) ) ) ; } } else if ( line . contains ( "BSSID" ) ) { int posLastComma = line . lastIndexOf ( ',' ) ; if ( posLastComma == ( - 1 ) ) { Logger . w ( "Empty<seq2seq4repair_space>BSSID<seq2seq4repair_space>list<seq2seq4repair_space>found<seq2seq4repair_space>in<seq2seq4repair_space>arff<seq2seq4repair_space>file." ) ; continue ; } String BSSIDString = line . substring ( ( ( line . indexOf ( '{' ) ) + 1 ) , posLastComma ) ; String [ ] BSSIDs = BSSIDString . split ( "," ) ; for ( String BSSID : BSSIDs ) { BSSIDSet . add ( BSSID ) ; } } else if ( line . contains ( "ROOM" ) ) { String roomString = line . substring ( ( ( line . indexOf ( '{' ) ) + 1 ) , line . lastIndexOf ( '}' ) ) ; String [ ] rooms = roomString . split ( "," ) ; for ( String room : rooms ) { roomSet . add ( room ) ; } } } else { Map < String , String > instance = new HashMap < String , String > ( ) ; <START_BUG> String classLabel = line . substring ( ( ( line . lastIndexOf ( ',' ) ) + 2 ) ) ; <END_BUG> instance . put ( Transformer . CLASS_LABEL , classLabel ) ; String BSSIDParesString = line . substring ( ( ( line . indexOf ( '"' ) ) + 1 ) , line . lastIndexOf ( '"' ) ) ; String [ ] BSSIDPares = BSSIDParesString . split ( "\\\\n" ) ; for ( String BSSIDPare : BSSIDPares ) { if ( ( BSSIDPare . length ( ) ) == 0 ) continue ; String BSSIDLabel = BSSIDPare . substring ( 0 , BSSIDPare . indexOf ( ',' ) ) ; String BSSIDStrengh = BSSIDPare . substring ( ( ( BSSIDPare . indexOf ( ',' ) ) + 1 ) ) ; instance . put ( BSSIDLabel , BSSIDStrengh ) ; } instancesList . add ( instance ) ; } } } public void transform ( File outputDataFile , File ... testDataFile ) throws Exception { } public void setMiisingValue ( int missingValue ) { } public void setTestDataPct ( int testDataPct ) { } }

Fix:
String classLabel = line . substring ( ( ( line . lastIndexOf ( ',' ) ) + 1 ) ) . trim ( ) ;
Buggy code:
public class MainClass { public static final String NAME = "Call<seq2seq4repair_space>of<seq2seq4repair_space>Cactus:<seq2seq4repair_space>Desert<seq2seq4repair_space>Warfare" ; public static void main ( String [ ] args ) throws UnknownHostException { System . out . println ( InetAddress . getLocalHost ( ) . getHostAddress ( ) ) ; System . out . println ( "Starting<seq2seq4repair_space>Call<seq2seq4repair_space>Of<seq2seq4repair_space>Cactus..." ) ; LwjglApplicationConfiguration config = new LwjglApplicationConfiguration ( ) ; config . title = MainClass . NAME ; config . fullscreen = false ; <START_BUG> new com . badlogic . gdx . backends . lwjgl . LwjglApplication ( new GameInitializer ( ) , config ) ; <END_BUG> } }

Fix:
new com . badlogic . gdx . backends . lwjgl . LwjglApplication ( GameInitializer . getInstance ( ) , config ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class JaxbProviderTestCase { @ Deployment ( testable = false ) public static Archive < ? > deploy ( ) { WebArchive war = ShrinkWrap . create ( WebArchive . class , "jaxrsnoap.war" ) ; war . addPackage ( HttpRequest . class . getPackage ( ) ) ; war . addClasses ( JaxbProviderTestCase . class , JaxbModel . class , JaxbResource . class ) ; <START_BUG> war . addAsWebResource ( WebXml . get ( ( "<servlet-mapping>\n" + ( ( ( "<seq2seq4repair_space><servlet-name>javax.ws.rs.core.Application<//servlet-name>\n" + "<seq2seq4repair_space><url-pattern>//myjaxrs//*<//url-pattern>\n" ) + "<seq2seq4repair_space><//servlet-mapping>\n" ) + "\n" ) ) ) , "web.xml" ) ; <END_BUG> return war ; } private static String performCall ( String urlPattern ) throws Exception { } @ Test public void testJaxRsWithNoApplication ( ) throws Exception { } }

Fix:
war . addAsWebInfResource ( WebXml . get ( ( "<servlet-mapping>\n" + ( ( ( "<seq2seq4repair_space><servlet-name>javax.ws.rs.core.Application<//servlet-name>\n" + "<seq2seq4repair_space><url-pattern>//myjaxrs//*<//url-pattern>\n" ) + "<seq2seq4repair_space><//servlet-mapping>\n" ) + "\n" ) ) ) , "web.xml" ) ;
Buggy code:
public class XMLValidateTask extends AbstractTask { public static String DEFAULT_XML_READER_CLASSNAME = "org.apache.crimson.parser.XMLReaderImpl" ; private static String INIT_FAILED_MSG = "Could<seq2seq4repair_space>not<seq2seq4repair_space>start<seq2seq4repair_space>xml<seq2seq4repair_space>validation:<seq2seq4repair_space>" ; private boolean m_warn = true ; private boolean m_lenient ; private String m_readerClassName = XMLValidateTask . DEFAULT_XML_READER_CLASSNAME ; private File m_file ; private ArrayList m_filesets = new ArrayList ( ) ; private XMLReader m_xmlReader ; private ValidatorErrorHandler m_errorHandler ; private Hashtable m_features = new Hashtable ( ) ; private ArrayList m_dtdLocations = new ArrayList ( ) ; private Path m_classpath ; public void setClassName ( final String className ) { } public void setClasspath ( final Path classpath ) throws TaskException { if ( ( m_classpath ) == null ) { m_classpath = classpath ; } else { <START_BUG> m_classpath . append ( classpath ) ; <END_BUG> } } public void setFile ( File file ) { } public void setLenient ( final boolean bool ) { } public void setWarn ( final boolean warn ) { } public void addFileset ( final FileSet fileSet ) { } public Path createClasspath ( ) throws TaskException { } public DTDLocation createDTD ( ) { } public void execute ( ) throws TaskException { } private EntityResolver buildEntityResolver ( ) { } private boolean setFeature ( final String feature , final boolean value , final boolean warn ) { } private void doValidate ( File afile ) throws TaskException { } private void initValidator ( ) throws TaskException { } }

Fix:
m_classpath . addPath ( classpath ) ;
Buggy code:
public class TableColumn extends Item { Table parent ; String displayText = "" ; int width ; boolean moveable ; boolean resizable = true ; int sort = SWT . NONE ; String toolTipText ; public TableColumn ( Table parent , int style ) { } public TableColumn ( Table parent , int style , int index ) { } public void addControlListener ( ControlListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static Table checkNull ( Table table ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void computeDisplayText ( GC gc ) { } public void dispose ( ) { } void dispose ( boolean notifyParent ) { } public int getAlignment ( ) { } int getContentWidth ( GC gc , boolean useDisplayText ) { } int getIndex ( ) { } public boolean getMoveable ( ) { } int getOrderIndex ( ) { } public Table getParent ( ) { } int getPreferredWidth ( ) { } public boolean getResizable ( ) { } public String getToolTipText ( ) { } public int getWidth ( ) { } int getX ( ) { } public void pack ( ) { } void paint ( GC gc ) { } public void removeControlListener ( ControlListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setAlignment ( int alignment ) { } public void setImage ( Image value ) { } public void setMoveable ( boolean moveable ) { } public void setResizable ( boolean value ) { } void setSortDirection ( int value ) { } public void setText ( String value ) { } public void setToolTipText ( String string ) { } public void setWidth ( int value ) { checkWidget ( ) ; <START_BUG> if ( ( width ) < 0 ) <END_BUG> return ; if ( ( width ) == value ) return ; parent . updateColumnWidth ( this , value ) ; } void updateFont ( GC gc ) { } void updateWidth ( GC gc ) { } }

Fix:
if ( value < 0 )
Buggy code:
public class CustomerPasswordResetCommandUnitTest { @ Test public void toStringDoesNotContainPassword ( ) { <START_BUG> final CustomerPasswordResetCommand cmd = CustomerPasswordResetCommand . of ( Versioned . of ( "id" , 3L ) , "tokenvalue" , "secret" ) ; <END_BUG> assertThat ( cmd . toString ( ) ) . doesNotContain ( "secret" ) ; } No newline ; at end ; of file ; }

Fix:
final CustomerPasswordResetCommand cmd = CustomerPasswordResetCommand . ofTokenAndPassword ( "tokenvalue" , "secret" ) ;
Buggy code:
public class SearchActivity extends ActionBarActivity { private static final String QUERY = "query" ; private SearchModel mSearchModel ; private SearchView mSearchView ; private SearchPresenter mSearchPresenter ; private ImageViewManager mImageViewManager ; private String mQuery ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setupStrictModeIfDebug ( ) ; if ( ! ( extractQuery ( savedInstanceState ) ) ) { finish ( ) ; return ; } final ActionBar actionBar = getSupportActionBar ( ) ; actionBar . setTitle ( mQuery ) ; actionBar . setDisplayHomeAsUpEnabled ( true ) ; setContentView ( activity_search ) ; new SearchHistoryManager ( this ) . recordSearch ( mQuery ) ; mImageViewManager = ImageViewManager . newInstance ( this ) ; mSearchView = new SearchView ( this , mImageViewManager ) ; mSearchModel = new SearchModel ( GISService . newInstance ( this , mQuery ) ) ; <START_BUG> mSearchPresenter = new SearchPresenter ( mSearchView , mSearchModel ) ; <END_BUG> mSearchPresenter . bind ( ) ; } private void setupStrictModeIfDebug ( ) { } private boolean extractQuery ( Bundle savedInstanceState ) { } @ Override public void onSaveInstanceState ( Bundle outState ) { } @ Override protected void onPause ( ) { } @ Override public void onLowMemory ( ) { } @ Override protected void onDestroy ( ) { } private String getQueryFromIntent ( Intent intent ) { } }

Fix:
mSearchPresenter = new SearchPresenter ( this , mQuery , mSearchView , mSearchModel ) ;
Buggy code:
public class LUSolver implements DecompositionSolver { private static final long serialVersionUID = - 8775006035077527661L ; private final LUDecomposition decomposition ; public LUSolver ( final LUDecomposition decomposition ) { } public double [ ] solve ( final double [ ] b ) throws IllegalArgumentException , InvalidMatrixException { } public RealVector solve ( final RealVector b ) throws IllegalArgumentException , InvalidMatrixException { } public RealMatrix solve ( final RealMatrix b ) throws IllegalArgumentException , InvalidMatrixException { final int [ ] pivot = decomposition . getPivot ( ) ; final int m = pivot . length ; if ( ( b . getRowDimension ( ) ) != m ) { throw new IllegalArgumentException ( "Incorrect<seq2seq4repair_space>row<seq2seq4repair_space>dimension" ) ; } if ( decomposition . isSingular ( ) ) { throw new SingularMatrixException ( ) ; } final int nColB = b . getColumnDimension ( ) ; final double [ ] [ ] bp = new double [ m ] [ nColB ] ; for ( int row = 0 ; row < m ; row ++ ) { final double [ ] bpRow = bp [ row ] ; final int pRow = pivot [ row ] ; for ( int col = 0 ; col < nColB ; col ++ ) { bpRow [ col ] = b . getEntry ( pRow , col ) ; } } final RealMatrix l = decomposition . getL ( ) ; for ( int col = 0 ; col < m ; col ++ ) { final double [ ] bpCol = bp [ col ] ; for ( int i = col + 1 ; i < m ; i ++ ) { final double [ ] bpI = bp [ i ] ; final double luICol = l . getEntry ( i , col ) ; for ( int j = 0 ; j < nColB ; j ++ ) { bpI [ j ] -= ( bpCol [ j ] ) * luICol ; } } } final RealMatrix u = decomposition . getU ( ) ; for ( int col = m - 1 ; col >= 0 ; col -- ) { final double [ ] bpCol = bp [ col ] ; final double luDiag = u . getEntry ( col , col ) ; for ( int j = 0 ; j < nColB ; j ++ ) { bpCol [ j ] //= luDiag ; } for ( int i = 0 ; i < col ; i ++ ) { final double [ ] bpI = bp [ i ] ; final double luICol = u . getEntry ( i , col ) ; for ( int j = 0 ; j < nColB ; j ++ ) { bpI [ j ] -= ( bpCol [ j ] ) * luICol ; } } } <START_BUG> return new RealMatrixImpl ( bp , false ) ; <END_BUG> } public double getDeterminant ( ) { } public boolean isNonSingular ( ) { } public RealMatrix getInverse ( ) throws InvalidMatrixException { } }

Fix:
return MatrixUtils . createRealMatrix ( bp ) ;
Buggy code:
public class CookieTest extends TestCase { private static Log log = LogFactory . getLog ( CookieTest . class ) ; private MockWebApplication application ; private SignInPanel panel ; private Form form ; private Cookie cookieUsername ; private Cookie cookiePassword ; private Cookie [ ] cookies ; private WebPage page ; private WebRequestCycle cycle ; public CookieTest ( String name ) { } protected void setUp ( ) throws Exception { super . setUp ( ) ; application = new MockWebApplication ( null ) ; application . setHomePage ( MockPage . class ) ; application . setupRequestAndResponse ( ) ; final ISecuritySettings settings = application . getSecuritySettings ( ) ; settings . setCryptFactory ( new NoCryptFactory ( ) ) ; this . panel = new SignInPanel ( "panel" ) { public boolean signIn ( final String username , final String password ) { return true ; } } ; this . panel . setPersistent ( true ) ; this . form = ( ( Form ) ( panel . get ( "signInForm" ) ) ) ; final ICrypt crypt = application . getSecuritySettings ( ) . getCryptFactory ( ) . newCrypt ( ) ; <START_BUG> final String encryptedPassword = crypt . encrypt ( "test" ) ; <END_BUG> assertNotNull ( encryptedPassword ) ; this . cookieUsername = new Cookie ( "panel:signInForm:username" , "juergen" ) ; this . cookiePassword = new Cookie ( "panel:signInForm:password" , encryptedPassword ) ; this . cookies = new Cookie [ ] { cookieUsername , cookiePassword } ; application . getServletRequest ( ) . setCookies ( cookies ) ; cycle = new WebRequestCycle ( application . getWicketSession ( ) , application . getWicketRequest ( ) , application . getWicketResponse ( ) ) ; this . page = new MockPage ( null ) ; page . add ( this . panel ) ; WebRequestCycle cycle = new WebRequestCycle ( application . getWicketSession ( ) , application . getWicketRequest ( ) , application . getWicketResponse ( ) ) ; } public void testSetCookieOnForm ( ) throws IOException , ServletException { } public void testPersistCookieWithPersistenceDisabled ( ) throws IOException , ServletException { } public void testPersistCookie ( ) throws IOException , ServletException { } public void testRemoveFromPage ( ) throws IOException , ServletException { } }

Fix:
final String encryptedPassword = crypt . encryptUrlSafe ( "test" ) ;
Buggy code:
public class SwitchManager implements ISwitchManager { private NFSManager nfsManager ; private BootImageManager bootImageManager ; private FPGAManager fpgaManager ; private IConfigurationCenter configurationCenter ; public SwitchManager ( LDMCore ldmCore ) { } @ Override public void changeConnectionPropertyFromNFS ( Integer switchID , String controllerIP , int controllerPort ) throws IOException , InterruptedException { Map < String , String > nfsMapping = configurationCenter . getSwitchId2NFSRootDirectoryMapping ( ) ; String nfsRootPath = nfsMapping . get ( switchID . toString ( ) ) ; Process process2Copy = Runtime . getRuntime ( ) . exec ( ( "cp<seq2seq4repair_space>-r<seq2seq4repair_space>//export//backup<seq2seq4repair_space>//export//" + ( switchID . toString ( ) ) ) ) ; process2Copy . waitFor ( ) ; Logger . getAnonymousLogger ( ) . info ( ( "cp<seq2seq4repair_space>-r<seq2seq4repair_space>//export//backup<seq2seq4repair_space>//export//" + ( switchID . toString ( ) ) ) ) ; nfsManager . changeConnecitonPropertyFromNFS ( switchID , nfsRootPath , controllerIP , controllerPort ) ; <START_BUG> Process process2Chmod = Runtime . getRuntime ( ) . exec ( ( ( "chmod<seq2seq4repair_space>-R<seq2seq4repair_space>777<seq2seq4repair_space>" + ( switchID . toString ( ) ) ) + "//" ) ) ; <END_BUG> process2Chmod . waitFor ( ) ; Logger . getAnonymousLogger ( ) . info ( ( ( ( "chmod<seq2seq4repair_space>-R<seq2seq4repair_space>777<seq2seq4repair_space>" + "//export//" ) + ( switchID . toString ( ) ) ) + "//" ) ) ; } @ Override public void resetSwitchConf ( Integer switchID ) throws IOException , InterruptedException { } }

Fix:
Process process2Chmod = Runtime . getRuntime ( ) . exec ( ( ( "chmod<seq2seq4repair_space>-R<seq2seq4repair_space>777<seq2seq4repair_space>//export//" + ( switchID . toString ( ) ) ) + "//" ) ) ;
Buggy code:
public final class RepositoryDescriptorGenerator { public static Document generateRepositoryDescriptor ( String name , Set < BundleInfo > bundles ) throws ParserConfigurationException { } private static void addBundleRequirement ( Document doc , Element resource , BundleInfo info , Content p ) { Element requirement = doc . createElement ( "require" ) ; requirement . setAttribute ( "name" , "bundle" ) ; requirement . setAttribute ( "extend" , "false" ) ; requirement . setAttribute ( "multiple" , "false" ) ; requirement . setAttribute ( "optional" , "false" ) ; <START_BUG> requirement . setAttribute ( "filter" , ManifestHeaderProcessor . generateFilter ( "bundle" , p . getContentName ( ) , p . getAttributes ( ) ) ) ; <END_BUG> resource . appendChild ( requirement ) ; } private static void addPackageRequirement ( Document doc , Element resource , BundleInfo info , Content p ) { } private static void addPackageCapability ( Document doc , Element resource , BundleInfo info , Content p ) { } private static void addBundleCapability ( Document doc , Element resource , BundleInfo info ) { } private static void addProperty ( Document doc , Element capability , String name , String value , String type ) { } }

Fix:
requirement . setAttribute ( "filter" , ManifestHeaderProcessor . generateFilter ( "symbolicname" , p . getContentName ( ) , p . getAttributes ( ) ) ) ;
Buggy code:
public final class PartialBuilderTest extends MahoutTestCase { private static final int NUM_MAPS = 5 ; private static final int NUM_TREES = 32 ; private static final int NUM_INSTANCES = 20 ; @ Test public void testProcessOutput ( ) throws Exception { <START_BUG> Configuration conf = new Configuration ( ) ; <END_BUG> conf . setInt ( "mapred.map.tasks" , PartialBuilderTest . NUM_MAPS ) ; Random rng = RandomUtils . getRandom ( ) ; TreeID [ ] keys = new TreeID [ PartialBuilderTest . NUM_TREES ] ; MapredOutput [ ] values = new MapredOutput [ PartialBuilderTest . NUM_TREES ] ; int [ ] firstIds = new int [ PartialBuilderTest . NUM_MAPS ] ; PartialBuilderTest . randomKeyValues ( rng , keys , values , firstIds ) ; Path base = getTestTempDirPath ( "testdata" ) ; FileSystem fs = base . getFileSystem ( conf ) ; Path outputFile = new Path ( base , "PartialBuilderTest.seq" ) ; Writer writer = SequenceFile . createWriter ( fs , conf , outputFile , TreeID . class , MapredOutput . class ) ; try { for ( int index = 0 ; index < ( PartialBuilderTest . NUM_TREES ) ; index ++ ) { writer . append ( keys [ index ] , values [ index ] ) ; } } finally { Closeables . close ( writer , false ) ; } TreeID [ ] newKeys = new TreeID [ PartialBuilderTest . NUM_TREES ] ; Node [ ] newTrees = new Node [ PartialBuilderTest . NUM_TREES ] ; PartialBuilder . processOutput ( new Job ( conf ) , base , newKeys , newTrees ) ; for ( int tree = 0 ; tree < ( PartialBuilderTest . NUM_TREES ) ; tree ++ ) { assertEquals ( values [ tree ] . getTree ( ) , newTrees [ tree ] ) ; } assertTrue ( "keys<seq2seq4repair_space>not<seq2seq4repair_space>equal" , Arrays . deepEquals ( keys , newKeys ) ) ; } @ Test public void testConfigure ( ) { } private static void randomKeyValues ( Random rng , TreeID [ ] keys , MapredOutput [ ] values , int [ ] firstIds ) { } private static int [ ] nextIntArray ( Random rng , int size ) { } static class PartialBuilderChecker extends PartialBuilder { private final Long seed ; private final TreeBuilder treeBuilder ; private final Path datasetPath ; PartialBuilderChecker ( TreeBuilder treeBuilder , Path dataPath , Path datasetPath , Long seed ) { } @ Override protected boolean runJob ( Job job ) throws IOException { } } }

Fix:
Configuration conf = getConfiguration ( ) ;
Buggy code:
public class RemoteChannelPairSetup { static final String ENDPOINT_NAME = "endpoint" ; static final String URI_SCHEME = "test123" ; static final String TEST_CHANNEL = "Test-Channel" ; static final int PORT = 32123 ; static final int EXECUTOR_MAX_THREADS = 20 ; private static final long EXECUTOR_KEEP_ALIVE_TIME = 60000 ; ChannelServer channelServer ; protected ExecutorService executorService ; protected Channel serverChannel ; protected Channel clientChannel ; private Connection connection ; final CountDownLatch clientConnectedLatch = new CountDownLatch ( 1 ) ; public Channel getServerChannel ( ) { } public Channel getClientChannel ( ) { } public ExecutorService getExecutorService ( ) { } public void setupRemoting ( final ManagementMessageHandler handler ) throws IOException { } public void startClientConnetion ( ) throws IOException , URISyntaxException { ProtocolChannelClient . Configuration configuration = new ProtocolChannelClient . Configuration ( ) ; configuration . setEndpointName ( RemoteChannelPairSetup . ENDPOINT_NAME ) ; configuration . setUriScheme ( RemoteChannelPairSetup . URI_SCHEME ) ; configuration . setUri ( new URI ( ( ( ( ( "" + ( RemoteChannelPairSetup . URI_SCHEME ) ) + ":////127.0.0.1:" ) + ( RemoteChannelPairSetup . PORT ) ) + "" ) ) ) ; ProtocolChannelClient client = ProtocolChannelClient . create ( configuration ) ; <START_BUG> connection = client . connect ( new org . jboss . remoting3 . security . PasswordClientCallbackHandler ( "bob" , configuration . getEndpointName ( ) , "pass" . toCharArray ( ) ) ) . get ( ) ; <END_BUG> clientChannel = connection . openChannel ( RemoteChannelPairSetup . TEST_CHANNEL , EMPTY ) . get ( ) ; try { clientConnectedLatch . await ( ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } } public void stopChannels ( ) throws InterruptedException { } public void shutdownRemoting ( ) throws IOException , InterruptedException { } }

Fix:
connection = client . connectSync ( new org . jboss . remoting3 . security . PasswordClientCallbackHandler ( "bob" , configuration . getEndpointName ( ) , "pass" . toCharArray ( ) ) ) ;
Buggy code:
public class OlsAxisMap extends XdfTable { public static final int AXIS_CATEGORY = 255 ; private Axis axis ; public OlsAxisMap ( Axis axis ) { } @ Override public String getUniqueId ( ) { } @ Override public String getTitle ( ) { } @ Override public XdfAxis getRowAxis ( ) { } @ Override public XdfAxis getColAxis ( ) { } @ Override public XdfAxis getValueAxis ( ) { return new XdfAxis ( ) { @ Override public String getDimension ( ) { return "z" ; } @ Override public XdfEmbedded getEmbedded ( ) { return new XdfEmbedded ( ) { @ Override public int getXdfWidth ( ) { return ( axis . getValueType ( ) . width ) * 8 ; } @ Override public String getXdfAddress ( ) { return getUniqueId ( ) ; } @ Override public String getTypeFlags ( ) { <START_BUG> return "0x03" ; <END_BUG> } } ; } @ Override public XdfMath getXdfMath ( ) { return new OlsMath ( axis . getValue ( ) ) ; } } ; } @ Override public XdfCategoryMem getCategory ( ) { } }

Fix:
return String . format ( "0x%X" , ( ( axis . isSigned ( ) ? 1 : 0 ) + ( axis . getValueType ( ) . isLsbFirst ( ) ? 2 : 0 ) ) ) ;
Buggy code:
public class ResultTest { @ Test public void failedAssumptionDoesntCountAsRun ( ) throws Exception { Result result = new Result ( ) ; RunListener listener = result . createListener ( ) ; Description someTest = Description . EMPTY ; listener . testStarted ( someTest ) ; <START_BUG> listener . testAssumptionInvalid ( someTest , null ) ; <END_BUG> listener . testFinished ( someTest ) ; Assert . assertThat ( result . getRunCount ( ) , is ( 0 ) ) ; } }

Fix:
listener . testIgnored ( someTest ) ;
Buggy code:
public class ResponseEntity < T > extends HttpEntity < T > { private final HttpStatus statusCode ; public ResponseEntity ( HttpStatus statusCode ) { } public ResponseEntity ( T body , HttpStatus statusCode ) { } public ResponseEntity ( MultiValueMap < String , String > headers , HttpStatus statusCode ) { } public ResponseEntity ( T body , MultiValueMap < String , String > headers , HttpStatus statusCode ) { } public HttpStatus getStatusCode ( ) { } @ Override public boolean equals ( Object other ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } public static ResponseEntity . BodyBuilder status ( HttpStatus status ) { } public static ResponseEntity . BodyBuilder status ( int status ) { } public static ResponseEntity . BodyBuilder ok ( ) { } public static < T > ResponseEntity < T > ok ( T body ) { } public static ResponseEntity . BodyBuilder created ( URI location ) { } public static ResponseEntity . BodyBuilder accepted ( ) { } public static ResponseEntity . HeadersBuilder < ? > noContent ( ) { } public static ResponseEntity . BodyBuilder badRequest ( ) { } public static ResponseEntity . HeadersBuilder < ? > notFound ( ) { } <START_BUG> public static ResponseEntity . HeadersBuilder < ? > unprocessableEntity ( ) { <END_BUG> return ResponseEntity . status ( UNPROCESSABLE_ENTITY ) ; } public interface HeadersBuilder < B extends ResponseEntity . HeadersBuilder < B > > { B header ( String headerName , String ... headerValues ) { } B headers ( HttpHeaders headers ) { } B allow ( HttpMethod ... allowedMethods ) { } B eTag ( String eTag ) { } B lastModified ( long lastModified ) { } B location ( URI location ) { } ResponseEntity < Void > build ( ) { } } public interface BodyBuilder extends ResponseEntity . HeadersBuilder < ResponseEntity . BodyBuilder > { ResponseEntity . BodyBuilder contentLength ( long contentLength ) { } ResponseEntity . BodyBuilder contentType ( MediaType contentType ) { } < T > ResponseEntity < T > body ( T body ) { } } private static class DefaultBuilder implements ResponseEntity . BodyBuilder { private final HttpStatus status ; private final HttpHeaders headers = new HttpHeaders ( ) ; public DefaultBuilder ( HttpStatus status ) { } @ Override public ResponseEntity . BodyBuilder header ( String headerName , String ... headerValues ) { } @ Override public ResponseEntity . BodyBuilder headers ( HttpHeaders headers ) { } @ Override public ResponseEntity . BodyBuilder allow ( HttpMethod ... allowedMethods ) { } @ Override public ResponseEntity . BodyBuilder contentLength ( long contentLength ) { } @ Override public ResponseEntity . BodyBuilder contentType ( MediaType contentType ) { } @ Override public ResponseEntity . BodyBuilder eTag ( String eTag ) { } @ Override public ResponseEntity . BodyBuilder lastModified ( long date ) { } @ Override public ResponseEntity . BodyBuilder location ( URI location ) { } @ Override public ResponseEntity < Void > build ( ) { } @ Override public < T > ResponseEntity < T > body ( T body ) { } } }

Fix:
public static ResponseEntity . BodyBuilder unprocessableEntity ( ) {
Buggy code:
public class CharacterManager { public static void playerInfo ( Session session ) { } public static void playerDetails ( Session session , ClientMessage msg ) { } private static void sendPlayerInfo ( Session session ) { } public static void sendItemList ( Session session ) { } public static void sendItemsInUse ( Session session ) { } private static void sendTrainingList ( Session session ) { } private static void sendSkillList ( Session session ) { } private static void sendCelebrationList ( Session session ) { } public static void resetStats ( int playerId ) { } public static short checkExperience ( int playerId , Connection ... con ) { short levels = 0 ; final short level = PlayerInfo . getLevel ( playerId , con ) ; final int experience = PlayerInfo . getExperience ( playerId , con ) ; LevelInfo newLevelInfo = TableManager . getLevelInfo ( ( li ) -> ( ( li . getLevel ( ) ) > level ) && ( ( li . getExperience ( ) ) <= experience ) ) ; if ( newLevelInfo != null ) { short newLevel = newLevelInfo . getLevel ( ) ; if ( newLevel > level ) { <START_BUG> levels += newLevel - level ; <END_BUG> } if ( levels > 0 ) { PlayerInfo . setLevel ( newLevel , playerId , con ) ; short position = PlayerInfo . getPosition ( playerId , con ) ; CharacterManager . onPlayerLevelUp ( playerId , newLevel , levels , position , con ) ; } } return levels ; } private static void onPlayerLevelUp ( int id , short level , short levels , short position , Connection ... con ) { } private static void onPlayerLevelUp ( int level , int levels , short position , PlayerStats stats , MutableInteger statPoints ) { } public static void addStatsPoints ( Session session , ClientMessage msg ) { } }

Fix:
levels = ( ( short ) ( newLevel - level ) ) ;
Buggy code:
public class AbilitiesMobListener implements Listener { @ EventHandler ( priority = EventPriority . LOW , ignoreCancelled = true ) public void rates ( CreatureSpawnEvent event ) { } @ EventHandler ( priority = EventPriority . NORMAL , ignoreCancelled = true ) public void onCreatureSpawn ( CreatureSpawnEvent event ) { } public static void addAbilities ( LivingEntity entity , SpawnReason spawnReason ) { } public static void applyNormalAbilities ( LivingEntity entity , MobAbilityConfig ma ) { } @ EventHandler public void onEntityDeath ( EntityDeathEvent event ) { } @ EventHandler ( priority = EventPriority . NORMAL , ignoreCancelled = true ) public void setDamageMulti ( EntityDamageByEntityEvent event ) { if ( ( ( ( event . getCause ( ) ) != ( DamageCause . ENTITY_ATTACK ) ) && ( ( event . getCause ( ) ) != ( DamageCause . PROJECTILE ) ) ) && ( ( event . getCause ( ) ) != ( DamageCause . ENTITY_EXPLOSION ) ) ) return ; LivingEntity damager = null ; if ( ( event . getDamager ( ) ) instanceof Projectile ) { Projectile entity = ( ( Projectile ) ( event . getDamager ( ) ) ) ; <START_BUG> if ( ( entity . getShooter ( ) ) instanceof LivingEntity ) ; <END_BUG> damager = ( ( LivingEntity ) ( entity . getShooter ( ) ) ) ; } else if ( ( event . getDamager ( ) ) instanceof LivingEntity ) { damager = ( ( LivingEntity ) ( event . getDamager ( ) ) ) ; } if ( damager == null ) return ; float multi = DamageAbility . getMetaValue ( damager ) ; if ( multi != 1.0F ) { if ( ! ( P . p ( ) . getPluginIntegration ( ) . canApplyAbilities ( damager ) ) ) return ; double newDamage = ( event . getDamage ( ) ) * multi ; event . setDamage ( newDamage ) ; } } @ EventHandler ( ignoreCancelled = true ) public void onEntityCombust ( EntityCombustEvent event ) { } }

Fix:
if ( ( entity . getShooter ( ) ) instanceof LivingEntity )
Buggy code:
public class update { static final int ZONE = Section . QUESTION ; static final int PREREQ = Section . ANSWER ; static final int UPDATE = Section . AUTHORITY ; static final int ADDITIONAL = Section . ADDITIONAL ; Message query ; Message response ; Resolver res ; String server = "localhost" ; Name origin ; int defaultTTL ; short defaultClass = DClass . IN ; PrintStream log = null ; void print ( Object o ) { } public update ( InputStream in ) throws IOException { } void sendUpdate ( ) throws IOException { } Record parseRR ( MyStringTokenizer st , short classValue , int TTLValue ) throws IOException { } Record parseSet ( MyStringTokenizer st , short classValue ) throws IOException { } Record parseName ( MyStringTokenizer st , short classValue ) throws IOException { } void doRequire ( MyStringTokenizer st ) throws IOException { } void doProhibit ( MyStringTokenizer st ) throws IOException { } void doAdd ( MyStringTokenizer st ) throws IOException { } void doDelete ( MyStringTokenizer st ) throws IOException { } void doGlue ( MyStringTokenizer st ) throws IOException { } void doQuery ( MyStringTokenizer st ) throws IOException { } void doFile ( MyStringTokenizer st , Vector inputs , Vector istreams ) { } void doLog ( MyStringTokenizer st ) { String s = st . nextToken ( ) ; try { FileOutputStream fos = new FileOutputStream ( s ) ; log = new PrintStream ( fos ) ; <START_BUG> } catch ( FileNotFoundException e ) { <END_BUG> print ( ( "Error<seq2seq4repair_space>opening<seq2seq4repair_space>" + s ) ) ; } } boolean doAssert ( MyStringTokenizer st ) { } static void helpResolver ( ) { } static void helpAttributes ( ) { } static void helpData ( ) { } static void helpOperations ( ) { } static void help ( String topic ) { } public static void main ( String [ ] args ) throws IOException { } }

Fix:
} catch ( Exception e ) {
Buggy code:
class InitializerSignatureImpl extends CodeSignatureImpl implements InitializerSignature { private Constructor constructor ; InitializerSignatureImpl ( int modifiers , Class declaringType ) { } InitializerSignatureImpl ( String stringRep ) { } public String getName ( ) { } protected String createToString ( StringMaker sm ) { } public Constructor getInitializer ( ) { if ( ( constructor ) == null ) { try { <START_BUG> constructor = declaringType . getDeclaredConstructor ( getParameterTypes ( ) ) ; <END_BUG> } catch ( Exception ex ) { } } return constructor ; } }

Fix:
constructor = getDeclaringType ( ) . getDeclaredConstructor ( getParameterTypes ( ) ) ;
Buggy code:
public class WhenTakingLargeScreenshots { @ Rule public TemporaryFolder temporaryDirectory = new TemporaryFolder ( ) ; private File screenshotDirectory ; private WebDriver driver ; @ After public void closeBrowser ( ) { } @ Before public void createScreenshotDir ( ) { } private static File fileInClasspathCalled ( final String resourceName ) { } private static void openStaticTestSite ( WebDriver driver ) { } @ Test public void should_take_screenshot_with_specified_dimensions ( ) throws Exception { } @ Test public void should_take_screenshot_with_specified_larger_dimensions ( ) throws Exception { } @ Test public void should_take_screenshots_correctly ( ) throws IOException { } @ Test public void should_take_screenshots_correctly_in_chrome ( ) throws IOException { } @ Mock Logger logger ; @ Test public void should_not_explode_when_firefox_cannot_take_a_large_screenshot ( ) { } @ Test public void should_not_explode_when_chrome_cannot_take_a_large_screenshot ( ) throws IOException { driver = new WebDriverFactory ( ) . newInstanceOf ( CHROME ) ; openPage ( "big-page.html" , driver ) ; Photographer photographer = new Photographer ( driver , screenshotDirectory ) { @ Override protected Logger getLogger ( ) { return logger ; } } ; File screenshot = photographer . takeScreenshot ( "screenshot" ) ; if ( screenshot == null ) { <START_BUG> verify ( logger ) . error ( contains ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>write<seq2seq4repair_space>screenshot" ) , any ( WebDriverException . class ) ) ; <END_BUG> } else { File expectedScreenshot = WhenTakingLargeScreenshots . fileInClasspathCalled ( "screenshots//expected-big-screenshot.png" ) ; assertThat ( FileUtils . contentEquals ( screenshot , expectedScreenshot ) , is ( true ) ) ; } } private void openPage ( String pageName , WebDriver driver ) { } }

Fix:
verify ( logger ) . warn ( contains ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>write<seq2seq4repair_space>screenshot" ) , any ( WebDriverException . class ) ) ;
Buggy code:
public class SSLManagerCommand implements Command { private static final Set < String > commandSet ; private JFileChooser keyStoreChooser ; public void doAction ( ActionEvent e ) { } public Set < String > getActionNames ( ) { } private void sslManager ( ) { SSLManager . reset ( ) ; <START_BUG> keyStoreChooser = new JFileChooser ( JMeterUtils . getJMeterProperties ( ) . getProperty ( "user.dir" ) ) ; <END_BUG> keyStoreChooser . addChoosableFileFilter ( new SSLManagerCommand . AcceptPKCS12FileFilter ( ) ) ; keyStoreChooser . setFileSelectionMode ( JFileChooser . FILES_ONLY ) ; int retVal = keyStoreChooser . showOpenDialog ( GuiPackage . getInstance ( ) . getMainFrame ( ) ) ; if ( ( JFileChooser . APPROVE_OPTION ) == retVal ) { File selectedFile = keyStoreChooser . getSelectedFile ( ) ; try { System . setProperty ( JAVAX_NET_SSL_KEY_STORE , selectedFile . getCanonicalPath ( ) ) ; } catch ( IOException e ) { } } keyStoreChooser = null ; SSLManager . getInstance ( ) ; } private static class AcceptPKCS12FileFilter extends FileFilter { @ Override public String getDescription ( ) { } @ Override public boolean accept ( File testFile ) { } } }

Fix:
keyStoreChooser = new JFileChooser ( System . getProperty ( "user.dir" ) ) ;
Buggy code:
public class AS7Plugin implements JdrPlugin { private final PluginId pluginId = new PluginId ( "AS7_PLUGIN" , 1 , 0 , null ) ; @ Override public List < JdrCommand > getCommands ( ) throws Exception { Sanitizer xmlSanitizer = Sanitizers . xml ( "////password" ) ; Sanitizer passwordSanitizer = Sanitizers . pattern ( "password=.*" , "password=*" ) ; <START_BUG> return Arrays . asList ( new TreeCommand ( ) , new JarCheck ( ) , new CallAS7 ( "configuration" ) . param ( "recursive" , "true" ) , new CallAS7 ( "dump-services" ) . operation ( "dump-services" ) . resource ( "core-service" , "service-container" ) , new CallAS7 ( "cluster-proxies-configuration" ) . resource ( "subsystem" , "modcluster" ) , new CollectFiles ( "*//standalone//configuration//*" ) . sanitizer ( xmlSanitizer , passwordSanitizer ) , new CollectFiles ( "*//domain//configuration//*" ) . sanitizer ( xmlSanitizer , passwordSanitizer ) , new CollectFiles ( "*server.log" ) . limit ( ( 50 * ( Utils . ONE_MB ) ) ) , new CollectFiles ( "*.log" ) . omit ( "*server.log" ) , new CollectFiles ( "*gc.log.*" ) , new CollectFiles ( "*.properties" ) . sanitizer ( passwordSanitizer ) , new CollectFiles ( "*.xml" ) . sanitizer ( xmlSanitizer ) ) ; <END_BUG> } public PluginId getPluginId ( ) { } }

Fix:
return Arrays . asList ( new TreeCommand ( ) , new JarCheck ( ) , new CallAS7 ( "configuration" ) . param ( "recursive" , "true" ) , new CallAS7 ( "dump-services" ) . resource ( "core-service" , "service-container" ) , new CallAS7 ( "cluster-proxies-configuration" ) . resource ( "subsystem" , "modcluster" ) , new CollectFiles ( "*//standalone//configuration//*" ) . sanitizer ( xmlSanitizer , passwordSanitizer ) , new CollectFiles ( "*//domain//configuration//*" ) . sanitizer ( xmlSanitizer , passwordSanitizer ) , new CollectFiles ( "*server.log" ) . limit ( ( 50 * ( Utils . ONE_MB ) ) ) , new CollectFiles ( "*.log" ) . omit ( "*server.log" ) , new CollectFiles ( "*gc.log.*" ) , new CollectFiles ( "*.properties" ) . sanitizer ( passwordSanitizer ) , new CollectFiles ( "*.xml" ) . sanitizer ( xmlSanitizer ) ) ;
Buggy code:
public class TripDataAdapter { public static final String TABLE_NAME = "trips" ; public static final String KEY_ID = "_id" ; private static final String KEY_START_DATE = "start_date" ; private static final String KEY_END_DATE = "end_date" ; private static final String KEY_DISTANCE = "distance" ; public static final String CREATE_STATEMENT ; public static final String DROP_STATEMENT = "DROP<seq2seq4repair_space>TABLE<seq2seq4repair_space>IF<seq2seq4repair_space>EXISTS<seq2seq4repair_space>" + ( TripDataAdapter . TABLE_NAME ) ; private SQLiteDatabase mDb ; private DBHelper mOpenHelper ; private GPSCoordinateDataAdapter mGPSAdapter ; public TripDataAdapter ( Context context ) { } public void open ( ) { } public void close ( ) { } private ContentValues getContentValues ( Trip trip ) { } public ArrayList < Trip > getAllTrips ( ArrayList < Trip > trips ) { } public Trip getTrip ( long id ) { String [ ] projection = new String [ ] { TripDataAdapter . KEY_ID , TripDataAdapter . KEY_START_DATE , TripDataAdapter . KEY_END_DATE , TripDataAdapter . KEY_DISTANCE } ; <START_BUG> String selection = ( ( TripDataAdapter . KEY_ID ) + "<seq2seq4repair_space>+<seq2seq4repair_space>" ) + id ; <END_BUG> Cursor c = mDb . query ( TripDataAdapter . TABLE_NAME , projection , selection , null , null , null , null , null ) ; if ( ( c != null ) && ( c . moveToFirst ( ) ) ) { Trip trip = getTripFromCursor ( c ) ; trip . setCoordinates ( mGPSAdapter . getAllCoordinates ( trip . getCoordinates ( ) , trip . getId ( ) ) ) ; return trip ; } return null ; } private Trip getTripFromCursor ( Cursor cursor ) { } public long addTrip ( Trip trip ) { } public void deleteTrip ( Trip trip ) { } }

Fix:
String selection = ( ( TripDataAdapter . KEY_ID ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + id ;
Buggy code:
@ Deprecated public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerIntegrationTest { @ Override public Settings overrideSettings ( final Settings settings ) { } @ Test public void shouldFailIfSslEnabledOnServerButNotClient ( ) throws Exception { final Cluster cluster = Cluster . build ( ) . create ( ) ; final Client client = cluster . connect ( ) ; try { client . submit ( "1+1" ) . all ( ) . get ( ) ; fail ( "This<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>succeed<seq2seq4repair_space>as<seq2seq4repair_space>the<seq2seq4repair_space>client<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>enable<seq2seq4repair_space>SSL" ) ; } catch ( Exception ex ) { final Throwable root = ExceptionUtils . getRootCause ( ex ) ; assertEquals ( TimeoutException . class , root . getClass ( ) ) ; <START_BUG> assertEquals ( "Timed<seq2seq4repair_space>out<seq2seq4repair_space>waiting<seq2seq4repair_space>for<seq2seq4repair_space>an<seq2seq4repair_space>available<seq2seq4repair_space>host." , root . getMessage ( ) ) ; <END_BUG> } finally { cluster . close ( ) ; } } @ Test public void shouldAuthenticateWithPlainText ( ) throws Exception { } @ Test public void shouldAuthenticateOverSslWithPlainText ( ) throws Exception { } @ Test public void shouldFailAuthenticateWithPlainTextNoCredentials ( ) throws Exception { } @ Test public void shouldFailAuthenticateWithPlainTextBadPassword ( ) throws Exception { } @ Test public void shouldFailAuthenticateWithPlainTextBadUsername ( ) throws Exception { } @ Test public void shouldAuthenticateWithPlainTextOverJSONSerialization ( ) throws Exception { } @ Test public void shouldAuthenticateWithPlainTextOverGraphSONSerialization ( ) throws Exception { } @ Test public void shouldAuthenticateAndWorkWithVariablesOverJsonSerialization ( ) throws Exception { } @ Test public void shouldAuthenticateAndWorkWithVariablesOverGraphSONSerialization ( ) throws Exception { } }

Fix:
assertThat ( root . getMessage ( ) , startsWith ( "Timed<seq2seq4repair_space>out<seq2seq4repair_space>while<seq2seq4repair_space>waiting<seq2seq4repair_space>for<seq2seq4repair_space>an<seq2seq4repair_space>available<seq2seq4repair_space>host" ) ) ;
Buggy code:
public class ActionSetAssociationEndType extends UMLChangeAction { public static final ActionSetAssociationEndType SINGLETON = new ActionSetAssociationEndType ( ) ; protected ActionSetAssociationEndType ( ) { } public void actionPerformed ( ActionEvent e ) { super . actionPerformed ( e ) ; Object source = e . getSource ( ) ; MClassifier oldClassifier = null ; MClassifier newClassifier = null ; MAssociationEnd end = null ; if ( source instanceof UMLComboBox2 ) { UMLComboBox2 box = ( ( UMLComboBox2 ) ( source ) ) ; Object o = box . getTarget ( ) ; if ( o instanceof MAssociationEnd ) { end = ( ( MAssociationEnd ) ( o ) ) ; oldClassifier = end . getType ( ) ; } o = box . getSelectedItem ( ) ; if ( o instanceof MClassifier ) { newClassifier = ( ( MClassifier ) ( o ) ) ; } } <START_BUG> if ( ( newClassifier != oldClassifier ) && ( end != null ) ) { <END_BUG> end . setType ( newClassifier ) ; } } }

Fix:
if ( ( ( newClassifier != oldClassifier ) && ( end != null ) ) && ( newClassifier != null ) ) {
Buggy code:
public class QueuelessThreadPoolMetricsHandler extends ThreadPoolMetricsHandler { public static final List < AttributeDefinition > METRICS = Arrays . asList ( CURRENT_THREAD_COUNT , LARGEST_THREAD_COUNT , REJECTED_COUNT , QUEUE_SIZE ) ; public QueuelessThreadPoolMetricsHandler ( final ServiceName serviceNameBase ) { } @ Override protected void setResult ( OperationContext context , final String attributeName , final Service < ? > service ) throws OperationFailedException { final QueuelessThreadPoolService pool = ( ( QueuelessThreadPoolService ) ( service ) ) ; if ( attributeName . equals ( CommonAttributes . CURRENT_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getCurrentThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . LARGEST_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getLargestThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . REJECTED_COUNT ) ) { context . getResult ( ) . set ( pool . getRejectedCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . QUEUE_SIZE ) ) { context . getResult ( ) . set ( pool . getRejectedCount ( ) ) ; } else { <START_BUG> throw ROOT_LOGGER . unsupportedQueuelessThreadPoolMetric ( attributeName ) ; <END_BUG> } } }

Fix:
throw MESSAGES . unsupportedQueuelessThreadPoolMetric ( attributeName ) ;
Buggy code:
public class ScoreBoard2 implements Serializable { ArrayList < String > players = new ArrayList < > ( ) ; ArrayList < Double > score = new ArrayList < > ( ) ; ArrayList < Double > wins = new ArrayList < > ( ) ; ArrayList < Double > losses = new ArrayList < > ( ) ; public ScoreBoard2 ( ) { } public ScoreBoard2 ( String fileName ) throws IOException , ClassNotFoundException { } public void updateScore ( int score , int index , boolean won ) { } public void updateScoreBoard ( PlayerList pl ) { } public void ScoreBoardToFile ( String fileName ) throws FileNotFoundException , IOException { } public boolean isEmpty ( ) { } public int size ( ) { } public String playerRankToString ( int index ) { <START_BUG> return String . format ( "%s<seq2seq4repair_space>%d:%d<seq2seq4repair_space>%.2f" , this . players . get ( index ) , this . wins . get ( index ) , this . losses . get ( index ) , this . getRank ( index ) ) ; <END_BUG> } public double getRank ( int index ) { } public double getRank ( String player ) { } public int indexOf ( String player ) { } @ Override public String toString ( ) { } public String toString ( int i ) { } }

Fix:
return String . format ( "%s<seq2seq4repair_space>%f:%f<seq2seq4repair_space>%.2f" , this . players . get ( index ) , this . wins . get ( index ) , this . losses . get ( index ) , this . getRank ( index ) ) ;
Buggy code:
public class ServiceFacade implements ServiceInterface { private EntityManagerFactory emf ; public ServiceFacade ( EntityManagerFactory e ) { } public EntityManager getEntityManager ( ) { } public Person getPersonById ( int id ) { } @ Override public List < Person > getPeople ( ) { } @ Override public List < Company > getCompanies ( ) { } @ Override public List < Hobby > getHobbies ( ) { } @ Override public List < CityInfo > getCityInfoList ( ) { } @ Override public List < Address > getAddresses ( ) { } @ Override public List < Phone > getPhones ( ) { } @ Override public Person getPersonFromPhone ( Integer phone ) { } @ Override public Company getCompanyFromPhone ( Integer phone ) { } @ Override public Company getCompanyFromCvr ( Integer cvr ) { } @ Override public List < Person > getPeopleFromHobby ( Hobby hobby ) { EntityManager em = getEntityManager ( ) ; <START_BUG> Query q = em . createQuery ( "select<seq2seq4repair_space>p<seq2seq4repair_space>from<seq2seq4repair_space>Person<seq2seq4repair_space>p,<seq2seq4repair_space>Hobby<seq2seq4repair_space>h<seq2seq4repair_space>where<seq2seq4repair_space>:hobby<seq2seq4repair_space>MEMBER<seq2seq4repair_space>OF<seq2seq4repair_space>p.hobbies" ) ; <END_BUG> q . setParameter ( "hobby" , hobby ) ; List < Person > lp = q . getResultList ( ) ; return lp ; } @ Override public List < Person > getPeopleFromCity ( String city ) { } @ Override public Integer getCountOfPeopleFromHobby ( Hobby hobby ) { } @ Override public List < Integer > getZipCodes ( ) { } @ Override public List < Company > getCompanyWithMoreThanXEmployees ( Integer numberEmployees ) { } }

Fix:
Query q = em . createQuery ( "select<seq2seq4repair_space>p<seq2seq4repair_space>from<seq2seq4repair_space>Person<seq2seq4repair_space>p,<seq2seq4repair_space>Hobby<seq2seq4repair_space>h<seq2seq4repair_space>where<seq2seq4repair_space>p.hobbies<seq2seq4repair_space>=<seq2seq4repair_space>h<seq2seq4repair_space>and<seq2seq4repair_space>h<seq2seq4repair_space>=<seq2seq4repair_space>:hobby" ) ;