From b6846e3655e748face5c18d52a92a5b3a406f006 Mon Sep 17 00:00:00 2001 From: Santiago Revilla Date: Fri, 22 Feb 2019 16:40:09 -0300 Subject: [PATCH] Minor changes and refactor --- .../qi-core/src/main/java/org/jpos/qi/QINavigator.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/qi-core/src/main/java/org/jpos/qi/QINavigator.java b/modules/qi-core/src/main/java/org/jpos/qi/QINavigator.java index b3af3af415..caa711fa04 100644 --- a/modules/qi-core/src/main/java/org/jpos/qi/QINavigator.java +++ b/modules/qi-core/src/main/java/org/jpos/qi/QINavigator.java @@ -70,11 +70,7 @@ private void initNavigator() { } perms.put(route, perm); e.getChildren("property").stream().filter(p -> "entityName".equals(p.getAttributeValue("name"))).forEach( - p -> { - if (routes.get(p.getAttributeValue("value")) == null ) { - routes.put(p.getAttributeValue("value"), route); - } - }); + p -> routes.putIfAbsent(p.getAttributeValue("value"), route)); } catch (ClassNotFoundException ex) { app.getLog().error(ex); } @@ -105,7 +101,7 @@ public void navigateTo(String navigationState) { } super.navigateTo(navigationState); if (app.sidebar() != null) { - app.sidebar().markAsSelected(navigationState.substring(1).split("/|,|\\?")[0]); + app.sidebar().markAsSelected(navigationState.substring(1).split("[/,?]")[0]); } } catch( IllegalArgumentException e) { QI.getQI().displayNotification(e.getMessage());