mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-06 18:52:13 +00:00
Java 7: Identical 'catch' branches in 'try' statement
This commit is contained in:
parent
5e44a249f8
commit
25c06be1eb
@ -111,11 +111,7 @@ public class DefaultAuthenticationEventPublisher implements AuthenticationEventP
|
|||||||
try {
|
try {
|
||||||
event = constructor.newInstance(authentication, exception);
|
event = constructor.newInstance(authentication, exception);
|
||||||
}
|
}
|
||||||
catch (IllegalAccessException ignored) {
|
catch (IllegalAccessException | InvocationTargetException | InstantiationException ignored) {
|
||||||
}
|
|
||||||
catch (InstantiationException ignored) {
|
|
||||||
}
|
|
||||||
catch (InvocationTargetException ignored) {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,17 +179,12 @@ public class ProviderManager implements AuthenticationManager, MessageSourceAwar
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (AccountStatusException e) {
|
catch (AccountStatusException | InternalAuthenticationServiceException e) {
|
||||||
prepareException(e, authentication);
|
prepareException(e, authentication);
|
||||||
// SEC-546: Avoid polling additional providers if auth failure is due to
|
// SEC-546: Avoid polling additional providers if auth failure is due to
|
||||||
// invalid account status
|
// invalid account status
|
||||||
throw e;
|
throw e;
|
||||||
}
|
} catch (AuthenticationException e) {
|
||||||
catch (InternalAuthenticationServiceException e) {
|
|
||||||
prepareException(e, authentication);
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
catch (AuthenticationException e) {
|
|
||||||
lastException = e;
|
lastException = e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,11 +116,7 @@ public class OpenID4JavaConsumer implements OpenIDConsumer {
|
|||||||
authReq.addExtension(fetchRequest);
|
authReq.addExtension(fetchRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (MessageException e) {
|
catch (MessageException | ConsumerException e) {
|
||||||
throw new OpenIDConsumerException(
|
|
||||||
"Error processing ConsumerManager authentication", e);
|
|
||||||
}
|
|
||||||
catch (ConsumerException e) {
|
|
||||||
throw new OpenIDConsumerException(
|
throw new OpenIDConsumerException(
|
||||||
"Error processing ConsumerManager authentication", e);
|
"Error processing ConsumerManager authentication", e);
|
||||||
}
|
}
|
||||||
@ -164,13 +160,7 @@ public class OpenID4JavaConsumer implements OpenIDConsumer {
|
|||||||
verification = consumerManager.verify(receivingURL.toString(), openidResp,
|
verification = consumerManager.verify(receivingURL.toString(), openidResp,
|
||||||
discovered);
|
discovered);
|
||||||
}
|
}
|
||||||
catch (MessageException e) {
|
catch (MessageException | AssociationException | DiscoveryException e) {
|
||||||
throw new OpenIDConsumerException("Error verifying openid response", e);
|
|
||||||
}
|
|
||||||
catch (DiscoveryException e) {
|
|
||||||
throw new OpenIDConsumerException("Error verifying openid response", e);
|
|
||||||
}
|
|
||||||
catch (AssociationException e) {
|
|
||||||
throw new OpenIDConsumerException("Error verifying openid response", e);
|
throw new OpenIDConsumerException("Error verifying openid response", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,10 +77,7 @@ public class ClientApplication {
|
|||||||
System.out
|
System.out
|
||||||
.println("This client proxy factory does not have a setUsername(String) method");
|
.println("This client proxy factory does not have a setUsername(String) method");
|
||||||
}
|
}
|
||||||
catch (IllegalAccessException ignored) {
|
catch (IllegalAccessException | InvocationTargetException ignored) {
|
||||||
ignored.printStackTrace();
|
|
||||||
}
|
|
||||||
catch (InvocationTargetException ignored) {
|
|
||||||
ignored.printStackTrace();
|
ignored.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,9 +95,7 @@ public class ClientApplication {
|
|||||||
System.out
|
System.out
|
||||||
.println("This client proxy factory does not have a setPassword(String) method");
|
.println("This client proxy factory does not have a setPassword(String) method");
|
||||||
}
|
}
|
||||||
catch (IllegalAccessException ignored) {
|
catch (IllegalAccessException | InvocationTargetException ignored) {
|
||||||
}
|
|
||||||
catch (InvocationTargetException ignored) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("Calling ContactManager '" + beanName + "'");
|
System.out.println("Calling ContactManager '" + beanName + "'");
|
||||||
|
@ -114,19 +114,9 @@ public class WebXmlMappableAttributesRetriever implements ResourceLoaderAware,
|
|||||||
doc = db.parse(aStream);
|
doc = db.parse(aStream);
|
||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
catch (FactoryConfigurationError e) {
|
catch (FactoryConfigurationError | IOException | SAXException | ParserConfigurationException e) {
|
||||||
throw new RuntimeException("Unable to parse document object", e);
|
throw new RuntimeException("Unable to parse document object", e);
|
||||||
}
|
} finally {
|
||||||
catch (ParserConfigurationException e) {
|
|
||||||
throw new RuntimeException("Unable to parse document object", e);
|
|
||||||
}
|
|
||||||
catch (SAXException e) {
|
|
||||||
throw new RuntimeException("Unable to parse document object", e);
|
|
||||||
}
|
|
||||||
catch (IOException e) {
|
|
||||||
throw new RuntimeException("Unable to parse document object", e);
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
try {
|
try {
|
||||||
aStream.close();
|
aStream.close();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user