You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by me...@apache.org on 2017/01/21 16:21:08 UTC

[2/2] jspwiki git commit: * minor bugfix in SessionsPlugin (StringIndexOutOfBoundsException when using the distinctUsers option

       * minor bugfix in SessionsPlugin (StringIndexOutOfBoundsException when using the distinctUsers option


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

Branch: refs/heads/master
Commit: 97433effa7fb84bb0ba3fd6650f99df9a2c8ea25
Parents: a5d15c6
Author: Harry Metske <ha...@gmail.com>
Authored: Sat Jan 21 17:20:53 2017 +0100
Committer: Harry Metske <ha...@gmail.com>
Committed: Sat Jan 21 17:20:53 2017 +0100

----------------------------------------------------------------------
 ChangeLog                                                        | 1 +
 .../src/main/java/org/apache/wiki/plugin/SessionsPlugin.java     | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jspwiki/blob/97433eff/ChangeLog
----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index be8b713..ff9c968 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
        * 2.10.3-git-31.
 
        * Fixed JSPWIKI-1047 - Access Control Lists do not work if page cache is deactivated (thanks to E. Poth)
+       * minor bugfix in SessionsPlugin (StringIndexOutOfBoundsException when using the distinctUsers option
 
 2017-01-21  Dirk Frederickx (brushed AT apache DOT org)
 

http://git-wip-us.apache.org/repos/asf/jspwiki/blob/97433eff/jspwiki-war/src/main/java/org/apache/wiki/plugin/SessionsPlugin.java
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/java/org/apache/wiki/plugin/SessionsPlugin.java b/jspwiki-war/src/main/java/org/apache/wiki/plugin/SessionsPlugin.java
index dca31ca..e78d7e8 100644
--- a/jspwiki-war/src/main/java/org/apache/wiki/plugin/SessionsPlugin.java
+++ b/jspwiki-war/src/main/java/org/apache/wiki/plugin/SessionsPlugin.java
@@ -106,10 +106,10 @@ public class SessionsPlugin
             while (entries.hasNext())
             {
                 Map.Entry<String, Integer> entry = entries.next();
-                s.append( entry.getKey().toString() + "(" + entry.getValue().toString() + "), " );
+                s.append( entry.getKey() + "(" + entry.getValue().toString() + "), " );
             }
             // remove the last comma and blank :
-            return s.substring(0, s.length() - 2);
+            if (s.length() >= 2) return s.substring(0,    s.length() - 2);
         }
 
         return String.valueOf( WikiSession.sessions( engine ) );