nus-yam/ex-repair huggingface dataset:
Buggy code:
public class DormandPrince853IntegratorTest extends TestCase { public DormandPrince853IntegratorTest ( String name ) { } public void testMissedEndEvent ( ) throws MathUserException , IntegratorException { } public void testDimensionCheck ( ) { } public void testNullIntervalCheck ( ) { } public void testMinStep ( ) { } public void testIncreasingTolerance ( ) throws MathUserException , IntegratorException { } public void testBackward ( ) throws MathUserException , IntegratorException { } public void testEvents ( ) throws MathUserException , IntegratorException { TestProblem4 pb = new TestProblem4 ( ) ; double minStep = 0 ; double maxStep = ( pb . getFinalTime ( ) ) - ( pb . getInitialTime ( ) ) ; double scalAbsoluteTolerance = 1.0E-9 ; double scalRelativeTolerance = 0.01 * scalAbsoluteTolerance ; FirstOrderIntegrator integ = new DormandPrince853Integrator ( minStep , maxStep , scalAbsoluteTolerance , scalRelativeTolerance ) ; TestProblemHandler handler = new TestProblemHandler ( pb , integ ) ; integ . addStepHandler ( handler ) ; EventHandler [ ] functions = pb . getEventsHandlers ( ) ; for ( int l = 0 ; l < ( functions . length ) ; ++ l ) { integ . addEventHandler ( functions [ l ] , Double . POSITIVE_INFINITY , ( 1.0E-8 * maxStep ) , 1000 ) ; } assertEquals ( functions . length , integ . getEventHandlers ( ) . size ( ) ) ; integ . integrate ( pb , pb . getInitialTime ( ) , pb . getInitialState ( ) , pb . getFinalTime ( ) , new double [ pb . getDimension ( ) ] ) ; <START_BUG> assertTrue ( ( ( handler . getMaximalValueError ( ) ) < 5.0E-8 ) ) ; <END_BUG> assertEquals ( 0 , handler . getMaximalTimeError ( ) , 1.0E-12 ) ; assertEquals ( 12.0 , handler . getLastTime ( ) , ( 1.0E-8 * maxStep ) ) ; integ . clearEventHandlers ( ) ; assertEquals ( 0 , integ . getEventHandlers ( ) . size ( ) ) ; } public void testKepler ( ) throws MathUserException , IntegratorException { } public void testVariableSteps ( ) throws MathUserException , IntegratorException { } public void testNoDenseOutput ( ) throws MathUserException , IntegratorException { } public void testUnstableDerivative ( ) throws MathUserException , IntegratorException { } private static class KeplerHandler implements StepHandler { public KeplerHandler ( TestProblem3 pb ) { } public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) throws MathUserException { } private int nbSteps ; private double maxError ; private TestProblem3 pb ; } private static class VariableHandler implements StepHandler { public VariableHandler ( ) { } public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) { } private boolean firstTime = true ; private double minStep = 0 ; private double maxStep = 0 ; } private static class InterpolatingStepHandler implements StepHandler { public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) throws MathUserException { } } }

Fix:
assertEquals ( 0 , handler . getMaximalValueError ( ) , 1.1E-7 ) ;
Buggy code:
public class ScriptDef extends DefBase { private ScriptRunner runner = new ScriptRunner ( ) ; private String name ; private List attributes = new ArrayList ( ) ; private List nestedElements = new ArrayList ( ) ; private Set attributeSet ; private Map nestedElementMap ; public void setName ( String name ) { } public boolean isAttributeSupported ( String attributeName ) { } public static class Attribute { private String name ; public void setName ( String name ) { } } public void addAttribute ( ScriptDef . Attribute attribute ) { } public static class NestedElement { private String name ; private String type ; private String className ; public void setName ( String name ) { } public void setType ( String type ) { } public void setClassName ( String className ) { } } public void addElement ( ScriptDef . NestedElement nestedElement ) { } public void execute ( ) { } public Object createNestedElement ( String elementName ) { } public void executeScript ( Map attributes , Map elements ) { } public void executeScript ( Map attributes , Map elements , ScriptDefBase instance ) { runner . addBean ( "attributes" , attributes ) ; runner . addBean ( "elements" , elements ) ; runner . addBean ( "project" , getProject ( ) ) ; <START_BUG> runner . addBean ( "self" , self ) ; <END_BUG> runner . executeScript ( ( "scriptdef_" + ( name ) ) ) ; } public void setLanguage ( String language ) { } public void setSrc ( File file ) { } public void addText ( String text ) { } }

Fix:
runner . addBean ( "self" , instance ) ;
Buggy code:
public class BlockSyncCalls { public static void updateBlockstate ( final BlockState bs ) { if ( gameEngine . isExiting ) { try { bs . update ( ) ; } catch ( Exception ex ) { try { StringWriter sw = new StringWriter ( ) ; PrintWriter pw = new PrintWriter ( sw ) ; ex . printStackTrace ( pw ) ; Error err = new Error ( "Exception<seq2seq4repair_space>while<seq2seq4repair_space>exiting" , sw . toString ( ) , "This<seq2seq4repair_space>problem<seq2seq4repair_space>exists<seq2seq4repair_space>due<seq2seq4repair_space>to<seq2seq4repair_space>a<seq2seq4repair_space>ugly<seq2seq4repair_space>botch<seq2seq4repair_space>and<seq2seq4repair_space>the<seq2seq4repair_space>related<seq2seq4repair_space>code<seq2seq4repair_space>is<seq2seq4repair_space>pending<seq2seq4repair_space>a<seq2seq4repair_space>rewrite." , BlockSyncCalls . class . getName ( ) , ErrorSeverity . INFO ) ; ErrorReporter . reportError ( err ) ; pw . close ( ) ; sw . close ( ) ; } catch ( Exception exint ) { exint . printStackTrace ( ) ; } } return ; } <START_BUG> main . getServer ( ) . getScheduler ( ) . runTask ( main , new Runnable ( ) { <END_BUG> public void run ( ) { bs . update ( ) ; } } ) ; } }

