[java-opensaml] 03/04: JPAR-85 - Checkstyle, check final parameters
Tom Zeller
tzeller at dragonacea.biz
Mon Aug 7 16:51:56 EDT 2017
This is an automated email from the git hooks/post-receive script.
tzeller pushed a commit to branch master
in repository java-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=209a98b1d492421eaf78bb7b36fa642bbca6dfa3
commit 209a98b1d492421eaf78bb7b36fa642bbca6dfa3
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Mon Aug 7 15:50:45 2017 -0500
JPAR-85 - Checkstyle, check final parameters
---
.../handler/impl/HTTPRequestValidationHandler.java | 16 ++++++++--------
.../handler/impl/MessageHandlerErrorStrategyAdapter.java | 8 ++++----
.../messaging/handler/impl/SchemaValidateXMLMessage.java | 4 ++--
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/HTTPRequestValidationHandler.java b/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/HTTPRequestValidationHandler.java
index dc7adb6..2577388 100644
--- a/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/HTTPRequestValidationHandler.java
+++ b/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/HTTPRequestValidationHandler.java
@@ -64,7 +64,7 @@ public class HTTPRequestValidationHandler extends AbstractMessageHandler {
*
* @param contentType the content type
*/
- public void setRequiredContentType(String contentType) {
+ public void setRequiredContentType(final String contentType) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
requiredContentType = contentType;
requiredRequestMethod = StringSupport.trimOrNull(contentType);
@@ -84,7 +84,7 @@ public class HTTPRequestValidationHandler extends AbstractMessageHandler {
*
* @param requestMethod the required request method
*/
- public void setRequiredRequestMethod(String requestMethod) {
+ public void setRequiredRequestMethod(final String requestMethod) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
requiredRequestMethod = StringSupport.trimOrNull(requestMethod);
}
@@ -103,7 +103,7 @@ public class HTTPRequestValidationHandler extends AbstractMessageHandler {
*
* @param secured true if required to be secure, false otherwise
*/
- public void setRequireSecured(boolean secured) {
+ public void setRequireSecured(final boolean secured) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
requireSecured = secured;
}
@@ -122,7 +122,7 @@ public class HTTPRequestValidationHandler extends AbstractMessageHandler {
*
* @param request the request instance
*/
- public void setHttpServletRequest(HttpServletRequest request) {
+ public void setHttpServletRequest(final HttpServletRequest request) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
httpServletRequest = Constraint.isNotNull(request, "HttpServletRequest may not be null");
}
@@ -141,7 +141,7 @@ public class HTTPRequestValidationHandler extends AbstractMessageHandler {
*
* @throws MessageHandlerException thrown if the request does not meet the requirements of the handler
*/
- protected void doInvoke(MessageContext messageContext) throws MessageHandlerException {
+ protected void doInvoke(final MessageContext messageContext) throws MessageHandlerException {
evaluateContentType(getHttpServletRequest());
evaluateRequestMethod(getHttpServletRequest());
evaluateSecured(getHttpServletRequest());
@@ -154,7 +154,7 @@ public class HTTPRequestValidationHandler extends AbstractMessageHandler {
*
* @throws MessageHandlerException thrown if the content type was an unexpected value
*/
- protected void evaluateContentType(HttpServletRequest request) throws MessageHandlerException {
+ protected void evaluateContentType(final HttpServletRequest request) throws MessageHandlerException {
String transportContentType = request.getHeader("Content-Type");
if (getRequiredContentType() != null && !transportContentType.startsWith(getRequiredContentType())) {
log.error("Invalid content type, expected '{}' but was '{}'", getRequiredContentType(),
@@ -171,7 +171,7 @@ public class HTTPRequestValidationHandler extends AbstractMessageHandler {
*
* @throws MessageHandlerException thrown if the request method was an unexpected value
*/
- protected void evaluateRequestMethod(HttpServletRequest request) throws MessageHandlerException {
+ protected void evaluateRequestMethod(final HttpServletRequest request) throws MessageHandlerException {
String transportMethod = request.getMethod();
if (getRequiredRequestMethod() != null && !transportMethod.equalsIgnoreCase(getRequiredRequestMethod())) {
log.error("Invalid request method, expected '{}' but was '{}'", getRequiredRequestMethod(),
@@ -188,7 +188,7 @@ public class HTTPRequestValidationHandler extends AbstractMessageHandler {
*
* @throws MessageHandlerException thrown if the request is not secure and was required to be
*/
- protected void evaluateSecured(HttpServletRequest request) throws MessageHandlerException {
+ protected void evaluateSecured(final HttpServletRequest request) throws MessageHandlerException {
if (isRequireSecured() && !request.isSecure()) {
log.error("Request was required to be secured but was not");
throw new MessageHandlerException("Request was required to be secured but was not");
diff --git a/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/MessageHandlerErrorStrategyAdapter.java b/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/MessageHandlerErrorStrategyAdapter.java
index 957e034..66ab412 100644
--- a/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/MessageHandlerErrorStrategyAdapter.java
+++ b/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/MessageHandlerErrorStrategyAdapter.java
@@ -104,7 +104,7 @@ public class MessageHandlerErrorStrategyAdapter<MessageType> extends AbstractMes
*
* @param flag true if should rethrow, false if not
*/
- public void setRethrowIfHandled(boolean flag) {
+ public void setRethrowIfHandled(final boolean flag) {
rethrowIfHandled = flag;
}
@@ -116,16 +116,16 @@ public class MessageHandlerErrorStrategyAdapter<MessageType> extends AbstractMes
*
* @param flag true if should rethrow, false if not
*/
- public void setRethrowIfNotHandled(boolean flag) {
+ public void setRethrowIfNotHandled(final boolean flag) {
rethrowIfNotHandled = flag;
}
/** {@inheritDoc} */
- protected void doInvoke(MessageContext<MessageType> messageContext) throws MessageHandlerException {
+ protected void doInvoke(final MessageContext<MessageType> messageContext) throws MessageHandlerException {
try {
wrappedHandler.invoke(messageContext);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
log.trace("Wrapped message handler threw error", t);
for (TypedMessageErrorHandler errorHandler : errorHandlers) {
if (errorHandler.handlesError(t)) {
diff --git a/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/SchemaValidateXMLMessage.java b/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/SchemaValidateXMLMessage.java
index 2d94856..ced5bae 100644
--- a/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/SchemaValidateXMLMessage.java
+++ b/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/SchemaValidateXMLMessage.java
@@ -99,11 +99,11 @@ public class SchemaValidateXMLMessage<MessageType extends XMLObject> extends Abs
try {
final Validator schemaValidator = validationSchema.newValidator();
schemaValidator.validate(new DOMSource(messageContext.getMessage().getDOM()));
- } catch (SAXException e) {
+ } catch (final SAXException e) {
log.debug("{} Message {} is not schema-valid", getLogPrefix(), messageContext.getMessage()
.getElementQName(), e);
throw new MessageHandlerException("Message is not schema-valid.", e);
- } catch (IOException e) {
+ } catch (final IOException e) {
log.debug("{} Unable to read message", getLogPrefix(), e);
throw new MessageHandlerException("Unable to read message.", e);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list