Buggy code:
public class KeyToolUtils { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String DEFAULT_DNAME = "cn=JMeter<seq2seq4repair_space>Proxy<seq2seq4repair_space>(DO<seq2seq4repair_space>NOT<seq2seq4repair_space>TRUST)" ; private static final String DNAME_ROOT_KEY = "cn=Apache<seq2seq4repair_space>JMeter<seq2seq4repair_space>Proxy<seq2seq4repair_space>root<seq2seq4repair_space>(TEMPORARY<seq2seq4repair_space>TRUST<seq2seq4repair_space>ONLY)" ; private static final String DNAME_CA_KEY = "cn=Apache<seq2seq4repair_space>JMeter<seq2seq4repair_space>Proxy<seq2seq4repair_space>server<seq2seq4repair_space>CA<seq2seq4repair_space>(TEMPORARY<seq2seq4repair_space>TRUST<seq2seq4repair_space>ONLY)" ; private static final String CACERT = "ApacheJMeterTemporaryCA.crt" ; private static final String ROOT_ALIAS = "root" ; public static final String CA_ALIAS = "ca" ; public static final boolean SUPPORTS_HOST_CERT = SystemUtils . isJavaVersionAtLeast ( JavaVersion . JAVA_1_7 ) ; private KeyToolUtils ( ) { } public static void genkeypair ( final File keystore , String alias , final String password , int validity , String dname , String ext ) throws IOException { } public static void generateProxyCA ( File keystore , String password , int validity ) throws IOException { keystore . delete ( ) ; <START_BUG> if ( ! ( new File ( KeyToolUtils . CACERT ) . delete ( ) ) ) { <END_BUG> KeyToolUtils . log . warn ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>delete<seq2seq4repair_space>file:" + ( new File ( KeyToolUtils . CACERT ) . getAbsolutePath ( ) ) ) + ",<seq2seq4repair_space>will<seq2seq4repair_space>continue<seq2seq4repair_space>ignoring<seq2seq4repair_space>this" ) ) ; } KeyToolUtils . genkeypair ( keystore , KeyToolUtils . ROOT_ALIAS , password , validity , KeyToolUtils . DNAME_ROOT_KEY , "bc:c" ) ; KeyToolUtils . genkeypair ( keystore , KeyToolUtils . CA_ALIAS , password , validity , KeyToolUtils . DNAME_CA_KEY , "bc:c" ) ; ByteArrayOutputStream certReqOut = new ByteArrayOutputStream ( ) ; KeyToolUtils . keytool ( "-certreq" , keystore , password , KeyToolUtils . CA_ALIAS , null , certReqOut ) ; InputStream certReqIn = new ByteArrayInputStream ( certReqOut . toByteArray ( ) ) ; KeyToolUtils . keytool ( "-gencert" , keystore , password , KeyToolUtils . CA_ALIAS , certReqIn , null , "-ext" , "BC:0" , "-outfile" , KeyToolUtils . CACERT ) ; KeyToolUtils . keytool ( "-importcert" , keystore , password , KeyToolUtils . CA_ALIAS , null , null , "-file" , KeyToolUtils . CACERT ) ; } public static void generateDomainCert ( File keystore , String password , String domain , int validity ) throws IOException { } public static void generateHostCert ( File keystore , String password , String host , int validity ) throws IOException { } private static void generateSignedCert ( File keystore , String password , int validity , String alias , String subject ) throws IOException { } public static String list ( final File keystore , final String storePass ) throws IOException { } static void keytool ( String command , File keystore , String password , String alias , InputStream input , OutputStream output , String ... parameters ) throws IOException { } }

Fix:
if ( ( new File ( KeyToolUtils . CACERT ) . exists ( ) ) && ( ! ( new File ( KeyToolUtils . CACERT ) . delete ( ) ) ) ) {