Source:
<code>public void execute() throws Exception { KeystoreService ks = getKeystoreService(); AliasService as = getAliasService(); if (ks != null) { try { if (!ks.isCredentialStoreForClusterAvailable(GATEWAY_CREDENTIAL_STORE_NAME)) { ks.createCredentialStoreForCluster(GATEWAY_CREDENTIAL_STORE_NAME); } else { } } catch (KeystoreServiceException e) { throw new ServiceLifecycleException("Keystore was not loaded properly - the stored password may not match the password for the keystore.", e); } try { if (!ks.isKeystoreForGatewayAvailable()) { ks.createKeystoreForGateway(); } else { } <START> boolean isSelfSigned; <END> Certificate certificate; try { certificate = ks.getCertificateForGateway(); } catch (KeystoreServiceException e) { certificate = null; } isSelfSigned = (certificate == null) || X509CertificateUtil.isSelfSignedCertificate(certificate); if ((certificate == null) || isSelfSigned || force) { char[] passphrase = as.getGatewayIdentityPassphrase(); if (passphrase == null) { MasterService ms = services.getService("MasterService"); passphrase = ms.getMasterSecret(); } ks.addSelfSignedCertForGateway(getGatewayConfig().getIdentityKeyAlias(), passphrase, hostname); out.println("Certificate " + getGatewayConfig().getIdentityKeyAlias() + " has been successfully created."); } else { out.println("A non-self-signed certificate has already been installed in the configured keystore. " + "Please use --force if you wish to overwrite it with a generated self-signed certificate."); } } catch (KeystoreServiceException e) { throw new ServiceLifecycleException("Keystore was not loaded properly - the provided (or persisted) master secret may not match the password for the keystore.", e); } } }</code><technical_language>Moving this declaration initiate variable</technical_language>

Target:
public void execute() throws Exception { KeystoreService ks = getKeystoreService(); AliasService as = getAliasService(); if (ks != null) { try { if (!ks.isCredentialStoreForClusterAvailable(GATEWAY_CREDENTIAL_STORE_NAME)) { ks.createCredentialStoreForCluster(GATEWAY_CREDENTIAL_STORE_NAME); } else { } } catch (KeystoreServiceException e) { throw new ServiceLifecycleException("Keystore was not loaded properly - the stored password may not match the password for the keystore.", e); } try { if (!ks.isKeystoreForGatewayAvailable()) { ks.createKeystoreForGateway(); } else { } GatewayConfig config = getGatewayConfig(); if ( !isForceRequired(config, ks) || force) { char[] passphrase = as.getGatewayIdentityPassphrase(); if (passphrase == null) { MasterService ms = services.getService("MasterService"); passphrase = ms.getMasterSecret(); } ks.addSelfSignedCertForGateway(config.getIdentityKeyAlias(), passphrase, hostname); out.println("Certificate " + config.getIdentityKeyAlias() + " has been successfully created."); } else { out.println("A non-self-signed certificate has already been installed in the configured keystore. " + "Please use --force if you wish to overwrite it with a generated self-signed certificate."); } } catch (KeystoreServiceException e) { throw new ServiceLifecycleException("The identity keystore was not loaded properly - the provided password may not match the password for the keystore.", e); } } }