chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1676694 [1/2] - in /chemistry/opencmis/trunk: chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ chemistry-opencmis-android/chemistry-opencmis-android-clien...
Date Wed, 29 Apr 2015 09:02:54 GMT
Author: fmui
Date: Wed Apr 29 09:02:50 2015
New Revision: 1676694

URL: http://svn.apache.org/r1676694
Log:
more code clean up and optimization

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkCache.java
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/SessionParameterMap.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/CacheImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/ContentTypeCacheLevelImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkCache.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/Response.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractWebServicesService.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/OperationContextImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PropertyImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/QueryStatementImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/DateTimeHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/IOUtils.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/StringListBuilder.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/UrlBuilder.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/WSConverter.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/CmisExtensionElementImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONArray.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONObject.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONValue.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/JSONParseException.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/Yylex.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/Yytoken.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/IOUtilsTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserCallContextImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultipartParser.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/token/AbstractSimpleTokenHandler.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/token/SimpleTokenHandlerSessionHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareCmisServiceFactory.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepositoryManager.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareTypeManager.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareUserManager.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/StringUtil.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/wrapper/CmisServiceWrapperManager.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/CoreHtmlReport.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ConnectionErrorDialog.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ExpertLoginTab.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/InfoDialog.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/PropertyEditorFrame.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ProxyDetector.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/QueryFrame.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/RepositoryInfoFrame.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TckDialog.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TypeSplitPane.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TypesFrame.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/DeleteTreePanel.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientSession.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CollectionRenderer.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/IdRenderer.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkCache.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkCache.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkCache.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkCache.java Wed Apr 29 09:02:50 2015
@@ -267,8 +267,8 @@ public class LinkCache implements Serial
             return null;
         }
 
-        StringBuilder result = new StringBuilder();
-        StringBuilder param = new StringBuilder();
+        StringBuilder result = new StringBuilder(128);
+        StringBuilder param = new StringBuilder(32);
 
         boolean paramMode = false;
         for (int i = 0; i < template.length(); i++) {
@@ -283,7 +283,7 @@ public class LinkCache implements Serial
                         result.append(IOUtils.encodeURL(paramValue));
                     }
 
