tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thiag...@apache.org
Subject [15/45] tapestry-5 git commit: TAP5-2332: Replace String.format call by simple String concatenation, the compiler will transform that to StringBuilder-based concatenation which is considerably faster
Date Sun, 07 Dec 2014 02:29:13 GMT
TAP5-2332: Replace String.format call by simple String concatenation, the compiler will transform
that to StringBuilder-based concatenation which is considerably faster


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/4de73e96
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/4de73e96
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/4de73e96

Branch: refs/heads/beanmodel-split
Commit: 4de73e9642263d8f5b02000663a196df46059b99
Parents: 7a86bfd
Author: Michael Mikhulya <mmi@kupivip.ru>
Authored: Mon May 19 17:41:01 2014 +0400
Committer: Jochen Kemnade <jochen.kemnade@eddyson.de>
Committed: Thu Nov 13 09:17:51 2014 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/tapestry5/internal/OptionModelImpl.java | 2 +-
 .../internal/beaneditor/MessagesConstraintGenerator.java         | 3 +--
 .../apache/tapestry5/internal/services/DocumentLinkerImpl.java   | 2 +-
 .../java/org/apache/tapestry5/internal/services/EventImpl.java   | 2 +-
 .../services/javascript/JavaScriptStackPathConstructorImpl.java  | 4 +---
 .../tapestry5/internal/structure/ComponentPageElementImpl.java   | 2 +-
 .../ioc/internal/services/PerThreadServiceLifecycle.java         | 2 +-
 7 files changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4de73e96/tapestry-core/src/main/java/org/apache/tapestry5/internal/OptionModelImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/OptionModelImpl.java
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/OptionModelImpl.java
index 89ce561..101cfef 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/OptionModelImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/OptionModelImpl.java
@@ -49,6 +49,6 @@ public class OptionModelImpl extends AbstractOptionModel
     @Override
     public String toString()
     {
-        return String.format("OptionModel[%s %s]", label, value);
+        return "OptionModel[" + label + ' ' + value + ']';
     }
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4de73e96/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/MessagesConstraintGenerator.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/MessagesConstraintGenerator.java
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/MessagesConstraintGenerator.java
index 0156a93..2ae9b81 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/MessagesConstraintGenerator.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/MessagesConstraintGenerator.java
@@ -34,7 +34,6 @@ public class MessagesConstraintGenerator implements ValidationConstraintGenerato
 {
 
     private final Environment environment;
-    private final String format="%s-validate";
     private final Pattern splitPattern;
 
     public MessagesConstraintGenerator(final Environment environment) {
@@ -49,7 +48,7 @@ public class MessagesConstraintGenerator implements ValidationConstraintGenerato
             return null;
         }
 
-        String key = String.format(format,environmentMessages.getOverrideId());
+        String key = environmentMessages.getOverrideId() + "-validate";
         Messages m = environmentMessages.getMessages();
         if (!m.contains(key))
         {

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4de73e96/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
index a6f5198..56ad354 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
@@ -62,7 +62,7 @@ public class DocumentLinkerImpl implements DocumentLinker
         this.omitGeneratorMetaTag = omitGeneratorMetaTag;
         this.enablePageloadingMask = enablePageloadingMask;
 
-        tapestryBanner = String.format("Apache Tapestry Framework (version %s)", tapestryVersion);
+        tapestryBanner = "Apache Tapestry Framework (version " + tapestryVersion + ')';
     }
 
     public void addStylesheetLink(StylesheetLink sheet)

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4de73e96/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/EventImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/EventImpl.java
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/EventImpl.java
index 40d6e6a..22ac3b6 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/EventImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/EventImpl.java
@@ -82,7 +82,7 @@ public class EventImpl implements Event
         if (result != null)
         {
             boolean handleResult =
-                    tracker.invoke(String.format("Handling result from method %s.", methodDescription),
new Invokable<Boolean>()
+                    tracker.invoke("Handling result from method " + methodDescription + '.',
new Invokable<Boolean>()
                     {
                         public Boolean invoke()
                         {

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4de73e96/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/JavaScriptStackPathConstructorImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/JavaScriptStackPathConstructorImpl.java
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/JavaScriptStackPathConstructorImpl.java
index c7eccf7..9bb3342 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/JavaScriptStackPathConstructorImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/JavaScriptStackPathConstructorImpl.java
@@ -103,9 +103,7 @@ public class JavaScriptStackPathConstructorImpl implements JavaScriptStackPathCo
             StreamableResource assembled = assembler.assembleJavaScriptResourceForStack(stackName,
compressionAnalyzer.isGZipSupported(),
                     stack.getJavaScriptAggregationStrategy());
 
-            String path = String.format("%s/%s.js",
-                    threadLocale.getLocale(),
-                    stackName);
+            String path = threadLocale.getLocale().toString() + '/' + stackName + ".js";
 
             String stackURL = assetPathConstructor.constructAssetPath(RequestConstants.STACK_FOLDER,
path, assembled);
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4de73e96/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
index b0d6fe6..abd0258 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
@@ -1040,7 +1040,7 @@ public class ComponentPageElementImpl extends BaseLocatable implements
Component
     {
         assert InternalUtils.isNonBlank(eventType);
         assert context != null;
-        String description = String.format("Triggering event '%s' on %s", eventType, completeId);
+        String description = "Triggering event '" + eventType + "' on " + completeId;
 
         return elementResources.invoke(description, new Invokable<Boolean>()
         {

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4de73e96/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceLifecycle.java
----------------------------------------------------------------------
diff --git a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceLifecycle.java
b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceLifecycle.java
index f9017c2..cbf7b49 100644
--- a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceLifecycle.java
+++ b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceLifecycle.java
@@ -60,6 +60,6 @@ public class PerThreadServiceLifecycle implements ServiceLifecycle
 
         Class serviceInterface = resources.getServiceInterface();
 
-        return proxyFactory.createProxy(serviceInterface, perThreadCreator, String.format("<PerThread
Proxy for %s(%s)>", resources.getServiceId(), serviceInterface.getName()));
+        return proxyFactory.createProxy(serviceInterface, perThreadCreator, "<PerThread
Proxy for " + resources.getServiceId() + "(" + serviceInterface.getName() + ")>");
     }
 }


Mime
View raw message