felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r898728 - /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
Date Wed, 13 Jan 2010 12:17:03 GMT
Author: fmeschbe
Date: Wed Jan 13 12:17:02 2010
New Revision: 898728

URL: http://svn.apache.org/viewvc?rev=898728&view=rev
Log:
FELIX-1957 apply slightly modified patch by Valentin Valchev (thanks)

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java?rev=898728&r1=898727&r2=898728&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
Wed Jan 13 12:17:02 2010
@@ -989,13 +989,30 @@
             String value = String.valueOf(headers.get( header ));
             // Package headers may be long, support line breaking by
             // ensuring blanks after comma and semicolon.
-            value = value.replaceAll( "([;,])", "$1 " );
+            value = enableLineWrapping(value);
             val.put( header + ": " + value );
         }
 
         keyVal( jw, "Manifest Headers", val );
     }
 
+    private static final String enableLineWrapping(final String value)
+    {
+        StringBuffer sb = new StringBuffer(value.length() * 2 / 3);
+        synchronized (sb)
+        { // faster
+            for (int i = 0; i < value.length(); i++)
+            {
+                final char ch = value.charAt( i );
+                sb.append( ch );
+                if ( ch == ';' || ch == ',' )
+                {
+                    sb.append( ' ' );
+                }
+            }
+            return sb.toString();
+        }
+    }
 
     private void listFragmentInfo( final JSONWriter jw, final Bundle bundle, final String
pluginRoot )
         throws JSONException



Mime
View raw message