-                    param = new StringBuilder();
+                    param = new StringBuilder(32);
                 } else {
                     param.append(c);
                 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java Wed Apr 29 09:02:50 2015
@@ -268,7 +268,7 @@ public final class XMLUtils {
         assert parser != null;
         assert maxLength >= 0;
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
 
         next(parser);
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java Wed Apr 29 09:02:50 2015
@@ -102,7 +102,7 @@ public abstract class XMLWalker<T> {
             throws XmlPullParserException {
         final QName name = new QName(parser.getNamespace(), parser.getName());
         Map<String, String> attributes = null;
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
         List<CmisExtensionElement> children = null;
 
         if (parser.getAttributeCount() > 0) {
@@ -188,7 +188,7 @@ public abstract class XMLWalker<T> {
 
     protected BigInteger readInteger(final XmlPullParser parser) throws XmlPullParserException {
         String value = readText(parser);
-        
+
         try {
             return new BigInteger(value);
         } catch (NumberFormatException e) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/SessionParameterMap.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/SessionParameterMap.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/SessionParameterMap.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/SessionParameterMap.java Wed Apr 29 09:02:50 2015
@@ -836,7 +836,7 @@ public class SessionParameterMap extends
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
 
         for (Map.Entry<String, String> entry : entrySet()) {
             sb.append(entry.getKey());

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/CacheImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/CacheImpl.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/CacheImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/CacheImpl.java Wed Apr 29 09:02:50 2015
@@ -321,7 +321,7 @@ public class CacheImpl implements Cache
     private static String getFormattedKeys(String[] keys) {
         assert keys != null;
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(32);
         for (String k : keys) {
             if (sb.length() > 0) {
                 sb.append(", ");

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/ContentTypeCacheLevelImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/ContentTypeCacheLevelImpl.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/ContentTypeCacheLevelImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/ContentTypeCacheLevelImpl.java Wed Apr 29 09:02:50 2015
@@ -61,7 +61,7 @@ public class ContentTypeCacheLevelImpl e
             return null;
         }
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(32);
         int parameterStart = 0;
 
         // first, get the MIME type

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkCache.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkCache.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkCache.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkCache.java Wed Apr 29 09:02:50 2015
@@ -265,8 +265,8 @@ public class LinkCache implements Serial
             return null;
         }
 
-        StringBuilder result = new StringBuilder();
-        StringBuilder param = new StringBuilder();
+        StringBuilder result = new StringBuilder(128);
+        StringBuilder param = new StringBuilder(32);
 
         boolean paramMode = false;
         for (int i = 0; i < template.length(); i++) {
@@ -281,7 +281,7 @@ public class LinkCache implements Serial
                         result.append(IOUtils.encodeURL(paramValue));
                     }
 
-                    param = new StringBuilder();
+                    param = new StringBuilder(32);
                 } else {
                     param.append(c);
                 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.java Wed Apr 29 09:02:50 2015
@@ -127,7 +127,7 @@ public class CmisCookieManager implement
             return Collections.emptyMap();
         }
 
-        StringBuilder cookieHeaderStr = new StringBuilder();
+        StringBuilder cookieHeaderStr = new StringBuilder(128);
 
         for (CmisHttpCookie cookie : cookies) {
             if (cookieHeaderStr.length() > 0) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java Wed Apr 29 09:02:50 2015
@@ -772,7 +772,7 @@ public final class CmisHttpCookie implem
      */
     @Override
     public String toString() {
-        StringBuilder cookieStr = new StringBuilder();
+        StringBuilder cookieStr = new StringBuilder(128);
         cookieStr.append(name);
         cookieStr.append('=');
         if (version == 0) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/Response.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/Response.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/Response.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/Response.java Wed Apr 29 09:02:50 2015
@@ -90,7 +90,7 @@ public class Response {
                         || contentTypeLower.startsWith("application/xml")
                         || contentTypeLower.startsWith("application/json")) {
                     errorStream = new BufferedInputStream(errorStream, 64 * 1024);
-                    StringBuilder sb = new StringBuilder();
+                    StringBuilder sb = new StringBuilder(4096);
 
                     try {
                         String encoding = getContentEncoding();

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractWebServicesService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractWebServicesService.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractWebServicesService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractWebServicesService.java Wed Apr 29 09:02:50 2015
@@ -84,7 +84,7 @@ public abstract class AbstractWebService
 
         String errorContent = null;
         if (!ex.getFaultInfo().getAny().isEmpty()) {
-            StringBuilder sb = new StringBuilder();
+            StringBuilder sb = new StringBuilder(1024);
             for (Object o : ex.getFaultInfo().getAny()) {
                 if (o != null) {
                     if (o instanceof Node) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/OperationContextImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/OperationContextImpl.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/OperationContextImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/OperationContextImpl.java Wed Apr 29 09:02:50 2015
@@ -185,7 +185,7 @@ public class OperationContextImpl implem
             filter.add(PropertyIds.SECONDARY_OBJECT_TYPE_IDS);
         }
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
 
         for (String oid : filter) {
             if (sb.length() > 0) {
@@ -301,7 +301,7 @@ public class OperationContextImpl implem
             return null;
         }
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
 
         for (String rf : renditionFilter) {
             if (sb.length() > 0) {
@@ -351,7 +351,7 @@ public class OperationContextImpl implem
             cacheKey = null;
         }
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
 
         sb.append(includeAcls ? '1' : '0');
         sb.append(includeAllowableActions ? '1' : '0');

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PropertyImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PropertyImpl.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PropertyImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PropertyImpl.java Wed Apr 29 09:02:50 2015
@@ -102,7 +102,7 @@ public class PropertyImpl<T> extends Abs
     public String getValuesAsString() {
         List<T> values = getValues();
 
-        StringBuilder result = new StringBuilder();
+        StringBuilder result = new StringBuilder(128);
         for (T value : values) {
             if (result.length() > 0) {
                 result.append(", ");

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/QueryStatementImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/QueryStatementImpl.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/QueryStatementImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/QueryStatementImpl.java Wed Apr 29 09:02:50 2015
@@ -17,7 +17,8 @@
  */
 package org.apache.chemistry.opencmis.client.runtime;
 
-import static org.apache.chemistry.opencmis.commons.impl.CollectionsHelper.*;
+import static org.apache.chemistry.opencmis.commons.impl.CollectionsHelper.isNotEmpty;
+import static org.apache.chemistry.opencmis.commons.impl.CollectionsHelper.isNullOrEmpty;
 
 import java.net.URI;
 import java.net.URL;
@@ -104,7 +105,7 @@ public class QueryStatementImpl implemen
 
         this.session = session;
 
-        StringBuilder stmt = new StringBuilder();
+        StringBuilder stmt = new StringBuilder(1024);
 
         // find the primary type and check if all types are queryable
         ObjectType primaryType = null;
@@ -454,7 +455,7 @@ public class QueryStatementImpl implemen
             throw new IllegalArgumentException("Calendar must be set!");
         }
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(64);
         for (Calendar c : cal) {
             if (c == null) {
                 throw new IllegalArgumentException("DateTime is null!");
@@ -524,7 +525,7 @@ public class QueryStatementImpl implemen
         boolean inStr = false;
         int parameterIndex = 0;
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(1024);
         for (int i = 0; i < statement.length(); i++) {
             char c = statement.charAt(i);
 
@@ -575,7 +576,10 @@ public class QueryStatementImpl implemen
     // --- internal ---
 
     private static String escape(String str) {
-        StringBuilder sb = new StringBuilder("'");
+        StringBuilder sb = new StringBuilder(str.length() + 16);
+
+        sb.append('\'');
+
         for (int i = 0; i < str.length(); i++) {
             char c = str.charAt(i);
 
@@ -592,7 +596,10 @@ public class QueryStatementImpl implemen
     }
 
     private static String escapeLike(String str) {
-        StringBuilder sb = new StringBuilder("'");
+        StringBuilder sb = new StringBuilder(str.length() + 16);
+
+        sb.append('\'');
+
         for (int i = 0; i < str.length(); i++) {
             char c = str.charAt(i);
 
@@ -615,7 +622,10 @@ public class QueryStatementImpl implemen
     }
 
     private static String escapeContains(String str) {
-        StringBuilder sb = new StringBuilder("'");
+        StringBuilder sb = new StringBuilder(str.length() + 16);
+
+        sb.append('\'');
+
         for (int i = 0; i < str.length(); i++) {
             char c = str.charAt(i);
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java Wed Apr 29 09:02:50 2015
@@ -582,7 +582,7 @@ public class SessionImpl implements Sess
             throw new IllegalArgumentException("Name must be set!");
         }
 
-        StringBuilder path = new StringBuilder();
+        StringBuilder path = new StringBuilder(parentPath.length() + name.length() + 2);
         path.append(parentPath);
         if (!parentPath.endsWith("/")) {
             path.append('/');
@@ -968,7 +968,9 @@ public class SessionImpl implements Sess
         final DiscoveryService discoveryService = getBinding().getDiscoveryService();
         final ObjectFactory of = getObjectFactory();
         final OperationContext ctxt = new OperationContextImpl(context);
-        final StringBuilder statement = new StringBuilder("SELECT ");
+        final StringBuilder statement = new StringBuilder(1024);
+
+        statement.append("SELECT ");
 
         String select = ctxt.getFilterString();
         if (select == null) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/DateTimeHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/DateTimeHelper.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/DateTimeHelper.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/DateTimeHelper.java Wed Apr 29 09:02:50 2015
@@ -124,7 +124,7 @@ public final class DateTimeHelper {
             throw new IllegalArgumentException();
         }
 
-        final StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder(32);
         add4d(sb, cal.get(Calendar.YEAR));
         sb.append('-');
         add2d(sb, cal.get(Calendar.MONTH) + 1);
@@ -250,7 +250,7 @@ public final class DateTimeHelper {
         final GregorianCalendar cal = new GregorianCalendar(GMT);
         cal.setTimeInMillis(millis);
 
-        final StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder(64);
         sb.append(WDAYS[cal.get(Calendar.DAY_OF_WEEK) - 1]);
         sb.append(", ");
         add2d(sb, cal.get(Calendar.DAY_OF_MONTH));

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/IOUtils.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/IOUtils.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/IOUtils.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/IOUtils.java Wed Apr 29 09:02:50 2015
@@ -318,18 +318,27 @@ public final class IOUtils {
      *            the stream
      * @param handler
      *            a handler the processes each line.
+     * @param maxLines
+     *            maximum number of lines or -1 for unlimited number of lines
      */
-    public static void readLinesFromStream(InputStream stream, LineHandler handler) throws IOException {
+    public static void readLinesFromStream(InputStream stream, LineHandler handler, int maxLines) throws IOException {
         if (stream == null) {
             return;
         }
 
+        int counter = 0;
+
         BufferedReader reader = null;
         try {
             reader = new BufferedReader(new InputStreamReader(stream, UTF8));
 
             String line;
             while ((line = reader.readLine()) != null) {
+                if (maxLines > -1 && counter == maxLines) {
+                    break;
+                }
+                counter++;
+
                 if (!handler.handle(line)) {
                     break;
                 }
@@ -346,14 +355,14 @@ public final class IOUtils {
      *            the input stream
      */
     public static String readFirstLine(InputStream stream) throws IOException {
-        final StringBuilder result = new StringBuilder();
+        final StringBuilder result = new StringBuilder(128);
 
         readLinesFromStream(stream, new LineHandler() {
             public boolean handle(String line) {
                 result.append(line);
                 return false;
             }
-        });
+        }, 1);
 
         return result.toString();
     }
@@ -365,7 +374,11 @@ public final class IOUtils {
      *            the input stream
      */
     public static String readAllLines(InputStream stream) throws IOException {
-        final StringBuilder result = new StringBuilder();
+        return readAllLines(stream, Integer.MAX_VALUE);
+    }
+
+    public static String readAllLines(InputStream stream, int maxLines) throws IOException {
+        final StringBuilder result = new StringBuilder(1024);
 
         readLinesFromStream(stream, new LineHandler() {
             public boolean handle(String line) {
@@ -373,7 +386,7 @@ public final class IOUtils {
                 result.append('\n');
                 return true;
             }
-        });
+        }, maxLines);
 
         return result.toString();
     }
@@ -385,7 +398,11 @@ public final class IOUtils {
      *            the input stream
      */
     public static String readAllLinesAndRemoveHeader(InputStream stream) throws IOException {
-        final StringBuilder result = new StringBuilder();
+        return readAllLinesAndRemoveHeader(stream, Integer.MAX_VALUE);
+    }
+
+    public static String readAllLinesAndRemoveHeader(InputStream stream, int maxLines) throws IOException {
+        final StringBuilder result = new StringBuilder(1024);
 
         readLinesFromStream(stream, new SkipHeaderLineHandler() {
             public boolean handle(String line) {
@@ -395,7 +412,7 @@ public final class IOUtils {
                 }
                 return true;
             }
-        });
+        }, maxLines);
 
         return result.toString();
     }
@@ -408,7 +425,11 @@ public final class IOUtils {
      *            the input stream
      */
     public static String readAllLinesAndIgnoreComments(InputStream stream) throws IOException {
-        final StringBuilder result = new StringBuilder();
+        return readAllLinesAndIgnoreComments(stream, Integer.MAX_VALUE);
+    }
+
+    public static String readAllLinesAndIgnoreComments(InputStream stream, int maxLines) throws IOException {
+        final StringBuilder result = new StringBuilder(1024);
 
         readLinesFromStream(stream, new IgnoreCommentsLineHandler() {
             public boolean handle(String line) {
@@ -418,7 +439,7 @@ public final class IOUtils {
                 }
                 return true;
             }
-        });
+        }, maxLines);
 
         return result.toString();
     }
@@ -431,6 +452,10 @@ public final class IOUtils {
      *            the input stream
      */
     public static List<String> readAllLinesAsList(InputStream stream) throws IOException {
+        return readAllLinesAsList(stream, Integer.MAX_VALUE);
+    }
+
+    public static List<String> readAllLinesAsList(InputStream stream, int maxLines) throws IOException {
         final List<String> result = new ArrayList<String>();
 
         readLinesFromStream(stream, new IgnoreCommentsLineHandler() {
@@ -440,7 +465,7 @@ public final class IOUtils {
                 }
                 return true;
             }
-        });
+        }, maxLines);
 
         return result;
     }
@@ -453,6 +478,10 @@ public final class IOUtils {
      *            the input stream
      */
     public static Map<String, String> readAllLinesAsMap(InputStream stream) throws IOException {
+        return readAllLinesAsMap(stream, Integer.MAX_VALUE);
+    }
+
+    public static Map<String, String> readAllLinesAsMap(InputStream stream, int maxLines) throws IOException {
         final Map<String, String> result = new HashMap<String, String>();
 
         readLinesFromStream(stream, new IgnoreCommentsLineHandler() {
@@ -467,7 +496,7 @@ public final class IOUtils {
                 }
                 return true;
             }
-        });
+        }, maxLines);
 
         return result;
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeHelper.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeHelper.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeHelper.java Wed Apr 29 09:02:50 2015
@@ -121,7 +121,7 @@ public final class MimeHelper {
      * @return the encoded string
      */
     protected static String encodeRFC2231(String key, String value) {
-        StringBuilder buf = new StringBuilder();
+        StringBuilder buf = new StringBuilder(32);
         boolean encoded = encodeRFC2231value(value, buf);
         if (encoded) {
             return "; " + key + "*=" + buf.toString();
@@ -260,7 +260,7 @@ public final class MimeHelper {
         boolean inName = true;
         String challenge = null;
         String paramName = "";
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(64);
         for (int i = 0; i < trimValue.length(); i++) {
             char c = trimValue.charAt(i);
 
@@ -288,7 +288,7 @@ public final class MimeHelper {
                     }
                     authMap.put(paramName, sb.toString());
                 }
-                sb = new StringBuilder();
+                sb = new StringBuilder(32);
                 inQuotes = !inQuotes;
             } else if (c == '=') {
                 if (inName) {
@@ -301,7 +301,7 @@ public final class MimeHelper {
                         paramName = paramName.substring(spcIdx).trim();
                     }
 
-                    sb = new StringBuilder();
+                    sb = new StringBuilder(32);
                     inName = false;
                 } else if (!inQuotes) {
                     return null;
@@ -310,7 +310,7 @@ public final class MimeHelper {
                 if (inName) {
                     challenge = sb.toString().trim().toLowerCase(Locale.ENGLISH);
                     result.put(challenge, new HashMap<String, String>());
-                    sb = new StringBuilder();
+                    sb = new StringBuilder(32);
                 } else {
                     if (inQuotes) {
                         sb.append(c);
@@ -322,7 +322,7 @@ public final class MimeHelper {
                         if (!authMap.containsKey(paramName)) {
                             authMap.put(paramName, sb.toString().trim());
                         }
-                        sb = new StringBuilder();
+                        sb = new StringBuilder(32);
                         inName = true;
                     }
                 }
@@ -542,7 +542,7 @@ public final class MimeHelper {
          * @return The processed string value.
          */
         private String getEscapedValue(int start, int end) throws ParseException {
-            StringBuilder value = new StringBuilder();
+            StringBuilder value = new StringBuilder(32);
             for (int i = start; i < end; i++) {
                 char ch = header.charAt(i);
                 // is this an escape character?

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/StringListBuilder.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/StringListBuilder.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/StringListBuilder.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/StringListBuilder.java Wed Apr 29 09:02:50 2015
@@ -25,7 +25,7 @@ public class StringListBuilder {
     private boolean first;
 
     public StringListBuilder() {
-        this(",", new StringBuilder());
+        this(",", new StringBuilder(128));
     }
 
     public StringListBuilder(StringBuilder stringBuilder) {
@@ -33,7 +33,7 @@ public class StringListBuilder {
     }
 
     public StringListBuilder(String seperator) {
-        this(seperator, new StringBuilder());
+        this(seperator, new StringBuilder(128));
     }
 
     public StringListBuilder(String seperator, StringBuilder stringBuilder) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/UrlBuilder.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/UrlBuilder.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/UrlBuilder.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/UrlBuilder.java Wed Apr 29 09:02:50 2015
@@ -45,8 +45,8 @@ public class UrlBuilder {
             throw new IllegalArgumentException("URL must be set");
         }
 
-        urlPart = new StringBuilder();
-        queryPart = new StringBuilder();
+        urlPart = new StringBuilder(128);
+        queryPart = new StringBuilder(128);
 
         int qm = url.indexOf('?');
         if (qm == -1) {
@@ -80,8 +80,8 @@ public class UrlBuilder {
             port = -1;
         }
 
-        urlPart = new StringBuilder();
-        queryPart = new StringBuilder();
+        urlPart = new StringBuilder(128);
+        queryPart = new StringBuilder(128);
 
         urlPart.append(scheme);
         urlPart.append("://");

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/WSConverter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/WSConverter.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/WSConverter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/WSConverter.java Wed Apr 29 09:02:50 2015
@@ -531,8 +531,10 @@ public final class WSConverter {
         if (repositoryInfo.getChangesOnType() != null) {
             for (BaseTypeId baseType : repositoryInfo.getChangesOnType()) {
                 if (cmisVersion == CmisVersion.CMIS_1_0 && baseType == BaseTypeId.CMIS_ITEM) {
-                    LOG.warn("Receiver only understands CMIS 1.0 but the Changes On Type list in the Repository info contains the base type Item. "
-                            + "The Item base type has been removed from the list.");
+                    if (LOG.isWarnEnabled()) {
+                        LOG.warn("Receiver only understands CMIS 1.0 but the Changes On Type list in the Repository info contains the base type Item. "
+                                + "The Item base type has been removed from the list.");
+                    }
                     continue;
                 }
                 result.getChangesOnType().add(convert(EnumBaseObjectTypeIds.class, baseType));
@@ -2087,8 +2089,10 @@ public final class WSConverter {
             result.setCanCreateFolder(set.contains(Action.CAN_CREATE_FOLDER));
             result.setCanCreateRelationship(set.contains(Action.CAN_CREATE_RELATIONSHIP));
             if (set.contains(Action.CAN_CREATE_ITEM) && cmisVersion == CmisVersion.CMIS_1_0) {
-                LOG.warn("Receiver only understands CMIS 1.0 but the Allowable Actions contain the canCreateItem action. "
-                        + "The canCreateItem action has been removed from the Allowable Actions.");
+                if (LOG.isWarnEnabled()) {
+                    LOG.warn("Receiver only understands CMIS 1.0 but the Allowable Actions contain the canCreateItem action. "
+                            + "The canCreateItem action has been removed from the Allowable Actions.");
+                }
             } else {
                 result.setCanCreateItem(set.contains(Action.CAN_CREATE_ITEM));
             }
@@ -3032,7 +3036,7 @@ public final class WSConverter {
 
         CmisExtensionElement result = null;
         List<CmisExtensionElement> cmisChildren = new ArrayList<CmisExtensionElement>();
-        StringBuilder value = new StringBuilder();
+        StringBuilder value = new StringBuilder(128);
 
         NodeList children = node.getChildNodes();
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java Wed Apr 29 09:02:50 2015
@@ -332,7 +332,7 @@ public final class XMLUtils {
         assert parser != null;
         assert maxLength >= 0;
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
 
         next(parser);
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java Wed Apr 29 09:02:50 2015
@@ -116,7 +116,7 @@ public abstract class XMLWalker<T> {
 
         final QName name = parser.getName();
         Map<String, String> attributes = null;
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
         List<CmisExtensionElement> children = null;
 
         if (parser.getAttributeCount() > 0) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/CmisExtensionElementImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/CmisExtensionElementImpl.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/CmisExtensionElementImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/CmisExtensionElementImpl.java Wed Apr 29 09:02:50 2015
@@ -120,7 +120,7 @@ public class CmisExtensionElementImpl im
     }
 
     public String toTreeString(int level) {
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(512);
         nextTreelevel(sb, level);
         return sb.toString();
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONArray.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONArray.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONArray.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONArray.java Wed Apr 29 09:02:50 2015
@@ -90,7 +90,7 @@ public class JSONArray extends ArrayList
         }
 
         boolean first = true;
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(1024);
 
         sb.append('[');
         for (Object value : list) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONObject.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONObject.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONObject.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONObject.java Wed Apr 29 09:02:50 2015
@@ -103,7 +103,7 @@ public class JSONObject extends LinkedHa
             return "null";
         }
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(1024);
         boolean first = true;
 
         sb.append('{');
@@ -145,7 +145,7 @@ public class JSONObject extends LinkedHa
     }
 
     public static String toString(String key, Object value) {
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(1024);
         toJSONString(key, value, sb);
         return sb.toString();
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONValue.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONValue.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONValue.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONValue.java Wed Apr 29 09:02:50 2015
@@ -259,7 +259,7 @@ public final class JSONValue {
             return null;
         }
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(s.length() + 16);
         escape(s, sb);
         return sb.toString();
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/JSONParseException.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/JSONParseException.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/JSONParseException.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/JSONParseException.java Wed Apr 29 09:02:50 2015
@@ -90,7 +90,7 @@ public class JSONParseException extends
     }
 
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
 
         switch (errorType) {
         case ERROR_UNEXPECTED_CHAR:

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/Yylex.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/Yylex.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/Yylex.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/Yylex.java Wed Apr 29 09:02:50 2015
@@ -217,7 +217,7 @@ class Yylex {
     private boolean zzAtEOF;
 
     /* user code: */
-    private StringBuilder sb = new StringBuilder();
+    private StringBuilder sb = new StringBuilder(128);
 
     int getPosition() {
         return yychar;

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/Yytoken.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/Yytoken.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/Yytoken.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/Yytoken.java Wed Apr 29 09:02:50 2015
@@ -44,7 +44,7 @@ public class Yytoken {
     }
 
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(64);
         switch (type) {
         case TYPE_VALUE:
             sb.append("VALUE(").append(value).append(')');

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/IOUtilsTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/IOUtilsTest.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/IOUtilsTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/IOUtilsTest.java Wed Apr 29 09:02:50 2015
@@ -142,6 +142,26 @@ public class IOUtilsTest {
     }
 
     @Test
+    public void testAllLinesWithMaxLines() throws IOException {
+        String content = "line 1\nline 2\nline 3";
+
+        InputStream stream1 = createStream(content);
+        assertEquals("", IOUtils.readAllLines(stream1, 0));
+
+        InputStream stream2 = createStream(content);
+        assertEquals("line 1\n", IOUtils.readAllLines(stream2, 1));
+
+        InputStream stream3 = createStream(content);
+        assertEquals("line 1\nline 2\n", IOUtils.readAllLines(stream3, 2));
+
+        InputStream stream4 = createStream(content);
+        assertEquals("line 1\nline 2\nline 3\n", IOUtils.readAllLines(stream4, 3));
+
+        InputStream stream5 = createStream(content);
+        assertEquals("line 1\nline 2\nline 3\n", IOUtils.readAllLines(stream5, 4));
+    }
+
+    @Test
     public void testAllLinesAndSkipHeader1() throws IOException {
         String content = "#header\n\nline 1\nline 2";
         InputStream stream = createStream(content);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserCallContextImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserCallContextImpl.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserCallContextImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserCallContextImpl.java Wed Apr 29 09:02:50 2015
@@ -147,7 +147,7 @@ public class BrowserCallContextImpl exte
             return "/";
         }
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
         for (int i = 2; i < pathFragments.length; i++) {
             if (pathFragments[i].length() == 0) {
                 continue;

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultipartParser.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultipartParser.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultipartParser.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultipartParser.java Wed Apr 29 09:02:50 2015
@@ -265,7 +265,7 @@ public class MultipartParser {
     }
 
     private String readLine() throws IOException {
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
 
         int r;
         while ((r = nextByte()) > -1) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/token/AbstractSimpleTokenHandler.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/token/AbstractSimpleTokenHandler.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/token/AbstractSimpleTokenHandler.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/token/AbstractSimpleTokenHandler.java Wed Apr 29 09:02:50 2015
@@ -356,7 +356,7 @@ public abstract class AbstractSimpleToke
             return null;
         }
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(s.length() + 16);
 
         for (int i = 0; i < s.length(); i++) {
             char c = s.charAt(i);
@@ -375,7 +375,7 @@ public abstract class AbstractSimpleToke
             return null;
         }
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(s.length() + 64);
 
         for (int i = 0; i < s.length(); i++) {
             char c = s.charAt(i);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/token/SimpleTokenHandlerSessionHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/token/SimpleTokenHandlerSessionHelper.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/token/SimpleTokenHandlerSessionHelper.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/token/SimpleTokenHandlerSessionHelper.java Wed Apr 29 09:02:50 2015
@@ -292,7 +292,7 @@ public class SimpleTokenHandlerSessionHe
         byte[] bytes = new byte[APP_ID_BYTES];
         random.nextBytes(bytes);
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(APP_ID_BYTES * 2);
 
         for (byte b : bytes) {
             String s = Integer.toHexString(b & 0xff);
@@ -311,7 +311,7 @@ public class SimpleTokenHandlerSessionHe
         byte[] bytes = new byte[KEY_BYTES];
         random.nextBytes(bytes);
 
-        StringBuilder sb = new StringBuilder(appId);
+        StringBuilder sb = new StringBuilder(appId + KEY_BYTES * 2);
 
         for (byte b : bytes) {
             String s = Integer.toHexString(b & 0xff);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java Wed Apr 29 09:02:50 2015
@@ -108,7 +108,7 @@ public class CmisWebServicesServlet exte
         }
 
         try {
-            return IOUtils.readAllLines(stream);
+            return IOUtils.readAllLines(stream, 100000);
         } catch (IOException e) {
             throw new ServletException("Cannot read file '" + path + "': " + e.getMessage(), e);
         } finally {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareCmisServiceFactory.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareCmisServiceFactory.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareCmisServiceFactory.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareCmisServiceFactory.java Wed Apr 29 09:02:50 2015
@@ -242,7 +242,7 @@ public class FileShareCmisServiceFactory
             return null;
         }
 
-        StringBuilder result = new StringBuilder();
+        StringBuilder result = new StringBuilder(128);
         StringBuilder property = null;
         boolean inProperty = false;
 
@@ -261,7 +261,7 @@ public class FileShareCmisServiceFactory
                 }
             } else {
                 if (c == '{') {
-                    property = new StringBuilder();
+                    property = new StringBuilder(32);
                     inProperty = true;
                 } else {
                     result.append(c);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepositoryManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepositoryManager.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepositoryManager.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepositoryManager.java Wed Apr 29 09:02:50 2015
@@ -67,7 +67,7 @@ public class FileShareRepositoryManager
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
 
         for (FileShareRepository repository : repositories.values()) {
             sb.append('[');

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareTypeManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareTypeManager.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareTypeManager.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareTypeManager.java Wed Apr 29 09:02:50 2015
@@ -209,7 +209,7 @@ public class FileShareTypeManager {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
 
         for (TypeDefinition type : typeDefinitions.values()) {
             sb.append('[');

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareUserManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareUserManager.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareUserManager.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareUserManager.java Wed Apr 29 09:02:50 2015
@@ -87,7 +87,7 @@ public class FileShareUserManager {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
 
         for (String user : logins.keySet()) {
             sb.append('[');

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java Wed Apr 29 09:02:50 2015
@@ -25,7 +25,7 @@ public class JsonPrettyPrinter {
 
     private int indent = 0;
     private String indentStr;
-    private StringBuilder sb = new StringBuilder();
+    private StringBuilder sb = new StringBuilder(1024);
 
     public JsonPrettyPrinter() {
         init(3);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java Wed Apr 29 09:02:50 2015
@@ -118,7 +118,7 @@ public class LoggingFilter implements Fi
             String requestFileName = getRequestFileName(reqNo);
             String cType = logReq.getContentType();
             String xmlRequest = logReq.getPayload();
-            StringBuilder sb = new StringBuilder();
+            StringBuilder sb = new StringBuilder(1024);
 
             if (logHeaders) {
                 logHeaders(logReq, sb);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/StringUtil.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/StringUtil.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/StringUtil.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/StringUtil.java Wed Apr 29 09:02:50 2015
@@ -39,7 +39,6 @@ public final class StringUtil {
     public static String unescape(String literal, String escapedChars) {
         char c = '?';
         int i = 0;
-        StringBuilder sb = new StringBuilder();
 
         if (null == escapedChars) {
             escapedChars = "\\'";
@@ -59,6 +58,8 @@ public final class StringUtil {
             return null;
         }
 
+        StringBuilder sb = new StringBuilder(len + 16);
+
         for (i = 0; i < len; i++) {
             c = literal.charAt(i);
             if (c == '\\') {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/wrapper/CmisServiceWrapperManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/wrapper/CmisServiceWrapperManager.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/wrapper/CmisServiceWrapperManager.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/wrapper/CmisServiceWrapperManager.java Wed Apr 29 09:02:50 2015
@@ -234,7 +234,7 @@ public class CmisServiceWrapperManager {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(128);
 
         WrapperDefinition def = outerMost;
         while (def != null) {
@@ -319,7 +319,10 @@ public class CmisServiceWrapperManager {
 
         @Override
         public String toString() {
-            StringBuilder sb = new StringBuilder(wrapperClass.getName());
+            StringBuilder sb = new StringBuilder(128);
+
+            sb.append(wrapperClass.getName());
+
             if (params != null) {
                 for (int i = 0; i < params.length; i++) {
                     sb.append(',');

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java Wed Apr 29 09:02:50 2015
@@ -311,7 +311,7 @@ public class BrowseServlet extends HttpS
         if (source == null) {
             String[] ctp = contentType.trim().toLowerCase().split(";");
 
-            StringBuilder match = new StringBuilder();
+            StringBuilder match = new StringBuilder(1024);
             int i = 0;
             while (source == null && i < ctp.length) {
                 if (i > 0) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java Wed Apr 29 09:02:50 2015
@@ -241,7 +241,7 @@ public abstract class AbstractSessionTes
             return null;
         }
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(4096);
         Reader reader = new InputStreamReader(contentStream.getStream(), IOUtils.UTF8);
 
         try {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/CoreHtmlReport.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/CoreHtmlReport.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/CoreHtmlReport.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/CoreHtmlReport.java Wed Apr 29 09:02:50 2015
@@ -212,7 +212,7 @@ public class CoreHtmlReport extends Abst
     }
 
     protected String getSourceCodeLink(StackTraceElement ste, String revision) {
-        StringBuilder result = new StringBuilder();
+        StringBuilder result = new StringBuilder(1024);
 
         if (!ste.getClassName().startsWith("org.apache.chemistry.opencmis.tck.")) {
             result.append(escape(ste.getFileName()));
@@ -252,7 +252,7 @@ public class CoreHtmlReport extends Abst
             return "";
         }
 
-        StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder(s.length() + 32);
 
         for (int i = 0; i < s.length(); i++) {
             char c = s.charAt(i);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java Wed Apr 29 09:02:50 2015
@@ -105,7 +105,7 @@ public abstract class AbstractRunner {
 
         if (stream != null) {
             try {
-                return IOUtils.readAllLines(stream);
+                return IOUtils.readAllLines(stream, 1000);
             } catch (IOException e) {
                 return "";
             } finally {
@@ -166,7 +166,7 @@ public abstract class AbstractRunner {
             throw new IllegalArgumentException("Stream is null!");
         }
 
-        for (String groupName : IOUtils.readAllLinesAsList(stream)) {
+        for (String groupName : IOUtils.readAllLinesAsList(stream, 10000)) {
             addGroup(groupName);
         }
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java?rev=1676694&r1=1676693&r2=1676694&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java Wed Apr 29 09:02:50 2015
@@ -390,7 +390,7 @@ public final class ClientHelper {
     public static void copyTableToClipboard(JTable table) {
         final String newline = System.getProperty("line.separator");
 
-        final StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder(1024);
         final int rows = table.getModel().getRowCount();
         final int cols = table.getModel().getColumnCount();
 
@@ -450,7 +450,7 @@ public final class ClientHelper {
         } else if (value instanceof String) {
             String s = value.toString();
 
-            StringBuilder sb = new StringBuilder();
+            StringBuilder sb = new StringBuilder(s.length() + 16);
             sb.append('\"');
 
             for (int i = 0; i < s.length(); i++) {
@@ -465,7 +465,7 @@ public final class ClientHelper {
 
             return sb.toString();
         } else if (value instanceof Collection<?>) {
-            StringBuilder sb = new StringBuilder();
+            StringBuilder sb = new StringBuilder(((Collection<?>) value).size() * 16 + 16);
             sb.append('[');
 
             for (Object v : (Collection<?>) value) {
@@ -522,7 +522,7 @@ public final class ClientHelper {
         }
 
         try {
-            return IOUtils.readAllLinesAndRemoveHeader(stream);
+            return IOUtils.readAllLinesAndRemoveHeader(stream, 10000);
         } catch (IOException e1) {
             return "";
         }



Mime
View raw message