karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject [4/5] karaf git commit: Various code cleanup
Date Fri, 02 Jun 2017 11:08:29 GMT
Various code cleanup

Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/d5d25169
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/d5d25169
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/d5d25169

Branch: refs/heads/master
Commit: d5d2516916e7ebb1b31248bc34c6c68262cf3422
Parents: 7eacf6c
Author: Guillaume Nodet <gnodet@apache.org>
Authored: Fri Jun 2 11:04:37 2017 +0200
Committer: Guillaume Nodet <gnodet@apache.org>
Committed: Fri Jun 2 13:08:16 2017 +0200

----------------------------------------------------------------------
 .../apache/karaf/bundle/command/Services.java   |  4 +--
 .../karaf/bundle/command/bundletree/Tree.java   |  4 +--
 .../karaf/bundle/core/BundleStateService.java   |  6 ++--
 .../bundle/core/internal/BundleInfoImpl.java    |  2 +-
 .../karaf/bundle/command/ListServicesTest.java  |  4 +--
 .../main/java/org/apache/karaf/client/Main.java |  3 +-
 .../apache/karaf/client/ClientConfigTest.java   |  2 --
 .../command/ConfigPropertyCommandSupport.java   |  7 +----
 .../deployer/blueprint/BlueprintURLHandler.java |  5 +--
 .../features/FeatureDeploymentListener.java     |  5 +--
 .../deployer/features/FeatureTransformer.java   |  1 -
 .../deployer/features/FeatureURLHandler.java    |  2 +-
 .../deployer/spring/SpringTransformer.java      |  3 --
 .../karaf/deployer/spring/SpringURLHandler.java |  2 +-
 .../deployer/wrap/WrapDeploymentListener.java   |  9 ++----
 .../karaf/diagnostic/command/DumpCommand.java   |  1 -
 .../karaf/diagnostic/internal/Activator.java    |  1 -
 .../karaf/features/command/FeatureExport.java   |  2 +-
 .../features/command/ListFeaturesCommand.java   |  2 +-
 .../features/command/StopFeaturesCommand.java   |  1 -
 .../org/apache/karaf/features/Conditional.java  |  1 -
 .../org/apache/karaf/features/FeatureEvent.java |  2 +-
 .../apache/karaf/features/RepositoryEvent.java  |  2 +-
 .../karaf/features/internal/model/Bundle.java   |  5 +--
 .../features/internal/model/Capability.java     |  5 +--
 .../karaf/features/internal/model/Feature.java  |  5 +--
 .../features/internal/model/Requirement.java    |  5 +--
 .../internal/region/CandidateComparator.java    |  1 -
 .../internal/region/OfflineResolver.java        |  2 --
 .../features/internal/region/Subsystem.java     |  1 -
 .../region/SubsystemResolveContext.java         |  8 +----
 .../internal/region/SubsystemResolver.java      |  9 ++----
 .../internal/resolver/ResolverUtil.java         |  1 -
 .../service/FeatureConfigInstaller.java         |  1 -
 .../karaf/features/FeaturesServiceTest.java     |  2 +-
 .../region/FeaturesDependenciesTest.java        |  3 +-
 .../features/internal/region/SubsystemTest.java |  3 +-
 .../features/internal/service/DeployerTest.java |  3 --
 .../service/FeaturesServiceImplTest.java        |  5 ++-
 .../internal/service/OverridesTest.java         |  2 --
 .../org/apache/karaf/http/core/ServletInfo.java |  1 -
 .../completers/StartedInstanceCompleter.java    |  6 +---
 .../completers/StoppedInstanceCompleter.java    |  6 +---
 .../core/internal/InstanceServiceImpl.java      |  2 +-
 .../java/org/apache/karaf/itests/JmsTest.java   | 10 ++----
 .../ssh/ConfigSshCommandSecurityTest.java       |  6 ++--
 .../karaf/itests/ssh/SshCommandTestBase.java    |  4 +--
 ...tableConfigAdminPropertyPlaceholderTest.java |  1 -
 .../jaas/boot/principal/GroupPrincipal.java     | 11 +++----
 .../karaf/jaas/boot/principal/RolePolicy.java   |  2 +-
 .../jaas/boot/principal/RolePrincipal.java      | 11 +++----
 .../jaas/boot/principal/UserPrincipal.java      | 11 +++----
 .../karaf/jaas/command/JaasCommandSupport.java  |  1 -
 .../karaf/jaas/command/ListGroupsCommand.java   |  7 -----
 .../jaas/command/ManageRealmCommandTest.java    |  1 -
 .../org/apache/karaf/jaas/config/JaasRealm.java |  6 ++--
 .../jaas/jasypt/impl/JasyptEncryption.java      |  2 --
 .../karaf/jaas/modules/BackingEngine.java       |  2 +-
 .../apache/karaf/jaas/modules/Encryption.java   |  4 +--
 .../karaf/jaas/modules/impl/Activator.java      |  1 -
 .../karaf/jaas/modules/impl/KarafRealm.java     |  1 -
 .../jaas/modules/jdbc/JDBCBackingEngine.java    |  3 --
 .../karaf/jaas/modules/jdbc/JDBCUtils.java      |  1 -
 .../jaas/modules/ldap/LDAPLoginModule.java      |  1 -
 .../karaf/jaas/modules/ldap/LDAPOptions.java    |  2 +-
 .../modules/osgi/OsgiConfigLoginModule.java     |  1 -
 .../properties/DigestPasswordLoginModule.java   |  1 -
 .../properties/PropertiesLoginModule.java       |  1 -
 .../publickey/PublickeyBackingEngine.java       |  1 -
 .../modules/publickey/PublickeyLoginModule.java |  1 -
 .../modules/syncope/SyncopeBackingEngine.java   |  1 -
 .../modules/syncope/SyncopeLoginModule.java     |  1 -
 .../modules/ldap/GSSAPILdapLoginModuleTest.java |  2 +-
 .../karaf/jaas/modules/ldap/LdapCacheTest.java  |  2 +-
 .../modules/ldap/LdapCaseInsensitiveDNTest.java |  2 +-
 .../jaas/modules/ldap/LdapLoginModuleTest.java  |  2 +-
 .../ldap/LdapLoginModuleWithEscapesTest.java    |  2 +-
 .../ldap/LdapSpecialCharsInPasswordTest.java    |  6 ++--
 .../jdbc/command/completers/SqlCompleter.java   |  1 -
 .../apache/karaf/jms/internal/JmsConnector.java |  1 -
 .../karaf/jms/internal/osgi/Activator.java      |  1 -
 .../karaf/jms/pool/internal/PooledSession.java  |  1 -
 .../java/org/apache/karaf/jndi/JndiMBean.java   | 18 +++++------
 .../karaf/jndi/internal/JndiServiceImpl.java    |  2 +-
 .../java/org/apache/karaf/kar/internal/Kar.java |  1 -
 .../karaf/kar/internal/KarServiceImpl.java      |  3 +-
 .../org/apache/karaf/log/command/LoadTest.java  |  2 --
 .../karaf/log/core/LogEventFormatter.java       |  2 +-
 .../karaf/main/KarafActivatorManager.java       |  1 -
 .../main/java/org/apache/karaf/main/Status.java |  2 +-
 .../main/java/org/apache/karaf/main/Stop.java   |  2 +-
 .../management/ConnectorServerFactory.java      |  2 +-
 .../karaf/management/JMXSecurityMBean.java      |  8 ++---
 .../karaf/management/RmiRegistryFactory.java    |  4 ---
 .../karaf/packages/core/PackageService.java     |  1 -
 .../core/internal/PackageServiceImpl.java       |  2 --
 .../core/internal/PackagesMBeanImpl.java        |  1 -
 .../core/internal/filter/SimpleItem.java        |  3 +-
 .../packages/command/PackageImportTest.java     |  3 --
 .../apache/karaf/profile/assembly/Builder.java  |  1 -
 .../profile/assembly/CustomDownloadManager.java |  1 -
 .../karaf/profile/command/ProfileEdit.java      |  2 --
 .../profile/impl/PlaceholderResolvers.java      |  2 --
 .../karaf/profile/assembly/BuilderTest.java     |  1 -
 .../org/apache/karaf/scheduler/Scheduler.java   |  1 -
 .../internal/ScrServiceMBeanImpl.java           |  2 +-
 .../guard/tools/ACLConfigurationParser.java     |  2 +-
 .../guard/impl/GuardProxyCatalogTest.java       |  6 ++--
 .../main/java/org/eclipse/osgi/util/NLS.java    |  2 +-
 .../impl/info/InfoBundleTrackerCustomizer.java  |  1 -
 .../karaf/shell/commands/info/InfoProvider.java |  4 +--
 .../apache/felix/gogo/commands/Argument.java    |  2 +-
 .../org/apache/felix/gogo/commands/Option.java  |  2 +-
 .../apache/karaf/shell/commands/Argument.java   |  2 +-
 .../karaf/shell/commands/InfoProvider.java      |  4 +--
 .../org/apache/karaf/shell/commands/Option.java |  2 +-
 .../shell/commands/meta/ActionMetaData.java     |  1 -
 .../karaf/shell/compat/ArgumentCompleter.java   |  1 -
 .../apache/karaf/shell/console/NameScoping.java |  5 +--
 .../apache/karaf/shell/api/action/Argument.java |  2 +-
 .../apache/karaf/shell/api/action/Option.java   |  2 +-
 .../apache/karaf/shell/api/console/Signal.java  |  2 +-
 .../action/command/DefaultActionPreparator.java |  2 +-
 .../karaf/shell/impl/console/KarafTerminal.java |  5 ---
 .../shell/impl/console/parsing/KarafParser.java |  2 --
 .../shell/impl/console/standalone/Main.java     |  2 --
 .../apache/karaf/shell/support/NameScoping.java |  5 +--
 .../shell/support/terminal/SignalSupport.java   |  1 -
 .../org/apache/karaf/shell/ssh/Activator.java   |  1 -
 .../karaf/shell/ssh/KarafAgentFactory.java      |  1 -
 .../karaf/shell/ssh/ShellFactoryImpl.java       |  4 +--
 .../org/apache/karaf/shell/ssh/SshAction.java   |  2 +-
 .../org/apache/karaf/shell/ssh/SshUtils.java    |  1 -
 .../karaf/subsystem/commands/ListAction.java    |  6 ----
 .../subsystem/commands/SubsystemSupport.java    |  1 -
 .../org/apache/karaf/system/SystemService.java  |  2 +-
 .../java/org/apache/karaf/tooling/RunMojo.java  |  4 ---
 .../apache/karaf/tooling/client/ClientMojo.java |  4 ---
 .../tooling/commands/GenerateHelpMojo.java      |  6 ++--
 .../features/GenerateDescriptorMojo.java        |  2 +-
 .../karaf/tooling/utils/Dependency30Helper.java |  4 +--
 .../karaf/tooling/utils/Dependency31Helper.java |  4 +--
 .../karaf/tooling/utils/DependencyHelper.java   | 32 ++++++++++----------
 .../apache/karaf/tooling/VerifyMojoTest.java    |  1 -
 .../features/GenerateDescriptorMojoTest.java    |  1 -
 .../tracker/GenerateServiceMetadata.java        |  1 -
 .../CopyOnWriteArrayIdentityList.java           | 10 ++----
 .../org/apache/karaf/util/BundleUtilsTest.java  |  1 -
 .../karaf/webconsole/gogo/GogoPlugin.java       |  2 +-
 .../karaf/webconsole/gogo/WebTerminal.java      |  1 -
 .../webconsole/instance/InstancePlugin.java     |  2 +-
 .../webconsole/instance/InstancePluginTest.java |  2 +-
 .../apache/karaf/wrapper/WrapperService.java    |  6 ++--
 153 files changed, 147 insertions(+), 340 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/bundle/core/src/main/java/org/apache/karaf/bundle/command/Services.java
