You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by sk...@apache.org on 2017/11/10 16:19:18 UTC

syncope git commit: [SYNCOPE-1233] Fixed NullPointerException in Topology when having a connector with no displayName

Repository: syncope
Updated Branches:
  refs/heads/2_0_X 5078b5f09 -> 8ddd68b53


[SYNCOPE-1233] Fixed NullPointerException in Topology when having a connector with no displayName


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

Branch: refs/heads/2_0_X
Commit: 8ddd68b53b73e1d1248318f6f504d03987909769
Parents: 5078b5f
Author: skylark17 <ma...@tirasa.net>
Authored: Fri Nov 10 17:18:44 2017 +0100
Committer: skylark17 <ma...@tirasa.net>
Committed: Fri Nov 10 17:18:44 2017 +0100

----------------------------------------------------------------------
 .../org/apache/syncope/client/console/topology/Topology.java  | 5 ++++-
 .../syncope/client/console/topology/TopologyNodePanel.java    | 7 ++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/8ddd68b5/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java b/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
index 071da87..e7709d1 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
@@ -318,7 +318,10 @@ public class Topology extends BasePage {
                         final ConnInstanceTO conn = item.getModelObject();
 
                         final TopologyNode topologynode = new TopologyNode(
-                                conn.getKey(), conn.getDisplayName(), TopologyNode.Kind.CONNECTOR);
+                                conn.getKey(),
+                                StringUtils.isBlank(conn.getDisplayName()) // [SYNCOPE-1233]
+                                ? conn.getBundleName() : conn.getDisplayName(),
+                                TopologyNode.Kind.CONNECTOR);
 
                         // Define the parent note
                         final TopologyNode parent = servers.get(conn.getLocation());

http://git-wip-us.apache.org/repos/asf/syncope/blob/8ddd68b5/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java
index 2d81c3d..92842d1 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java
@@ -23,6 +23,7 @@ import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.client.console.rest.ConnectorRestClient;
 import org.apache.syncope.client.console.topology.TopologyNode.Kind;
 import org.apache.syncope.client.console.topology.TopologyTogglePanel.UpdateEvent;
+import org.apache.syncope.common.lib.to.ConnInstanceTO;
 import org.apache.wicket.AttributeModifier;
 import org.apache.wicket.Component;
 import org.apache.wicket.MarkupContainer;
@@ -120,7 +121,11 @@ public class TopologyNodePanel extends Panel implements IAjaxIndicatorAware {
             final AjaxRequestTarget target = updateEvent.getTarget();
 
             if (node.getKind() == Kind.CONNECTOR && key.equalsIgnoreCase(node.getKey())) {
-                String displayName = new ConnectorRestClient().read(key).getDisplayName();
+                ConnInstanceTO conn = new ConnectorRestClient().read(key);
+
+                String displayName =
+                        // [SYNCOPE-1233]
+                        StringUtils.isBlank(conn.getDisplayName()) ? conn.getBundleName() : conn.getDisplayName();
 
                 final String resourceName = displayName.length() > 14
                         ? displayName.subSequence(0, 10) + "..."