Removed exceptions from @PostConstruct methods, closes #663

pull/705/head
Justin Richer 10 years ago
parent 7f8402e59e
commit f4b508fa62

@ -66,7 +66,7 @@ public class StaticClientConfigurationService implements ClientConfigurationServ
}
@PostConstruct
public void afterPropertiesSet() throws Exception {
public void afterPropertiesSet() {
if (clients == null || clients.isEmpty()) {
throw new IllegalArgumentException("Clients map cannot be null or empty");
}

@ -60,7 +60,7 @@ public class StaticServerConfigurationService implements ServerConfigurationServ
}
@PostConstruct
public void afterPropertiesSet() throws Exception {
public void afterPropertiesSet() {
if (servers == null || servers.isEmpty()) {
throw new IllegalArgumentException("Servers map cannot be null or empty.");
}

@ -60,7 +60,7 @@ public class StaticSingleIssuerService implements IssuerService {
}
@PostConstruct
public void afterPropertiesSet() throws Exception {
public void afterPropertiesSet() {
if (Strings.isNullOrEmpty(issuer)) {
throw new IllegalArgumentException("Issuer must not be null or empty.");

@ -127,11 +127,8 @@ public class ThirdPartyIssuerService implements IssuerService {
this.blacklist = blacklist;
}
/* (non-Javadoc)
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
@PostConstruct
public void afterPropertiesSet() throws Exception {
public void afterPropertiesSet() {
if (Strings.isNullOrEmpty(this.accountChooserUrl)) {
throw new IllegalArgumentException("Account Chooser URL cannot be null or empty");
}

@ -109,12 +109,20 @@ public class DefaultJwtEncryptionAndDecryptionService implements JwtEncryptionAn
@PostConstruct
public void afterPropertiesSet() throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException{
public void afterPropertiesSet() {
if (keys == null) {
throw new IllegalArgumentException("Encryption and decryption service must have at least one key configured.");
}
buildEncryptersAndDecrypters();
try {
buildEncryptersAndDecrypters();
} catch (NoSuchAlgorithmException e) {
throw new IllegalArgumentException("Encryption and decryption service could not find given algorithm.");
} catch (InvalidKeySpecException e) {
throw new IllegalArgumentException("Encryption and decryption service saw an invalid key specification.");
} catch (JOSEException e) {
throw new IllegalArgumentException("Encryption and decryption service was unable to process JOSE object.");
}
}
public String getDefaultEncryptionKeyId() {

Loading…
Cancel
Save