[java-opensaml] 03/12: JPAR-85 - Checkstyle, check final parameters
Tom Zeller
tzeller at dragonacea.biz
Thu Aug 10 18:25:52 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=d164b3d39025a8a988944ece039d1deebc1dcc15
commit d164b3d39025a8a988944ece039d1deebc1dcc15
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Thu Aug 10 16:23:41 2017 -0500
JPAR-85 - Checkstyle, check final parameters
---
.../opensaml/storage/impl/JPAStorageService.java | 54 +++++++++++-----------
.../opensaml/storage/impl/LDAPStorageService.java | 12 ++---
.../impl/ServletRequestScopedStorageService.java | 13 +++---
.../impl/client/ClientStorageSaveContext.java | 2 +-
.../storage/impl/client/ClientStorageService.java | 5 +-
.../client/PopulateClientStorageSaveContext.java | 2 +-
.../impl/memcached/MemcachedStorageRecord.java | 2 +-
.../impl/memcached/MemcachedStorageService.java | 14 +++---
.../impl/memcached/StorageRecordTranscoder.java | 2 +-
.../storage/impl/memcached/StringTranscoder.java | 2 +-
10 files changed, 55 insertions(+), 53 deletions(-)
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/JPAStorageService.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/JPAStorageService.java
index 69428fd..1e6a9de 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/JPAStorageService.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/JPAStorageService.java
@@ -160,7 +160,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive()) {
try {
transaction.rollback();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
log.error("Error rolling back transaction", e);
}
}
@@ -173,7 +173,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive()) {
try {
transaction.rollback();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
log.error("Error rolling back transaction", e);
}
}
@@ -184,7 +184,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive() && !transaction.getRollbackOnly()) {
try {
transaction.commit();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error committing transaction", e);
}
}
@@ -195,7 +195,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (manager != null && manager.isOpen()) {
try {
manager.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error closing entity manager", e);
}
}
@@ -221,7 +221,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (manager != null && manager.isOpen()) {
try {
manager.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error closing entity manager", e);
}
}
@@ -249,7 +249,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (manager != null && manager.isOpen()) {
try {
manager.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error closing entity manager", e);
}
}
@@ -273,7 +273,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (manager != null && manager.isOpen()) {
try {
manager.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error closing entity manager", e);
}
}
@@ -335,7 +335,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive()) {
try {
transaction.rollback();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
log.error("Error rolling back transaction", e);
}
}
@@ -344,14 +344,14 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive() && !transaction.getRollbackOnly()) {
try {
transaction.commit();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error committing transaction", e);
}
}
if (manager != null && manager.isOpen()) {
try {
manager.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error closing entity manager", e);
}
}
@@ -455,7 +455,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive()) {
try {
transaction.rollback();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
log.error("Error rolling back transaction", e);
}
}
@@ -464,7 +464,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive() && !transaction.getRollbackOnly()) {
try {
transaction.commit();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error committing transaction", e);
}
}
@@ -475,7 +475,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (manager != null && manager.isOpen()) {
try {
manager.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error closing entity manager", e);
}
}
@@ -549,7 +549,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive()) {
try {
transaction.rollback();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
log.error("Error rolling back transaction", e);
}
}
@@ -558,7 +558,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive() && !transaction.getRollbackOnly()) {
try {
transaction.commit();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error committing transaction", e);
}
}
@@ -569,7 +569,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (manager != null && manager.isOpen()) {
try {
manager.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error closing entity manager", e);
}
}
@@ -609,7 +609,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive()) {
try {
transaction.rollback();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
log.error("Error rolling back transaction", e);
}
}
@@ -618,7 +618,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive() && !transaction.getRollbackOnly()) {
try {
transaction.commit();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error committing transaction", e);
}
}
@@ -629,7 +629,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (manager != null && manager.isOpen()) {
try {
manager.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error closing entity manager", e);
}
}
@@ -693,7 +693,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive()) {
try {
transaction.rollback();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
log.error("Error rolling back transaction", e);
}
}
@@ -702,7 +702,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive() && !transaction.getRollbackOnly()) {
try {
transaction.commit();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error committing transaction", e);
}
}
@@ -713,7 +713,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (manager != null && manager.isOpen()) {
try {
manager.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error closing entity manager", e);
}
}
@@ -756,7 +756,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive()) {
try {
transaction.rollback();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
log.error("Error rolling back transaction", e);
}
}
@@ -765,7 +765,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive() && !transaction.getRollbackOnly()) {
try {
transaction.commit();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error committing transaction", e);
}
}
@@ -776,7 +776,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (manager != null && manager.isOpen()) {
try {
manager.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error closing entity manager", e);
}
}
@@ -820,7 +820,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive()) {
try {
transaction.rollback();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
log.error("Error rolling back transaction", e);
}
}
@@ -829,7 +829,7 @@ public class JPAStorageService extends AbstractStorageService implements Storage
if (transaction != null && transaction.isActive() && !transaction.getRollbackOnly()) {
try {
transaction.commit();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error committing transaction", e);
}
}
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/LDAPStorageService.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/LDAPStorageService.java
index ab73458..294eb5e 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/LDAPStorageService.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/LDAPStorageService.java
@@ -110,7 +110,7 @@ public class LDAPStorageService extends AbstractStorageService implements Storag
/** {@inheritDoc} */
@Override public boolean create(@Nonnull @NotEmpty final String context, @Nonnull @NotEmpty final String key,
- @Nonnull @NotEmpty final String value, @Nullable @Positive Long expiration) throws IOException {
+ @Nonnull @NotEmpty final String value, @Nullable @Positive final Long expiration) throws IOException {
if (expiration != null) {
throw new UnsupportedOperationException("Expiration not supported");
}
@@ -119,7 +119,7 @@ public class LDAPStorageService extends AbstractStorageService implements Storag
try {
merge(entry);
return true;
- } catch (LdapException e) {
+ } catch (final LdapException e) {
log.error("LDAP merge operation failed", e);
throw new IOException(e);
}
@@ -131,7 +131,7 @@ public class LDAPStorageService extends AbstractStorageService implements Storag
SearchResult result = null;
try {
result = search(context, key).getResult();
- } catch (LdapException e) {
+ } catch (final LdapException e) {
if (e.getResultCode() != ResultCode.NO_SUCH_OBJECT) {
log.error("LDAP search operation failed", e);
throw new IOException(e);
@@ -167,7 +167,7 @@ public class LDAPStorageService extends AbstractStorageService implements Storag
try {
merge(entry);
return true;
- } catch (LdapException e) {
+ } catch (final LdapException e) {
log.error("LDAP merge operation failed", e);
throw new IOException(e);
}
@@ -193,7 +193,7 @@ public class LDAPStorageService extends AbstractStorageService implements Storag
try {
deleteAttribute(context, key);
return true;
- } catch (LdapException e) {
+ } catch (final LdapException e) {
log.error("LDAP modify operation failed", e);
throw new IOException(e);
}
@@ -220,7 +220,7 @@ public class LDAPStorageService extends AbstractStorageService implements Storag
@Override public void deleteContext(@Nonnull @NotEmpty final String context) throws IOException {
try {
delete(context);
- } catch (LdapException e) {
+ } catch (final LdapException e) {
log.error("LDAP delete operation failed", e);
throw new IOException(e);
}
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/ServletRequestScopedStorageService.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/ServletRequestScopedStorageService.java
index 4fe46d5..7d3c4a7 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/ServletRequestScopedStorageService.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/ServletRequestScopedStorageService.java
@@ -267,13 +267,14 @@ public class ServletRequestScopedStorageService extends AbstractMapBackedStorage
/** {@inheritDoc} */
@Override
- public void init(FilterConfig filterConfig) throws ServletException {
+ public void init(final FilterConfig filterConfig) throws ServletException {
}
/** {@inheritDoc} */
@Override
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
+ public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
+ throws IOException,
ServletException {
if (!(response instanceof HttpServletResponse)) {
throw new ServletException("Response was not an HttpServletResponse");
@@ -566,19 +567,19 @@ public class ServletRequestScopedStorageService extends AbstractMapBackedStorage
}
/** {@inheritDoc} */
- public void sendError(int sc, String msg) throws IOException {
+ public void sendError(final int sc, final String msg) throws IOException {
save();
super.sendError(sc, msg);
}
/** {@inheritDoc} */
- public void sendError(int sc) throws IOException {
+ public void sendError(final int sc) throws IOException {
save();
super.sendError(sc);
}
/** {@inheritDoc} */
- public void sendRedirect(String location) throws IOException {
+ public void sendRedirect(final String location) throws IOException {
save();
super.sendRedirect(location);
}
@@ -625,7 +626,7 @@ public class ServletRequestScopedStorageService extends AbstractMapBackedStorage
}
/** {@inheritDoc} */
- public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {
+ public boolean tryLock(final long time, final TimeUnit unit) throws InterruptedException {
return true;
}
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageSaveContext.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageSaveContext.java
index ac1cbe4..e405b23 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageSaveContext.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageSaveContext.java
@@ -62,7 +62,7 @@ public class ClientStorageSaveContext extends BaseContext {
*/
public boolean isSourceRequired(@Nonnull final ClientStorageSource source) {
return Iterables.any(storageOperations, new Predicate<ClientStorageServiceOperation>() {
- public boolean apply(ClientStorageServiceOperation input) {
+ public boolean apply(final ClientStorageServiceOperation input) {
return input.getStorageSource() == source;
}
});
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java
index 74e3b41..da870f8 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java
@@ -242,13 +242,14 @@ public class ClientStorageService extends AbstractMapBackedStorageService implem
/** {@inheritDoc} */
@Override
- public void init(FilterConfig filterConfig) throws ServletException {
+ public void init(final FilterConfig filterConfig) throws ServletException {
}
/** {@inheritDoc} */
@Override
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
+ public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
+ throws IOException,
ServletException {
// This is just a no-op available to preserve compatibility with web.xml references to the
// older storage plugin that saved modified data back to a cookie on every response.
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/PopulateClientStorageSaveContext.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/PopulateClientStorageSaveContext.java
index 70406cf..1f11e79 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/PopulateClientStorageSaveContext.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/PopulateClientStorageSaveContext.java
@@ -120,7 +120,7 @@ public class PopulateClientStorageSaveContext<InboundMessageType, OutboundMessag
if (log.isDebugEnabled()) {
final Collection<String> ids = Collections2.transform(saveCtx.getStorageOperations(),
new Function<ClientStorageServiceOperation,String>() {
- public String apply(ClientStorageServiceOperation input) {
+ public String apply(final ClientStorageServiceOperation input) {
return input.getStorageServiceID();
}
});
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageRecord.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageRecord.java
index 71694f4..4b3efdb 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageRecord.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageRecord.java
@@ -37,7 +37,7 @@ public class MemcachedStorageRecord extends StorageRecord {
* @param val Stored value.
* @param exp Expiration instant in milliseconds, null for infinite expiration.
*/
- public MemcachedStorageRecord(@Nonnull @NotEmpty String val, @Nullable Long exp) {
+ public MemcachedStorageRecord(@Nonnull @NotEmpty final String val, @Nullable final Long exp) {
super(val, exp);
}
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageService.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageService.java
index 7427486..6f90f74 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageService.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageService.java
@@ -232,7 +232,7 @@ public class MemcachedStorageService extends AbstractIdentifiableInitializableCo
/** {@inheritDoc} */
@Override
- public boolean create(@Nonnull Object value) throws IOException {
+ public boolean create(@Nonnull final Object value) throws IOException {
Constraint.isNotNull(value, "Value cannot be null");
return create(
AnnotationSupport.getContext(value),
@@ -257,7 +257,7 @@ public class MemcachedStorageService extends AbstractIdentifiableInitializableCo
final CASValue<MemcachedStorageRecord> record;
try {
record = handleAsyncResult(memcacheClient.asyncGets(cacheKey, storageRecordTranscoder));
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
throw new IOException("Memcached operation failed", e);
}
if (record == null) {
@@ -327,7 +327,7 @@ public class MemcachedStorageService extends AbstractIdentifiableInitializableCo
/** {@inheritDoc} */
@Override
- public boolean update(@Nonnull Object value) throws IOException {
+ public boolean update(@Nonnull final Object value) throws IOException {
Constraint.isNotNull(value, "Value cannot be null");
return update(
AnnotationSupport.getContext(value),
@@ -592,7 +592,7 @@ public class MemcachedStorageService extends AbstractIdentifiableInitializableCo
final CASValue<String> result = handleAsyncResult(
memcacheClient.asyncGets(memcachedKey(context), stringTranscoder));
return result == null ? null : result.getValue();
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
throw new IOException("Memcached operation failed", e);
}
}
@@ -662,11 +662,11 @@ public class MemcachedStorageService extends AbstractIdentifiableInitializableCo
private <T> T handleAsyncResult(final OperationFuture<T> result) throws IOException {
try {
return result.get(operationTimeout, TimeUnit.SECONDS);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
throw new IOException("Memcached operation interrupted");
- } catch (TimeoutException e) {
+ } catch (final TimeoutException e) {
throw new IOException("Memcached operation did not complete in time (" + operationTimeout + "s)");
- } catch (ExecutionException e) {
+ } catch (final ExecutionException e) {
throw new IOException("Memcached operation error", e);
}
}
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/StorageRecordTranscoder.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/StorageRecordTranscoder.java
index 82843cc..3a696de 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/StorageRecordTranscoder.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/StorageRecordTranscoder.java
@@ -35,7 +35,7 @@ public class StorageRecordTranscoder implements Transcoder<MemcachedStorageRecor
@Override
- public boolean asyncDecode(CachedData d) {
+ public boolean asyncDecode(final CachedData d) {
return false;
}
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/StringTranscoder.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/StringTranscoder.java
index 43b800f..1782745 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/StringTranscoder.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/StringTranscoder.java
@@ -34,7 +34,7 @@ public class StringTranscoder implements Transcoder<String> {
@Override
- public boolean asyncDecode(CachedData d) {
+ public boolean asyncDecode(final CachedData d) {
return false;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list