Remove usage of deprecated code

This commit is contained in:
Dave Syer
2016-05-05 12:37:24 +01:00
parent 8c9317bd7e
commit 6f3cb2f132
2 changed files with 11 additions and 11 deletions

View File

@@ -64,11 +64,12 @@ public class EncryptionBootstrapConfiguration {
KeyStore keyStore = this.key.getKeyStore();
if (keyStore.getLocation() != null && keyStore.getLocation().exists()) {
return new RsaSecretEncryptor(
new KeyStoreKeyFactory(keyStore.getLocation(), keyStore
.getPassword().toCharArray()).getKeyPair(
keyStore.getAlias(), keyStore.getSecret().toCharArray()),
this.key.getRsa().getAlgorithm(), this.key.getRsa().getSalt(), this.key.getRsa()
.isStrong());
new KeyStoreKeyFactory(keyStore.getLocation(),
keyStore.getPassword().toCharArray()).getKeyPair(
keyStore.getAlias(),
keyStore.getSecret().toCharArray()),
this.key.getRsa().getAlgorithm(), this.key.getRsa().getSalt(),
this.key.getRsa().isStrong());
}
return new EncryptorFactory().create(this.key.getKey());
}
@@ -77,7 +78,7 @@ public class EncryptionBootstrapConfiguration {
@Configuration
@Conditional(KeyCondition.class)
@ConditionalOnMissingClass(name = "org.springframework.security.rsa.crypto.RsaSecretEncryptor")
@ConditionalOnMissingClass("org.springframework.security.rsa.crypto.RsaSecretEncryptor")
protected static class VanillaEncryptionConfiguration {
@Autowired

View File

@@ -20,7 +20,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.endpoint.AbstractEndpoint;
import org.springframework.boot.actuate.endpoint.Endpoint;
import org.springframework.boot.context.event.ApplicationPreparedEvent;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.ApplicationEvent;
@@ -43,8 +42,8 @@ import org.springframework.util.ClassUtils;
*/
@ConfigurationProperties("endpoints.restart")
@ManagedResource
public class RestartEndpoint extends AbstractEndpoint<Boolean> implements
ApplicationListener<ApplicationPreparedEvent> {
public class RestartEndpoint extends AbstractEndpoint<Boolean>
implements ApplicationListener<ApplicationPreparedEvent> {
private static Log logger = LogFactory.getLog(RestartEndpoint.class);
@@ -186,8 +185,8 @@ public class RestartEndpoint extends AbstractEndpoint<Boolean> implements
}
private void overrideClassLoaderForRestart() {
ClassUtils.overrideThreadContextClassLoader(this.application.getClass()
.getClassLoader());
ClassUtils.overrideThreadContextClassLoader(
this.application.getClass().getClassLoader());
}
private class IntegrationShutdown {