Fix:
get . getScheduler ( ) . runTask ( main , new Runnable ( ) {
Buggy code:
public class ReclaimSpaceHelper { public static int reclaimSpace ( BaseDataFileFactory dataFactory , RawTransaction tran , ReclaimSpace work ) throws StandardException { } private static int reclaimContainer ( BaseDataFileFactory dataFactory , RawTransaction tran , ReclaimSpace work ) throws StandardException { } private static ContainerHandle openContainerNW ( Transaction tran , LockingPolicy rlock , ContainerKey containerId ) throws StandardException { ContainerHandle containerHdl = null ; try { containerHdl = tran . openContainer ( containerId , rlock , ( ( ContainerHandle . MODE_FORUPDATE ) | ( ContainerHandle . MODE_LOCK_NOWAIT ) ) ) ; } catch ( StandardException se ) { <START_BUG> if ( ! ( se . getSQLState ( ) . equals ( LOCK_TIMEOUT ) ) ) { <END_BUG> throw se ; } } return containerHdl ; } }

Fix:
if ( ! ( se . isLockTimeout ( ) ) ) {
Buggy code:
public class DeploymentAddHandler implements OperationStepHandler { public static final String OPERATION_NAME = ADD ; private final ContentRepository contentRepository ; public DeploymentAddHandler ( ) { } public DeploymentAddHandler ( final ContentRepository contentRepository ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final Resource resource = context . createResource ( EMPTY_ADDRESS ) ; ModelNode newModel = resource . getModel ( ) ; for ( AttributeDefinition def : DOMAIN_ADD_ATTRIBUTES ) { if ( ! ( def . getName ( ) . equals ( CONTENT_ALL . getName ( ) ) ) ) { def . validateAndSet ( operation , newModel ) ; } else { def . validateOperation ( operation ) ; } } ModelNode content = operation . require ( CONTENT_ALL . getName ( ) ) ; ModelNode contentItemNode = content . require ( 0 ) ; final ModelNode opAddr = operation . get ( OP_ADDR ) ; PathAddress address = PathAddress . pathAddress ( opAddr ) ; final String name = address . getLastElement ( ) . getValue ( ) ; final String runtimeName = ( operation . hasDefined ( RUNTIME_NAME . getName ( ) ) ) ? operation . get ( RUNTIME_NAME . getName ( ) ) . asString ( ) : name ; newModel . get ( RUNTIME_NAME . getName ( ) ) . set ( runtimeName ) ; byte [ ] hash = null ; if ( contentItemNode . hasDefined ( CONTENT_HASH . getName ( ) ) ) { hash = contentItemNode . require ( CONTENT_HASH . getName ( ) ) . asBytes ( ) ; if ( ( ( contentRepository ) != null ) && ( ! ( contentRepository . hasContent ( hash ) ) ) ) { if ( context . isBooting ( ) ) { if ( ( context . getRunningMode ( ) ) == ( RunningMode . ADMIN_ONLY ) ) { HOST_CONTROLLER_LOGGER . reportAdminOnlyMissingDeploymentContent ( HashUtil . bytesToHexString ( hash ) , name ) ; } else { throw DeploymentAddHandler . createFailureException ( DomainControllerMessages . MESSAGES . noDeploymentContentWithHashAtBoot ( HashUtil . bytesToHexString ( hash ) , name ) ) ; } } else { throw DeploymentAddHandler . createFailureException ( DomainControllerMessages . MESSAGES . noDeploymentContentWithHash ( HashUtil . bytesToHexString ( hash ) ) ) ; } } } else if ( DeploymentHandlerUtils . hasValidContentAdditionParameterDefined ( contentItemNode ) ) { if ( ( contentRepository ) == null ) { throw DeploymentAddHandler . createFailureException ( DomainControllerMessages . MESSAGES . slaveCannotAcceptUploads ( ) ) ; } InputStream in = DeploymentHandlerUtils . getInputStream ( context , contentItemNode ) ; try { try { hash = contentRepository . addContent ( in ) ; } catch ( IOException e ) { throw DeploymentAddHandler . createFailureException ( e . toString ( ) ) ; } } finally { StreamUtils . safeClose ( in ) ; } contentItemNode = new ModelNode ( ) ; contentItemNode . get ( CONTENT_HASH . getName ( ) ) . set ( hash ) ; content = new ModelNode ( ) ; content . add ( contentItemNode ) ; } else { } newModel . get ( CONTENT_ALL . getName ( ) ) . set ( content ) ; <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } private static OperationFailedException createFailureException ( String msg ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class Preferences { private boolean vibrate ; private boolean fullscreen ; private boolean keepScreen ; private boolean enableFlashPosts ; private boolean useCSS ; private boolean roaming ; private boolean use3g ; private boolean useTabletDesign ; private SharedPreferences prefs ; public Preferences ( Context context ) { } private void loadPreferences ( Context context ) { PreferenceManager . setDefaultValues ( context , preferences , false ) ; <START_BUG> SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( context ) ; <END_BUG> vibrate = sharedPreferences . getBoolean ( "vibrate" , true ) ; fullscreen = sharedPreferences . getBoolean ( "fullscreen" , false ) ; keepScreen = sharedPreferences . getBoolean ( "keep_screen" , false ) ; enableFlashPosts = sharedPreferences . getBoolean ( "enable_flash_posts" , true ) ; useCSS = sharedPreferences . getBoolean ( "use_css" , true ) ; roaming = sharedPreferences . getBoolean ( "roaming" , false ) ; use3g = sharedPreferences . getBoolean ( "use_3g" , true ) ; useTabletDesign = sharedPreferences . getBoolean ( "use_tablet_design" , false ) ; prefs = sharedPreferences ; } public boolean isUseTabletDesign ( ) { } public boolean isVibrate ( ) { } public boolean isFullscreen ( ) { } public boolean isKeepScreen ( ) { } public boolean isEnableFlashPosts ( ) { } public boolean isUseCSS ( ) { } public boolean isRoaming ( ) { } public boolean isUse3g ( ) { } public SharedPreferences getSharedPreferences ( ) { } No newline ; at end ; of file ; }

Fix:
final SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( context ) ;
Buggy code:
public class FieldRetrievingFactoryBeanTests extends TestCase { public void testStaticField ( ) throws Exception { } public void testStaticFieldWithWhitespace ( ) throws Exception { } public void testStaticFieldViaClassAndFieldName ( ) throws Exception { } public void testNonStaticField ( ) throws Exception { } public void testNothingButBeanName ( ) throws Exception { } public void testJustTargetField ( ) throws Exception { } public void testJustTargetClass ( ) throws Exception { } public void testJustTargetObject ( ) throws Exception { } public void testWithConstantOnClassWithPackageLevelVisibility ( ) throws Exception { FieldRetrievingFactoryBean fr = new FieldRetrievingFactoryBean ( ) ; <START_BUG> fr . setBeanName ( "org.springframework.beans.factory.PackageLevelVisibleBean.CONSTANT" ) ; <END_BUG> fr . afterPropertiesSet ( ) ; assertEquals ( "Wuby" , fr . getObject ( ) ) ; } public void testBeanNameSyntaxWithBeanFactory ( ) throws Exception { } private static class PublicFieldHolder { public String publicField = "test" ; } }

Fix:
fr . setBeanName ( "test.beans.PackageLevelVisibleBean.CONSTANT" ) ;
Buggy code:
public class BPlusTreeMain { public static void main ( String [ ] args ) throws Exception { BPlusTree tree = new BPlusTree ( ) ; <START_BUG> tree . initBTree ( "e://temp//test.btree" , 64 , true ) ; <END_BUG> File commandFile = new File ( ".//data//cmd.txt" ) ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( commandFile ) ) ) ; String line ; while ( ( line = reader . readLine ( ) ) != null ) { StringTokenizer st = new StringTokenizer ( line ) ; String command = st . nextToken ( ) ; String key = st . nextToken ( ) ; switch ( command . charAt ( 0 ) ) { case 'i' : tree . insertRecord ( new BPlusTreeRecord ( Integer . parseInt ( key ) , st . nextToken ( ) ) ) ; break ; case 'd' : tree . deleteRecord ( new Key ( Integer . parseInt ( key ) ) ) ; break ; case 'r' : BPlusTreeRecord record = new BPlusTreeRecord ( ) ; tree . retrieveRecord ( new Key ( Integer . parseInt ( key ) ) , record ) ; break ; default : throw new Exception ( ) ; } } tree . closeBTree ( ) ; } }

Fix:
tree . initBTree ( ".//data//test.btree" , 64 , true ) ;
Buggy code:
public class CollectionToCollectionConverterTests { private GenericConversionService conversionService = new GenericConversionService ( ) ; @ Before public void setUp ( ) { } @ Test public void scalarList ( ) throws Exception { } public ArrayList < Integer > scalarListTarget ; @ Test public void emptyListToList ( ) throws Exception { } public List < Integer > emptyListTarget ; @ Test public void emptyListToListDifferentTargetType ( ) throws Exception { } public LinkedList < Integer > emptyListDifferentTarget ; @ Test public void collectionToObjectInteraction ( ) throws Exception { } @ Test @ SuppressWarnings ( "unchecked" ) public void arrayCollectionToObjectInteraction ( ) throws Exception { } @ Test @ SuppressWarnings ( "unchecked" ) public void objectToCollection ( ) throws Exception { } public List < List < List < Integer > > > objectToCollection ; @ Test @ SuppressWarnings ( "unchecked" ) public void stringToCollection ( ) throws Exception { } @ Test public void differentImpls ( ) throws Exception { } @ Test public void mixedInNulls ( ) throws Exception { } @ Test public void allNulls ( ) throws Exception { } @ Test ( expected = ConverterNotFoundException . class ) public void elementTypesNotConvertible ( ) throws Exception { <START_BUG> List < Resource > resources = new ArrayList < Resource > ( ) ; <END_BUG> resources . add ( null ) ; resources . add ( null ) ; TypeDescriptor sourceType = new TypeDescriptor ( getClass ( ) . getField ( "strings" ) ) ; assertEquals ( resources , conversionService . convert ( resources , sourceType , new TypeDescriptor ( getClass ( ) . getField ( "resources" ) ) ) ) ; } public List < String > strings ; @ Test ( expected = ConversionFailedException . class ) public void nothingInCommon ( ) throws Exception { } public List < Resource > resources ; public abstract static class BaseResource implements Resource { public InputStream getInputStream ( ) throws IOException { } public boolean exists ( ) { } public boolean isReadable ( ) { } public boolean isOpen ( ) { } public URL getURL ( ) throws IOException { } public URI getURI ( ) throws IOException { } public File getFile ( ) throws IOException { } public long contentLength ( ) throws IOException { } public long lastModified ( ) throws IOException { } public Resource createRelative ( String relativePath ) throws IOException { } public String getFilename ( ) { } public String getDescription ( ) { } } public static class TestResource extends CollectionToCollectionConverterTests . BaseResource { } @ Test public void convertEmptyVector_shouldReturnEmptyArrayList ( ) { } @ Test public void convertNonEmptyVector_shouldReturnNonEmptyArrayList ( ) { } @ SuppressWarnings ( "rawtypes" ) private void testCollectionConversionToArrayList ( Collection < String > aSource ) { } }

Fix:
List < String > resources = new ArrayList < String > ( ) ;
Buggy code:
public class ConnectionPropertyRemove extends AbstractRemoveStepHandler { public static final ConnectionPropertyRemove INSTANCE = new ConnectionPropertyRemove ( ) ; protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) { final ServiceRegistry registry = context . getServiceRegistry ( true ) ; final ModelNode address = operation . require ( OP_ADDR ) ; PathAddress path = PathAddress . pathAddress ( address ) ; final String jndiName = path . getElement ( ( ( path . size ( ) ) - 2 ) ) . getValue ( ) ; final String configPropertyName = PathAddress . pathAddress ( address ) . getLastElement ( ) . getValue ( ) ; <START_BUG> ServiceName serviceName = SERVICE_NAME_BASE . append ( jndiName ) . append ( configPropertyName ) ; <END_BUG> final ServiceController < ? > dataSourceConfigController = registry . getService ( serviceName ) ; if ( dataSourceConfigController != null ) { context . removeService ( serviceName ) ; } } protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) { } }

Fix:
ServiceName serviceName = SERVICE_NAME_BASE . append ( jndiName ) . append ( "connetion-properties" ) . append ( configPropertyName ) ;
Buggy code:
public class IndexSelector { IJavaSearchScope searchScope ; SearchPattern pattern ; IPath [ ] indexLocations ; public IndexSelector ( IJavaSearchScope searchScope , SearchPattern pattern ) { } public static boolean canSeeFocus ( IJavaElement focus , boolean isPolymorphicSearch , IPath projectOrJarPath ) { } public static boolean canSeeFocus ( IJavaElement focus , JavaProject javaProject , IClasspathEntry [ ] focusEntriesForPolymorphicSearch ) { } private void initializeIndexLocations ( ) { } public IPath [ ] getIndexLocations ( ) { if ( ( this . indexLocations ) == null ) { <START_BUG> this . initializeIndexLocations ( ) ; <END_BUG> } return this . indexLocations ; } private static IJavaProject getJavaProject ( IPath path , IJavaModel model ) { } }

Fix:
initializeIndexLocations ( ) ;
Buggy code:
public final class YuiLib implements IClusterable { private static final long serialVersionUID = 1L ; private static ResourceReference YUILOADER ; public static void load ( IHeaderResponse response ) { } private static ResourceReference getYuiLoader ( ) { if ( ( YuiLib . YUILOADER ) == null ) { StringBuffer sb = new StringBuffer ( ) ; <START_BUG> sb . append ( "yuiloader-beta" ) ; <END_BUG> if ( DEPLOYMENT . equals ( Application . get ( ) . getConfigurationType ( ) ) ) { sb . append ( "-min" ) ; } sb . append ( ".js" ) ; YuiLib . YUILOADER = new JavascriptResourceReference ( YuiLib . class , sb . toString ( ) ) ; } return YuiLib . YUILOADER ; } private YuiLib ( ) { } }

Fix:
sb . append ( "yuiloader" ) ;
Buggy code:
public class SocketBindingRemove extends AbstractSocketBindingUpdate { private static final long serialVersionUID = - 4506224971076132988L ; private final String name ; public SocketBindingRemove ( String name ) { } public AbstractSocketBindingUpdate getCompensatingUpdate ( SocketBindingGroupElement original ) { } protected void applyUpdate ( SocketBindingGroupElement element ) throws UpdateFailedException { } protected < P > void applyUpdate ( UpdateContext updateContext , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { <START_BUG> final ServiceController < ? > controller = updateContext . getServiceContainer ( ) . getService ( JBOSS_BINDING_NAME . append ( name ) ) ; <END_BUG> if ( controller == null ) { resultHandler . handleSuccess ( null , param ) ; return ; } controller . addListener ( new UpdateResultHandler . ServiceRemoveListener < P > ( resultHandler , param ) ) ; } }

Fix:
final ServiceController < ? > controller = updateContext . getServiceRegistry ( ) . getService ( JBOSS_BINDING_NAME . append ( name ) ) ;
Buggy code:
public abstract class Client { static final String HOST = "localhost" ; static final int PORT = 6789 ; static int user_id ; public static void main ( String [ ] arg ) { try { Log . log ( "Client" , "Client<seq2seq4repair_space>Start" , "" ) ; <START_BUG> List < Book > books = Client . searchBook ( "Cat<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>Hat" ) ; <END_BUG> Book selected = books . get ( 0 ) ; Exchange e = new Exchange ( ) ; e . book_id = selected . book_id ; e . book_title = selected . book_title ; e . status = Status . INITIAL ; e . exchange_type = Type . BORROW ; e . borrower_id = 1 ; e . loaner_id = 0 ; Client . createBook ( selected ) ; Client . createExchange ( e ) ; } catch ( Exception e ) { System . err . println ( e ) ; } } private static Request send ( Request r ) throws IOException { } public static int login ( String username , String password ) throws IOException { } public static String getUsernameFromUserID ( int user_id ) throws IOException { } public static int createLogin ( String username , String password ) throws IOException { } public static List < Book > searchBook ( String query ) throws IOException { } public static void createBook ( Book book ) throws IOException { } public static Book getBook ( int book_id ) throws IOException { } public static List < Exchange > getPublicExchanges ( ) throws IOException { } public static List < Exchange > getPrivateExchanges ( int user_id ) throws IOException { } public static void createExchange ( Exchange exchange ) throws IOException { } public static void updateExchangeBorrower ( int exchange_id , int borrower_id ) throws IOException { } public static void updateExchangeLoaner ( int exchange_id , int loaner_id ) throws IOException { } public static void updateExchangeStatus ( int exchange_id , Exchange . Status status ) throws IOException { } }

Fix:
List < Book > books = Client . searchBook ( "Harry<seq2seq4repair_space>Potter" ) ;
Buggy code:
public abstract class RequestHandler implements HttpHandler { private CameraController controller ; public RequestHandler ( CameraController controller ) { } public Attributes parseURI ( String uri ) throws MalformedURIException { } public void respond ( HttpExchange exchange , String response ) { try { exchange . sendResponseHeaders ( 200 , response . length ( ) ) ; OutputStream out = exchange . getResponseBody ( ) ; <START_BUG> out . write ( response . getBytes ( ) ) ; <END_BUG> out . close ( ) ; } catch ( IOException e ) { System . out . println ( e ) ; } } public CameraController getCameraController ( ) { } public int getCameraId ( HttpExchange exchange ) { } }

Fix:
out . write ( response . getBytes ( "UTF-8" ) ) ;
Buggy code:
public class ShiroAuthorizingRealm extends AuthorizingRealm { private static Log log = LogFactory . getLog ( ShiroAuthorizingRealm . class ) ; public ShiroAuthorizingRealm ( ) { } @ Override public AuthenticationInfo doGetAuthenticationInfo ( AuthenticationToken authToken ) throws AuthenticationException { ShiroAuthorizingRealm . log . info ( "ShiroAuthorizingRealm.doGetAuthenticationInfo()" ) ; UsernamePasswordToken token = ( ( UsernamePasswordToken ) ( authToken ) ) ; User user ; try { user = loadUserByUsername ( token . getUsername ( ) ) ; } catch ( WebloggerException ex ) { ShiroAuthorizingRealm . log . error ( "Error<seq2seq4repair_space>looking<seq2seq4repair_space>up<seq2seq4repair_space>user" , ex ) ; throw new AuthenticationException ( ( "Error<seq2seq4repair_space>looking<seq2seq4repair_space>up<seq2seq4repair_space>user<seq2seq4repair_space>" + ( token . getUsername ( ) ) ) , ex ) ; } if ( user != null ) { ShiroAuthorizingRealm . log . debug ( ( ( ( "Returning<seq2seq4repair_space>user<seq2seq4repair_space>" + ( user . getUserName ( ) ) ) + "<seq2seq4repair_space>password<seq2seq4repair_space>" ) + ( user . getPassword ( ) ) ) ) ; <START_BUG> return new org . apache . shiro . authc . SimpleAuthenticationInfo ( user . getUserName ( ) , new org . apache . shiro . crypto . hash . Sha1Hash ( user . getPassword ( ) ) , getName ( ) ) ; <END_BUG> } else { ShiroAuthorizingRealm . log . error ( ( "Username<seq2seq4repair_space>not<seq2seq4repair_space>found:<seq2seq4repair_space>" + ( token . getUsername ( ) ) ) ) ; throw new AuthenticationException ( ( "Username<seq2seq4repair_space>not<seq2seq4repair_space>found:<seq2seq4repair_space>" + ( token . getUsername ( ) ) ) ) ; } } public AuthorizationInfo doGetAuthorizationInfo ( PrincipalCollection principals ) { } @ Override public boolean supports ( AuthenticationToken token ) { } private User loadUserByUsername ( String userName ) throws WebloggerException { } No newline ; at end ; of file ; }

Fix:
return new org . apache . shiro . authc . SimpleAuthenticationInfo ( user . getUserName ( ) , user . getPassword ( ) , getName ( ) ) ;
Buggy code:
public class MVTO extends CCAlgorithm { private VersioningUnitMVTO versioningUnit ; private List < Integer > primaryTransactions = Collections . synchronizedList ( new LinkedList < Integer > ( ) ) ; private HDFSLogger log ; public MVTO ( RemoteHandler rh , HDFSLogger log ) { } @ Override public ReadResponse read ( ReadRequest request ) { } @ Override public GenericSuccessResponse write ( WriteRequest request ) { } @ Override public GenericSuccessResponse begin ( BeginRequest request ) { } @ Override public GenericSuccessResponse commit ( CommitRequest request ) { } private ConcurrentHashMap < Integer , Transaction > transactions ; private void terminate ( Transaction transaction , boolean success ) { <START_BUG> if ( ( primaryTransactions . contains ( transaction ) ) && ( isLocalTransaction ( transaction ) ) ) { <END_BUG> sendTerminateMessage ( transaction . transactionId ) ; } log . info ( ( "Terminating<seq2seq4repair_space>transaction<seq2seq4repair_space>with<seq2seq4repair_space>status<seq2seq4repair_space>" + success ) , MVTO . class ) ; if ( success ) { versioningUnit . commit ( transaction . transactionId ) ; } else { versioningUnit . abort ( transaction . transactionId ) ; } if ( ( ! success ) && ( ! ( isLocalTransaction ( transaction ) ) ) ) remote . abortOthers ( transaction ) ; transactions . remove ( transaction . transactionId ) ; primaryTransactions . remove ( new Integer ( transaction . transactionId ) ) ; } @ Override public GenericSuccessResponse abort ( AbortRequest request ) { } @ Override public GenericSuccessResponse prepare ( PrepareRequest request ) { } @ Override public Transaction getTransaction ( int xid ) { } @ Override public void checkpoint ( ) { } private void sendTerminateMessage ( int tid ) { } }

Fix:
if ( ( primaryTransactions . contains ( transaction . transactionId ) ) && ( isLocalTransaction ( transaction ) ) ) {
Buggy code:
public class RssParser { public RssParser ( ) { } public String getRssLinkFromURL ( String url ) { Document doc = null ; try { <START_BUG> doc = Jsoup . connect ( url ) . get ( ) ; <END_BUG> } catch ( IOException e ) { e . printStackTrace ( ) ; } Elements rssLink = doc . select ( "link[type=application//rss+xml]" ) ; Elements atomLink = doc . select ( "link[type=application//atom+xml]" ) ; if ( ( rssLink . size ( ) ) > 0 ) { return rssLink . attr ( "href" ) ; } else if ( ( atomLink . size ( ) ) > 0 ) { return atomLink . attr ( "href" ) ; } else { return null ; } } public String getXMLFromURL ( String feedUrl ) { } public WebSite getWebsiteDetails ( WebSite site , String xml ) { } public List < RssFeed > getFeedDetails ( WebSite site , String xml ) { } }

Fix:
doc = Jsoup . connect ( url ) . userAgent ( "Mozilla//5.0<seq2seq4repair_space>(Windows<seq2seq4repair_space>NT<seq2seq4repair_space>6.1)<seq2seq4repair_space>AppleWebKit//537.36<seq2seq4repair_space>(KHTML,<seq2seq4repair_space>like<seq2seq4repair_space>Gecko)<seq2seq4repair_space>Chrome//41.0.2228.0<seq2seq4repair_space>Safari//537.36" ) . get ( ) ;
Buggy code:
public class PluginManagerTest extends TestCase { private File file ; protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } public void test ( ) { <START_BUG> PluginManager manager = PluginManager . getInstance ( ) ; <END_BUG> manager . initPlugins ( ) ; } }

Fix:
IPluginManager manager = PluginManager . getInstance ( ) ;
Buggy code:
public final class ListRewrite { private ASTNode parent ; private StructuralPropertyDescriptor childProperty ; private ASTRewrite rewriter ; ListRewrite ( ASTRewrite rewriter , ASTNode parent , StructuralPropertyDescriptor childProperty ) { } private RewriteEventStore getRewriteStore ( ) { } private ListRewriteEvent getEvent ( ) { } public void remove ( ASTNode node , TextEditGroup editGroup ) { } public void replace ( ASTNode node , ASTNode replacement , TextEditGroup editGroup ) { } public void insertAfter ( ASTNode node , ASTNode element , TextEditGroup editGroup ) { } public void insertBefore ( ASTNode node , ASTNode element , TextEditGroup editGroup ) { } public void insertFirst ( ASTNode node , TextEditGroup editGroup ) { } public void insertLast ( ASTNode node , TextEditGroup editGroup ) { } public void insertAt ( ASTNode node , int index , TextEditGroup editGroup ) { } private void internalInsertAt ( ASTNode node , int index , boolean boundToPrevious , TextEditGroup editGroup ) { } private ASTNode createTargetNode ( ASTNode first , ASTNode last , boolean isMove ) { if ( ( first == null ) || ( last == null ) ) { throw new IllegalArgumentException ( ) ; } <START_BUG> RewriteEventStore . CopySourceInfo info = getRewriteStore ( ) . markAsRangeCopySource ( parent , childProperty , first , last , isMove ) ; <END_BUG> NodeInfoStore nodeStore = this . rewriter . getNodeStore ( ) ; ASTNode placeholder = nodeStore . newPlaceholderNode ( first . getNodeType ( ) ) ; if ( placeholder == null ) { throw new IllegalArgumentException ( ( "Creating<seq2seq4repair_space>a<seq2seq4repair_space>target<seq2seq4repair_space>node<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>for<seq2seq4repair_space>nodes<seq2seq4repair_space>of<seq2seq4repair_space>type" + ( first . getClass ( ) . getName ( ) ) ) ) ; } nodeStore . markAsCopyTarget ( placeholder , info ) ; return placeholder ; } public final ASTNode createCopyTarget ( ASTNode first , ASTNode last ) { } private boolean isInsertBoundToPreviousByDefault ( ASTNode node ) { } public List getOriginalList ( ) { } public List getRewrittenList ( ) { } }

Fix:
RewriteEventStore . CopySourceInfo info = getRewriteStore ( ) . markAsRangeCopySource ( this . parent , this . childProperty , first , last , isMove ) ;
Buggy code:
public class ControlFilter implements Filter { Perl5Util util = new Perl5Util ( ) ; String [ ] allowedPatterns ; public ControlFilter ( String [ ] allowedPatterns ) { } public String filter ( String in ) throws UnexpectedFormatException { int len = allowedPatterns . length ; for ( int i = 0 ; i < len ; i ++ ) { if ( util . match ( ( ( "//" + ( allowedPatterns [ i ] ) ) + "//" ) , in ) ) { return in ; } } <START_BUG> throw new UnexpectedFormatException ( in ) ; <END_BUG> } }

Fix:
throw new UnexpectedFormatException ( ( ( "[" + in ) + "]" ) ) ;
Buggy code:
@ InterfaceAudience . Private public class DefaultMemStore extends AbstractMemStore { private static final Log LOG = LogFactory . getLog ( DefaultMemStore . class ) ; public DefaultMemStore ( ) { } public DefaultMemStore ( final Configuration conf , final CellComparator c ) { } void dump ( ) { } @ Override public MemStoreSnapshot snapshot ( ) { } @ Override protected List < MemStoreSegmentScanner > getListOfScanners ( long readPt ) throws IOException { } @ Override public void rollback ( Cell cell ) { } @ Override public boolean shouldSeek ( Scan scan , long oldestUnexpiredTS ) { } @ Override public long getFlushableSize ( ) { } Cell getNextRow ( final Cell cell ) { } @ Override public long size ( ) { } @ Override public AbstractMemStore setForceFlushToDisk ( ) { } @ Override boolean isForceFlushToDisk ( ) { <START_BUG> return false ; <END_BUG> } @ Override public boolean isMemStoreCompaction ( ) { } @ Override public void flushInMemory ( long flushOpSeqId ) { } public static void main ( String [ ] args ) { } }

Fix:
return true ;
Buggy code:
public class StandardWebSocketSessionAdapter extends AbstractWebSocketSesssionAdapter < Session > { private Session session ; private URI uri ; private String remoteHostName ; private String remoteAddress ; @ Override public void initSession ( Session session ) { <START_BUG> Assert . notNull ( session , "session<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; <END_BUG> this . session = session ; } @ Override public String getId ( ) { } @ Override public URI getUri ( ) { } @ Override public void setUri ( URI uri ) { } @ Override public boolean isSecure ( ) { } @ Override public Principal getPrincipal ( ) { } @ Override public void setPrincipal ( Principal principal ) { } @ Override public String getRemoteHostName ( ) { } @ Override public void setRemoteHostName ( String name ) { } @ Override public String getRemoteAddress ( ) { } @ Override public void setRemoteAddress ( String address ) { } @ Override public boolean isOpen ( ) { } @ Override protected void sendTextMessage ( TextMessage message ) throws IOException { } @ Override protected void sendBinaryMessage ( BinaryMessage message ) throws IOException { } @ Override protected void closeInternal ( CloseStatus status ) throws IOException { } }

Fix:
Assert . notNull ( session , "session<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ;
Buggy code:
public class TaskServerDaemon { private boolean running ; private TaskServer taskServer ; public TaskServerDaemon ( ) { } public void startServer ( ) { if ( isRunning ( ) ) throw new IllegalStateException ( "Server<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>started" ) ; this . running = true ; <START_BUG> EntityManagerFactory entityManagerFactory = Persistence . createEntityManagerFactory ( "org.drools.task" ) ; <END_BUG> TaskService taskService = new TaskService ( entityManagerFactory , SystemEventListenerFactory . getSystemEventListener ( ) ) ; TaskServiceSession taskSession = taskService . createSession ( ) ; MockUserInfo userInfo = new MockUserInfo ( ) ; taskService . setUserinfo ( userInfo ) ; for ( String userName : getDefaultUsers ( ) ) { taskSession . addUser ( new User ( userName ) ) ; } taskServer = new org . jbpm . task . service . mina . MinaTaskServer ( taskService ) ; Thread thread = new Thread ( taskServer ) ; thread . start ( ) ; } public void stopServer ( ) throws Exception { } public boolean isRunning ( ) { } private String [ ] getDefaultUsers ( ) { } }

Fix:
EntityManagerFactory entityManagerFactory = Persistence . createEntityManagerFactory ( "org.jbpm.task" ) ;
Buggy code:
public class StudentSubmission extends CanvasModel < StudentSubmission > implements Parcelable { private long user_id ; private ArrayList < Submission > submissions ; private double computed_final_score ; private double computed_current_score ; public long getUser_id ( ) { } public void setUser_id ( long user_id ) { } public ArrayList < Submission > getSubmissions ( ) { } public void setSubmissions ( ArrayList < Submission > submissions ) { } public double getComputed_final_score ( ) { } public void setComputed_final_score ( double computed_final_score ) { } public double getComputed_current_score ( ) { } public void setComputed_current_score ( double computed_current_score ) { } @ Override public long getId ( ) { <START_BUG> return this . getId ( ) ; <END_BUG> } @ Override public Date getComparisonDate ( ) { } @ Override public String getComparisonString ( ) { } @ Override public int describeContents ( ) { } @ Override public void writeToParcel ( Parcel dest , int flags ) { } public StudentSubmission ( ) { } private StudentSubmission ( Parcel in ) { } public static Creator < StudentSubmission > CREATOR = new Creator < StudentSubmission > ( ) { public StudentSubmission createFromParcel ( Parcel source ) { } public StudentSubmission [ ] newArray ( int size ) { } } ; }

Fix:
return user_id ;
Buggy code:
public class CSVSourceTests extends TestCase { public void testLoadCSVFile ( ) throws Exception { SkaterSource csvSource = new CSVSkaterSource ( "res//skaters.csv" ) ; List < Skater > skaters = csvSource . readAllSkaters ( ) ; <START_BUG> assertEquals ( 32 , skaters . size ( ) ) ; <END_BUG> assertEquals ( "Armin" , skaters . get ( 21 ) . getName ( ) ) ; assertEquals ( 36.5 , skaters . get ( 27 ) . getTimeSeconds ( ) ) ; assertEquals ( FEMALE , skaters . get ( 8 ) . getGender ( ) ) ; assertEquals ( "AUT" , skaters . get ( 1 ) . getNation ( ) ) ; } }

Fix:
assertEquals ( 30 , skaters . size ( ) ) ;
Buggy code:
public class DirectoryDialog extends Dialog { String message = "" ; String filterPath = "" ; static final String SEPARATOR = System . getProperty ( "file.separator" ) ; public DirectoryDialog ( Shell parent ) { } public DirectoryDialog ( Shell parent , int style ) { } public String getFilterPath ( ) { } public String getMessage ( ) { } public String open ( ) { <START_BUG> boolean useChooserDialog = ( OS . gtk_check_version ( 2 , 4 , 10 ) ) == 0 ; <END_BUG> if ( useChooserDialog ) { return openChooserDialog ( ) ; } else { return openClassicDialog ( ) ; } } String openChooserDialog ( ) { } String openClassicDialog ( ) { } public void setFilterPath ( String string ) { } public void setMessage ( String string ) { } }

Fix:
boolean useChooserDialog = ( OS . GTK_VERSION ) >= ( OS . VERSION ( 2 , 4 , 10 ) ) ;
Buggy code:
public class SpriteBatch { Texture lastTexture ; AABB aim ; FloatBuffer vertexData ; int vertexSize = 2 ; FloatBuffer textureData ; int textureSize = 2 ; float [ ] vertices ; float [ ] textures ; private int index = 0 ; private boolean drawing = false ; private boolean containmentTest = false ; public SpriteBatch ( int size , int width , int height ) { } public void begin ( AABB aim ) { } public void begin ( ) { } public void draw ( Sprite s ) { } public void draw ( final TextureRegion tr , float x1 , float x2 , float y1 , float y2 , boolean flipX , boolean flipY , boolean containmentTest ) { if ( ! ( drawing ) ) { System . err . println ( "Must<seq2seq4repair_space>call<seq2seq4repair_space>begin<seq2seq4repair_space>before<seq2seq4repair_space>drawing!" ) ; return ; } if ( ( ( this . containmentTest ) && containmentTest ) && ( ! ( aim . collides ( ( ( int ) ( Math . floor ( x1 ) ) ) , ( ( int ) ( Math . floor ( y1 ) ) ) , ( ( int ) ( x2 - x1 ) ) , ( ( int ) ( y2 - y1 ) ) ) ) ) ) { return ; } Texture t = tr . texture ; <START_BUG> if ( ( ( lastTexture ) != null ) && ( ( lastTexture ) != t ) ) { <END_BUG> flush ( ) ; } lastTexture = t ; float u1 = tr . u1 ; float u2 = tr . u2 ; float v1 = tr . v1 ; float v2 = tr . v2 ; if ( flipY ) { final float tmp = u1 ; u1 = u2 ; u2 = tmp ; } if ( flipX ) { final float tmp = v1 ; v1 = v2 ; v2 = tmp ; } vertices [ index ] = x1 ; textures [ ( ( index ) ++ ) ] = u1 ; vertices [ index ] = y1 ; textures [ ( ( index ) ++ ) ] = v1 ; vertices [ index ] = x2 ; textures [ ( ( index ) ++ ) ] = u2 ; vertices [ index ] = y1 ; textures [ ( ( index ) ++ ) ] = v1 ; vertices [ index ] = x2 ; textures [ ( ( index ) ++ ) ] = u2 ; vertices [ index ] = y2 ; textures [ ( ( index ) ++ ) ] = v2 ; vertices [ index ] = x1 ; textures [ ( ( index ) ++ ) ] = u1 ; vertices [ index ] = y2 ; textures [ ( ( index ) ++ ) ] = v2 ; } public void end ( ) { } public void flush ( ) { } public void translate ( float x , float y ) { } }

Fix:
if ( ( ( lastTexture ) != null ) || ( ( lastTexture ) != t ) ) {
Buggy code:
public class ToolFactory { public static ICodeFormatter createCodeFormatter ( ) { } public static ICodeFormatter createDefaultCodeFormatter ( Map options ) { } public static IClassFileDisassembler createDefaultClassFileDisassembler ( ) { } public static ClassFileBytesDisassembler createDefaultClassFileBytesDisassembler ( ) { } public static IClassFileReader createDefaultClassFileReader ( String fileName , int decodingFlag ) { } public static IClassFileReader createDefaultClassFileReader ( IClassFile classfile , int decodingFlag ) { } public static IClassFileReader createDefaultClassFileReader ( String zipFileName , String zipEntryName , int decodingFlag ) { } public static IScanner createScanner ( boolean tokenizeComments , boolean tokenizeWhiteSpace , boolean assertMode , boolean recordLineSeparator ) { <START_BUG> PublicScanner scanner = new PublicScanner ( tokenizeComments , tokenizeWhiteSpace , false , JDK1_3 , null , null ) ; <END_BUG> scanner . recordLineSeparator = recordLineSeparator ; return scanner ; } public static IScanner createScanner ( boolean tokenizeComments , boolean tokenizeWhiteSpace , boolean recordLineSeparator , String sourceLevel ) { } }

Fix:
PublicScanner scanner = new PublicScanner ( tokenizeComments , tokenizeWhiteSpace , false , ( assertMode ? JDK1_4 : JDK1_3 ) , null , null ) ;
Buggy code:
public class ImportContainer extends SourceRefElement implements IImportContainer { protected ImportContainer ( CompilationUnit parent ) { } public boolean equals ( Object o ) { } public int getElementType ( ) { } public IJavaElement getHandleFromMemento ( String token , StringTokenizer memento , WorkingCopyOwner workingCopyOwner ) { } protected char getHandleMementoDelimiter ( ) { } public IImportDeclaration getImport ( String name ) { } public IJavaElement getPrimaryElement ( boolean checkOwner ) { CompilationUnit cu = ( ( CompilationUnit ) ( fParent ) ) ; <START_BUG> if ( checkOwner && ( ( cu . owner ) == ( DefaultWorkingCopyOwner . PRIMARY ) ) ) <END_BUG> return this ; return cu . getImportContainer ( ) ; } public ISourceRange getSourceRange ( ) throws JavaModelException { } public boolean hasChildren ( ) { } public String readableName ( ) { } protected void toString ( int tab , StringBuffer buffer ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } }

Fix:
if ( checkOwner && ( cu . isPrimary ( ) ) )
Buggy code:
public class TestSpanishAnalyzer extends BaseTokenStreamTestCase { public void testResourcesAvailable ( ) { } public void testBasics ( ) throws IOException { } public void testExclude ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new SpanishAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } }

Fix:
checkRandomData ( random ( ) , new SpanishAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
@ SuppressWarnings ( "restriction" ) public class JAXWSSelectionTransformer implements Transformer { public Object transform ( Object value ) { if ( value instanceof IStructuredSelection ) { IStructuredSelection structuredSelection = ( ( IStructuredSelection ) ( value ) ) ; Object selection = structuredSelection . getFirstElement ( ) ; if ( selection instanceof IFile ) { IFile file = ( ( IFile ) ( selection ) ) ; String fullyQualifiedJavaName = this . getFullyQualifiedJavaName ( file ) ; return new StructuredSelection ( fullyQualifiedJavaName ) ; } else if ( selection instanceof ICompilationUnit ) { IResource resource = ( ( ICompilationUnit ) ( selection ) ) . getResource ( ) ; if ( resource instanceof IFile ) { IFile file = ( ( IFile ) ( resource ) ) ; String fullyQualifiedJavaName = this . getFullyQualifiedJavaName ( file ) ; return new StructuredSelection ( fullyQualifiedJavaName ) ; } } } <START_BUG> return value ; <END_BUG> } private String getFullyQualifiedJavaName ( IFile resource ) { } }

Fix:
return StructuredSelection . EMPTY ;
Buggy code:
public class BundleResourceInstaller extends ResourceInstaller { static class BundleConstituent implements BundleRevision { private final Resource resource ; private final BundleRevision revision ; public BundleConstituent ( Resource resource , BundleRevision revision ) { } @ Override public List < Capability > getCapabilities ( String namespace ) { } @ Override public List < Requirement > getRequirements ( String namespace ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } @ Override public Bundle getBundle ( ) { } @ Override public String getSymbolicName ( ) { } @ Override public Version getVersion ( ) { } @ Override public List < BundleCapability > getDeclaredCapabilities ( String namespace ) { } @ Override public List < BundleRequirement > getDeclaredRequirements ( String namespace ) { } @ Override public int getTypes ( ) { } @ Override public BundleWiring getWiring ( ) { } @ Override public String toString ( ) { } } public BundleResourceInstaller ( Coordination coordination , Resource resource , AriesSubsystem subsystem ) { } public Resource install ( ) { } private BundleRevision installBundle ( ) { final Bundle bundle ; InputStream is = ( ( org . osgi . service . repository . RepositoryContent ) ( resource ) ) . getContent ( ) ; try { <START_BUG> bundle = provisionTo . getRegion ( ) . installBundle ( getLocation ( ) , is ) ; <END_BUG> } catch ( BundleException e ) { throw new SubsystemException ( e ) ; } finally { IOUtils . close ( is ) ; } coordination . addParticipant ( new Participant ( ) { public void ended ( Coordination coordination ) throws Exception { } public void failed ( Coordination coordination ) throws Exception { provisionTo . getRegion ( ) . removeBundle ( bundle ) ; } } ) ; bundle . adapt ( BundleStartLevel . class ) . setStartLevel ( 1 ) ; return bundle . adapt ( BundleRevision . class ) ; } }

Fix:
bundle = provisionTo . getRegion ( ) . installBundleAtLocation ( getLocation ( ) , is ) ;
Buggy code:
public class TCPSampler extends AbstractSampler implements ThreadListener { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String SERVER = "TCPSampler.server" ; public static final String PORT = "TCPSampler.port" ; public static final String FILENAME = "TCPSampler.filename" ; public static final String CLASSNAME = "TCPSampler.classname" ; public static final String NODELAY = "TCPSampler.nodelay" ; public static final String TIMEOUT = "TCPSampler.timeout" ; public static final String REQUEST = "TCPSampler.request" ; public static final String RE_USE_CONNECTION = "TCPSampler.reUseConnection" ; private static final String TCPKEY = "TCP" ; private static final String ERRKEY = "ERR" ; private static final String STATUS_PREFIX = JMeterUtils . getPropDefault ( "tcp.status.prefix" , "" ) ; private static final String STATUS_SUFFIX = JMeterUtils . getPropDefault ( "tcp.status.suffix" , "" ) ; private static final String STATUS_PROPERTIES = JMeterUtils . getPropDefault ( "tcp.status.properties" , "" ) ; private static final Properties statusProps = new Properties ( ) ; private static final boolean haveStatusProps ; private static final ThreadLocal tp = new ThreadLocal ( ) { protected Object initialValue ( ) { } } ; private transient TCPClient protocolHandler ; public TCPSampler ( ) { } private String getError ( ) { } private Socket getSocket ( ) { } public String getUsername ( ) { } public String getPassword ( ) { } public void setServer ( String newServer ) { } public String getServer ( ) { } public void setReUseConnection ( String newServer ) { } public boolean isReUseConnection ( ) { } public void setPort ( String newFilename ) { } public int getPort ( ) { } public void setFilename ( String newFilename ) { } public String getFilename ( ) { } public void setRequestData ( String newRequestData ) { } public String getRequestData ( ) { } public void setTimeout ( String newTimeout ) { <START_BUG> this . setProperty ( TCPSampler . FILENAME , newTimeout ) ; <END_BUG> } public int getTimeout ( ) { } public void setNoDelay ( String newNoDelay ) { } public boolean getNoDelay ( ) { } public String getLabel ( ) { } private static String getClassname ( ) { } private static final String protoPrefix = "org.apache.jmeter.protocol.tcp.sampler." ; private Class getClass ( String className ) { } private TCPClient getProtocol ( ) { } public SampleResult sample ( Entry e ) { } private boolean checkResponseCode ( String rc ) { } public void threadStarted ( ) { } private void closeSocket ( ) { } public void threadFinished ( ) { } }

Fix:
this . setProperty ( TCPSampler . TIMEOUT , newTimeout ) ;