felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvalc...@apache.org
Subject svn commit: r1455592 - /felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/WebConsolePlugin.java
Date Tue, 12 Mar 2013 16:01:44 GMT
Author: vvalchev
Date: Tue Mar 12 16:01:43 2013
New Revision: 1455592

URL: http://svn.apache.org/r1455592
Log:
Fixed FELIX-3968 StringIndexOutOfBoundsException in packageadmin plugin
https://issues.apache.org/jira/browse/FELIX-3968

Modified:
    felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/WebConsolePlugin.java

Modified: felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/WebConsolePlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/WebConsolePlugin.java?rev=1455592&r1=1455591&r2=1455592&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/WebConsolePlugin.java
(original)
+++ felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/WebConsolePlugin.java
Tue Mar 12 16:01:43 2013
@@ -276,10 +276,15 @@ class WebConsolePlugin extends SimpleWeb
         SortedSet/*<String>*/result = new TreeSet/*<String>*/();
         while (tok.hasMoreTokens())
         {
-            final String part = tok.nextToken().trim();
+            String part = tok.nextToken().trim();
             if (part.length() > 0)
             {
                 int idx = part.lastIndexOf('.');
+                if (idx == part.length() - 1)
+                {
+                    part = part.substring(0, part.length() - 1);
+                    idx = part.lastIndexOf('.');
+                }
                 if (idx != -1)
                 {
                     char firstCharAfterLastDot = part.charAt(idx + 1);
@@ -291,6 +296,10 @@ class WebConsolePlugin extends SimpleWeb
                     {
                         result.add(part);
                     }
+                } 
+                else
+                {
+                    result.add(part);
                 }
             }
         }



Mime
View raw message