Buggy code:
public class CookieManager extends ConfigTestElement implements Serializable , TestListener { private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String CLEAR = "CookieManager.clearEachIteration" ; public static final String COOKIES = "CookieManager.cookies" ; private transient SimpleDateFormat dateFormat = new SimpleDateFormat ( "EEEE,<seq2seq4repair_space>dd-MMM-yy<seq2seq4repair_space>HH:mm:ss<seq2seq4repair_space>zzz" ) ; public CookieManager ( ) { } public CollectionProperty getCookies ( ) { } public int getCookieCount ( ) { } public boolean getClearEachIteration ( ) { } public void setClearEachIteration ( boolean clear ) { } public Cookie getCookie ( int row ) { } public void save ( String authFile ) throws IOException { } public void addFile ( String cookieFile ) throws IOException { } public void recoverRunningVersion ( ) { } public void setRunningVersion ( boolean running ) { } public void add ( Cookie c ) { } public void add ( ) { } public void clear ( ) { } public void remove ( int index ) { } public int size ( ) { } public Cookie get ( int i ) { } public String convertLongToDateFormatStr ( long dateLong ) { } public String getCookieHeaderForURL ( URL url ) { } public void addCookieFromHeader ( String cookieHeader , URL url ) { StringTokenizer st = new StringTokenizer ( cookieHeader , ";" ) ; String nvp ; nvp = st . nextToken ( ) ; int index = nvp . indexOf ( "=" ) ; String name = nvp . substring ( 0 , index ) ; String value = nvp . substring ( ( index + 1 ) ) ; String domain = "." + ( url . getHost ( ) ) ; String path = "//" ; Cookie newCookie = new Cookie ( name , value , domain , path , false , ( ( System . currentTimeMillis ( ) ) + ( ( ( 1000 * 60 ) * 60 ) * 24 ) ) ) ; while ( st . hasMoreTokens ( ) ) { nvp = st . nextToken ( ) ; nvp = nvp . trim ( ) ; index = nvp . indexOf ( "=" ) ; if ( index == ( - 1 ) ) { index = nvp . length ( ) ; } String key = nvp . substring ( 0 , index ) ; if ( key . equalsIgnoreCase ( "expires" ) ) { try { String expires = nvp . substring ( ( index + 1 ) ) ; Date date = dateFormat . parse ( expires ) ; newCookie . setExpires ( date . getTime ( ) ) ; } catch ( ParseException pe ) { CookieManager . log . error ( "Couldn't<seq2seq4repair_space>parse<seq2seq4repair_space>Cookie<seq2seq4repair_space>expiration<seq2seq4repair_space>time." , pe ) ; } catch ( Exception e ) { CookieManager . log . error ( "Couln't<seq2seq4repair_space>parse<seq2seq4repair_space>Cookie<seq2seq4repair_space>expiration<seq2seq4repair_space>time:<seq2seq4repair_space>likely<seq2seq4repair_space>JDK<seq2seq4repair_space>bug." , e ) ; } } else if ( key . equalsIgnoreCase ( "domain" ) ) { domain = nvp . substring ( ( index + 1 ) ) . trim ( ) ; if ( ! ( domain . startsWith ( "." ) ) ) { domain = "." + domain ; } newCookie . setDomain ( domain ) ; } else if ( key . equalsIgnoreCase ( "path" ) ) { <START_BUG> newCookie . setPath ( nvp . substring ( ( index + 1 ) ) ) ; <END_BUG> } else if ( key . equalsIgnoreCase ( "secure" ) ) { newCookie . setSecure ( true ) ; } } Vector removeIndices = new Vector ( ) ; for ( int i = ( getCookies ( ) . size ( ) ) - 1 ; i >= 0 ; i -- ) { Cookie cookie = ( ( Cookie ) ( getCookies ( ) . get ( i ) . getObjectValue ( ) ) ) ; if ( cookie == null ) continue ; if ( ( ( cookie . getPath ( ) . equals ( newCookie . getPath ( ) ) ) && ( cookie . getDomain ( ) . equals ( newCookie . getDomain ( ) ) ) ) && ( cookie . getName ( ) . equals ( newCookie . getName ( ) ) ) ) { removeIndices . addElement ( new Integer ( i ) ) ; } } for ( Enumeration e = removeIndices . elements ( ) ; e . hasMoreElements ( ) ; ) { index = ( ( Integer ) ( e . nextElement ( ) ) ) . intValue ( ) ; remove ( index ) ; } if ( ( newCookie . getExpires ( ) ) >= ( System . currentTimeMillis ( ) ) ) { add ( newCookie ) ; } } public void removeCookieNamed ( String name ) { } public String [ ] split ( String splittee , String splitChar , String def ) { } public String getClassLabel ( ) { } public void testStarted ( ) { } public void testEnded ( ) { } public void testStarted ( String host ) { } public void testEnded ( String host ) { } public void testIterationStart ( LoopIterationEvent event ) { } public static class Test extends TestCase { CookieManager man = null ; public Test ( String name ) { } private JMeterContext jmctx = null ; public void setUp ( ) { } public void testRemoveCookie ( ) throws Exception { } public void testSendCookie ( ) throws Exception { } public void testSendCookie2 ( ) throws Exception { } public void testDomainHandling ( ) throws Exception { } public void testSimilarHostNames ( ) throws Exception { } } }

Fix:
newCookie . setPath ( nvp . substring ( ( index + 1 ) ) . trim ( ) ) ;