syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject syncope git commit: Findbugs sweep of the client module
Date Fri, 09 Dec 2016 11:36:46 GMT
Repository: syncope
Updated Branches:
  refs/heads/master 18e67bbd2 -> 380386ee8


Findbugs sweep of the client module


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

Branch: refs/heads/master
Commit: 380386ee8e4050db6485121bc440214fe9436319
Parents: 18e67bb
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Dec 9 11:36:31 2016 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Dec 9 11:36:31 2016 +0000

----------------------------------------------------------------------
 .../java/org/apache/syncope/client/cli/SyncopeServices.java | 9 +++++----
 .../commands/entitlement/EntitlementSyncopeOperations.java  | 5 +++--
 .../client/cli/commands/self/WorkflowExportDefinition.java  | 4 +---
 .../client/cli/commands/self/WorkflowExportDiagram.java     | 7 ++++---
 .../org/apache/syncope/client/cli/util/CommandUtils.java    | 2 +-
 .../java/org/apache/syncope/client/cli/view/Messages.java   | 4 ++--
 .../main/java/org/apache/syncope/client/cli/view/Table.java | 2 +-
 .../syncope/client/console/SyncopeConsoleApplication.java   | 5 +++--
 .../apache/syncope/client/console/approvals/Approval.java   | 3 ---
 .../client/console/commons/ResourceStatusDataProvider.java  | 2 +-
 .../syncope/client/console/commons/status/StatusUtils.java  | 4 ++--
 .../syncope/client/console/events/EventCategoryPanel.java   | 2 +-
 .../syncope/client/console/panels/RealmChoicePanel.java     | 2 +-
 .../console/wicket/markup/html/form/DateTimeFieldPanel.java | 2 +-
 .../apache/syncope/client/console/widgets/AlertWidget.java  | 2 +-
 .../syncope/client/console/widgets/ApprovalsWidget.java     | 9 +++++++--
 .../widgets/reconciliation/ReconciliationReport.java        | 6 +++++-
 .../widgets/reconciliation/ReconciliationReportParser.java  | 6 +++---
 .../client/console/wizards/AjaxWizardMgtButtonBar.java      | 1 -
 .../syncope/client/console/wizards/any/AbstractAttrs.java   | 8 +++++++-
 .../client/console/wizards/any/GroupWizardBuilder.java      | 6 +++---
 .../console/wizards/resources/ProvisionWizardBuilder.java   | 4 ++--
 .../client/console/wizards/role/RoleWizardBuilder.java      | 8 ++++----
 .../syncope/client/enduser/SyncopeEnduserApplication.java   | 5 +++--
 24 files changed, 61 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeServices.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeServices.java b/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeServices.java
