knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kris...@apache.org
Subject [07/10] knox git commit: KNOX-1663 - Enforce more Checkstyle rules
Date Fri, 07 Dec 2018 23:49:20 GMT
http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultCryptoService.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultCryptoService.java b/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultCryptoService.java
index 502dfa2..7cfc4ee 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultCryptoService.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultCryptoService.java
@@ -182,7 +182,7 @@ public class DefaultCryptoService implements CryptoService {
 
   // The assumption here is that lock contention will be less of a performance issue than the cost of object creation.
   // We have seen via profiling that AESEncryptor instantiation is very expensive.
-  private final ConfigurableEncryptor getEncryptor( final String clusterName, final char[] password ) {
+  private ConfigurableEncryptor getEncryptor( final String clusterName, final char[] password ) {
     synchronized( encryptorCache ) {
       ConfigurableEncryptor encryptor = encryptorCache.get( clusterName );
       if( encryptor == null ) {

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultKeystoreService.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultKeystoreService.java b/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultKeystoreService.java
index d232305..11afe75 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultKeystoreService.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultKeystoreService.java
@@ -124,8 +124,7 @@ public class DefaultKeystoreService extends BaseKeystoreService implements
     try {
       String filename = getKeystorePath();
       createKeystore(filename, "JKS");
-    } 
-    finally {
+    } finally {
       writeLock.unlock();
     }
   }
@@ -157,7 +156,7 @@ public class DefaultKeystoreService extends BaseKeystoreService implements
     } else {
       keyStoreFile = new File(keyStoreDir + GATEWAY_KEYSTORE);
     }
-      
+
     // make sure the keystore exists
     if (!keyStoreFile.exists()) {
       throw new KeystoreServiceException("Configured signing keystore does not exist.");
@@ -183,14 +182,14 @@ public class DefaultKeystoreService extends BaseKeystoreService implements
   }
 
   @Override
-  public void addSelfSignedCertForGateway(String alias, char[] passphrase, String hostname) 
+  public void addSelfSignedCertForGateway(String alias, char[] passphrase, String hostname)
       throws KeystoreServiceException {
     writeLock.lock();
     try {
       KeyPairGenerator keyPairGenerator;
       try {
         keyPairGenerator = KeyPairGenerator.getInstance("RSA");
-        keyPairGenerator.initialize(1024);  
+        keyPairGenerator.initialize(1024);
         KeyPair KPair = keyPairGenerator.generateKeyPair();
         if (hostname == null) {
           hostname = System.getProperty(CERT_GEN_MODE, CERT_GEN_MODE_LOCALHOST);
@@ -204,12 +203,12 @@ public class DefaultKeystoreService extends BaseKeystoreService implements
           String dn = buildDistinguishedName(hostname);
           cert = X509CertificateUtil.generateCertificate(dn, KPair, 365, "SHA1withRSA");
         }
-  
+
         KeyStore privateKS = getKeystoreForGateway();
-        privateKS.setKeyEntry(alias, KPair.getPrivate(),  
-            passphrase,  
-            new java.security.cert.Certificate[]{cert});  
-        
+        privateKS.setKeyEntry(alias, KPair.getPrivate(),
+            passphrase,
+            new java.security.cert.Certificate[]{cert});
+
         writeKeystoreToFile(privateKS, new File( keyStoreDir + GATEWAY_KEYSTORE  ));
         //writeCertificateToFile( cert, new File( keyStoreDir + alias + ".pem" ) );
       } catch (GeneralSecurityException | IOException e) {
@@ -226,10 +225,9 @@ public class DefaultKeystoreService extends BaseKeystoreService implements
     MessageFormat headerFormatter = new MessageFormat(dnTemplate, Locale.ROOT);
     String[] paramArray = new String[1];
     paramArray[0] = hostname;
-    String dn = headerFormatter.format(paramArray);
-    return dn;
+    return headerFormatter.format(paramArray);
   }
-  
+
   @Override
   public void createCredentialStoreForCluster(String clusterName) throws KeystoreServiceException {
     String filename = keyStoreDir + clusterName + CREDENTIALS_SUFFIX;
@@ -308,7 +306,7 @@ public class DefaultKeystoreService extends BaseKeystoreService implements
     finally {
       readLock.unlock();
     }
-  }  
+  }
 
   @Override
   public Key getSigningKey(String alias, char[] passphrase) throws KeystoreServiceException {
@@ -382,7 +380,7 @@ public class DefaultKeystoreService extends BaseKeystoreService implements
   }
 
   @Override
-  public char[] getCredentialForCluster(String clusterName, String alias) 
+  public char[] getCredentialForCluster(String clusterName, String alias)
       throws KeystoreServiceException {
     char[] credential = null;
     readLock.lock();

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultMasterService.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultMasterService.java b/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultMasterService.java
index 2607436..fbb574c 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultMasterService.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultMasterService.java
@@ -55,5 +55,4 @@ public class DefaultMasterService extends CMFMasterService implements MasterServ
   @Override
   public void stop() throws ServiceLifecycleException {
   }
-  
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/JettySSLService.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/JettySSLService.java b/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/JettySSLService.java
index 3a17938..8041a83 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/JettySSLService.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/JettySSLService.java
@@ -77,7 +77,6 @@ public class JettySSLService implements SSLService {
     this.ks = ks;
   }
 
-  
   @Override
   public void init(GatewayConfig config, Map<String, String> options)
       throws ServiceLifecycleException {
@@ -149,7 +148,7 @@ public class JettySSLService implements SSLService {
         Date notBefore = ((X509Certificate) cert).getNotBefore();
         Date notAfter = ((X509Certificate) cert).getNotAfter();
         log.certificateValidityPeriod(notBefore, notAfter);
-        
+
         // let's not even start if the current date is not within the validity period for the SSL cert
         try {
           ((X509Certificate)cert).checkValidity();
@@ -158,12 +157,10 @@ public class JettySSLService implements SSLService {
         } catch (CertificateNotYetValidException e) {
           throw new ServiceLifecycleException("Gateway SSL Certificate is not yet valid. Server will not start.", e);
         }
-      }
-      else {
+      } else {
         throw new ServiceLifecycleException("Public certificate for the gateway cannot be found with the alias gateway-identity. Plase check the identity certificate alias.");
       }
-    }
-    else {
+    } else {
       throw new ServiceLifecycleException("Public certificate for the gateway is not of the expected type of X509Certificate. Something is wrong with the gateway keystore.");
     }
   }
@@ -233,7 +230,7 @@ public class JettySSLService implements SSLService {
     }
     return sslContextFactory;
   }
-  
+
   @Override
   public void start() throws ServiceLifecycleException {
   }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/RemoteAliasService.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/RemoteAliasService.java b/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/RemoteAliasService.java
index c7552db..e6470c0 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/RemoteAliasService.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/RemoteAliasService.java
@@ -264,7 +264,7 @@ public class RemoteAliasService implements AliasService {
       }
 
       if (remoteClient.getEntryData(aliasEntryPath) == null) {
-        throw new IllegalStateException(String.format(Locale.ROOT, 
+        throw new IllegalStateException(String.format(Locale.ROOT,
             "Failed to store alias %s for cluster %s in remote registry", alias,
             clusterName));
       }
@@ -290,7 +290,7 @@ public class RemoteAliasService implements AliasService {
         remoteClient.deleteEntry(aliasEntryPath);
 
         if (remoteClient.entryExists(aliasEntryPath)) {
-          throw new IllegalStateException(String.format(Locale.ROOT, 
+          throw new IllegalStateException(String.format(Locale.ROOT,
               "Failed to delete alias %s for cluster %s in remote registry",
               alias, clusterName));
         }
@@ -559,7 +559,7 @@ public class RemoteAliasService implements AliasService {
 
     final RemoteAliasService remoteAliasService;
 
-    public RemoteAliasChildListener (final RemoteAliasService remoteAliasService ) {
+    RemoteAliasChildListener (final RemoteAliasService remoteAliasService ) {
       this.remoteAliasService = remoteAliasService;
     }
 
@@ -627,7 +627,7 @@ public class RemoteAliasService implements AliasService {
     final String alias;
     final RemoteAliasService remoteAliasService;
 
-    public RemoteAliasEntryListener(final String cluster, final String alias, final RemoteAliasService remoteAliasService) {
+    RemoteAliasEntryListener(final String cluster, final String alias, final RemoteAliasService remoteAliasService) {
       this.cluster = cluster;
       this.alias = alias;
       this.remoteAliasService = remoteAliasService;

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/main/java/org/apache/knox/gateway/topology/simple/SimpleDescriptorMessages.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/topology/simple/SimpleDescriptorMessages.java b/gateway-server/src/main/java/org/apache/knox/gateway/topology/simple/SimpleDescriptorMessages.java
index b0113a2..08438e6 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/topology/simple/SimpleDescriptorMessages.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/topology/simple/SimpleDescriptorMessages.java
@@ -26,30 +26,30 @@ public interface SimpleDescriptorMessages {
 
     @Message(level = MessageLevel.ERROR,
             text = "Unable to complete service discovery for cluster {0}.")
-    void failedToDiscoverClusterServices(final String descriptorName);
+    void failedToDiscoverClusterServices(String descriptorName);
 
     @Message(level = MessageLevel.ERROR,
             text = "No valid URLs were discovered for {0} in the {1} cluster.")
-    void failedToDiscoverClusterServiceURLs(final String serviceName, final String clusterName);
+    void failedToDiscoverClusterServiceURLs(String serviceName, String clusterName);
 
     @Message(level = MessageLevel.ERROR,
             text = "Failed to resolve the referenced provider configuration {0}.")
-    void failedToResolveProviderConfigRef(final String providerConfigRef);
+    void failedToResolveProviderConfigRef(String providerConfigRef);
 
     @Message(level = MessageLevel.ERROR,
             text = "Failed to parse the referenced provider configuration {0}: {1}")
-    void failedToParseProviderConfig(final String providerConfigRef,
+    void failedToParseProviderConfig(String providerConfigRef,
                                      @StackTrace( level = MessageLevel.DEBUG ) Exception e);
 
     @Message(level = MessageLevel.ERROR,
             text = "URL validation failed for {0} URL {1} : {2}")
-    void serviceURLValidationFailed(final String serviceName,
-                                    final String url,
+    void serviceURLValidationFailed(String serviceName,
+                                    String url,
                                     @StackTrace( level = MessageLevel.DEBUG ) Exception e);
 
     @Message(level = MessageLevel.ERROR,
             text = "Error generating topology {0} from simple descriptor: {1}")
-    void failedToGenerateTopologyFromSimpleDescriptor(final String topologyFile,
+    void failedToGenerateTopologyFromSimpleDescriptor(String topologyFile,
                                                       @StackTrace( level = MessageLevel.DEBUG ) Exception e);
 
     @Message(level = MessageLevel.ERROR,

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/main/java/org/apache/knox/gateway/trace/TraceUtil.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/trace/TraceUtil.java b/gateway-server/src/main/java/org/apache/knox/gateway/trace/TraceUtil.java
index e3c1ba8..c7f0c6b 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/trace/TraceUtil.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/trace/TraceUtil.java
@@ -29,7 +29,7 @@ public class TraceUtil {
 
   private static CorrelationService cs = CorrelationServiceFactory.getCorrelationService();
 
-  static final void appendCorrelationContext( final StringBuilder sb ) {
+  static void appendCorrelationContext(final StringBuilder sb ) {
     CorrelationContext cc = cs.getContext();
     if( cc == null ) {
       sb.append( "||" );
@@ -42,13 +42,13 @@ public class TraceUtil {
     }
   }
 
-  private static final void append( final StringBuilder sb, final String s ) {
+  private static void append( final StringBuilder sb, final String s ) {
     if( s != null ) {
       sb.append( s );
     }
   }
 
-  static final Set<Integer> parseIntegerSet( String str ) {
+  static Set<Integer> parseIntegerSet(String str ) {
     Set<Integer> set = new HashSet<>();
     if( str != null && !str.trim().isEmpty() ) {
       StringTokenizer parser = new StringTokenizer( str.trim(), ",", false );
@@ -59,7 +59,7 @@ public class TraceUtil {
     return set;
   }
 
-  private static final void addParsedIntegerToSet( Set<Integer> set, String str ) {
+  private static void addParsedIntegerToSet( Set<Integer> set, String str ) {
     if( str != null && !str.trim().isEmpty() ) {
       try {
         set.add( Integer.valueOf( str.trim() ) );

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/main/java/org/apache/knox/gateway/util/KnoxCLI.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/util/KnoxCLI.java b/gateway-server/src/main/java/org/apache/knox/gateway/util/KnoxCLI.java
index 108961a..37b0335 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/util/KnoxCLI.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/util/KnoxCLI.java
@@ -88,7 +88,7 @@ import java.util.UUID;
 public class KnoxCLI extends Configured implements Tool {
 
   private static final String USAGE_PREFIX = "KnoxCLI {cmd} [options]";
-  static final private String COMMANDS =
+  private static final String COMMANDS =
       "   [--help]\n" +
       "   [" + VersionCommand.USAGE + "]\n" +
       "   [" + MasterCreateCommand.USAGE + "]\n" +
@@ -1176,7 +1176,7 @@ public class KnoxCLI extends Configured implements Tool {
 
             if(errors > 0) {
               out.println(userSearchAttributeName + " or " + userObjectClass + " or " + searchBase + " or " + userSearchBase + " was found in the topology");
-              out.println("If any one of the above params is present then " + userSearchAttributeName + 
+              out.println("If any one of the above params is present then " + userSearchAttributeName +
                   " and " + userObjectClass + " must both be present and either " + searchBase + " or " + userSearchBase + " must also be present.");
             }
             errs += errors;

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/main/java/org/apache/knox/gateway/websockets/GatewayWebsocketHandler.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/websockets/GatewayWebsocketHandler.java b/gateway-server/src/main/java/org/apache/knox/gateway/websockets/GatewayWebsocketHandler.java
index 99ee19d..ffe423e 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/websockets/GatewayWebsocketHandler.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/websockets/GatewayWebsocketHandler.java
@@ -63,7 +63,7 @@ public class GatewayWebsocketHandler extends WebSocketHandler
 
   static final String REGEX_SPLIT_CONTEXT = "^((?:[^/]*/){2}[^/]*)";
 
-  final static String REGEX_SPLIT_SERVICE_PATH = "^((?:[^/]*/){3}[^/]*)";
+  static final String REGEX_SPLIT_SERVICE_PATH = "^((?:[^/]*/){3}[^/]*)";
 
   private static final int POOL_SIZE = 10;
 

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/main/java/org/apache/knox/gateway/websockets/MessageEventCallback.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/websockets/MessageEventCallback.java b/gateway-server/src/main/java/org/apache/knox/gateway/websockets/MessageEventCallback.java
index a91eaef..4e3e1ea 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/websockets/MessageEventCallback.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/websockets/MessageEventCallback.java
@@ -29,39 +29,38 @@ public interface MessageEventCallback {
    * A generic callback, can be left un-implemented
    * @param message message
    */
-  void doCallback(final String message);
-  
+  void doCallback(String message);
+
   /**
    * Callback when connection is established.
    * @param session session
    */
-  void onConnectionOpen(final Object session);
-  
+  void onConnectionOpen(Object session);
+
   /**
    * Callback when connection is closed.
    * @param reason Reason for the connection close
    */
-  void onConnectionClose(final CloseReason reason);
-  
+  void onConnectionClose(CloseReason reason);
+
   /**
    * Callback when there is an error in connection.
    * @param cause cause to throw on error
    */
-  void onError(final Throwable cause);
-  
+  void onError(Throwable cause);
+
   /**
    * Callback when a text message is received.
    * @param message message
    * @param session session
    */
-  void onMessageText(final String message, final Object session);
-  
+  void onMessageText(String message, Object session);
+
   /**
    * Callback when a binary message is received.
    * @param message message
    * @param last last
    * @param session session
    */
-  void onMessageBinary(final byte[]  message, final boolean last, final Object session);
-  
+  void onMessageBinary(byte[]  message, boolean last, Object session);
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/main/java/org/apache/knox/gateway/websockets/ProxyWebSocketAdapter.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/websockets/ProxyWebSocketAdapter.java b/gateway-server/src/main/java/org/apache/knox/gateway/websockets/ProxyWebSocketAdapter.java
index d3cc717..529cf3f 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/websockets/ProxyWebSocketAdapter.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/websockets/ProxyWebSocketAdapter.java
@@ -64,7 +64,7 @@ public class ProxyWebSocketAdapter extends WebSocketAdapter {
    * @since 0.14
    */
   private ClientEndpointConfig clientConfig;
-  
+
   public ProxyWebSocketAdapter(final URI backend, final ExecutorService pool) {
     this(backend, pool, null);
   }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/main/java/org/apache/knox/gateway/websockets/WebsocketLogMessages.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/websockets/WebsocketLogMessages.java b/gateway-server/src/main/java/org/apache/knox/gateway/websockets/WebsocketLogMessages.java
index 42f6ee5..9681d9d 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/websockets/WebsocketLogMessages.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/websockets/WebsocketLogMessages.java
@@ -24,10 +24,9 @@ import org.apache.knox.gateway.i18n.messages.StackTrace;
 
 /**
  * Logging for Websocket
- * 
+ *
  * @since 0.10
  */
-
 @Messages(logger = "org.apache.knox.gateway.websockets")
 public interface WebsocketLogMessages {
 
@@ -41,20 +40,20 @@ public interface WebsocketLogMessages {
   void connectionFailed(@StackTrace(level = MessageLevel.ERROR) Exception e);
 
   @Message(level = MessageLevel.ERROR, text = "Error: {0}")
-  void onError(final String message);
+  void onError(String message);
 
   @Message(level = MessageLevel.ERROR, text = "Bad or malformed url: {0}")
   void badUrlError(@StackTrace(level = MessageLevel.ERROR) Exception e);
 
   @Message(level = MessageLevel.DEBUG,
       text = "Websocket connection to backend server {0} opened")
-  void onConnectionOpen(final String backend);
+  void onConnectionOpen(String backend);
 
   @Message(level = MessageLevel.DEBUG, text = "Message: {0}")
-  void logMessage(final String message);
+  void logMessage(String message);
 
   @Message(level = MessageLevel.DEBUG,
       text = "Websocket connection to backend server {0} closed")
-  void onConnectionClose(final String backend);
+  void onConnectionClose(String backend);
 
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/java/org/apache/knox/gateway/GatewayFilterTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/GatewayFilterTest.java b/gateway-server/src/test/java/org/apache/knox/gateway/GatewayFilterTest.java
index 853cb1b..6f5129e 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/GatewayFilterTest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/GatewayFilterTest.java
@@ -73,7 +73,7 @@ public class GatewayFilterTest {
     EasyMock.replay( request );
     EasyMock.replay( context );
     EasyMock.replay( gatewayConfig );
-    
+
     HttpServletResponse response = EasyMock.createNiceMock( HttpServletResponse.class );
     EasyMock.replay( response );
 

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/java/org/apache/knox/gateway/GatewayForwardingServletTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/GatewayForwardingServletTest.java b/gateway-server/src/test/java/org/apache/knox/gateway/GatewayForwardingServletTest.java
index ec4d26e..72876b0 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/GatewayForwardingServletTest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/GatewayForwardingServletTest.java
@@ -31,7 +31,6 @@ import org.easymock.IMocksControl;
 import org.junit.Test;
 
 public class GatewayForwardingServletTest {
-  
   @Test
   public void testRedirectDefaults() throws ServletException, IOException {
     IMocksControl mockControl = EasyMock.createControl();
@@ -62,5 +61,4 @@ public class GatewayForwardingServletTest {
     servlet.service(request, response);
     mockControl.verify();
   }
-
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/java/org/apache/knox/gateway/GatewayPortMappingConfigTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/GatewayPortMappingConfigTest.java b/gateway-server/src/test/java/org/apache/knox/gateway/GatewayPortMappingConfigTest.java
index 68280e9..56b59b9 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/GatewayPortMappingConfigTest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/GatewayPortMappingConfigTest.java
@@ -141,7 +141,7 @@ public class GatewayPortMappingConfigTest {
       throws IOException, NoSuchFieldException, IllegalAccessException {
     /* Check port conflict with default port */
     exception.expect(IOException.class);
-    exception.expectMessage(String.format(Locale.ROOT, 
+    exception.expectMessage(String.format(Locale.ROOT,
         " Port %d used by topology %s is used by other topology, ports for topologies (if defined) have to be unique. ",
         huronPort, "eerie"));
 

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/java/org/apache/knox/gateway/config/impl/GatewayConfigImplTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/config/impl/GatewayConfigImplTest.java b/gateway-server/src/test/java/org/apache/knox/gateway/config/impl/GatewayConfigImplTest.java
index c34bf95..ffd9ac3 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/config/impl/GatewayConfigImplTest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/config/impl/GatewayConfigImplTest.java
@@ -196,12 +196,12 @@ public class GatewayConfigImplTest {
     assertThat(config.getGraphiteHost(), is("localhost"));
     assertThat(config.getGraphitePort(), is(32772));
   }
-  
+
   @Test( timeout = TestUtils.SHORT_TIMEOUT )
   public void testGatewayIdleTimeout() {
     GatewayConfigImpl config = new GatewayConfigImpl();
-    long idleTimeout = 0l;
-    
+    long idleTimeout;
+
     idleTimeout = config.getGatewayIdleTimeout();
     assertThat( idleTimeout, is(300000L));
 
@@ -209,12 +209,12 @@ public class GatewayConfigImplTest {
     idleTimeout = config.getGatewayIdleTimeout();
     assertThat( idleTimeout, is(15000L));
   }
-  
+
   @Test( timeout = TestUtils.SHORT_TIMEOUT )
   public void testGatewayServerHeaderEnabled() {
     GatewayConfigImpl config = new GatewayConfigImpl();
-    boolean serverHeaderEnabled = true;
-    
+    boolean serverHeaderEnabled;
+
     serverHeaderEnabled = config.isGatewayServerHeaderEnabled();
     assertThat( serverHeaderEnabled, is(true));
 

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/java/org/apache/knox/gateway/services/security/CryptoServiceTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/services/security/CryptoServiceTest.java b/gateway-server/src/test/java/org/apache/knox/gateway/services/security/CryptoServiceTest.java
index 4d8511d..84a829e 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/services/security/CryptoServiceTest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/services/security/CryptoServiceTest.java
@@ -28,6 +28,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
+import java.nio.charset.StandardCharsets;
 import java.security.cert.Certificate;
 import java.util.HashMap;
 import java.util.List;
@@ -37,9 +38,9 @@ import static org.junit.Assert.assertEquals;
 
 @Category( { ManualTests.class, MediumTests.class } )
 public class CryptoServiceTest {
-  static CryptoService cs = null;
-  static AliasService as = null;
-  
+  private static CryptoService cs = null;
+  private static AliasService as = null;
+
   @BeforeClass
   public static void setupSuite() throws Exception {
     as = new AliasService() {
@@ -125,11 +126,11 @@ public class CryptoServiceTest {
     ConfigurableEncryptor aes0 = new ConfigurableEncryptor("password");
     aes0.init(config);
     cs.init(config, new HashMap<String,String>());
-    EncryptionResult result0 = cs.encryptForCluster("Test", "encrypt_url", queryString.getBytes("UTF8"));
+    EncryptionResult result0 = cs.encryptForCluster("Test", "encrypt_url", queryString.getBytes(StandardCharsets.UTF_8));
     byte[] decrypted0 = cs.decryptForCluster("Test", "encrypt_url", result0.cipher, result0.iv, result0.salt);
-    assertEquals(queryString, new String(decrypted0, "UTF8"));
-    assertEquals(queryString.getBytes("UTF8").length, decrypted0.length);
-    assertEquals(queryString.getBytes("UTF8").length, new String(decrypted0, "UTF8").toCharArray().length);
+    assertEquals(queryString, new String(decrypted0, StandardCharsets.UTF_8));
+    assertEquals(queryString.getBytes(StandardCharsets.UTF_8).length, decrypted0.length);
+    assertEquals(queryString.getBytes(StandardCharsets.UTF_8).length, new String(decrypted0, StandardCharsets.UTF_8).toCharArray().length);
   }
 
   @Test
@@ -148,11 +149,11 @@ public class CryptoServiceTest {
     ConfigurableEncryptor aes0 = new ConfigurableEncryptor("password");
     aes0.init(config);
     cs.init(config, new HashMap<String,String>());
-    EncryptionResult result0 = cs.encryptForCluster("Test", "encrypt_url", queryString.getBytes("UTF8"));
+    EncryptionResult result0 = cs.encryptForCluster("Test", "encrypt_url", queryString.getBytes(StandardCharsets.UTF_8));
     byte[] decrypted0 = cs.decryptForCluster("Test", "encrypt_url", result0.cipher, result0.iv, result0.salt);
-    assertEquals(queryString, new String(decrypted0, "UTF8"));
-    assertEquals(queryString.getBytes("UTF8").length, decrypted0.length);
-    assertEquals(queryString.getBytes("UTF8").length, new String(decrypted0, "UTF8").toCharArray().length);
+    assertEquals(queryString, new String(decrypted0, StandardCharsets.UTF_8));
+    assertEquals(queryString.getBytes(StandardCharsets.UTF_8).length, decrypted0.length);
+    assertEquals(queryString.getBytes(StandardCharsets.UTF_8).length, new String(decrypted0, StandardCharsets.UTF_8).toCharArray().length);
   }
 
   @Test
@@ -169,39 +170,39 @@ public class CryptoServiceTest {
     // password to create key - same Encryptor
     ConfigurableEncryptor aes = new ConfigurableEncryptor("Test");
     aes.init(config);
-    EncryptionResult result = aes.encrypt("larry".getBytes("UTF8"));
+    EncryptionResult result = aes.encrypt("larry".getBytes(StandardCharsets.UTF_8));
     byte[] decrypted = aes.decrypt(result.salt, result.iv, result.cipher);
-    assertEquals(new String(decrypted, "UTF8"), "larry");
+    assertEquals(new String(decrypted, StandardCharsets.UTF_8), "larry");
 
     // password to create key - different Encryptor
     ConfigurableEncryptor aes2 = new ConfigurableEncryptor("Test");
     aes2.init(config);
     decrypted = aes2.decrypt(result.salt, result.iv, result.cipher);
-    assertEquals(new String(decrypted, "UTF8"), "larry");
+    assertEquals(new String(decrypted, StandardCharsets.UTF_8), "larry");
 
     // password to create key resolved from alias - same Encryptor
     ConfigurableEncryptor aes3 = new ConfigurableEncryptor(new String(as.getPasswordFromAliasForCluster("test", "encrypt_url")));
     aes3.init(config);
-    result = aes3.encrypt("larry".getBytes("UTF8"));
+    result = aes3.encrypt("larry".getBytes(StandardCharsets.UTF_8));
     decrypted = aes3.decrypt(result.salt, result.iv, result.cipher);
-    assertEquals(new String(decrypted, "UTF8"), "larry");
+    assertEquals(new String(decrypted, StandardCharsets.UTF_8), "larry");
 
     // password to create key resolved from alias - different Encryptor
     ConfigurableEncryptor aes4 = new ConfigurableEncryptor(new String(as.getPasswordFromAliasForCluster("test", "encrypt_url")));
     aes4.init(config);
     decrypted = aes4.decrypt(result.salt, result.iv, result.cipher);
-    assertEquals(new String(decrypted, "UTF8"), "larry");
+    assertEquals(new String(decrypted, StandardCharsets.UTF_8), "larry");
   }
 
   @Test
   //@Ignore
   public void testEncryptionOfQueryStrings() throws Exception {
     String alias = "encrypt-url";
-    String queryString = "url=http://localhost:50070/api/v1/blahblah";    
-    
-    EncryptionResult result = cs.encryptForCluster("Test", alias, queryString.getBytes("UTF8"));
+    String queryString = "url=http://localhost:50070/api/v1/blahblah";
+
+    EncryptionResult result = cs.encryptForCluster("Test", alias, queryString.getBytes(StandardCharsets.UTF_8));
     assertEquals("Resulted cipertext length should be a multiple of 16", 0, (result.cipher.length % 16));
     byte[] decryptedQueryString = cs.decryptForCluster("Test", alias, result.cipher, result.iv, result.salt);
-    assertEquals(queryString.getBytes("UTF8").length, decryptedQueryString.length);
+    assertEquals(queryString.getBytes(StandardCharsets.UTF_8).length, decryptedQueryString.length);
   }
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/java/org/apache/knox/gateway/util/KnoxCLITest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/util/KnoxCLITest.java b/gateway-server/src/test/java/org/apache/knox/gateway/util/KnoxCLITest.java
index f82593f..ec1864e 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/util/KnoxCLITest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/util/KnoxCLITest.java
@@ -455,14 +455,14 @@ public class KnoxCLITest {
         "created."));
 
     outContent.reset();
-    String[] args2 = {"list-alias", "--master", 
+    String[] args2 = {"list-alias", "--master",
         "master"};
     rc = cli.run(args2);
     assertEquals(0, rc);
     assertTrue(outContent.toString(StandardCharsets.UTF_8.name()), outContent.toString(StandardCharsets.UTF_8.name()).contains("alias1"));
 
     outContent.reset();
-    String[] args4 = {"delete-alias", "alias1", "--master", 
+    String[] args4 = {"delete-alias", "alias1", "--master",
       "master"};
     rc = cli.run(args4);
     assertEquals(0, rc);
@@ -474,7 +474,7 @@ public class KnoxCLITest {
     assertEquals(0, rc);
     assertFalse(outContent.toString(StandardCharsets.UTF_8.name()), outContent.toString(StandardCharsets.UTF_8.name()).contains("alias1"));
   }
-  
+
   @Test
   public void testListAndDeleteOfAliasForInvalidClusterName() throws Exception {
     outContent.reset();
@@ -620,7 +620,7 @@ public class KnoxCLITest {
     AliasService as = cli.getGatewayServices().getService(GatewayServices.ALIAS_SERVICE);
 
     outContent.reset();
-    String[] clusterCreateArgs = {"create-alias", "alias2", "--value", "testvalue1", "--cluster", "test", 
+    String[] clusterCreateArgs = {"create-alias", "alias2", "--value", "testvalue1", "--cluster", "test",
         "--master", "master"};
     cli = new KnoxCLI();
     cli.setConf( config );
@@ -656,7 +656,7 @@ public class KnoxCLITest {
     assertEquals(0, rc);
     assertTrue(outContent.toString(StandardCharsets.UTF_8.name()), outContent.toString(StandardCharsets.UTF_8.name()).contains("alias1 has been successfully " +
         "deleted."));
-    
+
     outContent.reset();
     String[] args5 = {"delete-alias", "alias2", "--cluster", "test", "--master", "master"};
     cli = new KnoxCLI();

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/java/org/apache/knox/gateway/websockets/BadBackendTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/BadBackendTest.java b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/BadBackendTest.java
index 036224b..ceaad86 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/BadBackendTest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/BadBackendTest.java
@@ -40,37 +40,30 @@ import java.util.concurrent.TimeUnit;
  *
  */
 public class BadBackendTest {
-  
   /* Proxy */
   private static Server proxy;
   private static ServerConnector proxyConnector;
   private static URI proxyUri;
-  
+
   private static final String BAD_BACKEND = "ws://localhost:666";
-  
-  public BadBackendTest() {
-    super();
-  }
-  
+
   @BeforeClass
   public static void startServer() throws Exception {
     startProxy();
-
   }
 
   @AfterClass
   public static  void stopServer() throws Exception {
     proxy.stop();
-    
   }
-  
+
   /*
    * Test for a message within limit.
    */
   @Test(timeout = 8000)
   public void testBadBackEnd() throws IOException, Exception {
     final String message = "Echo";
-    
+
     WebSocketContainer container = ContainerProvider.getWebSocketContainer();
 
     WebsocketClient client = new WebsocketClient();
@@ -80,11 +73,10 @@ public class BadBackendTest {
 
     client.awaitClose(CloseReason.CloseCodes.UNEXPECTED_CONDITION.getCode(), 1000,
         TimeUnit.MILLISECONDS);
-    
-    Assert.assertThat(client.close.getCloseCode().getCode(), CoreMatchers.is(CloseReason.CloseCodes.UNEXPECTED_CONDITION.getCode()));
 
+    Assert.assertThat(client.close.getCloseCode().getCode(), CoreMatchers.is(CloseReason.CloseCodes.UNEXPECTED_CONDITION.getCode()));
   }
-  
+
   private static void startProxy() throws Exception {
     proxy = new Server();
     proxyConnector = new ServerConnector(proxy);
@@ -108,8 +100,5 @@ public class BadBackendTest {
     }
     int port = proxyConnector.getLocalPort();
     proxyUri = new URI(String.format(Locale.ROOT, "ws://%s:%d/", host, port));
-    
   }
-
-
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/java/org/apache/knox/gateway/websockets/ConnectionDroppedTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/ConnectionDroppedTest.java b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/ConnectionDroppedTest.java
index bdc5672..88a3275 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/ConnectionDroppedTest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/ConnectionDroppedTest.java
@@ -41,7 +41,7 @@ import java.util.concurrent.TimeUnit;
 /**
  * Test to simulate unexpected connection drop. Here we establish a connection
  * and then try to simulate an error.
- * 
+ *
  * @since 0.10
  *
  */
@@ -148,9 +148,8 @@ public class ConnectionDroppedTest {
 }
 
 /**
- * 
  * Simulate a bad socket.
- * 
+ *
  * @since 0.10
  */
 class BadSocket extends WebSocketAdapter {

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/java/org/apache/knox/gateway/websockets/EchoSocket.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/EchoSocket.java b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/EchoSocket.java
index 477a218..4d55b60 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/EchoSocket.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/EchoSocket.java
@@ -26,8 +26,7 @@ import org.eclipse.jetty.websocket.api.RemoteEndpoint;
 import org.eclipse.jetty.websocket.api.WebSocketAdapter;
 
 /**
- * 
- * A simple Echo socket 
+ * A simple Echo socket
  */
 public class EchoSocket extends WebSocketAdapter {
 

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/java/org/apache/knox/gateway/websockets/MessageFailureTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/MessageFailureTest.java b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/MessageFailureTest.java
index 6b38ca0..9786dc1 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/MessageFailureTest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/MessageFailureTest.java
@@ -88,7 +88,7 @@ public class MessageFailureTest {
 
     client.awaitClose(CloseReason.CloseCodes.TOO_BIG.getCode(), 1000,
         TimeUnit.MILLISECONDS);
-    
+
     Assert.assertThat(client.close.getCloseCode().getCode(), CoreMatchers.is(CloseReason.CloseCodes.TOO_BIG.getCode()));
   }
 
@@ -161,21 +161,16 @@ public class MessageFailureTest {
     }
     int port = proxyConnector.getLocalPort();
     proxyUri = new URI(String.format(Locale.ROOT, "ws://%s:%d/", host, port));
-    
   }
-
 }
 
 /**
  * A Mock websocket handler that just Echos messages
  */
-class BigEchoSocketHandler extends WebSocketHandler
-    implements WebSocketCreator {
-
-  // final EchoSocket socket = new EchoSocket();
-  final WebSocketAdapter socket;
+class BigEchoSocketHandler extends WebSocketHandler implements WebSocketCreator {
+  private final WebSocketAdapter socket;
 
-  public BigEchoSocketHandler(final WebSocketAdapter socket) {
+  BigEchoSocketHandler(final WebSocketAdapter socket) {
     this.socket = socket;
   }
 

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketEchoHandler.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketEchoHandler.java b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketEchoHandler.java
index b231c76..1049c9b 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketEchoHandler.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketEchoHandler.java
@@ -28,20 +28,16 @@ import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory;
  *
  */
 public class WebsocketEchoHandler extends WebSocketHandler implements WebSocketCreator {
+  private final EchoSocket socket = new EchoSocket();
 
-  final EchoSocket socket = new EchoSocket();
-  
   @Override
-  public void configure(WebSocketServletFactory factory)
-  {
+  public void configure(WebSocketServletFactory factory) {
       factory.getPolicy().setMaxTextMessageSize(2 * 1024 * 1024);
       factory.setCreator(this);
   }
 
   @Override
-  public Object createWebSocket(ServletUpgradeRequest req, ServletUpgradeResponse resp)
-  {
+  public Object createWebSocket(ServletUpgradeRequest req, ServletUpgradeResponse resp) {
       return socket;
   }
-  
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketEchoTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketEchoTest.java b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketEchoTest.java
index a15b70c..9891985 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketEchoTest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketEchoTest.java
@@ -72,11 +72,10 @@ import static org.hamcrest.MatcherAssert.assertThat;
  * address of the Websocket server.
  * <li>A mock client is setup to connect to gateway.
  * </ul>
- * 
+ *
  * The test is to confirm whether the message is sent all the way to the backend
  * Websocket server through Knox and back.
- * 
- * 
+ *
  * @since 0.10
  */
 public class WebsocketEchoTest {

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketMultipleConnectionTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketMultipleConnectionTest.java b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketMultipleConnectionTest.java
index 2d25d82..fd28e7f 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketMultipleConnectionTest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/websockets/WebsocketMultipleConnectionTest.java
@@ -372,7 +372,7 @@ public class WebsocketMultipleConnectionTest {
     }
   }
 
-  private static abstract class WebsocketClient extends Endpoint
+  private abstract static class WebsocketClient extends Endpoint
       implements MessageHandler.Whole<String> {
     @Override
     public void onOpen(Session session, EndpointConfig config) {

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-server/src/test/resources/org/apache/knox/gateway/topology/xml/simple-topology-knox-format.xml
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/resources/org/apache/knox/gateway/topology/xml/simple-topology-knox-format.xml b/gateway-server/src/test/resources/org/apache/knox/gateway/topology/xml/simple-topology-knox-format.xml
index c0b9b13..b9fed2d 100644
--- a/gateway-server/src/test/resources/org/apache/knox/gateway/topology/xml/simple-topology-knox-format.xml
+++ b/gateway-server/src/test/resources/org/apache/knox/gateway/topology/xml/simple-topology-knox-format.xml
@@ -47,16 +47,16 @@
            </param>
         </provider>
         <provider>
-        	<role>identity-assertion</role>
-        	<enabled>true</enabled>
-        	<name>Default</name>
-     	    <param>
+            <role>identity-assertion</role>
+            <enabled>true</enabled>
+            <name>Default</name>
+            <param>
             <name>name</name>
             <value>user.name</value>
           </param>
           <param>
-          	<name>principal.mapping</name>
-          	<value>hdfs=lmccay;kminder=admin</value>
+            <name>principal.mapping</name>
+            <value>hdfs=lmccay;kminder=admin</value>
           </param>
         </provider>
     </gateway>

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-service-admin/src/main/java/org/apache/knox/gateway/service/admin/VersionResource.java
----------------------------------------------------------------------
diff --git a/gateway-service-admin/src/main/java/org/apache/knox/gateway/service/admin/VersionResource.java b/gateway-service-admin/src/main/java/org/apache/knox/gateway/service/admin/VersionResource.java
index 4d613c0..30e35ff 100644
--- a/gateway-service-admin/src/main/java/org/apache/knox/gateway/service/admin/VersionResource.java
+++ b/gateway-service-admin/src/main/java/org/apache/knox/gateway/service/admin/VersionResource.java
@@ -37,7 +37,7 @@ import static javax.ws.rs.core.Response.Status.NOT_FOUND;
 
 @Path( "/api/v1" )
 public class VersionResource {
-  @Context 
+  @Context
   private HttpServletRequest request;
 
   @GET
@@ -68,7 +68,7 @@ public class VersionResource {
     private String version;
     @XmlElement(name="hash")
     private String hash;
-    
+
     public ServerVersion(String version, String hash) {
       super();
       this.version = version;
@@ -76,7 +76,7 @@ public class VersionResource {
     }
 
     public ServerVersion() { }
-    
+
     public String getVersion() {
       return version;
     }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-service-definitions/src/main/resources/services/sparkthriftui/2.1.0/service.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/sparkthriftui/2.1.0/service.xml b/gateway-service-definitions/src/main/resources/services/sparkthriftui/2.1.0/service.xml
index 1865efa..3633899 100644
--- a/gateway-service-definitions/src/main/resources/services/sparkthriftui/2.1.0/service.xml
+++ b/gateway-service-definitions/src/main/resources/services/sparkthriftui/2.1.0/service.xml
@@ -19,7 +19,7 @@
     <routes>
         <route path="/thrift/jobs">
             <rewrite apply="THRIFTSERVERUI/thrift/root/filter/OUT" to="response.body"/>
-        </route>			
+        </route>
         <route path="/thrift/">
             <rewrite apply="THRIFTSERVERUI/thrift/outbound/headers" to="response.headers"/>
         </route>

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-service-definitions/src/main/resources/services/yarn-rm/2.5.0/rewrite.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/yarn-rm/2.5.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/yarn-rm/2.5.0/rewrite.xml
index 95ce2a3..bcb9005 100644
--- a/gateway-service-definitions/src/main/resources/services/yarn-rm/2.5.0/rewrite.xml
+++ b/gateway-service-definitions/src/main/resources/services/yarn-rm/2.5.0/rewrite.xml
@@ -33,27 +33,27 @@
 
     <rule dir="OUT" name="RESOURCEMANAGER/resourcemanager/url/outbound">
         <match pattern="*://*:*/**?**"/>
-		<rewrite template=""/>
+        <rewrite template=""/>
     </rule>
     <rule dir="OUT" name="RESOURCEMANAGER/resourcemanager/trackingUrlHistory/outbound">
         <match pattern="{scheme}://{host}:{port}/proxy/{appid=*}/jobhistory/job/**"/>
-		<rewrite template=""/>
+        <rewrite template=""/>
     </rule>
     <rule dir="OUT" name="RESOURCEMANAGER/resourcemanager/trackingUrlAM/outbound">
         <match pattern="{scheme}://{host}:{port}/proxy/{appid=*}"/>
-		<rewrite template="{$frontend[url]}/resourcemanager/proxy/{appid=*}?{scheme}?host={$hostmap(host)}?{port}?{**}"/>
-		<encrypt-query/>
+        <rewrite template="{$frontend[url]}/resourcemanager/proxy/{appid=*}?{scheme}?host={$hostmap(host)}?{port}?{**}"/>
+        <encrypt-query/>
     </rule>
     <rule dir="OUT" name="RESOURCEMANAGER/resourcemanager/hostport/outbound">
         <match pattern="*:*"/>
-		<rewrite template=""/>
+        <rewrite template=""/>
     </rule>
     <rule dir="OUT" name="RESOURCEMANAGER/resourcemanager/logsLink/outbound">
         <match pattern="//*:*/**?**"/>
-		<rewrite template=""/>
+        <rewrite template=""/>
     </rule>
     <rule dir="OUT" name="RESOURCEMANAGER/resourcemanager/host/outbound">
-		<rewrite template=""/>
+        <rewrite template=""/>
     </rule>
     <rule dir="OUT" name="RESOURCEMANAGER/resourcemanager/nodeId/outbound">
         <match pattern="{host=*}:{port=*}"/>
@@ -68,54 +68,54 @@
 
     <filter name="RESOURCEMANAGER/resourcemanager/apps/outbound">
         <content type="*/json">
-        	<buffer path="$.apps.app[*]">
-        		<detect path="$.trackingUI" value="History">
-					<apply path="$.trackingUrl" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
-				</detect>
-				<detect path="$.trackingUI" value="ApplicationMaster">
-					<apply path="$.trackingUrl" rule="RESOURCEMANAGER/resourcemanager/trackingUrlAM/outbound"/>
-				</detect>
-				<apply path="$.amContainerLogs" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
-            	<apply path="$.amHostHttpAddress" rule="RESOURCEMANAGER/resourcemanager/hostport/outbound"/>
-        	</buffer>
+            <buffer path="$.apps.app[*]">
+                <detect path="$.trackingUI" value="History">
+                    <apply path="$.trackingUrl" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
+                </detect>
+                <detect path="$.trackingUI" value="ApplicationMaster">
+                    <apply path="$.trackingUrl" rule="RESOURCEMANAGER/resourcemanager/trackingUrlAM/outbound"/>
+                </detect>
+                <apply path="$.amContainerLogs" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
+                <apply path="$.amHostHttpAddress" rule="RESOURCEMANAGER/resourcemanager/hostport/outbound"/>
+            </buffer>
         </content>
         <content type="*/xml">
-        	<buffer path="/apps/app">
-        		<detect path="trackingUI" value="History">
-					<apply path="trackingUrl" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
-				</detect>
-				<detect path="trackingUI" value="ApplicationMaster">
-					<apply path="trackingUrl" rule="RESOURCEMANAGER/resourcemanager/trackingUrlAM/outbound"/>
-				</detect>
-				<apply path="amContainerLogs" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
-            	<apply path="amHostHttpAddress" rule="RESOURCEMANAGER/resourcemanager/hostport/outbound"/>
-        	</buffer>
+            <buffer path="/apps/app">
+                <detect path="trackingUI" value="History">
+                    <apply path="trackingUrl" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
+                </detect>
+                <detect path="trackingUI" value="ApplicationMaster">
+                    <apply path="trackingUrl" rule="RESOURCEMANAGER/resourcemanager/trackingUrlAM/outbound"/>
+                </detect>
+                <apply path="amContainerLogs" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
+                <apply path="amHostHttpAddress" rule="RESOURCEMANAGER/resourcemanager/hostport/outbound"/>
+            </buffer>
         </content>
     </filter>
 
     <filter name="RESOURCEMANAGER/resourcemanager/app/outbound">
         <content type="*/json">
-        	<buffer path="$.app">
-	       		<detect path="$.trackingUI" value="History">
-	       			<apply path="$.trackingUrl" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
-	       		</detect>
-	       		<detect path="$.trackingUI" value="ApplicationMaster">
-	       			<apply path="$.trackingUrl" rule="RESOURCEMANAGER/resourcemanager/trackingUrlAM/outbound"/>
-	       		</detect>
-	            <apply path="$.amContainerLogs" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
-	            <apply path="$.amHostHttpAddress" rule="RESOURCEMANAGER/resourcemanager/hostport/outbound"/>
+            <buffer path="$.app">
+                <detect path="$.trackingUI" value="History">
+                    <apply path="$.trackingUrl" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
+                </detect>
+                <detect path="$.trackingUI" value="ApplicationMaster">
+                    <apply path="$.trackingUrl" rule="RESOURCEMANAGER/resourcemanager/trackingUrlAM/outbound"/>
+                </detect>
+                <apply path="$.amContainerLogs" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
+                <apply path="$.amHostHttpAddress" rule="RESOURCEMANAGER/resourcemanager/hostport/outbound"/>
             </buffer>
         </content>
         <content type="*/xml">
-        	<buffer path="/app">
-	       		<detect path="trackingUI" value="History">
-	       			<apply path="trackingUrl" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
-	       		</detect>
-	       		<detect path="trackingUI" value="ApplicationMaster">
-	       			<apply path="trackingUrl" rule="RESOURCEMANAGER/resourcemanager/trackingUrlAM/outbound"/>
-	       		</detect>
-	            <apply path="amContainerLogs" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
-	            <apply path="amHostHttpAddress" rule="RESOURCEMANAGER/resourcemanager/hostport/outbound"/>
+            <buffer path="/app">
+                <detect path="trackingUI" value="History">
+                    <apply path="trackingUrl" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
+                </detect>
+                <detect path="trackingUI" value="ApplicationMaster">
+                    <apply path="trackingUrl" rule="RESOURCEMANAGER/resourcemanager/trackingUrlAM/outbound"/>
+                </detect>
+                <apply path="amContainerLogs" rule="RESOURCEMANAGER/resourcemanager/url/outbound"/>
+                <apply path="amHostHttpAddress" rule="RESOURCEMANAGER/resourcemanager/hostport/outbound"/>
             </buffer>
         </content>
     </filter>

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-service-knoxsso/src/test/java/org/apache/knox/gateway/service/knoxsso/WebSSOResourceTest.java
----------------------------------------------------------------------
diff --git a/gateway-service-knoxsso/src/test/java/org/apache/knox/gateway/service/knoxsso/WebSSOResourceTest.java b/gateway-service-knoxsso/src/test/java/org/apache/knox/gateway/service/knoxsso/WebSSOResourceTest.java
index e5f972d..52cc8f7 100644
--- a/gateway-service-knoxsso/src/test/java/org/apache/knox/gateway/service/knoxsso/WebSSOResourceTest.java
+++ b/gateway-service-knoxsso/src/test/java/org/apache/knox/gateway/service/knoxsso/WebSSOResourceTest.java
@@ -548,7 +548,7 @@ public class WebSSOResourceTest {
 
     GatewayServices services = EasyMock.createNiceMock(GatewayServices.class);
     EasyMock.expect(context.getAttribute(GatewayServices.GATEWAY_SERVICES_ATTRIBUTE)).andReturn(services);
-    
+
     JWTokenAuthority authority = new TestJWTokenAuthority(gatewayPublicKey, gatewayPrivateKey);
     EasyMock.expect(services.getService(GatewayServices.TOKEN_SERVICE)).andReturn(authority);
 

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/TokenResource.java
----------------------------------------------------------------------
diff --git a/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/TokenResource.java b/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/TokenResource.java
index 983b616..1a583f4 100644
--- a/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/TokenResource.java
+++ b/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/TokenResource.java
@@ -212,7 +212,7 @@ public class TokenResource {
   }
 
   private long getExpiry() {
-    long expiry = 0l;
+    long expiry;
     if (tokenTTL == -1) {
       expiry = -1;
     }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-service-remoteconfig/src/main/java/org/apache/knox/gateway/service/config/remote/RemoteConfigurationMessages.java
----------------------------------------------------------------------
diff --git a/gateway-service-remoteconfig/src/main/java/org/apache/knox/gateway/service/config/remote/RemoteConfigurationMessages.java b/gateway-service-remoteconfig/src/main/java/org/apache/knox/gateway/service/config/remote/RemoteConfigurationMessages.java
index a243330..732981c 100644
--- a/gateway-service-remoteconfig/src/main/java/org/apache/knox/gateway/service/config/remote/RemoteConfigurationMessages.java
+++ b/gateway-service-remoteconfig/src/main/java/org/apache/knox/gateway/service/config/remote/RemoteConfigurationMessages.java
@@ -30,17 +30,16 @@ public interface RemoteConfigurationMessages {
     void multipleRemoteRegistryConfigurations();
 
     @Message(level = MessageLevel.ERROR, text = "Failed to resolve the credential alias {0}")
-    void unresolvedCredentialAlias(final String alias);
+    void unresolvedCredentialAlias(String alias);
 
     @Message(level = MessageLevel.ERROR, text = "An error occurred interacting with the remote configuration registry : {0}")
     void errorInteractingWithRemoteConfigRegistry(@StackTrace(level = MessageLevel.DEBUG) Exception e);
 
     @Message(level = MessageLevel.ERROR, text = "An error occurred handling the ACL for remote configuration {0} : {1}")
-    void errorHandlingRemoteConfigACL(final String path,
+    void errorHandlingRemoteConfigACL(String path,
                                       @StackTrace(level = MessageLevel.DEBUG) Exception e);
 
     @Message(level = MessageLevel.ERROR, text = "An error occurred setting the ACL for remote configuration {0} : {1}")
-    void errorSettingEntryACL(final String path,
+    void errorSettingEntryACL(String path,
                               @StackTrace(level = MessageLevel.DEBUG) Exception e);
-
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-service-vault/src/main/java/org/apache/knox/gateway/service/vault/CredentialResource.java
----------------------------------------------------------------------
diff --git a/gateway-service-vault/src/main/java/org/apache/knox/gateway/service/vault/CredentialResource.java b/gateway-service-vault/src/main/java/org/apache/knox/gateway/service/vault/CredentialResource.java
index 5a78500..0dfc6ae 100644
--- a/gateway-service-vault/src/main/java/org/apache/knox/gateway/service/vault/CredentialResource.java
+++ b/gateway-service-vault/src/main/java/org/apache/knox/gateway/service/vault/CredentialResource.java
@@ -41,9 +41,9 @@ import static javax.ws.rs.core.Response.Status.NOT_FOUND;
 
 @Path( "/vault/credentials" )
 public class CredentialResource {
-  @Context 
+  @Context
   private HttpServletRequest request;
-  
+
   @GET
   @Path("{alias}")
   @Produces({APPLICATION_JSON, APPLICATION_XML})
@@ -103,17 +103,17 @@ public class CredentialResource {
     }
     return null;
   }
-  
+
   public static class CredentialValue {
     private String alias;
     private String credential;
-    
+
     public CredentialValue(String alias, String credential) {
       super();
       this.alias = alias;
       this.credential = credential;
     }
-    
+
     public String getAlias() {
       return alias;
     }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/AbstractHdfsHaDispatch.java
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/AbstractHdfsHaDispatch.java b/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/AbstractHdfsHaDispatch.java
index 37e146a..97890fc 100644
--- a/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/AbstractHdfsHaDispatch.java
+++ b/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/AbstractHdfsHaDispatch.java
@@ -63,14 +63,14 @@ public abstract class AbstractHdfsHaDispatch extends HdfsHttpClientDispatch {
   public HaProvider getHaProvider() {
     return haProvider;
   }
-  
+
   abstract String getResourceRole();
 
   @Configure
   public void setHaProvider(HaProvider haProvider) {
     this.haProvider = haProvider;
   }
-  
+
   @Override
   protected void executeRequest(HttpUriRequest outboundRequest, HttpServletRequest inboundRequest, HttpServletResponse outboundResponse) throws IOException {
       HttpResponse inboundResponse = null;

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/WebHdfsHaDispatch.java
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/WebHdfsHaDispatch.java b/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/WebHdfsHaDispatch.java
index 925800e..643387b 100644
--- a/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/WebHdfsHaDispatch.java
+++ b/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/WebHdfsHaDispatch.java
@@ -25,7 +25,7 @@ public class WebHdfsHaDispatch extends AbstractHdfsHaDispatch {
   public WebHdfsHaDispatch() throws ServletException {
     super();
   }
-  
+
   @Override
   protected String getResourceRole() {
     return RESOURCE_ROLE;

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractCredentialCollector.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractCredentialCollector.java b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractCredentialCollector.java
index 9146c12..3d1f259 100644
--- a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractCredentialCollector.java
+++ b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractCredentialCollector.java
@@ -25,9 +25,6 @@ public abstract class AbstractCredentialCollector implements CredentialCollector
   protected String value;
   private String name;
 
-  /**
-   * 
-   */
   public AbstractCredentialCollector() {
     super();
   }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractJavaConsoleCredentialCollector.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractJavaConsoleCredentialCollector.java b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractJavaConsoleCredentialCollector.java
index e077ad6..f234a4a 100644
--- a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractJavaConsoleCredentialCollector.java
+++ b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractJavaConsoleCredentialCollector.java
@@ -31,10 +31,10 @@ public abstract class AbstractJavaConsoleCredentialCollector extends AbstractCre
       System.err.println("No console.");
       System.exit(1);
     }
-  
+
     String username = c.readLine(prompt);
     value = username;
-  
+
     return value;
   }
 
@@ -45,10 +45,10 @@ public abstract class AbstractJavaConsoleCredentialCollector extends AbstractCre
       System.err.println("No console.");
       System.exit(1);
     }
-  
+
     response = c.readPassword(prompt);
     value = new String(response);
-  
+
     return value;
   }
 

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractRequest.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractRequest.java b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractRequest.java
index 1a6af29..48a2e05 100644
--- a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractRequest.java
+++ b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/AbstractRequest.java
@@ -49,7 +49,7 @@ public abstract class AbstractRequest<T> {
     addHeaders(request, session.getHeaders());
     return session.executeNow( request );
   }
-  
+
   private void addHeaders(HttpRequest request, Map<String, String> headers) {
     for(Entry<String, String> header : headers.entrySet()) {
       request.setHeader(header.getKey(), header.getValue());
@@ -72,7 +72,7 @@ public abstract class AbstractRequest<T> {
     }
   }
 
-  abstract protected Callable<T> callable();
+  protected abstract Callable<T> callable();
 
   public T now() throws KnoxShellException {
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-shell/src/main/java/org/apache/knox/gateway/shell/Credentials.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/Credentials.java b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/Credentials.java
index 4cf42f0..dae0062 100644
--- a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/Credentials.java
+++ b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/Credentials.java
@@ -22,8 +22,8 @@ import java.util.ServiceLoader;
 
 public class Credentials {
   ArrayList<CredentialCollector> collectors = new ArrayList<>();
-  
-  public Credentials add(String collectorType, String prompt, String name) 
+
+  public Credentials add(String collectorType, String prompt, String name)
     throws CredentialCollectionException {
     CredentialCollector collector = loadCredentialCollector(collectorType, prompt, name);
     if (collector == null) {
@@ -50,7 +50,7 @@ public class Credentials {
     }
     return null;
   }
-  
+
   private CredentialCollector loadCredentialCollector(String type, String prompt, String name) {
     ServiceLoader<CredentialCollector> collectorsList = ServiceLoader.load(CredentialCollector.class);
     for (CredentialCollector collector : collectorsList) {

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-shell/src/main/java/org/apache/knox/gateway/shell/KnoxSh.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/KnoxSh.java b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/KnoxSh.java
index fdb09a5..af7b648 100644
--- a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/KnoxSh.java
+++ b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/KnoxSh.java
@@ -45,7 +45,7 @@ import java.util.TimeZone;
 public class KnoxSh {
 
   private static final String USAGE_PREFIX = "KnoxSh {cmd} [options]";
-  final static private String COMMANDS =
+  private static final String COMMANDS =
       "   [--help]\n" +
       "   [" + KnoxInit.USAGE + "]\n" +
       "   [" + KnoxDestroy.USAGE + "]\n" +
@@ -169,20 +169,20 @@ public class KnoxSh {
 
       String username = credentials.get("user").string();
       String pass = credentials.get("pass").string();
-      
+
       KnoxSession session = null;
       Get.Response response = null;
       try {
         session = KnoxSession.login(gateway, username, pass);
-  
+
         response = Token.get( session ).now();
         String text = response.getString();
         Map<String, String> json = JsonUtils.getMapFromJsonString(text);
-  
+
         //println "Access Token: " + json.access_token
         System.out.println("knoxinit successful!");
         displayTokenDetails(json);
-        
+
         File tokenfile = new File(System.getProperty("user.home"), ".knoxtokencache");
         try( FileOutputStream fos = new FileOutputStream(tokenfile) ) {
           fos.write(text.getBytes(StandardCharsets.UTF_8));
@@ -236,7 +236,7 @@ public class KnoxSh {
           File.separator + ".knoxtokencache";
       if (new File(tokenFilePath).exists()) {
         String tokenfile = readFile(tokenFilePath);
-  
+
         if (tokenfile != null) {
           Map<String, String> json = JsonUtils.getMapFromJsonString(tokenfile);
           displayTokenDetails(json);

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Java.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Java.java b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Java.java
index 72801fc..5d04d12 100644
--- a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Java.java
+++ b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Java.java
@@ -34,7 +34,6 @@ import java.util.List;
 import java.util.concurrent.Callable;
 
 class Java {
-  
   public static class Request extends AbstractRequest<Response> {
 
     String jar;
@@ -43,7 +42,7 @@ class Java {
     String output;
     List<NameValuePair> params = new ArrayList<>();
 
-    public Request( KnoxSession session ) {
+    Request( KnoxSession session ) {
       super( session );
     }
 
@@ -93,8 +92,7 @@ class Java {
   }
 
   public static class Response extends BasicResponse {
-
-    public Response( HttpResponse response ) {
+    Response( HttpResponse response ) {
       super( response );
     }
 

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Queue.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Queue.java b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Queue.java
index 07081eb..d5c0fea 100644
--- a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Queue.java
+++ b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Queue.java
@@ -29,8 +29,7 @@ import java.util.concurrent.Callable;
 class Queue {
 
   public static class Request extends AbstractRequest<Response> {
-
-    public Request( KnoxSession session ) {
+    Request( KnoxSession session ) {
       super( session );
     }
 
@@ -45,15 +44,11 @@ class Queue {
         }
       };
     }
-
   }
 
   public static class Response extends BasicResponse {
-
     protected Response( HttpResponse response ) {
       super( response );
     }
-
   }
-
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Status.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Status.java b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Status.java
index 2a1a9ae..79e2ce1 100644
--- a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Status.java
+++ b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/job/Status.java
@@ -32,7 +32,7 @@ class Status {
 
     private String jobId;
 
-    public Request( KnoxSession session ) {
+    Request( KnoxSession session ) {
       super( session );
     }
 
@@ -52,15 +52,11 @@ class Status {
         }
       };
     }
-
   }
 
   public static class Response extends BasicResponse {
-
     protected Response( HttpResponse response ) {
       super( response );
     }
-
   }
-
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-spi/src/main/java/org/apache/knox/gateway/SpiGatewayMessages.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/knox/gateway/SpiGatewayMessages.java b/gateway-spi/src/main/java/org/apache/knox/gateway/SpiGatewayMessages.java
index 8fffb36..335a5ce 100644
--- a/gateway-spi/src/main/java/org/apache/knox/gateway/SpiGatewayMessages.java
+++ b/gateway-spi/src/main/java/org/apache/knox/gateway/SpiGatewayMessages.java
@@ -33,7 +33,7 @@ public interface SpiGatewayMessages {
 
   @Message( level = MessageLevel.DEBUG, text = "Dispatch request: {0} {1}" )
   void dispatchRequest( String method, URI uri );
-  
+
   @Message( level = MessageLevel.WARN, text = "Connection exception dispatching request: {0} {1}" )
   void dispatchServiceConnectionException( URI uri, @StackTrace(level=MessageLevel.WARN) Exception e );
 
@@ -45,7 +45,7 @@ public interface SpiGatewayMessages {
 
   @Message( level = MessageLevel.DEBUG, text = "Successful Knox->Hadoop SPNegotiation authentication for URL: {0}" )
   void successfulSPNegoAuthn(String uri);
-  
+
   @Message( level = MessageLevel.ERROR, text = "Failed Knox->Hadoop SPNegotiation authentication for URL: {0}" )
   void failedSPNegoAuthn(String uri);
 
@@ -81,11 +81,11 @@ public interface SpiGatewayMessages {
 
   @Message( level = MessageLevel.INFO,
             text = "Applying a derived dispatch whitelist because none is configured in gateway-site: {0}" )
-  void derivedDispatchWhitelist(final String derivedWhitelist);
+  void derivedDispatchWhitelist(String derivedWhitelist);
 
   @Message( level=MessageLevel.ERROR,
              text = "Unable to reliably determine the Knox domain for the default whitelist. Defaulting to allow requests only to {0}. Please consider explicitly configuring the whitelist via the gateway.dispatch.whitelist property in gateway-site" )
-  void unableToDetermineKnoxDomainForDefaultWhitelist(final String permittedHostName);
+  void unableToDetermineKnoxDomainForDefaultWhitelist(String permittedHostName);
 
   @Message( level = MessageLevel.ERROR,
             text = "The dispatch to {0} was disallowed because it fails the dispatch whitelist validation. See documentation for dispatch whitelisting." )

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-spi/src/main/java/org/apache/knox/gateway/config/GatewayConfig.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/knox/gateway/config/GatewayConfig.java b/gateway-spi/src/main/java/org/apache/knox/gateway/config/GatewayConfig.java
index 98846ac..c13ece5 100644
--- a/gateway-spi/src/main/java/org/apache/knox/gateway/config/GatewayConfig.java
+++ b/gateway-spi/src/main/java/org/apache/knox/gateway/config/GatewayConfig.java
@@ -25,22 +25,22 @@ import java.util.Map;
 public interface GatewayConfig {
 
   // Used as the basis for any home directory that is not specified.
-  static final String GATEWAY_HOME_VAR = "GATEWAY_HOME";
+  String GATEWAY_HOME_VAR = "GATEWAY_HOME";
 
   // Variable name for the location of configuration files edited by users
-  static final String GATEWAY_CONF_HOME_VAR = "GATEWAY_CONF_HOME";
+  String GATEWAY_CONF_HOME_VAR = "GATEWAY_CONF_HOME";
 
   // Variable name for the location of data files generated by the gateway at runtime.
-  static final String GATEWAY_DATA_HOME_VAR = "GATEWAY_DATA_HOME";
+  String GATEWAY_DATA_HOME_VAR = "GATEWAY_DATA_HOME";
 
-  public static final String GATEWAY_CONFIG_ATTRIBUTE = "org.apache.knox.gateway.config";
-  public static final String HADOOP_KERBEROS_SECURED = "gateway.hadoop.kerberos.secured";
-  public static final String KRB5_CONFIG = "java.security.krb5.conf";
-  public static final String KRB5_DEBUG = "sun.security.krb5.debug";
-  public static final String KRB5_LOGIN_CONFIG = "java.security.auth.login.config";
-  public static final String KRB5_USE_SUBJECT_CREDS_ONLY = "javax.security.auth.useSubjectCredsOnly";
-  public static final String SIGNING_KEYSTORE_NAME = "gateway.signing.keystore.name";
-  public static final String SIGNING_KEY_ALIAS = "gateway.signing.key.alias";
+  String GATEWAY_CONFIG_ATTRIBUTE = "org.apache.knox.gateway.config";
+  String HADOOP_KERBEROS_SECURED = "gateway.hadoop.kerberos.secured";
+  String KRB5_CONFIG = "java.security.krb5.conf";
+  String KRB5_DEBUG = "sun.security.krb5.debug";
+  String KRB5_LOGIN_CONFIG = "java.security.auth.login.config";
+  String KRB5_USE_SUBJECT_CREDS_ONLY = "javax.security.auth.useSubjectCredsOnly";
+  String SIGNING_KEYSTORE_NAME = "gateway.signing.keystore.name";
+  String SIGNING_KEY_ALIAS = "gateway.signing.key.alias";
 
   String REMOTE_CONFIG_REGISTRY_TYPE = "type";
   String REMOTE_CONFIG_REGISTRY_ADDRESS = "address";
@@ -99,7 +99,7 @@ public interface GatewayConfig {
   InetSocketAddress getGatewayAddress() throws UnknownHostException;
 
   boolean isSSLEnabled();
-  
+
   List<String> getExcludedSSLProtocols();
 
   List<String> getIncludedSSLCiphers();
@@ -329,7 +329,7 @@ public interface GatewayConfig {
    * @return The polling interval configuration value, or -1 if it has not been configured.
    */
   int getClusterMonitorPollingInterval(String type);
-  
+
   /**
    *
    * @param type The type of cluster configuration monitor for which the interval should be returned.
@@ -337,7 +337,7 @@ public interface GatewayConfig {
    * @return The enabled status of the specified type of cluster configuration monitor.
    */
   boolean isClusterMonitorEnabled(String type);
-  
+
   /**
    * @return The list of the names of any remote registry configurations defined herein.
    */
@@ -406,7 +406,7 @@ public interface GatewayConfig {
   /**
    * Get the list of topology names that should be redeployed on restart.
    * manager and admin are default topologies as they may depend on gateway-site.xml
-   * configuration for deployment time config. 
+   * configuration for deployment time config.
    * @return list of topology names
    */
   List<String> getAutoDeployTopologyNames();

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-spi/src/main/java/org/apache/knox/gateway/deploy/ServiceDeploymentContributorBase.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/knox/gateway/deploy/ServiceDeploymentContributorBase.java b/gateway-spi/src/main/java/org/apache/knox/gateway/deploy/ServiceDeploymentContributorBase.java
index f4d8fb6..9f3b7a8 100644
--- a/gateway-spi/src/main/java/org/apache/knox/gateway/deploy/ServiceDeploymentContributorBase.java
+++ b/gateway-spi/src/main/java/org/apache/knox/gateway/deploy/ServiceDeploymentContributorBase.java
@@ -48,7 +48,7 @@ public abstract class ServiceDeploymentContributorBase extends DeploymentContrib
     final Provider provider = getProviderByRole(context, role);
     return (provider != null);
   }
-  
+
   protected Provider getProviderByRole(DeploymentContext context, String role) {
     Provider p = null;
     Collection<Provider> providers = context.getTopology().getProviders();
@@ -60,7 +60,7 @@ public abstract class ServiceDeploymentContributorBase extends DeploymentContrib
     }
     return p;
   }
-  
+
   protected void addWebAppSecFilters( DeploymentContext context, Service service, ResourceDescriptor resource ) {
     if (topologyContainsProviderType(context, "webappsec")) {
       context.contributeFilter( service, resource, "webappsec", null, null );

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-spi/src/main/java/org/apache/knox/gateway/descriptor/GatewayDescriptorExporter.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/knox/gateway/descriptor/GatewayDescriptorExporter.java b/gateway-spi/src/main/java/org/apache/knox/gateway/descriptor/GatewayDescriptorExporter.java
index b3264eb..95bf38e 100644
--- a/gateway-spi/src/main/java/org/apache/knox/gateway/descriptor/GatewayDescriptorExporter.java
+++ b/gateway-spi/src/main/java/org/apache/knox/gateway/descriptor/GatewayDescriptorExporter.java
@@ -21,9 +21,7 @@ import java.io.IOException;
 import java.io.Writer;
 
 public interface GatewayDescriptorExporter {
+  String getFormat();
 
-  public String getFormat();
-
-  public void store( GatewayDescriptor descriptor, Writer writer ) throws IOException;
-
+  void store( GatewayDescriptor descriptor, Writer writer ) throws IOException;
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-spi/src/main/java/org/apache/knox/gateway/descriptor/GatewayDescriptorImporter.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/knox/gateway/descriptor/GatewayDescriptorImporter.java b/gateway-spi/src/main/java/org/apache/knox/gateway/descriptor/GatewayDescriptorImporter.java
index 5d8151e..d7dcf51 100644
--- a/gateway-spi/src/main/java/org/apache/knox/gateway/descriptor/GatewayDescriptorImporter.java
+++ b/gateway-spi/src/main/java/org/apache/knox/gateway/descriptor/GatewayDescriptorImporter.java
@@ -21,9 +21,7 @@ import java.io.IOException;
 import java.io.Reader;
 
 public interface GatewayDescriptorImporter {
-
-  public String getFormat();
+  String getFormat();
 
   GatewayDescriptor load( Reader reader ) throws IOException;
-
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/AbstractGatewayDispatch.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/AbstractGatewayDispatch.java b/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/AbstractGatewayDispatch.java
index 00c16e2..cf60458 100644
--- a/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/AbstractGatewayDispatch.java
+++ b/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/AbstractGatewayDispatch.java
@@ -43,7 +43,7 @@ public abstract class AbstractGatewayDispatch implements Dispatch {
       REQUEST_EXCLUDE_HEADERS.add("Content-Length");
       REQUEST_EXCLUDE_HEADERS.add("Transfer-Encoding");
   }
-  
+
   protected  HttpClient client;
 
   @Override
@@ -69,12 +69,12 @@ public abstract class AbstractGatewayDispatch implements Dispatch {
   }
 
   @Override
-  synchronized public HttpClient getHttpClient() {
+  public synchronized HttpClient getHttpClient() {
     return client;
   }
 
   @Override
-  synchronized public void setHttpClient(HttpClient client) {
+  public synchronized void setHttpClient(HttpClient client) {
     this.client = client;
   }
 
@@ -128,7 +128,7 @@ public abstract class AbstractGatewayDispatch implements Dispatch {
       throws IOException, URISyntaxException {
     response.sendError( HttpServletResponse.SC_METHOD_NOT_ALLOWED );
   }
-  
+
   public void copyRequestHeaderFields(HttpUriRequest outboundRequest,
       HttpServletRequest inboundRequest) {
     Enumeration<String> headerNames = inboundRequest.getHeaderNames();

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/Dispatch.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/Dispatch.java b/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/Dispatch.java
index ac13031..32f985d 100644
--- a/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/Dispatch.java
+++ b/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/Dispatch.java
@@ -52,7 +52,7 @@ public interface Dispatch {
 
   void doOptions( URI url, HttpServletRequest request, HttpServletResponse response )
       throws IOException, ServletException, URISyntaxException;
-  
+
   void doHead( URI url, HttpServletRequest request, HttpServletResponse response )
       throws IOException, ServletException, URISyntaxException;
 

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/HttpClientFactory.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/HttpClientFactory.java b/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/HttpClientFactory.java
index e67c7fb..c5e639e 100644
--- a/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/HttpClientFactory.java
+++ b/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/HttpClientFactory.java
@@ -22,6 +22,5 @@ import org.apache.http.client.HttpClient;
 import javax.servlet.FilterConfig;
 
 public interface HttpClientFactory {
-
-  public HttpClient createHttpClient( FilterConfig filterConfig );
+  HttpClient createHttpClient( FilterConfig filterConfig );
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/PassAllHeadersDispatch.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/PassAllHeadersDispatch.java b/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/PassAllHeadersDispatch.java
index 2dbef75..6267047 100644
--- a/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/PassAllHeadersDispatch.java
+++ b/gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/PassAllHeadersDispatch.java
@@ -24,7 +24,7 @@ import java.util.Set;
 public class PassAllHeadersDispatch extends DefaultDispatch {
 
   private static final Set<String> REQUEST_EXCLUDE_HEADERS = new HashSet<>();
-  
+
   static {
       REQUEST_EXCLUDE_HEADERS.add("Content-Length");
   }

http://git-wip-us.apache.org/repos/asf/knox/blob/6736393d/gateway-spi/src/main/java/org/apache/knox/gateway/filter/security/AbstractIdentityAssertionFilter.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/knox/gateway/filter/security/AbstractIdentityAssertionFilter.java b/gateway-spi/src/main/java/org/apache/knox/gateway/filter/security/AbstractIdentityAssertionFilter.java
index f0cca53..aa1fdb3 100644
--- a/gateway-spi/src/main/java/org/apache/knox/gateway/filter/security/AbstractIdentityAssertionFilter.java
+++ b/gateway-spi/src/main/java/org/apache/knox/gateway/filter/security/AbstractIdentityAssertionFilter.java
@@ -67,7 +67,5 @@ public abstract class AbstractIdentityAssertionFilter extends AbstractIdentityAs
   }
 
   @Override
-  public void destroy() {
-    
-  }
+  public void destroy() {}
 }


Mime
View raw message