From c1483202a89463cadaed62a362d5fd4fe814f0f2 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Thu, 30 Aug 2012 15:38:33 +0300 Subject: Use empty string instead of null to denote "no fragment parameters" in Navigator (#9441) --- server/src/com/vaadin/navigator/Navigator.java | 4 ++-- server/src/com/vaadin/navigator/View.java | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'server/src') diff --git a/server/src/com/vaadin/navigator/Navigator.java b/server/src/com/vaadin/navigator/Navigator.java index 2e2cd5ec83..cef27c221d 100644 --- a/server/src/com/vaadin/navigator/Navigator.java +++ b/server/src/com/vaadin/navigator/Navigator.java @@ -435,7 +435,7 @@ public class Navigator implements Serializable { } } if (viewWithLongestName != null) { - String parameters = null; + String parameters = ""; if (viewAndParameters.length() > longestViewName.length() + 1) { parameters = viewAndParameters.substring(longestViewName .length() + 1); @@ -469,7 +469,7 @@ public class Navigator implements Serializable { if (null != viewName && getFragmentManager() != null) { String currentFragment = viewName; - if (fragmentParameters != null) { + if (!fragmentParameters.equals("")) { currentFragment += "/" + fragmentParameters; } if (!currentFragment.equals(getFragmentManager().getFragment())) { diff --git a/server/src/com/vaadin/navigator/View.java b/server/src/com/vaadin/navigator/View.java index 4db334a2dd..caee801f0c 100644 --- a/server/src/com/vaadin/navigator/View.java +++ b/server/src/com/vaadin/navigator/View.java @@ -38,11 +38,9 @@ public interface View extends Serializable { * is any additional id to data what should be shown in the view, it is also * optionally passed as parameter. * - * TODO fragmentParameters null if no parameters or empty string? - * * @param fragmentParameters - * parameters to the view or null if none given. This is the - * string that appears e.g. in URI after "viewname/" + * parameters to the view or empty string if none given. This is + * the string that appears e.g. in URI after "viewname/" */ public void navigateTo(String fragmentParameters); } \ No newline at end of file -- cgit v1.2.3