Buggy code:
public class CacheManager extends ConfigTestElement implements Serializable , TestListener { private static final long serialVersionUID = 234L ; private static final Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String CLEAR = "clearEachIteration" ; public static final String USE_EXPIRES = "useExpires" ; public static final String MAX_SIZE = "maxSize" ; private transient InheritableThreadLocal < Map < String , CacheManager . CacheEntry > > threadCache ; private transient boolean useExpires ; private static final int DEFAULT_MAX_SIZE = 5000 ; public CacheManager ( ) { } static class CacheEntry { private final String lastModified ; private final String etag ; private final Date expires ; public CacheEntry ( String lastModified , Date expires , String etag ) { } public String getLastModified ( ) { } public String getEtag ( ) { } @ Override public String toString ( ) { } public Date getExpires ( ) { } } public void saveDetails ( URLConnection conn , SampleResult res ) { } public void saveDetails ( HttpMethod method , SampleResult res ) throws URIException { } public void saveDetails ( HttpResponse method , SampleResult res ) { } private void setCache ( String lastModified , String cacheControl , String expires , String etag , String url ) { if ( CacheManager . log . isDebugEnabled ( ) ) { CacheManager . log . debug ( ( ( ( ( ( ( ( ( ( ( "SET(both)<seq2seq4repair_space>" + url ) + "<seq2seq4repair_space>" ) + cacheControl ) + "<seq2seq4repair_space>" ) + lastModified ) + "<seq2seq4repair_space>" ) + "<seq2seq4repair_space>" ) + expires ) + "<seq2seq4repair_space>" ) + etag ) ) ; } Date expiresDate = null ; if ( useExpires ) { final String MAX_AGE = "max-age=" ; <START_BUG> if ( ( ( cacheControl != null ) && ( cacheControl . contains ( "public" ) ) ) && ( cacheControl . contains ( MAX_AGE ) ) ) { <END_BUG> long maxAgeInSecs = Long . parseLong ( cacheControl . substring ( ( ( cacheControl . indexOf ( MAX_AGE ) ) + ( MAX_AGE . length ( ) ) ) ) . split ( "[,<seq2seq4repair_space>]" ) [ 0 ] ) ; expiresDate = new Date ( ( ( System . currentTimeMillis ( ) ) + ( maxAgeInSecs * 1000 ) ) ) ; } else if ( expires != null ) { try { expiresDate = DateUtil . parseDate ( expires ) ; } catch ( DateParseException e ) { if ( CacheManager . log . isDebugEnabled ( ) ) { CacheManager . log . debug ( ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>Expires:<seq2seq4repair_space>'" + expires ) + "'<seq2seq4repair_space>" ) + e ) ) ; } expiresDate = new Date ( 0L ) ; } } } getCache ( ) . put ( url , new CacheManager . CacheEntry ( lastModified , expiresDate , etag ) ) ; } private String getHeader ( HttpMethod method , String name ) { } private String getHeader ( HttpResponse method , String name ) { } private boolean isCacheable ( SampleResult res ) { } public void setHeaders ( URL url , HttpMethod method ) { } public void setHeaders ( URL url , HttpRequestBase request ) { } public void setHeaders ( HttpURLConnection conn , URL url ) { } public boolean inCache ( URL url ) { } private Map < String , CacheManager . CacheEntry > getCache ( ) { } public boolean getClearEachIteration ( ) { } public void setClearEachIteration ( boolean clear ) { } public boolean getUseExpires ( ) { } public void setUseExpires ( boolean expires ) { } public int getMaxSize ( ) { } public void setMaxSize ( int size ) { } @ Override public void clear ( ) { } private void clearCache ( ) { } public void testStarted ( ) { } public void testEnded ( ) { } public void testStarted ( String host ) { } public void testEnded ( String host ) { } public void testIterationStart ( LoopIterationEvent event ) { } }

Fix:
if ( ( ( cacheControl != null ) && ( ( cacheControl . contains ( "public" ) ) || ( cacheControl . contains ( "private" ) ) ) ) && ( cacheControl . contains ( MAX_AGE ) ) ) {