----------------------------------------------------------------------
diff --git a/bundle/core/src/main/java/org/apache/karaf/bundle/command/Services.java b/bundle/core/src/main/java/org/apache/karaf/bundle/command/Services.java
index 47167a3..145e832 100644
--- a/bundle/core/src/main/java/org/apache/karaf/bundle/command/Services.java
+++ b/bundle/core/src/main/java/org/apache/karaf/bundle/command/Services.java
@@ -41,10 +41,10 @@ public class Services extends BundlesCommand {
     @Option(name = "-p", aliases = {}, description = "Shows the properties of the services", required = false, multiValued = false)
     boolean showProperties = false;
 
-    Set<String> hidden = new HashSet<>(Arrays.asList(new String[] {
+    Set<String> hidden = new HashSet<>(Arrays.asList(
             "org.apache.felix.service.command.Function",
             "org.apache.karaf.shell.console.Completer"
-    }));
+    ));
 
     @Override
     protected void executeOnBundle(Bundle bundle) throws Exception {

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/bundle/core/src/main/java/org/apache/karaf/bundle/command/bundletree/Tree.java
----------------------------------------------------------------------
diff --git a/bundle/core/src/main/java/org/apache/karaf/bundle/command/bundletree/Tree.java b/bundle/core/src/main/java/org/apache/karaf/bundle/command/bundletree/Tree.java
index 8885d11..0b3398a 100644
--- a/bundle/core/src/main/java/org/apache/karaf/bundle/command/bundletree/Tree.java
+++ b/bundle/core/src/main/java/org/apache/karaf/bundle/command/bundletree/Tree.java
@@ -93,9 +93,9 @@ public class Tree<T> extends Node<T> {
      *
      * @param <T> the object type for the node value
      */
-    public static interface Converter<T> {
+    public interface Converter<T> {
 
-        public String toString(Node<T> node);
+        String toString(Node<T> node);
 
     }
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/bundle/core/src/main/java/org/apache/karaf/bundle/core/BundleStateService.java
----------------------------------------------------------------------
diff --git a/bundle/core/src/main/java/org/apache/karaf/bundle/core/BundleStateService.java b/bundle/core/src/main/java/org/apache/karaf/bundle/core/BundleStateService.java
index f2c8158..73fd2b4 100644
--- a/bundle/core/src/main/java/org/apache/karaf/bundle/core/BundleStateService.java
+++ b/bundle/core/src/main/java/org/apache/karaf/bundle/core/BundleStateService.java
@@ -24,9 +24,9 @@ import org.osgi.framework.Bundle;
  */
 public interface BundleStateService {
 
-    public final static String NAME_BLUEPRINT = "Blueprint";
-    public final static String NAME_SPRING_DM = "Spring DM";
-    public final static String NAME_DS = "Declarative Services";
+    String NAME_BLUEPRINT = "Blueprint";
+    String NAME_SPRING_DM = "Spring DM";
+    String NAME_DS = "Declarative Services";
 
     /**
      * Name of the framework the implementation supports.

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/bundle/core/src/main/java/org/apache/karaf/bundle/core/internal/BundleInfoImpl.java
----------------------------------------------------------------------
diff --git a/bundle/core/src/main/java/org/apache/karaf/bundle/core/internal/BundleInfoImpl.java b/bundle/core/src/main/java/org/apache/karaf/bundle/core/internal/BundleInfoImpl.java
index 25cb642..89e32e7 100644
--- a/bundle/core/src/main/java/org/apache/karaf/bundle/core/internal/BundleInfoImpl.java
+++ b/bundle/core/src/main/java/org/apache/karaf/bundle/core/internal/BundleInfoImpl.java
@@ -53,7 +53,7 @@ public class BundleInfoImpl implements BundleInfo {
         bundleStateMap.put(Bundle.RESOLVED, BundleState.Resolved);
         bundleStateMap.put(Bundle.STARTING, BundleState.Starting);
         bundleStateMap.put(Bundle.STOPPING, BundleState.Stopping);
-    };
+    }
 
     public BundleInfoImpl(Bundle bundle, BundleState extState) {
         BundleStartLevel bsl = bundle.adapt(BundleStartLevel.class);

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/bundle/core/src/test/java/org/apache/karaf/bundle/command/ListServicesTest.java
----------------------------------------------------------------------
diff --git a/bundle/core/src/test/java/org/apache/karaf/bundle/command/ListServicesTest.java b/bundle/core/src/test/java/org/apache/karaf/bundle/command/ListServicesTest.java
index 0d095a9..c7a9769 100644
--- a/bundle/core/src/test/java/org/apache/karaf/bundle/command/ListServicesTest.java
+++ b/bundle/core/src/test/java/org/apache/karaf/bundle/command/ListServicesTest.java
@@ -45,14 +45,14 @@ public class ListServicesTest {
     @Test
     public void listAllLong() throws Exception {
         System.out.println("listAllLong");
-        listServices.ids = Arrays.asList(new String[]{"1", "2"});
+        listServices.ids = Arrays.asList("1", "2");
         listServices.execute();
     }
 
     @Test
     public void listAllLongServiceUse() throws Exception {
         System.out.println("listAllLongServicesUse");
-        listServices.ids = Arrays.asList(new String[]{"1", "2"});
+        listServices.ids = Arrays.asList("1", "2");
         listServices.inUse = true;
         listServices.execute();
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/client/src/main/java/org/apache/karaf/client/Main.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/karaf/client/Main.java b/client/src/main/java/org/apache/karaf/client/Main.java
index 4162de6..8c8f5a5 100644
--- a/client/src/main/java/org/apache/karaf/client/Main.java
+++ b/client/src/main/java/org/apache/karaf/client/Main.java
@@ -57,7 +57,6 @@ import org.apache.sshd.common.FactoryManager;
 import org.apache.sshd.common.RuntimeSshException;
 import org.apache.sshd.common.channel.PtyMode;
 import org.apache.sshd.common.config.keys.FilePasswordProvider;
-import org.apache.sshd.common.keyprovider.AbstractKeyPairProvider;
 import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
 import org.apache.sshd.common.util.io.NoCloseInputStream;
 import org.jline.terminal.Attributes;
@@ -278,7 +277,7 @@ public class Main {
         client.getProperties().put(SshAgent.SSH_AUTHSOCKET_ENV_NAME, "local");
     }
 
-    private static ClientSession connectWithRetries(SshClient client, ClientConfig config) throws Exception, InterruptedException {
+    private static ClientSession connectWithRetries(SshClient client, ClientConfig config) throws Exception {
         ClientSession session = null;
         int retries = 0;
         do {

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/client/src/test/java/org/apache/karaf/client/ClientConfigTest.java
----------------------------------------------------------------------
diff --git a/client/src/test/java/org/apache/karaf/client/ClientConfigTest.java b/client/src/test/java/org/apache/karaf/client/ClientConfigTest.java
index 7a5c7ca..d5d0b32 100644
--- a/client/src/test/java/org/apache/karaf/client/ClientConfigTest.java
+++ b/client/src/test/java/org/apache/karaf/client/ClientConfigTest.java
@@ -16,8 +16,6 @@
  */
 package org.apache.karaf.client;
 
-import java.io.IOException;
-
 import org.junit.Test;
 
 import static org.hamcrest.CoreMatchers.equalTo;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/config/src/main/java/org/apache/karaf/config/command/ConfigPropertyCommandSupport.java
----------------------------------------------------------------------
diff --git a/config/src/main/java/org/apache/karaf/config/command/ConfigPropertyCommandSupport.java b/config/src/main/java/org/apache/karaf/config/command/ConfigPropertyCommandSupport.java
index 466d462..9982099 100644
--- a/config/src/main/java/org/apache/karaf/config/command/ConfigPropertyCommandSupport.java
+++ b/config/src/main/java/org/apache/karaf/config/command/ConfigPropertyCommandSupport.java
@@ -18,7 +18,6 @@ package org.apache.karaf.config.command;
 
 import java.util.Dictionary;
 import java.util.Hashtable;
-import java.util.Properties;
 
 import org.apache.karaf.config.command.completers.ConfigurationCompleter;
 import org.apache.karaf.shell.api.action.Completion;
@@ -68,11 +67,7 @@ public abstract class ConfigPropertyCommandSupport extends ConfigCommandSupport
      * @return <code>true</code> if the configuration requires an update, <code>false</code> else.
      */
     protected boolean requiresUpdate(String pid) {
-        if (pid != null) {
-            return true;
-        } else {
-            return false;
-        }
+        return pid != null;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/deployer/blueprint/src/main/java/org/apache/karaf/deployer/blueprint/BlueprintURLHandler.java
----------------------------------------------------------------------
diff --git a/deployer/blueprint/src/main/java/org/apache/karaf/deployer/blueprint/BlueprintURLHandler.java b/deployer/blueprint/src/main/java/org/apache/karaf/deployer/blueprint/BlueprintURLHandler.java
index d379a5a..837183f 100644
--- a/deployer/blueprint/src/main/java/org/apache/karaf/deployer/blueprint/BlueprintURLHandler.java
+++ b/deployer/blueprint/src/main/java/org/apache/karaf/deployer/blueprint/BlueprintURLHandler.java
@@ -19,9 +19,6 @@ package org.apache.karaf.deployer.blueprint;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.MalformedURLException;
@@ -78,7 +75,7 @@ public class BlueprintURLHandler extends AbstractURLStreamHandlerService {
                 return new ByteArrayInputStream(os.toByteArray());
             } catch (Exception e) {
                 logger.error("Error opening blueprint xml url", e);
-                throw (IOException) new IOException("Error opening blueprint xml url").initCause(e);
+                throw new IOException("Error opening blueprint xml url", e);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureDeploymentListener.java
----------------------------------------------------------------------
diff --git a/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureDeploymentListener.java b/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureDeploymentListener.java
index 733d585..fa36404 100644
--- a/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureDeploymentListener.java
+++ b/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureDeploymentListener.java
@@ -118,10 +118,7 @@ public class FeatureDeploymentListener implements ArtifactUrlTransformer, Bundle
         if(FeaturesNamespaces.URI_1_3_0.equalsIgnoreCase(uri)){
             return true;
         }
-    	if(FeaturesNamespaces.URI_CURRENT.equalsIgnoreCase(uri)){
-    		return true;
-    	}
-    	return false;
+        return FeaturesNamespaces.URI_CURRENT.equalsIgnoreCase(uri);
     }
 
     private void loadProperties() throws IOException {

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureTransformer.java
----------------------------------------------------------------------
diff --git a/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureTransformer.java b/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureTransformer.java
index 784e71f..b7d4c9d 100644
--- a/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureTransformer.java
+++ b/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureTransformer.java
@@ -17,7 +17,6 @@
  */
 package org.apache.karaf.deployer.features;
 
-import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.URL;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureURLHandler.java
----------------------------------------------------------------------
diff --git a/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureURLHandler.java b/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureURLHandler.java
index 20608b3..178a133 100644
--- a/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureURLHandler.java
+++ b/deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureURLHandler.java
@@ -80,7 +80,7 @@ public class FeatureURLHandler extends AbstractURLStreamHandlerService {
                 return new ByteArrayInputStream(os.toByteArray());
             } catch (Exception e) {
                 logger.error("Error opening features xml url", e);
-                throw (IOException) new IOException("Error opening features xml url").initCause(e);
+                throw new IOException("Error opening features xml url", e);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/deployer/spring/src/main/java/org/apache/karaf/deployer/spring/SpringTransformer.java
----------------------------------------------------------------------
diff --git a/deployer/spring/src/main/java/org/apache/karaf/deployer/spring/SpringTransformer.java b/deployer/spring/src/main/java/org/apache/karaf/deployer/spring/SpringTransformer.java
index 3153ef7..32e4c30 100644
--- a/deployer/spring/src/main/java/org/apache/karaf/deployer/spring/SpringTransformer.java
+++ b/deployer/spring/src/main/java/org/apache/karaf/deployer/spring/SpringTransformer.java
@@ -46,9 +46,6 @@ import org.apache.karaf.util.XmlUtils;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
 import org.osgi.framework.Constants;
 
 public class SpringTransformer {

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/deployer/spring/src/main/java/org/apache/karaf/deployer/spring/SpringURLHandler.java
----------------------------------------------------------------------
diff --git a/deployer/spring/src/main/java/org/apache/karaf/deployer/spring/SpringURLHandler.java b/deployer/spring/src/main/java/org/apache/karaf/deployer/spring/SpringURLHandler.java
index 44b36a3..70c2452 100644
--- a/deployer/spring/src/main/java/org/apache/karaf/deployer/spring/SpringURLHandler.java
+++ b/deployer/spring/src/main/java/org/apache/karaf/deployer/spring/SpringURLHandler.java
@@ -75,7 +75,7 @@ public class SpringURLHandler extends AbstractURLStreamHandlerService {
                 return new ByteArrayInputStream(os.toByteArray());
             } catch (Exception e) {
                 logger.error("Error opening Spring xml url", e);
-                throw (IOException) new IOException("Error opening Spring xml url").initCause(e);
+                throw new IOException("Error opening Spring xml url", e);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/deployer/wrap/src/main/java/org/apache/karaf/deployer/wrap/WrapDeploymentListener.java
----------------------------------------------------------------------
diff --git a/deployer/wrap/src/main/java/org/apache/karaf/deployer/wrap/WrapDeploymentListener.java b/deployer/wrap/src/main/java/org/apache/karaf/deployer/wrap/WrapDeploymentListener.java
index c02a8dc..eec7b22 100644
--- a/deployer/wrap/src/main/java/org/apache/karaf/deployer/wrap/WrapDeploymentListener.java
+++ b/deployer/wrap/src/main/java/org/apache/karaf/deployer/wrap/WrapDeploymentListener.java
@@ -40,12 +40,9 @@ public class WrapDeploymentListener implements ArtifactUrlTransformer {
             try (JarFile jar = new JarFile(artifact)) {
                 // only handle non OSGi jar
                 Manifest manifest = jar.getManifest();
-                if (manifest != null &&
-                    manifest.getMainAttributes().getValue(new Attributes.Name("Bundle-SymbolicName")) != null &&
-                    manifest.getMainAttributes().getValue(new Attributes.Name("Bundle-Version")) != null) {
-                    return false;
-                }
-                return true;
+                return manifest == null
+                        || manifest.getMainAttributes().getValue(new Attributes.Name("Bundle-SymbolicName")) == null
+                        || manifest.getMainAttributes().getValue(new Attributes.Name("Bundle-Version")) == null;
             }
         } catch (Exception e) {
             return false;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/diagnostic/core/src/main/java/org/apache/karaf/diagnostic/command/DumpCommand.java
----------------------------------------------------------------------
diff --git a/diagnostic/core/src/main/java/org/apache/karaf/diagnostic/command/DumpCommand.java b/diagnostic/core/src/main/java/org/apache/karaf/diagnostic/command/DumpCommand.java
index 20a66a2..05bb78e 100644
--- a/diagnostic/core/src/main/java/org/apache/karaf/diagnostic/command/DumpCommand.java
+++ b/diagnostic/core/src/main/java/org/apache/karaf/diagnostic/command/DumpCommand.java
@@ -19,7 +19,6 @@ package org.apache.karaf.diagnostic.command;
 import java.io.File;
 import java.text.SimpleDateFormat;
 import java.util.Date;
-import java.util.List;
 
 import org.apache.karaf.diagnostic.core.Dump;
 import org.apache.karaf.diagnostic.core.DumpDestination;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/diagnostic/core/src/main/java/org/apache/karaf/diagnostic/internal/Activator.java
----------------------------------------------------------------------
diff --git a/diagnostic/core/src/main/java/org/apache/karaf/diagnostic/internal/Activator.java b/diagnostic/core/src/main/java/org/apache/karaf/diagnostic/internal/Activator.java
index 9a32fa2..1789bd4 100644
--- a/diagnostic/core/src/main/java/org/apache/karaf/diagnostic/internal/Activator.java
+++ b/diagnostic/core/src/main/java/org/apache/karaf/diagnostic/internal/Activator.java
@@ -25,7 +25,6 @@ import org.apache.karaf.diagnostic.management.internal.DiagnosticDumpMBeanImpl;
 import org.apache.karaf.diagnostic.common.FeaturesDumpProvider;
 import org.apache.karaf.diagnostic.common.LogDumpProvider;
 import org.apache.karaf.features.FeaturesService;
-import org.apache.karaf.features.internal.model.Features;
 import org.apache.karaf.util.tracker.SingleServiceTracker;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/command/src/main/java/org/apache/karaf/features/command/FeatureExport.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/FeatureExport.java b/features/command/src/main/java/org/apache/karaf/features/command/FeatureExport.java
index 927bdaa..4c7422f 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/FeatureExport.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/FeatureExport.java
@@ -169,7 +169,7 @@ public class FeatureExport extends FeaturesCommandSupport {
      * @throws IOException
      *             If there is an issue performing the copy
      */
-    private static boolean copyFileToDirectory(final File file, final File directory) throws FileNotFoundException, IOException {
+    private static boolean copyFileToDirectory(final File file, final File directory) throws IOException {
         if (!directory.isDirectory()) {
             throw new IOException("Can't copy to non-directory specified: " + directory.getAbsolutePath());
         } else {

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/command/src/main/java/org/apache/karaf/features/command/ListFeaturesCommand.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/ListFeaturesCommand.java b/features/command/src/main/java/org/apache/karaf/features/command/ListFeaturesCommand.java
index fac8003..6bf9f9c 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/ListFeaturesCommand.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/ListFeaturesCommand.java
@@ -101,7 +101,7 @@ public class ListFeaturesCommand extends FeaturesCommandSupport {
     }
 
     private boolean isInstalledViaDeployDir(String st) {
-        return (st == null || st.length() <= 1) ? false : (st.charAt(st.length() - 1) == '*');
+        return st != null && st.length() > 1 && st.charAt(st.length() - 1) == '*';
     }
 
     class FeatureComparator implements Comparator<Feature> {

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/command/src/main/java/org/apache/karaf/features/command/StopFeaturesCommand.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/StopFeaturesCommand.java b/features/command/src/main/java/org/apache/karaf/features/command/StopFeaturesCommand.java
index 371e03c..ac87125 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/StopFeaturesCommand.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/StopFeaturesCommand.java
@@ -20,7 +20,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeatureState;
 import org.apache.karaf.features.FeaturesService;
 import org.apache.karaf.features.command.completers.StartedFeatureCompleter;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/Conditional.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/Conditional.java b/features/core/src/main/java/org/apache/karaf/features/Conditional.java
index adcf812..26463f2 100644
--- a/features/core/src/main/java/org/apache/karaf/features/Conditional.java
+++ b/features/core/src/main/java/org/apache/karaf/features/Conditional.java
@@ -17,7 +17,6 @@
 package org.apache.karaf.features;
 
 import java.util.List;
-import java.util.Map;
 
 public interface Conditional {
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/FeatureEvent.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/FeatureEvent.java b/features/core/src/main/java/org/apache/karaf/features/FeatureEvent.java
index 5a26e46..d6282f4 100644
--- a/features/core/src/main/java/org/apache/karaf/features/FeatureEvent.java
+++ b/features/core/src/main/java/org/apache/karaf/features/FeatureEvent.java
@@ -20,7 +20,7 @@ import java.util.EventObject;
 
 public class FeatureEvent extends EventObject {
 
-    public static enum EventType {
+    public enum EventType {
         FeatureInstalled,
         FeatureUninstalled
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/RepositoryEvent.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/RepositoryEvent.java b/features/core/src/main/java/org/apache/karaf/features/RepositoryEvent.java
index 68f287b..4a4e78d 100644
--- a/features/core/src/main/java/org/apache/karaf/features/RepositoryEvent.java
+++ b/features/core/src/main/java/org/apache/karaf/features/RepositoryEvent.java
@@ -20,7 +20,7 @@ import java.util.EventObject;
 
 public class RepositoryEvent extends EventObject {
 
-    public static enum EventType {
+    public enum EventType {
         RepositoryAdded,
         RepositoryRemoved,
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java
index 1bd45ef..9749da1 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java
@@ -167,10 +167,7 @@ public class Bundle implements BundleInfo {
         if ((startLevel != null ? startLevel : 0) != (bundle.startLevel != null ? bundle.startLevel : 0)) {
             return false;
         }
-        if (value != null ? !value.equals(bundle.value) : bundle.value != null) {
-            return false;
-        }
-        return true;
+        return value != null ? value.equals(bundle.value) : bundle.value == null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/internal/model/Capability.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Capability.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/Capability.java
index aba425d..d76497e 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Capability.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Capability.java
@@ -65,10 +65,7 @@ public class Capability implements org.apache.karaf.features.Capability {
             return false;
         }
         Capability bundle = (Capability) o;
-        if (value != null ? !value.equals(bundle.value) : bundle.value != null) {
-            return false;
-        }
-        return true;
+        return value != null ? value.equals(bundle.value) : bundle.value == null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/internal/model/Feature.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Feature.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/Feature.java
index 9c28174..752d2a8 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Feature.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Feature.java
@@ -391,10 +391,7 @@ public class Feature extends Content implements org.apache.karaf.features.Featur
         if (name != null ? !name.equals(feature.name) : feature.name != null) {
             return false;
         }
-        if (version != null ? !version.equals(feature.version) : feature.version != null) {
-            return false;
-        }
-        return true;
+        return version != null ? version.equals(feature.version) : feature.version == null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/internal/model/Requirement.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Requirement.java b/features/core/src/main/java/org/apache/karaf/features/internal/model/Requirement.java
index 7fbabc3..2e45bc0 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Requirement.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Requirement.java
@@ -63,10 +63,7 @@ public class Requirement implements org.apache.karaf.features.Requirement {
             return false;
         }
         Requirement bundle = (Requirement) o;
-        if (value != null ? !value.equals(bundle.value) : bundle.value != null) {
-            return false;
-        }
-        return true;
+        return value != null ? value.equals(bundle.value) : bundle.value == null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/internal/region/CandidateComparator.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/region/CandidateComparator.java b/features/core/src/main/java/org/apache/karaf/features/internal/region/CandidateComparator.java
index f65db51..9fecd4b 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/region/CandidateComparator.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/region/CandidateComparator.java
@@ -19,7 +19,6 @@ package org.apache.karaf.features.internal.region;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
-import java.util.Objects;
 import java.util.function.ToIntFunction;
 
 import org.apache.karaf.features.internal.resolver.ResolverUtil;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/internal/region/OfflineResolver.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/region/OfflineResolver.java b/features/core/src/main/java/org/apache/karaf/features/internal/region/OfflineResolver.java
index 849acd1..cb25236 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/region/OfflineResolver.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/region/OfflineResolver.java
@@ -23,10 +23,8 @@ import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.felix.resolver.Logger;
 import org.apache.felix.resolver.ResolverImpl;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/internal/region/Subsystem.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/region/Subsystem.java b/features/core/src/main/java/org/apache/karaf/features/internal/region/Subsystem.java
index 7780890..68db79a 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/region/Subsystem.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/region/Subsystem.java
@@ -17,7 +17,6 @@
 package org.apache.karaf.features.internal.region;
 
 import java.io.IOException;
-import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolveContext.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolveContext.java b/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolveContext.java
index bfc87e1..59e334c 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolveContext.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolveContext.java
@@ -23,7 +23,6 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -245,12 +244,7 @@ public class SubsystemResolveContext extends ResolveContext {
                         }
                     }
                 }
-                for (Iterator<Capability> it = caps.iterator(); it.hasNext();) {
-                    Capability cap = it.next();
-                    if (!providers.contains(cap.getResource())) {
-                        it.remove();
-                    }
-                }
+                caps.removeIf(cap -> !providers.contains(cap.getResource()));
             }
             // Sort caps
             if (distance != null) {

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolver.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolver.java b/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolver.java
index d131d65..c477f75 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolver.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/region/SubsystemResolver.java
@@ -222,12 +222,7 @@ public class SubsystemResolver {
         // Remove wiring to the fake environment resource
         if (environmentResource != null) {
             for (List<Wire> wires : wiring.values()) {
-                for (Iterator<Wire> iterator = wires.iterator(); iterator.hasNext();) {
-                    Wire wire = iterator.next();
-                    if (wire.getProvider() == environmentResource) {
-                        iterator.remove();
-                    }
-                }
+                wires.removeIf(wire -> wire.getProvider() == environmentResource);
             }
         }
         // Fragments are always wired to their host only, so create fake wiring to
@@ -470,7 +465,7 @@ public class SubsystemResolver {
         }
     }
 
-    private Requirement getSubsystemRequirement(Resource resource) {
+    static Requirement getSubsystemRequirement(Resource resource) {
         for (Requirement requirement : resource.getRequirements(null)) {
             if (IDENTITY_NAMESPACE.equals(requirement.getNamespace())
                     && TYPE_SUBSYSTEM.equals(requirement.getAttributes().get(CAPABILITY_TYPE_ATTRIBUTE))) {

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/internal/resolver/ResolverUtil.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/resolver/ResolverUtil.java b/features/core/src/main/java/org/apache/karaf/features/internal/resolver/ResolverUtil.java
index f1dceed..2c23201 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/resolver/ResolverUtil.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/resolver/ResolverUtil.java
@@ -30,7 +30,6 @@ import org.osgi.resource.Resource;
 
 import static org.apache.karaf.features.internal.resolver.ResourceUtils.TYPE_SUBSYSTEM;
 import static org.osgi.framework.namespace.IdentityNamespace.CAPABILITY_TYPE_ATTRIBUTE;
-import static org.osgi.service.subsystem.SubsystemConstants.SUBSYSTEM_TYPE;
 
 public class ResolverUtil
 {

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
index 52de7ae..5474806 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
@@ -28,7 +28,6 @@ import java.net.URL;
 import java.util.*;
 
 import org.apache.felix.utils.properties.InterpolationHelper;
-import org.apache.felix.utils.properties.InterpolationHelper.SubstitutionCallback;
 import org.apache.felix.utils.properties.TypedProperties;
 import org.apache.karaf.features.ConfigFileInfo;
 import org.apache.karaf.features.ConfigInfo;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/test/java/org/apache/karaf/features/FeaturesServiceTest.java
----------------------------------------------------------------------
diff --git a/features/core/src/test/java/org/apache/karaf/features/FeaturesServiceTest.java b/features/core/src/test/java/org/apache/karaf/features/FeaturesServiceTest.java
index ab5e31e..5e55819 100644
--- a/features/core/src/test/java/org/apache/karaf/features/FeaturesServiceTest.java
+++ b/features/core/src/test/java/org/apache/karaf/features/FeaturesServiceTest.java
@@ -58,7 +58,7 @@ public class FeaturesServiceTest extends TestBase {
             + "</features>";
 
     File dataFile;
-    Logger logger = LoggerFactory.getLogger(FeaturesServiceTest.class);;
+    Logger logger = LoggerFactory.getLogger(FeaturesServiceTest.class);
     Resolver resolver = new ResolverImpl(new Slf4jResolverLog(logger));
 
     @Before

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/test/java/org/apache/karaf/features/internal/region/FeaturesDependenciesTest.java
----------------------------------------------------------------------
diff --git a/features/core/src/test/java/org/apache/karaf/features/internal/region/FeaturesDependenciesTest.java b/features/core/src/test/java/org/apache/karaf/features/internal/region/FeaturesDependenciesTest.java
index bf9f24f..6b92352 100644
--- a/features/core/src/test/java/org/apache/karaf/features/internal/region/FeaturesDependenciesTest.java
+++ b/features/core/src/test/java/org/apache/karaf/features/internal/region/FeaturesDependenciesTest.java
@@ -32,7 +32,6 @@ import org.apache.karaf.features.internal.service.RepositoryImpl;
 import org.apache.karaf.features.internal.support.TestDownloadManager;
 import org.junit.Test;
 import org.osgi.framework.namespace.IdentityNamespace;
-import org.osgi.framework.wiring.BundleRevision;
 import org.osgi.resource.Capability;
 import org.osgi.resource.Resource;
 import org.osgi.resource.Wire;
@@ -45,7 +44,7 @@ import static org.junit.Assert.assertEquals;
 
 public class FeaturesDependenciesTest {
 
-    Logger logger = LoggerFactory.getLogger(FeaturesDependenciesTest.class);;
+    Logger logger = LoggerFactory.getLogger(FeaturesDependenciesTest.class);
     Resolver resolver = new ResolverImpl(new Slf4jResolverLog(logger));
 
     @Test

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/test/java/org/apache/karaf/features/internal/region/SubsystemTest.java
----------------------------------------------------------------------
diff --git a/features/core/src/test/java/org/apache/karaf/features/internal/region/SubsystemTest.java b/features/core/src/test/java/org/apache/karaf/features/internal/region/SubsystemTest.java
index 520dc5b..1d56011 100644
--- a/features/core/src/test/java/org/apache/karaf/features/internal/region/SubsystemTest.java
+++ b/features/core/src/test/java/org/apache/karaf/features/internal/region/SubsystemTest.java
@@ -33,7 +33,6 @@ import org.apache.karaf.features.internal.service.RepositoryImpl;
 import org.apache.karaf.features.internal.support.TestDownloadManager;
 import org.junit.Test;
 import org.osgi.framework.namespace.IdentityNamespace;
-import org.osgi.framework.wiring.BundleRevision;
 import org.osgi.resource.Capability;
 import org.osgi.resource.Resource;
 import org.osgi.resource.Wire;
@@ -46,7 +45,7 @@ import static org.junit.Assert.assertEquals;
 
 public class SubsystemTest {
 
-    Logger logger = LoggerFactory.getLogger(SubsystemTest.class);;
+    Logger logger = LoggerFactory.getLogger(SubsystemTest.class);
     Resolver resolver = new ResolverImpl(new Slf4jResolverLog(logger));
 
     @Test

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/test/java/org/apache/karaf/features/internal/service/DeployerTest.java
----------------------------------------------------------------------
diff --git a/features/core/src/test/java/org/apache/karaf/features/internal/service/DeployerTest.java b/features/core/src/test/java/org/apache/karaf/features/internal/service/DeployerTest.java
index 77aeb07..d06e195 100644
--- a/features/core/src/test/java/org/apache/karaf/features/internal/service/DeployerTest.java
+++ b/features/core/src/test/java/org/apache/karaf/features/internal/service/DeployerTest.java
@@ -24,7 +24,6 @@ import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.jar.Manifest;
@@ -46,8 +45,6 @@ import org.easymock.IMocksControl;
 import org.junit.Test;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
-import org.osgi.resource.Resource;
-import org.osgi.resource.Wire;
 import org.osgi.service.resolver.Resolver;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/test/java/org/apache/karaf/features/internal/service/FeaturesServiceImplTest.java
----------------------------------------------------------------------
diff --git a/features/core/src/test/java/org/apache/karaf/features/internal/service/FeaturesServiceImplTest.java b/features/core/src/test/java/org/apache/karaf/features/internal/service/FeaturesServiceImplTest.java
index 082fc21..15f4f04 100644
--- a/features/core/src/test/java/org/apache/karaf/features/internal/service/FeaturesServiceImplTest.java
+++ b/features/core/src/test/java/org/apache/karaf/features/internal/service/FeaturesServiceImplTest.java
@@ -34,7 +34,6 @@ import org.apache.karaf.features.internal.resolver.Slf4jResolverLog;
 import org.apache.karaf.features.internal.service.BundleInstallSupport.FrameworkInfo;
 import org.easymock.EasyMock;
 import org.junit.After;
-import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.osgi.service.resolver.Resolver;
@@ -53,7 +52,7 @@ import static org.junit.Assert.assertTrue;
  */
 public class FeaturesServiceImplTest extends TestBase {
 
-    Logger logger = LoggerFactory.getLogger(FeaturesServiceImplTest.class);;
+    Logger logger = LoggerFactory.getLogger(FeaturesServiceImplTest.class);
     Resolver resolver = new ResolverImpl(new Slf4jResolverLog(logger));
     File dataFile;
 
@@ -198,7 +197,7 @@ public class FeaturesServiceImplTest extends TestBase {
     }
 
     private void installFeature(final FeaturesService featureService, Feature a1Feature)
-        throws Exception, InterruptedException {
+        throws Exception {
         featureService.installFeature(a1Feature, EnumSet.noneOf(Option.class));
         while (!featureService.isInstalled(a1Feature)) {
             Thread.sleep(100);

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/features/core/src/test/java/org/apache/karaf/features/internal/service/OverridesTest.java
----------------------------------------------------------------------
diff --git a/features/core/src/test/java/org/apache/karaf/features/internal/service/OverridesTest.java b/features/core/src/test/java/org/apache/karaf/features/internal/service/OverridesTest.java
index 660ffb0..033ac7c 100644
--- a/features/core/src/test/java/org/apache/karaf/features/internal/service/OverridesTest.java
+++ b/features/core/src/test/java/org/apache/karaf/features/internal/service/OverridesTest.java
@@ -17,8 +17,6 @@
 package org.apache.karaf.features.internal.service;
 
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/http/src/main/java/org/apache/karaf/http/core/ServletInfo.java
----------------------------------------------------------------------
diff --git a/http/src/main/java/org/apache/karaf/http/core/ServletInfo.java b/http/src/main/java/org/apache/karaf/http/core/ServletInfo.java
index c2e2fa3..515eb36 100644
--- a/http/src/main/java/org/apache/karaf/http/core/ServletInfo.java
+++ b/http/src/main/java/org/apache/karaf/http/core/ServletInfo.java
@@ -17,7 +17,6 @@
 package org.apache.karaf.http.core;
 
 import org.ops4j.pax.web.service.spi.WebEvent;
-import org.osgi.framework.Bundle;
 
 public class ServletInfo {
     private String name;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/instance/src/main/java/org/apache/karaf/instance/command/completers/StartedInstanceCompleter.java
----------------------------------------------------------------------
diff --git a/instance/src/main/java/org/apache/karaf/instance/command/completers/StartedInstanceCompleter.java b/instance/src/main/java/org/apache/karaf/instance/command/completers/StartedInstanceCompleter.java
index f9a098d..12f10d2 100644
--- a/instance/src/main/java/org/apache/karaf/instance/command/completers/StartedInstanceCompleter.java
+++ b/instance/src/main/java/org/apache/karaf/instance/command/completers/StartedInstanceCompleter.java
@@ -25,11 +25,7 @@ public class StartedInstanceCompleter extends InstanceCompleter {
 
     protected boolean acceptsInstance(Instance instance) {
         try {
-            if (instance.getState().equals(Instance.STARTED)) {
-                return true;
-            } else {
-                return false;
-            }
+            return instance.getState().equals(Instance.STARTED);
         } catch (Exception e) {
             return false;
         }

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/instance/src/main/java/org/apache/karaf/instance/command/completers/StoppedInstanceCompleter.java
----------------------------------------------------------------------
diff --git a/instance/src/main/java/org/apache/karaf/instance/command/completers/StoppedInstanceCompleter.java b/instance/src/main/java/org/apache/karaf/instance/command/completers/StoppedInstanceCompleter.java
index be17ad8..4da614b 100644
--- a/instance/src/main/java/org/apache/karaf/instance/command/completers/StoppedInstanceCompleter.java
+++ b/instance/src/main/java/org/apache/karaf/instance/command/completers/StoppedInstanceCompleter.java
@@ -25,11 +25,7 @@ public class StoppedInstanceCompleter extends InstanceCompleter {
     
     protected boolean acceptsInstance(Instance instance) {
         try {
-            if (instance.getState().equals(Instance.STOPPED)) {
-                return true;
-            } else {
-                return false;
-            }
+            return instance.getState().equals(Instance.STOPPED);
         } catch (Exception e) {
             return false;
         }

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
----------------------------------------------------------------------
diff --git a/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java b/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
index 010b52b..97152d9 100644
--- a/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
+++ b/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
@@ -1058,7 +1058,7 @@ public class InstanceServiceImpl implements InstanceService {
 
     protected static Properties loadPropertiesFile(URL configPropURL) throws Exception {
         try (
-            InputStream is = configPropURL.openConnection().getInputStream();
+            InputStream is = configPropURL.openConnection().getInputStream()
         ){
             Properties configProps = new Properties();
             configProps.load(is);

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/itests/src/test/java/org/apache/karaf/itests/JmsTest.java
----------------------------------------------------------------------
diff --git a/itests/src/test/java/org/apache/karaf/itests/JmsTest.java b/itests/src/test/java/org/apache/karaf/itests/JmsTest.java
index f0068de..c05e31c 100644
--- a/itests/src/test/java/org/apache/karaf/itests/JmsTest.java
+++ b/itests/src/test/java/org/apache/karaf/itests/JmsTest.java
@@ -27,17 +27,12 @@ import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
 import java.net.Socket;
-import java.net.UnknownHostException;
 import java.util.Arrays;
 import java.util.List;
 
 import javax.jms.ConnectionFactory;
-import javax.management.AttributeNotFoundException;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
-import javax.management.ReflectionException;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -111,7 +106,7 @@ public class JmsTest extends KarafTestSupport {
         invoke("delete", JMX_CF_NAME);
     }
 
-    public boolean jmsTransportPresent() throws UnknownHostException, IOException {
+    public boolean jmsTransportPresent() throws IOException {
         try (Socket socket = new Socket("localhost", 61616)) {
             return true;
         } catch (Exception e) {
@@ -125,8 +120,7 @@ public class JmsTest extends KarafTestSupport {
         return output;
     }
 
-    private void checkJMXCreateConnectionFactory() throws Exception, AttributeNotFoundException,
-        MBeanException, InstanceNotFoundException, ReflectionException {
+    private void checkJMXCreateConnectionFactory() throws Exception {
         invoke("create", JMX_CF_NAME, "activemq", "tcp://localhost:61616", "karaf", "karaf");
         waitForConnectionFactory("name=" + JMX_CF_NAME);
         @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/itests/src/test/java/org/apache/karaf/itests/ssh/ConfigSshCommandSecurityTest.java
----------------------------------------------------------------------
diff --git a/itests/src/test/java/org/apache/karaf/itests/ssh/ConfigSshCommandSecurityTest.java b/itests/src/test/java/org/apache/karaf/itests/ssh/ConfigSshCommandSecurityTest.java
index b742851..f7b65b7 100644
--- a/itests/src/test/java/org/apache/karaf/itests/ssh/ConfigSshCommandSecurityTest.java
+++ b/itests/src/test/java/org/apache/karaf/itests/ssh/ConfigSshCommandSecurityTest.java
@@ -13,8 +13,6 @@
  */
 package org.apache.karaf.itests.ssh;
 
-import java.io.IOException;
-
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -55,7 +53,7 @@ public class ConfigSshCommandSecurityTest extends SshCommandTestBase {
         testConfigEdits("karaf", Result.OK, "org.apache.karaf.service.acl.test_" + counter++, true);
     }
 
-    private void testConfigEdits(String user, Result expectedEditResult, String pid, boolean isAdmin) throws Exception, IOException {
+    private void testConfigEdits(String user, Result expectedEditResult, String pid, boolean isAdmin) throws Exception {
         assertCommand(user, "config:edit " + pid + "\n" +
                 "config:property-set x y\n" +
                 "config:property-set a b\n" +
@@ -120,7 +118,7 @@ public class ConfigSshCommandSecurityTest extends SshCommandTestBase {
         testConfigEditsNoSession("karaf", Result.OK, "org.apache.karaf.service.acl.test_" + counter++);
     }
 
-    private void testConfigEditsNoSession(String user, Result expectedResult, String pid) throws Exception, IOException {
+    private void testConfigEditsNoSession(String user, Result expectedResult, String pid) throws Exception {
         assertCommand(user, "config:property-set -p " + pid + " a.b.c d.e.f", expectedResult);
         assertCommand(user, "config:property-append -p " + pid + " a.b.c .g.h", expectedResult);
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/itests/src/test/java/org/apache/karaf/itests/ssh/SshCommandTestBase.java
----------------------------------------------------------------------
diff --git a/itests/src/test/java/org/apache/karaf/itests/ssh/SshCommandTestBase.java b/itests/src/test/java/org/apache/karaf/itests/ssh/SshCommandTestBase.java
index b252506..af1dbae 100644
--- a/itests/src/test/java/org/apache/karaf/itests/ssh/SshCommandTestBase.java
+++ b/itests/src/test/java/org/apache/karaf/itests/ssh/SshCommandTestBase.java
@@ -43,7 +43,7 @@ import org.ops4j.pax.exam.spi.reactors.PerClass;
 @ExamReactorStrategy(PerClass.class)
 public class SshCommandTestBase extends KarafTestSupport {
 
-    enum Result { OK, NOT_FOUND, NO_CREDENTIALS };
+    enum Result { OK, NOT_FOUND, NO_CREDENTIALS }
 
     private SshClient client;
     private ClientChannel channel;
@@ -88,7 +88,7 @@ public class SshCommandTestBase extends KarafTestSupport {
         System.out.println(new String(out.toByteArray()));
     }
 
-    String assertCommand(String user, String command, Result result) throws Exception, IOException {
+    String assertCommand(String user, String command, Result result) throws Exception {
         if (!command.endsWith("\n"))
             command += "\n";
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/blueprint/jasypt/src/test/java/org/apache/karaf/jaas/blueprint/jasypt/handler/EncryptableConfigAdminPropertyPlaceholderTest.java
----------------------------------------------------------------------
diff --git a/jaas/blueprint/jasypt/src/test/java/org/apache/karaf/jaas/blueprint/jasypt/handler/EncryptableConfigAdminPropertyPlaceholderTest.java b/jaas/blueprint/jasypt/src/test/java/org/apache/karaf/jaas/blueprint/jasypt/handler/EncryptableConfigAdminPropertyPlaceholderTest.java
index b345c7c..388e975 100644
--- a/jaas/blueprint/jasypt/src/test/java/org/apache/karaf/jaas/blueprint/jasypt/handler/EncryptableConfigAdminPropertyPlaceholderTest.java
+++ b/jaas/blueprint/jasypt/src/test/java/org/apache/karaf/jaas/blueprint/jasypt/handler/EncryptableConfigAdminPropertyPlaceholderTest.java
@@ -33,7 +33,6 @@ import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.util.tracker.ServiceTracker;
 
 import java.io.*;
-import java.net.URL;
 import java.util.*;
 import java.util.jar.JarInputStream;
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/GroupPrincipal.java
----------------------------------------------------------------------
diff --git a/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/GroupPrincipal.java b/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/GroupPrincipal.java
index 92e58d4..60f2953 100644
--- a/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/GroupPrincipal.java
+++ b/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/GroupPrincipal.java
@@ -19,6 +19,7 @@ import java.security.Principal;
 import java.security.acl.Group;
 import java.util.Enumeration;
 import java.util.Hashtable;
+import java.util.Objects;
 
 public class GroupPrincipal implements Group, Serializable {
     private static final long serialVersionUID = 1L;
@@ -39,18 +40,14 @@ public class GroupPrincipal implements Group, Serializable {
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
-        if (!(o instanceof GroupPrincipal)) return false;
-
+        if (o == null || getClass() != o.getClass()) return false;
         GroupPrincipal that = (GroupPrincipal) o;
-
-        if (name != null ? !name.equals(that.name) : that.name != null) return false;
-
-        return true;
+        return Objects.equals(name, that.name);
     }
 
     @Override
     public int hashCode() {
-        return name != null ? name.hashCode() : 0;
+        return Objects.hash(name);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/RolePolicy.java
----------------------------------------------------------------------
diff --git a/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/RolePolicy.java b/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/RolePolicy.java
index 93e5add..076435e 100644
--- a/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/RolePolicy.java
+++ b/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/RolePolicy.java
@@ -62,7 +62,7 @@ public enum RolePolicy {
         }
     }
 
-    private RolePolicy(String value) {
+    RolePolicy(String value) {
         this.value = value;
     }
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/RolePrincipal.java
----------------------------------------------------------------------
diff --git a/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/RolePrincipal.java b/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/RolePrincipal.java
index a7dd7ac..def42cb 100644
--- a/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/RolePrincipal.java
+++ b/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/RolePrincipal.java
@@ -18,6 +18,7 @@ package org.apache.karaf.jaas.boot.principal;
 
 import java.io.Serializable;
 import java.security.Principal;
+import java.util.Objects;
 
 public class RolePrincipal implements Principal, Serializable {
     private static final long serialVersionUID = 1L;
@@ -36,18 +37,14 @@ public class RolePrincipal implements Principal, Serializable {
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
-        if (!(o instanceof RolePrincipal)) return false;
-
+        if (o == null || getClass() != o.getClass()) return false;
         RolePrincipal that = (RolePrincipal) o;
-
-        if (name != null ? !name.equals(that.name) : that.name != null) return false;
-
-        return true;
+        return Objects.equals(name, that.name);
     }
 
     @Override
     public int hashCode() {
-        return name != null ? name.hashCode() : 0;
+        return Objects.hash(name);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/UserPrincipal.java
----------------------------------------------------------------------
diff --git a/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/UserPrincipal.java b/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/UserPrincipal.java
index 4270cd9..9f5318b 100644
--- a/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/UserPrincipal.java
+++ b/jaas/boot/src/main/java/org/apache/karaf/jaas/boot/principal/UserPrincipal.java
@@ -18,6 +18,7 @@ package org.apache.karaf.jaas.boot.principal;
 
 import java.io.Serializable;
 import java.security.Principal;
+import java.util.Objects;
 
 public class UserPrincipal implements Principal, Serializable {
     private static final long serialVersionUID = 1L;
@@ -36,18 +37,14 @@ public class UserPrincipal implements Principal, Serializable {
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
-        if (!(o instanceof UserPrincipal)) return false;
-
+        if (o == null || getClass() != o.getClass()) return false;
         UserPrincipal that = (UserPrincipal) o;
-
-        if (name != null ? !name.equals(that.name) : that.name != null) return false;
-
-        return true;
+        return Objects.equals(name, that.name);
     }
 
     @Override
     public int hashCode() {
-        return name != null ? name.hashCode() : 0;
+        return Objects.hash(name);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/command/src/main/java/org/apache/karaf/jaas/command/JaasCommandSupport.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/JaasCommandSupport.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/JaasCommandSupport.java
index 0ef7a28d..b823fdc 100644
--- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/JaasCommandSupport.java
+++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/JaasCommandSupport.java
@@ -16,7 +16,6 @@
 package org.apache.karaf.jaas.command;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Queue;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/command/src/main/java/org/apache/karaf/jaas/command/ListGroupsCommand.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/ListGroupsCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/ListGroupsCommand.java
index cd5c6ec..3c04963 100644
--- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/ListGroupsCommand.java
+++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/ListGroupsCommand.java
@@ -15,16 +15,9 @@
  */
 package org.apache.karaf.jaas.command;
 
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
 import javax.security.auth.login.AppConfigurationEntry;
 
 import org.apache.karaf.jaas.boot.principal.GroupPrincipal;
-import org.apache.karaf.jaas.boot.principal.UserPrincipal;
 import org.apache.karaf.jaas.config.JaasRealm;
 import org.apache.karaf.jaas.modules.BackingEngine;
 import org.apache.karaf.shell.api.action.Command;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/command/src/test/java/org/apache/karaf/jaas/command/ManageRealmCommandTest.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/test/java/org/apache/karaf/jaas/command/ManageRealmCommandTest.java b/jaas/command/src/test/java/org/apache/karaf/jaas/command/ManageRealmCommandTest.java
index 633fbf9..71397a1 100644
--- a/jaas/command/src/test/java/org/apache/karaf/jaas/command/ManageRealmCommandTest.java
+++ b/jaas/command/src/test/java/org/apache/karaf/jaas/command/ManageRealmCommandTest.java
@@ -18,7 +18,6 @@ package org.apache.karaf.jaas.command;
 import java.util.Arrays;
 import java.util.Properties;
 
-import org.apache.karaf.jaas.config.JaasRealm;
 import org.apache.karaf.jaas.config.impl.Config;
 import org.apache.karaf.jaas.config.impl.Module;
 import org.apache.karaf.shell.api.console.Session;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/config/src/main/java/org/apache/karaf/jaas/config/JaasRealm.java
----------------------------------------------------------------------
diff --git a/jaas/config/src/main/java/org/apache/karaf/jaas/config/JaasRealm.java b/jaas/config/src/main/java/org/apache/karaf/jaas/config/JaasRealm.java
index d3fc014..07fc8b8 100644
--- a/jaas/config/src/main/java/org/apache/karaf/jaas/config/JaasRealm.java
+++ b/jaas/config/src/main/java/org/apache/karaf/jaas/config/JaasRealm.java
@@ -20,9 +20,9 @@ import javax.security.auth.login.AppConfigurationEntry;
 
 public interface JaasRealm {
 
-    public String getName();
+    String getName();
 
-    public int getRank();
+    int getRank();
 
-    public AppConfigurationEntry[] getEntries();
+    AppConfigurationEntry[] getEntries();
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/jasypt/src/main/java/org/apache/karaf/jaas/jasypt/impl/JasyptEncryption.java
----------------------------------------------------------------------
diff --git a/jaas/jasypt/src/main/java/org/apache/karaf/jaas/jasypt/impl/JasyptEncryption.java b/jaas/jasypt/src/main/java/org/apache/karaf/jaas/jasypt/impl/JasyptEncryption.java
index 99311a8..0c50e42 100644
--- a/jaas/jasypt/src/main/java/org/apache/karaf/jaas/jasypt/impl/JasyptEncryption.java
+++ b/jaas/jasypt/src/main/java/org/apache/karaf/jaas/jasypt/impl/JasyptEncryption.java
@@ -18,8 +18,6 @@ import java.util.Map;
 
 import org.apache.karaf.jaas.modules.Encryption;
 import org.apache.karaf.jaas.modules.EncryptionService;
-import org.jasypt.digest.config.DigesterConfig;
-import org.jasypt.digest.config.SimpleDigesterConfig;
 import org.jasypt.digest.config.SimpleStringDigesterConfig;
 import org.jasypt.exceptions.EncryptionInitializationException;
 import org.jasypt.util.password.ConfigurablePasswordEncryptor;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java
index f0aa084..8638ee6 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java
@@ -24,7 +24,7 @@ import org.apache.karaf.jaas.boot.principal.UserPrincipal;
 
 public interface BackingEngine {
 
-    static final String GROUP_PREFIX = "_g_:";
+    String GROUP_PREFIX = "_g_:";
     
     /**
      * Create a new user.

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/Encryption.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/Encryption.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/Encryption.java
index fa44fd6..9927102 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/Encryption.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/Encryption.java
@@ -25,7 +25,7 @@ public interface Encryption {
      * @param plain the password in plain format.
      * @return the encrypted password format.
      */
-    public String encryptPassword(String plain);
+    String encryptPassword(String plain);
     
     /**
      * Check password.
@@ -34,6 +34,6 @@ public interface Encryption {
      * @param password the encrypted format to compare with.
      * @return true if the password match, false else.
      */
-    public boolean checkPassword(String input, String password);
+    boolean checkPassword(String input, String password);
 
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/impl/Activator.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/impl/Activator.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/impl/Activator.java
index 8e37aea..3d369ec 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/impl/Activator.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/impl/Activator.java
@@ -26,7 +26,6 @@ import org.apache.karaf.jaas.modules.ldap.LDAPCache;
 import org.apache.karaf.jaas.modules.properties.AutoEncryptionSupport;
 import org.apache.karaf.jaas.modules.properties.PropertiesBackingEngineFactory;
 import org.apache.karaf.jaas.modules.publickey.PublickeyBackingEngineFactory;
-import org.apache.karaf.util.StreamUtils;
 import org.apache.karaf.util.tracker.BaseActivator;
 import org.apache.karaf.util.tracker.annotation.Managed;
 import org.apache.karaf.util.tracker.annotation.ProvideService;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/impl/KarafRealm.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/impl/KarafRealm.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/impl/KarafRealm.java
index 8e4c99d..eaabbac 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/impl/KarafRealm.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/impl/KarafRealm.java
@@ -22,7 +22,6 @@ import javax.security.auth.login.AppConfigurationEntry;
 
 import org.apache.karaf.jaas.boot.ProxyLoginModule;
 import org.apache.karaf.jaas.config.JaasRealm;
-import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 
 public class KarafRealm implements JaasRealm {

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
index db0a8e8..11a52cc 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
@@ -27,12 +27,9 @@ import javax.sql.DataSource;
 
 import java.security.Principal;
 import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCUtils.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCUtils.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCUtils.java
index 6459a50..4e1cda8 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCUtils.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCUtils.java
@@ -20,7 +20,6 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 
 import org.osgi.framework.BundleContext;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPLoginModule.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPLoginModule.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPLoginModule.java
index b189057..1838f58 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPLoginModule.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPLoginModule.java
@@ -25,7 +25,6 @@ import javax.security.auth.callback.PasswordCallback;
 import javax.security.auth.callback.UnsupportedCallbackException;
 import javax.security.auth.login.LoginException;
 import java.io.IOException;
-import java.security.Principal;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPOptions.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPOptions.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPOptions.java
index f2c130b..90c3333 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPOptions.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPOptions.java
@@ -266,7 +266,7 @@ public class LDAPOptions {
 
     public boolean getDisableCache() {
         final Object object = options.get(DISABLE_CACHE);
-        return object == null ? true : Boolean.parseBoolean((String) object);
+        return object == null || Boolean.parseBoolean((String) object);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/osgi/OsgiConfigLoginModule.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/osgi/OsgiConfigLoginModule.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/osgi/OsgiConfigLoginModule.java
index c5d03f0..8ce320e 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/osgi/OsgiConfigLoginModule.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/osgi/OsgiConfigLoginModule.java
@@ -17,7 +17,6 @@
 package org.apache.karaf.jaas.modules.osgi;
 
 import java.io.IOException;
-import java.security.Principal;
 import java.util.Dictionary;
 import java.util.HashSet;
 import java.util.Map;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/DigestPasswordLoginModule.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/DigestPasswordLoginModule.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/DigestPasswordLoginModule.java
index 5ddf7d4..4ae2afa 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/DigestPasswordLoginModule.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/DigestPasswordLoginModule.java
@@ -20,7 +20,6 @@ import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.Field;
 import java.security.MessageDigest;
-import java.security.Principal;
 import java.util.HashSet;
 import java.util.Map;
 import javax.security.auth.Subject;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesLoginModule.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesLoginModule.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesLoginModule.java
index d4da774..9fe11ed 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesLoginModule.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesLoginModule.java
@@ -18,7 +18,6 @@ package org.apache.karaf.jaas.modules.properties;
 
 import java.io.File;
 import java.io.IOException;
-import java.security.Principal;
 import java.util.HashSet;
 import java.util.Map;
 import javax.security.auth.Subject;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngine.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngine.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngine.java
index 2eb246b..fcbe41c 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngine.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngine.java
@@ -26,7 +26,6 @@ import org.apache.karaf.jaas.boot.principal.GroupPrincipal;
 import org.apache.karaf.jaas.boot.principal.RolePrincipal;
 import org.apache.karaf.jaas.boot.principal.UserPrincipal;
 import org.apache.karaf.jaas.modules.BackingEngine;
-import org.apache.karaf.jaas.modules.encryption.EncryptionSupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyLoginModule.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyLoginModule.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyLoginModule.java
index e7cfdaf..d04f0ab 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyLoginModule.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyLoginModule.java
@@ -20,7 +20,6 @@ import java.io.DataOutputStream;
 import java.io.File;
 import java.io.IOException;
 import java.math.BigInteger;
-import java.security.Principal;
 import java.security.PublicKey;
 import java.security.interfaces.DSAPublicKey;
 import java.security.interfaces.RSAKey;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/syncope/SyncopeBackingEngine.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/syncope/SyncopeBackingEngine.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/syncope/SyncopeBackingEngine.java
index 16c7352..9558e53 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/syncope/SyncopeBackingEngine.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/syncope/SyncopeBackingEngine.java
@@ -32,7 +32,6 @@ import org.apache.karaf.jaas.modules.BackingEngine;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.naming.OperationNotSupportedException;
 import java.security.Principal;
 import java.util.ArrayList;
 import java.util.List;

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/syncope/SyncopeLoginModule.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/syncope/SyncopeLoginModule.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/syncope/SyncopeLoginModule.java
index 1af9751..aa977e4 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/syncope/SyncopeLoginModule.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/syncope/SyncopeLoginModule.java
@@ -32,7 +32,6 @@ import javax.security.auth.Subject;
 import javax.security.auth.callback.*;
 import javax.security.auth.login.LoginException;
 import java.io.IOException;
-import java.security.Principal;
 import java.util.*;
 
 /**

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5d25169/jaas/modules/src/test/java/org/apache/karaf/jaas/modules/ldap/GSSAPILdapLoginModuleTest.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/test/java/org/apache/karaf/jaas/modules/ldap/GSSAPILdapLoginModuleTest.java b/jaas/modules/src/test/java/org/apache/karaf/jaas/modules/ldap/GSSAPILdapLoginModuleTest.java
index 63382d7..47ea240 100644
--- a/jaas/modules/src/test/java/org/apache/karaf/jaas/modules/ldap/GSSAPILdapLoginModuleTest.java
+++ b/jaas/modules/src/test/java/org/apache/karaf/jaas/modules/ldap/GSSAPILdapLoginModuleTest.java
@@ -171,7 +171,7 @@ public class GSSAPILdapLoginModuleTest extends AbstractKerberosITest {
             FileInputStream inputStream = new FileInputStream(f);
             String content = IOUtils.toString(inputStream, "UTF-8");
             inputStream.close();
-            content = content.replaceAll("portno", "" + super.getLdapServer().getPort());
+            content = content.replaceAll("portno", "" + getLdapServer().getPort());
             content = content.replaceAll("address", KerberosTestUtils.getHostName());
 
             File f2 = new File(basedir + "/target/test-classes/org/apache/karaf/jaas/modules/ldap/gssapi.ldap.properties");


Mime
View raw message