index 2fecf4a..d534930 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeServices.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeServices.java
@@ -20,6 +20,7 @@ package org.apache.syncope.client.cli;
 
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.Properties;
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.syncope.client.cli.commands.install.InstallConfigFileTemplate;
@@ -38,8 +39,8 @@ public final class SyncopeServices {
 
     public static <T> T get(final Class<T> clazz) {
         final Properties properties = new Properties();
-        try {
-            properties.load(new FileInputStream(InstallConfigFileTemplate.configurationFilePath()));
+        try (InputStream is = new FileInputStream(InstallConfigFileTemplate.configurationFilePath()))
{
+            properties.load(is);
         } catch (final IOException e) {
             LOG.error("Error opening properties file", e);
         }
@@ -62,8 +63,8 @@ public final class SyncopeServices {
 
     public static void testUsernameAndPassword(final String username, final String password)
{
         final Properties properties = new Properties();
-        try {
-            properties.load(new FileInputStream(InstallConfigFileTemplate.configurationFilePath()));
+        try (InputStream is = new FileInputStream(InstallConfigFileTemplate.configurationFilePath()))
{
+            properties.load(is);
         } catch (final IOException e) {
             LOG.error("Error opening properties file", e);
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSyncopeOperations.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSyncopeOperations.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSyncopeOperations.java
index 55f0847..6d13269 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSyncopeOperations.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSyncopeOperations.java
@@ -70,8 +70,9 @@ public class EntitlementSyncopeOperations {
     public Set<RoleTO> rolePerEntitlements(final String entitlement) {
         final Set<RoleTO> roles = new HashSet<>();
         for (final RoleTO role : roleSyncopeOperations.list()) {
-            role.getEntitlements().contains(entitlement);
-            roles.add(role);
+            if (role.getEntitlements().contains(entitlement)) {
+                roles.add(role);
+            }
         }
         return roles;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java
index 2b09a92..b855ae0 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.client.cli.commands.self;
 
-import javax.ws.rs.core.Response;
 import javax.xml.ws.WebServiceException;
 import org.apache.syncope.client.cli.Input;
 import org.apache.syncope.client.cli.util.CommandUtils;
@@ -42,8 +41,7 @@ public class WorkflowExportDefinition extends AbstractWorkflowCommand {
     public void export() {
         if (input.parameterNumber() == 1) {
             try {
-
-                final Response response = workflowSyncopeOperations.exportDefinition(input.firstParameter());
+                workflowSyncopeOperations.exportDefinition(input.firstParameter());
             } catch (final SyncopeClientException | WebServiceException ex) {
                 LOG.error("Error", ex);
                 if (ex.getMessage().startsWith("NotFound")) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDiagram.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDiagram.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDiagram.java
index 7d98d70..ee5c541 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDiagram.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDiagram.java
@@ -44,9 +44,10 @@ public class WorkflowExportDiagram extends AbstractWorkflowCommand {
             try {
                 final Response response = workflowSyncopeOperations.exportDiagram(input.firstParameter());
                 final byte[] diagram = IOUtils.readBytesFromStream((InputStream) response.getEntity());
-                final FileOutputStream fos = new FileOutputStream("/tmp/diagram.png");
-                fos.write(diagram);
-                fos.close();
+                try (final FileOutputStream fos = new FileOutputStream("/tmp/diagram.png"))
{
+                    fos.write(diagram);
+                    fos.close();
+                }
                 workflowResultManager.genericMessage("Diagram created: /tmp/diagram.png");
             } catch (final SyncopeClientException | WebServiceException ex) {
                 if (ex.getMessage().startsWith("NotFound")) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/cli/src/main/java/org/apache/syncope/client/cli/util/CommandUtils.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/util/CommandUtils.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/util/CommandUtils.java
index 9fe31d5..b2e4594 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/util/CommandUtils.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/util/CommandUtils.java
@@ -73,7 +73,7 @@ public final class CommandUtils {
     }
 
     public static String helpMessage(final String command, final List<String> options)
{
-        final StringBuilder helpMessageBuilder = new StringBuilder(String.format("\nUsage:
%s [options]\n", command));
+        final StringBuilder helpMessageBuilder = new StringBuilder(String.format("%nUsage:
%s [options]%n", command));
         helpMessageBuilder.append("  Options:\n");
         for (final String option : options) {
             helpMessageBuilder.append("    ").append(option).append("\n");

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/cli/src/main/java/org/apache/syncope/client/cli/view/Messages.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/view/Messages.java b/client/cli/src/main/java/org/apache/syncope/client/cli/view/Messages.java
index e6592e2..a45d393 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/view/Messages.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/view/Messages.java
@@ -25,7 +25,7 @@ public final class Messages {
 
     private static final ResourceBundle MESSAGES = ResourceBundle.getBundle("messages");
 
-    private static final String OPTION_COMMAND_MESSAGE_TEMPLATE = "\n - Usage: %s\n";
+    private static final String OPTION_COMMAND_MESSAGE_TEMPLATE = "%n - Usage: %s%n";
 
     private static final String CREATED_MESSAGE_TEMPLATE = "%s %s successfully created";
 
@@ -43,7 +43,7 @@ public final class Messages {
     private static final String NOT_BOOLEAN_MESSAGE_TEMPLATE = "Error reading %s. It isn't
a valid %s "
             + "value because it isn't a boolean value";
 
-    private static final String DEFAULT_MESSAGE_TEMPLATE = "%s is not a valid option. \n\b
%s";
+    private static final String DEFAULT_MESSAGE_TEMPLATE = "%s is not a valid option. %n\b
%s";
 
     public static void printCommandOptionMessage(final String message) {
         System.out.println(String.format(OPTION_COMMAND_MESSAGE_TEMPLATE, message));

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/cli/src/main/java/org/apache/syncope/client/cli/view/Table.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/view/Table.java b/client/cli/src/main/java/org/apache/syncope/client/cli/view/Table.java
index d563f98..e8159c6 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/view/Table.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/view/Table.java
@@ -25,7 +25,7 @@ import org.apache.commons.lang3.StringUtils;
 
 public final class Table {
 
-    private static final String TABLE_TITLE_FORMAT = "#  %s  #\n";
+    private static final String TABLE_TITLE_FORMAT = "#  %s  #%n";
 
     private final String title;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
index 2ea2ffd..ce00366 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
@@ -23,6 +23,7 @@ import de.agilecoders.wicket.core.settings.BootstrapSettings;
 import de.agilecoders.wicket.core.settings.IBootstrapSettings;
 import de.agilecoders.wicket.core.settings.SingleThemeProvider;
 import java.io.File;
+import java.io.InputStream;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -123,8 +124,8 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication
{
 
         // read console.properties
         Properties props = new Properties();
-        try {
-            props.load(getClass().getResourceAsStream("/" + CONSOLE_PROPERTIES));
+        try (InputStream is = getClass().getResourceAsStream("/" + CONSOLE_PROPERTIES)) {
+            props.load(is);
             File consoleDir = new File(props.getProperty("console.directory"));
             if (consoleDir.exists() && consoleDir.canRead() && consoleDir.isDirectory())
{
                 File consoleDirProps = FileUtils.getFile(consoleDir, CONSOLE_PROPERTIES);

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
b/client/console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
index b084d48..7984e3c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
@@ -23,8 +23,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
-import org.apache.commons.collections4.MapUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.math.NumberUtils;
 import org.apache.commons.lang3.time.FastDateFormat;
@@ -134,7 +132,6 @@ public abstract class Approval extends Panel {
 
                     case Enum:
                         MapChoiceRenderer<String, String> enumCR = new MapChoiceRenderer<>(prop.getEnumValues());
-                        final Map<String, String> map = MapUtils.invertMap(prop.getEnumValues());
 
                         field = new AjaxDropDownChoicePanel(
                                 "value", label, new PropertyModel<String>(prop, "value"),
false).

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/commons/ResourceStatusDataProvider.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/ResourceStatusDataProvider.java
b/client/console/src/main/java/org/apache/syncope/client/console/commons/ResourceStatusDataProvider.java
index 53b5181..d743971 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/ResourceStatusDataProvider.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/ResourceStatusDataProvider.java
@@ -119,7 +119,7 @@ public class ResourceStatusDataProvider extends DirectoryDataProvider<StatusBean
                 return statusUtils.getStatusBean(
                         input,
                         resource,
-                        connObjects == null ? null : connObjects.iterator().next().getConnObjectTO(),
+                        connObjects.isEmpty() ? null : connObjects.iterator().next().getConnObjectTO(),
                         input instanceof GroupTO);
             }
         }, new ArrayList<StatusBean>());

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
b/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
index 665870a..a1d3fe2 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
@@ -118,8 +118,8 @@ public class StatusUtils implements Serializable {
         final AttrTO status = attributeTOs.get(ConnIdSpecialAttributeName.ENABLE);
 
         return status != null && status.getValues() != null && !status.getValues().isEmpty()
-                ? Boolean.parseBoolean(status.getValues().get(0))
-                : null;
+                ? Boolean.valueOf(status.getValues().get(0))
+                : Boolean.FALSE;
     }
 
     private String getConnObjectLink(final ConnObjectTO objectTO) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/events/EventCategoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/events/EventCategoryPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/events/EventCategoryPanel.java
index 9277212..61a88ec 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/events/EventCategoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/events/EventCategoryPanel.java
@@ -435,7 +435,7 @@ public abstract class EventCategoryPanel extends Panel {
         }
     }
 
-    private class ChangeCategoryEvent {
+    private static class ChangeCategoryEvent {
 
         private final AjaxRequestTarget target;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmChoicePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmChoicePanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmChoicePanel.java
index fe25812..48a31cd 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmChoicePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmChoicePanel.java
@@ -226,7 +226,7 @@ public class RealmChoicePanel extends Panel {
     public RealmTO moveToParentRealm(final String key) {
         for (Pair<RealmTO, List<RealmTO>> subtree : tree.values()) {
             for (RealmTO child : subtree.getRight()) {
-                if (child.getKey() == key) {
+                if (child.getKey() != null && child.getKey().equals(key)) {
                     model.setObject(subtree.getLeft());
                     return subtree.getLeft();
                 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.java
index 70f4efa..b4ff842 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.java
@@ -114,7 +114,7 @@ public class DateTimeFieldPanel extends DateFieldPanel {
     /**
      * Custom form validator for registering and handling DateTimeField components that are
in it.
      */
-    private class DateTimeFormValidator extends AbstractFormValidator {
+    private static class DateTimeFormValidator extends AbstractFormValidator {
 
         private static final long serialVersionUID = 6842264694946633582L;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/widgets/AlertWidget.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/AlertWidget.java
b/client/console/src/main/java/org/apache/syncope/client/console/widgets/AlertWidget.java
index 5b9438c..668daf0 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/widgets/AlertWidget.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/widgets/AlertWidget.java
@@ -87,7 +87,7 @@ public abstract class AlertWidget<T extends Serializable> extends
Panel {
             @Override
             protected void onComponentTag(final ComponentTag tag) {
                 super.onComponentTag(tag);
-                if (Integer.valueOf(getDefaultModelObject().toString()) > 0) {
+                if (Integer.parseInt(getDefaultModelObject().toString()) > 0) {
                     tag.put("class", "label label-danger");
                 } else {
                     tag.put("class", "label label-info");

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
b/client/console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
index d8d8666..0822ad3 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
@@ -69,7 +69,7 @@ public class ApprovalsWidget extends AlertWidget<WorkflowFormTO> {
             if (wsEvent.getMessage() instanceof ApprovalsWidgetMessage) {
                 List<WorkflowFormTO> updatedApprovals = ((ApprovalsWidgetMessage) wsEvent.getMessage()).
                         getUpdatedApprovals();
-                if (!latestAlerts.equals(updatedApprovals)) {
+                if (!latestAlerts.getObject().equals(updatedApprovals)) {
                     latestAlerts.getObject().clear();
                     latestAlerts.getObject().addAll(updatedApprovals);
 
@@ -229,7 +229,12 @@ public class ApprovalsWidget extends AlertWidget<WorkflowFormTO>
{
 
     }
 
-    private static class WorkflowFormComparator implements Comparator<WorkflowFormTO>
{
+    private static class WorkflowFormComparator implements Comparator<WorkflowFormTO>,
Serializable {
+
+        /**
+         *
+         */
+        private static final long serialVersionUID = 4650217602780789075L;
 
         @Override
         public int compare(final WorkflowFormTO o1, final WorkflowFormTO o2) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/widgets/reconciliation/ReconciliationReport.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/reconciliation/ReconciliationReport.java
b/client/console/src/main/java/org/apache/syncope/client/console/widgets/reconciliation/ReconciliationReport.java
index b107426..a178863 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/widgets/reconciliation/ReconciliationReport.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/widgets/reconciliation/ReconciliationReport.java
@@ -36,7 +36,11 @@ public class ReconciliationReport extends AbstractBaseBean {
     private final List<Anys> anyObjects = new ArrayList<>();
 
     public ReconciliationReport(final Date run) {
-        this.run = run;
+        if (run != null) {
+            this.run = new Date(run.getTime());
+        } else {
+            this.run = null;
+        }
     }
 
     public Date getRun() {

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/widgets/reconciliation/ReconciliationReportParser.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/reconciliation/ReconciliationReportParser.java
b/client/console/src/main/java/org/apache/syncope/client/console/widgets/reconciliation/ReconciliationReportParser.java
index dc86a7b..b73b4ba 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/widgets/reconciliation/ReconciliationReportParser.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/widgets/reconciliation/ReconciliationReportParser.java
@@ -57,7 +57,7 @@ public final class ReconciliationReportParser {
                 switch (streamReader.getLocalName()) {
                     case "users":
                         Anys users = new Anys();
-                        users.setTotal(Integer.valueOf(streamReader.getAttributeValue("",
"total")));
+                        users.setTotal(Integer.parseInt(streamReader.getAttributeValue("",
"total")));
                         report.setUsers(users);
                         break;
 
@@ -71,7 +71,7 @@ public final class ReconciliationReportParser {
 
                     case "groups":
                         Anys groups = new Anys();
-                        groups.setTotal(Integer.valueOf(streamReader.getAttributeValue("",
"total")));
+                        groups.setTotal(Integer.parseInt(streamReader.getAttributeValue("",
"total")));
                         report.setGroups(groups);
                         break;
 
@@ -87,7 +87,7 @@ public final class ReconciliationReportParser {
                         lastAnyType = streamReader.getAttributeValue("", "type");
                         Anys anyObjects = new Anys();
                         anyObjects.setAnyType(lastAnyType);
-                        anyObjects.setTotal(Integer.valueOf(streamReader.getAttributeValue("",
"total")));
+                        anyObjects.setTotal(Integer.parseInt(streamReader.getAttributeValue("",
"total")));
                         report.getAnyObjects().add(anyObjects);
                         break;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardMgtButtonBar.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardMgtButtonBar.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardMgtButtonBar.java
index 152f204..2509fa3 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardMgtButtonBar.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardMgtButtonBar.java
@@ -43,7 +43,6 @@ public class AjaxWizardMgtButtonBar<T extends Serializable> extends
WizardButton
         super(id, wizard);
         this.mode = mode;
         wizard.setOutputMarkupId(true);
-        wizard.getWizardModel().isCancelVisible();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java
index 47a3dca..7d9687c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.console.wizards.any;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -224,7 +225,12 @@ public abstract class AbstractAttrs<S extends AbstractSchemaTO>
extends WizardSt
         return CollectionUtils.isNotEmpty(attrTOs.getObject()) || CollectionUtils.isNotEmpty(membershipTOs.getObject());
     }
 
-    protected static class AttrComparator implements Comparator<AttrTO> {
+    protected static class AttrComparator implements Comparator<AttrTO>, Serializable
{
+
+        /**
+         *
+         */
+        private static final long serialVersionUID = -5105030477767941060L;
 
         @Override
         public int compare(final AttrTO left, final AttrTO right) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
index 04f72dc..4c6ccf5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
@@ -58,9 +58,9 @@ public class GroupWizardBuilder extends AnyWizardBuilder<GroupTO>
implements Gro
      */
     @Override
     public AjaxWizardBuilder<AnyWrapper<GroupTO>> setItem(final AnyWrapper<GroupTO>
item) {
-        return (AjaxWizardBuilder<AnyWrapper<GroupTO>>) (item == null
-                ? super.setItem(item)
-                : super.setItem(new GroupWrapper(item.getInnerObject())));
+        return (AjaxWizardBuilder<AnyWrapper<GroupTO>>) (item != null
+                ? super.setItem(new GroupWrapper(item.getInnerObject()))
+                : super.setItem(null));
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
index 2fbde76..8466c56 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
@@ -141,7 +141,7 @@ public class ProvisionWizardBuilder extends AjaxWizardBuilder<ProvisionTO>
imple
     /**
      * AuxClasses definition step.
      */
-    private final class AuxClasses extends WizardStep {
+    private static final class AuxClasses extends WizardStep {
 
         private static final long serialVersionUID = 5315236191866427500L;
 
@@ -155,7 +155,7 @@ public class ProvisionWizardBuilder extends AjaxWizardBuilder<ProvisionTO>
imple
     /**
      * Mapping definition step.
      */
-    private final class Mapping extends WizardStep {
+    private static final class Mapping extends WizardStep {
 
         private static final long serialVersionUID = 3454904947720856253L;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/console/src/main/java/org/apache/syncope/client/console/wizards/role/RoleWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/role/RoleWizardBuilder.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/role/RoleWizardBuilder.java
index c71d1ca..744b9b7 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/role/RoleWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/role/RoleWizardBuilder.java
@@ -71,9 +71,9 @@ public class RoleWizardBuilder extends AjaxWizardBuilder<RoleWrapper>
{
      */
     @Override
     public AjaxWizardBuilder<RoleWrapper> setItem(final RoleWrapper item) {
-        return (AjaxWizardBuilder<RoleWrapper>) (item == null
-                ? super.setItem(item)
-                : super.setItem(new RoleWrapper(item.getInnerObject())));
+        return (AjaxWizardBuilder<RoleWrapper>) (item != null
+                ? super.setItem(new RoleWrapper(item.getInnerObject()))
+                : super.setItem(null));
     }
 
     @Override
@@ -119,7 +119,7 @@ public class RoleWizardBuilder extends AjaxWizardBuilder<RoleWrapper>
{
                             required(false).build(panelId);
                 }
             }), Model.of(StringUtils.isBlank(modelObject.getDynMembershipCond()) ? -1 : 0)).setOutputMarkupId(true));
-            // ------------------------ 
+            // ------------------------
         }
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/380386ee/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
index 8f88801..3094e3c 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
@@ -20,6 +20,7 @@ package org.apache.syncope.client.enduser;
 
 import org.apache.syncope.client.enduser.resources.UserSelfIsLogged;
 import java.io.File;
+import java.io.InputStream;
 import java.io.Serializable;
 import org.apache.syncope.client.enduser.pages.HomePage;
 import java.util.Properties;
@@ -90,8 +91,8 @@ public class SyncopeEnduserApplication extends WebApplication implements
Seriali
 
         // read enduser.properties
         Properties props = new Properties();
-        try {
-            props.load(getClass().getResourceAsStream("/" + ENDUSER_PROPERTIES));
+        try (InputStream is = getClass().getResourceAsStream("/" + ENDUSER_PROPERTIES)) {
+            props.load(is);
             File enduserDir = new File(props.getProperty("enduser.directory"));
             if (enduserDir.exists() && enduserDir.canRead() && enduserDir.isDirectory())
{
                 File enduserDirProps = FileUtils.getFile(enduserDir, ENDUSER_PROPERTIES);


Mime
View raw message