You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2009/02/18 01:08:18 UTC

svn commit: r745308 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/internal/bindings/ main/java/org/apache/tapestry5/internal/pageload/ main/java/org/apache/tapestry5/internal/services/ main/java/org/apache/tapestry5/s...

Author: hlship
Date: Wed Feb 18 00:08:18 2009
New Revision: 745308

URL: http://svn.apache.org/viewvc?rev=745308&view=rev
Log:
TAP5-522: Reduce memory footprint by sharing binding descriptions

Added:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/StringInterner.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/StringInternerImpl.java
Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/PropBindingFactory.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/TranslateBindingFactory.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/ValidateBindingFactory.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageLoaderImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BindingSourceImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InternalModule.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/bindings/BindingFactoryTest.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/bindings/ValidateBindingFactoryTest.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BindingSourceImplTest.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/resources/log4j.properties

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/PropBindingFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/PropBindingFactory.java?rev=745308&r1=745307&r2=745308&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/PropBindingFactory.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/PropBindingFactory.java Wed Feb 18 00:08:18 2009
@@ -17,6 +17,7 @@
 import org.apache.tapestry5.Binding;
 import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.PropertyConduit;
+import org.apache.tapestry5.internal.services.StringInterner;
 import org.apache.tapestry5.ioc.Location;
 import org.apache.tapestry5.services.BindingFactory;
 import org.apache.tapestry5.services.PropertyConduitSource;
@@ -31,9 +32,12 @@
 {
     private final PropertyConduitSource source;
 
-    public PropBindingFactory(PropertyConduitSource propertyConduitSource)
+    private final StringInterner interner;
+
+    public PropBindingFactory(PropertyConduitSource propertyConduitSource, StringInterner interner)
     {
         source = propertyConduitSource;
+        this.interner = interner;
     }
 
     public Binding newBinding(String description, ComponentResources container,
@@ -44,7 +48,7 @@
 
         PropertyConduit conduit = source.create(targetClass, expression);
 
-        String toString = String.format("PropBinding[%s %s(%s)]", description, container
+        String toString = interner.format("PropBinding[%s %s(%s)]", description, container
                 .getCompleteId(), expression);
 
         return new PropBinding(location, target, conduit, toString);

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/TranslateBindingFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/TranslateBindingFactory.java?rev=745308&r1=745307&r2=745308&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/TranslateBindingFactory.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/TranslateBindingFactory.java Wed Feb 18 00:08:18 2009
@@ -17,6 +17,7 @@
 import org.apache.tapestry5.Binding;
 import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.FieldTranslator;
+import org.apache.tapestry5.internal.services.StringInterner;
 import org.apache.tapestry5.ioc.Location;
 import org.apache.tapestry5.services.BindingFactory;
 import org.apache.tapestry5.services.FieldTranslatorSource;
@@ -29,15 +30,18 @@
 {
     private final FieldTranslatorSource source;
 
-    public TranslateBindingFactory(FieldTranslatorSource source)
+    private final StringInterner interner;
+
+    public TranslateBindingFactory(FieldTranslatorSource source, StringInterner interner)
     {
         this.source = source;
+        this.interner = interner;
     }
 
     public Binding newBinding(String description, ComponentResources container,
                               final ComponentResources component, final String expression, Location location)
     {
-        return new InvariantBinding(location, FieldTranslator.class, description + ": " + expression)
+        return new InvariantBinding(location, FieldTranslator.class, interner.intern(description + ": " + expression))
         {
             public Object get()
             {

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/ValidateBindingFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/ValidateBindingFactory.java?rev=745308&r1=745307&r2=745308&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/ValidateBindingFactory.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/bindings/ValidateBindingFactory.java Wed Feb 18 00:08:18 2009
@@ -18,6 +18,7 @@
 import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.Field;
 import org.apache.tapestry5.FieldValidator;
+import org.apache.tapestry5.internal.services.StringInterner;
 import org.apache.tapestry5.ioc.Location;
 import org.apache.tapestry5.ioc.internal.util.TapestryException;
 import org.apache.tapestry5.services.BindingFactory;
@@ -32,9 +33,12 @@
 {
     private final FieldValidatorSource fieldValidatorSource;
 
-    public ValidateBindingFactory(FieldValidatorSource fieldValidatorSource)
+    private final StringInterner interner;
+
+    public ValidateBindingFactory(FieldValidatorSource fieldValidatorSource, StringInterner interner)
     {
         this.fieldValidatorSource = fieldValidatorSource;
+        this.interner = interner;
     }
 
     public Binding newBinding(String description, ComponentResources container,
@@ -48,7 +52,7 @@
 
         final Field field = (Field) fieldAsObject;
 
-        return new InvariantBinding(location, FieldValidator.class, description + ": " + expression)
+        return new InvariantBinding(location, FieldValidator.class, interner.intern(description + ": " + expression))
         {
             public Object get()
             {

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageLoaderImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageLoaderImpl.java?rev=745308&r1=745307&r2=745308&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageLoaderImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageLoaderImpl.java Wed Feb 18 00:08:18 2009
@@ -123,11 +123,13 @@
 
     private final PersistentFieldManager persistentFieldManager;
 
+    private final StringInterner interner;
+
     public PageLoaderImpl(ComponentInstantiatorSource instantiatorSource,
                           ComponentTemplateSource templateSource, PageElementFactory elementFactory,
                           ComponentPageElementResourcesSource resourcesSource,
                           ComponentClassResolver componentClassResolver,
-                          PersistentFieldManager persistentFieldManager)
+                          PersistentFieldManager persistentFieldManager, StringInterner interner)
     {
         this.instantiatorSource = instantiatorSource;
         this.templateSource = templateSource;
@@ -135,6 +137,7 @@
         this.resourcesSource = resourcesSource;
         this.componentClassResolver = componentClassResolver;
         this.persistentFieldManager = persistentFieldManager;
+        this.interner = interner;
     }
 
     public void objectWasInvalidated()
@@ -384,9 +387,9 @@
                 ComponentPageElement element = pageAssembly.createdElement.peek();
 
                 BlockImpl block = new BlockImpl(token.getLocation(),
-                                                String.format("Parameter %s of %s",
-                                                              parameterName,
-                                                              element.getCompleteId()));
+                                                interner.format("Parameter %s of %s",
+                                                                parameterName,
+                                                                element.getCompleteId()));
 
                 Binding binding = new LiteralBinding(token.getLocation(), "block parameter " + parameterName, block);
 
@@ -426,8 +429,8 @@
                 ComponentPageElement element = pageAssembly.activeElement.peek();
 
                 String description = blockId == null
-                                     ? String.format("Anonymous within %s", element.getCompleteId())
-                                     : String.format("%s within %s", blockId, element.getCompleteId());
+                                     ? interner.format("Anonymous within %s", element.getCompleteId())
+                                     : interner.format("%s within %s", blockId, element.getCompleteId());
 
                 BlockImpl block = new BlockImpl(token.getLocation(), description);
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BindingSourceImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BindingSourceImpl.java?rev=745308&r1=745307&r2=745308&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BindingSourceImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BindingSourceImpl.java Wed Feb 18 00:08:18 2009
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -29,9 +29,12 @@
 {
     private final Map<String, BindingFactory> factories;
 
-    public BindingSourceImpl(Map<String, BindingFactory> factories)
+    private final StringInterner interner;
+
+    public BindingSourceImpl(Map<String, BindingFactory> factories, StringInterner interner)
     {
         this.factories = factories;
+        this.interner = interner;
     }
 
     public Binding newBinding(String description, ComponentResources container,
@@ -75,7 +78,7 @@
 
         try
         {
-            return factory.newBinding(description, container, component, subexpression, location);
+            return factory.newBinding(interner.intern(description), container, component, subexpression, location);
         }
         catch (Exception ex)
         {

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InternalModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InternalModule.java?rev=745308&r1=745307&r2=745308&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InternalModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/InternalModule.java Wed Feb 18 00:08:18 2009
@@ -18,11 +18,13 @@
 import org.apache.tapestry5.internal.pageload.PageLoaderImpl;
 import org.apache.tapestry5.internal.structure.ComponentPageElementResourcesSource;
 import org.apache.tapestry5.internal.structure.ComponentPageElementResourcesSourceImpl;
-import org.apache.tapestry5.ioc.MethodAdviceReceiver;
 import org.apache.tapestry5.ioc.ObjectLocator;
 import org.apache.tapestry5.ioc.ScopeConstants;
 import org.apache.tapestry5.ioc.ServiceBinder;
-import org.apache.tapestry5.ioc.annotations.*;
+import org.apache.tapestry5.ioc.annotations.Autobuild;
+import org.apache.tapestry5.ioc.annotations.Marker;
+import org.apache.tapestry5.ioc.annotations.Scope;
+import org.apache.tapestry5.ioc.annotations.Symbol;
 import org.apache.tapestry5.ioc.internal.services.CtClassSource;
 import org.apache.tapestry5.ioc.services.*;
 import org.apache.tapestry5.services.*;
@@ -251,12 +253,6 @@
         return builder.build(componentInstantiatorSource, "classSource", CtClassSource.class);
     }
 
-    @Match("PageLoader")
-    public static void adviseWithLogging(LoggingAdvisor advisor, Logger logger, MethodAdviceReceiver receiver)
-    {
-        advisor.addLoggingAdvice(logger, receiver);
-    }
-
     public PageActivationContextCollector buildPageActivationContextCollector(
             @Autobuild PageActivationContextCollectorImpl service)
     {
@@ -265,4 +261,13 @@
         return service;
     }
 
+    /**
+     * @since 5.1.0.0
+     */
+    public StringInterner buildStringInterner(@Autobuild StringInternerImpl service)
+    {
+        classesInvalidationEventHub.addInvalidationListener(service);
+
+        return service;
+    }
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java?rev=745308&r1=745307&r2=745308&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java Wed Feb 18 00:08:18 2009
@@ -192,6 +192,8 @@
 
     private final TypeCoercer typeCoercer;
 
+    private final StringInterner interner;
+
     /**
      * Because of stuff like Hibernate, we sometimes start with a subclass in some inaccessible class loader and need to
      * work up to a base class from a common class loader.
@@ -298,7 +300,7 @@
 
             values.add(conduitPropertyType);
             values.add(annotationProvider);
-            values.add(String.format("PropertyConduit[%s %s]", rootType.getName(), expression));
+            values.add(interner.format("PropertyConduit[%s %s]", rootType.getName(), expression));
             values.add(typeCoercer);
 
             BodyBuilder builder = new BodyBuilder().begin();
@@ -1051,11 +1053,12 @@
     }
 
     public PropertyConduitSourceImpl(PropertyAccess access, @ComponentLayer ClassFactory classFactory,
-                                     TypeCoercer typeCoercer)
+                                     TypeCoercer typeCoercer, StringInterner interner)
     {
         this.access = access;
         this.classFactory = classFactory;
         this.typeCoercer = typeCoercer;
+        this.interner = interner;
 
         literalTrue = createLiteralConduit(Boolean.class, true);
         literalFalse = createLiteralConduit(Boolean.class, false);
@@ -1206,7 +1209,7 @@
     private <T> PropertyConduit createLiteralConduit(Class<T> type, T value)
     {
         return new LiteralPropertyConduit(type, invariantAnnotationProvider,
-                                          String.format("LiteralPropertyConduit[%s]", value), typeCoercer, value);
+                                          interner.format("LiteralPropertyConduit[%s]", value), typeCoercer, value);
     }
 
     private Tree parse(String expression)

Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/StringInterner.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/StringInterner.java?rev=745308&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/StringInterner.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/StringInterner.java Wed Feb 18 00:08:18 2009
@@ -0,0 +1,43 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.services;
+
+/**
+ * Creates "interned" strings that are unique for the same content. This is used for common description strings,
+ * particularly those used by {@link org.apache.tapestry5.Binding} instances.  The internal cache of interned strings id
+ * cleared whenever the {@link org.apache.tapestry5.services.ComponentClasses} {@link
+ * org.apache.tapestry5.services.InvalidationEventHub} is invalidated (i.e., when component class files change).
+ *
+ * @since 5.1.0.0
+ */
+public interface StringInterner
+{
+    /**
+     * Interns a string.
+     *
+     * @param string the string to intern
+     * @return the input string, or another string instance with the same content
+     */
+    String intern(String string);
+
+    /**
+     * Formats a string (using {@link String#format(String, Object[])}) and returns the interned result.
+     *
+     * @param format    string format
+     * @param arguments used inside the format
+     * @return formatted and interned string
+     */
+    String format(String format, Object... arguments);
+}

Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/StringInternerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/StringInternerImpl.java?rev=745308&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/StringInternerImpl.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/StringInternerImpl.java Wed Feb 18 00:08:18 2009
@@ -0,0 +1,50 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.services;
+
+import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
+import org.apache.tapestry5.services.InvalidationListener;
+
+import java.util.Map;
+
+public class StringInternerImpl implements StringInterner, InvalidationListener
+{
+    private final Map<String, String> cache = CollectionFactory.newConcurrentMap();
+
+    public void objectWasInvalidated()
+    {
+        cache.clear();
+    }
+
+    public String intern(String string)
+    {
+        String result = cache.get(string);
+
+        // Not yet in the cache?  Add it.
+
+        if (result == null)
+        {
+            cache.put(string, string);
+            result = string;
+        }
+
+        return result;
+    }
+
+    public String format(String format, Object... arguments)
+    {
+        return intern(String.format(format, arguments));
+    }
+}

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=745308&r1=745307&r2=745308&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java Wed Feb 18 00:08:18 2009
@@ -1017,8 +1017,7 @@
 
     /**
      * Builds the PropBindingFactory as a chain of command. The terminator of the chain is responsible for ordinary
-     * property names (and property paths). Contributions to the service cover additional special cases, such as simple
-     * literal values.
+     * property names (and property paths).
      * <p/>
      * This mechanism has been replaced in 5.1 with a more sophisticated parser based on ANTLR. See <a
      * href="https://issues.apache.org/jira/browse/TAP5-79">TAP5-79</a> for details.  There are no longer any built-in
@@ -1028,10 +1027,8 @@
      *                      binding if applicable, or null otherwise
      */
     public BindingFactory buildPropBindingFactory(List<BindingFactory> configuration,
-                                                  PropertyConduitSource propertyConduitSource)
+                                                  @Autobuild PropBindingFactory service)
     {
-        PropBindingFactory service = new PropBindingFactory(propertyConduitSource);
-
         configuration.add(service);
 
         return chainBuilder.build(BindingFactory.class, configuration);
@@ -2283,6 +2280,4 @@
         return pipelineBuilder.build(logger, ComponentRequestHandler.class, ComponentRequestFilter.class,
                                      configuration, terminator);
     }
-
-
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/bindings/BindingFactoryTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/bindings/BindingFactoryTest.java?rev=745308&r1=745307&r2=745308&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/bindings/BindingFactoryTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/bindings/BindingFactoryTest.java Wed Feb 18 00:08:18 2009
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
 import org.apache.tapestry5.Binding;
 import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.FieldTranslator;
+import org.apache.tapestry5.internal.services.StringInternerImpl;
 import org.apache.tapestry5.internal.test.InternalBaseTestCase;
 import org.apache.tapestry5.ioc.Location;
 import org.apache.tapestry5.ioc.internal.util.InternalUtils;
@@ -77,7 +78,7 @@
 
         replay();
 
-        BindingFactory factory = new TranslateBindingFactory(source);
+        BindingFactory factory = new TranslateBindingFactory(source, new StringInternerImpl());
 
         Binding binding = factory.newBinding(description, resources, resources, expression, l);
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/bindings/ValidateBindingFactoryTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/bindings/ValidateBindingFactoryTest.java?rev=745308&r1=745307&r2=745308&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/bindings/ValidateBindingFactoryTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/bindings/ValidateBindingFactoryTest.java Wed Feb 18 00:08:18 2009
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 2007, 2009 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -18,6 +18,8 @@
 import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.FieldComponent;
 import org.apache.tapestry5.FieldValidator;
+import org.apache.tapestry5.internal.services.StringInterner;
+import org.apache.tapestry5.internal.services.StringInternerImpl;
 import org.apache.tapestry5.internal.test.InternalBaseTestCase;
 import org.apache.tapestry5.ioc.Location;
 import org.apache.tapestry5.ioc.internal.util.TapestryException;
@@ -28,6 +30,7 @@
 
 public class ValidateBindingFactoryTest extends InternalBaseTestCase
 {
+    private StringInterner interner = new StringInternerImpl();
 
     @Test
     public void not_a_field()
@@ -43,7 +46,7 @@
 
         replay();
 
-        BindingFactory factory = new ValidateBindingFactory(source);
+        BindingFactory factory = new ValidateBindingFactory(source, interner);
 
         try
         {
@@ -79,7 +82,7 @@
 
         replay();
 
-        BindingFactory factory = new ValidateBindingFactory(source);
+        BindingFactory factory = new ValidateBindingFactory(source, interner);
 
         Binding binding = factory.newBinding("descrip", container, component, expression, l);
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BindingSourceImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BindingSourceImplTest.java?rev=745308&r1=745307&r2=745308&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BindingSourceImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BindingSourceImplTest.java Wed Feb 18 00:08:18 2009
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -28,6 +28,8 @@
 
 public class BindingSourceImplTest extends InternalBaseTestCase
 {
+    private final StringInterner interner = new StringInternerImpl();
+
     @Test
     public void expression_has_no_prefix()
     {
@@ -49,7 +51,7 @@
 
         map.put(defaultPrefix, factory);
 
-        BindingSource source = new BindingSourceImpl(map);
+        BindingSource source = new BindingSourceImpl(map, interner);
 
         Binding actual = source.newBinding(
                 description,
@@ -85,7 +87,7 @@
 
         map.put(defaultPrefix, factory);
 
-        BindingSource source = new BindingSourceImpl(map);
+        BindingSource source = new BindingSourceImpl(map, interner);
 
         Binding actual = source.newBinding(
                 description,
@@ -121,7 +123,7 @@
 
         map.put("prop", factory);
 
-        BindingSource source = new BindingSourceImpl(map);
+        BindingSource source = new BindingSourceImpl(map, interner);
 
         Binding actual = source.newBinding(
                 description,
@@ -158,7 +160,7 @@
 
         map.put(defaultPrefix, factory);
 
-        BindingSource source = new BindingSourceImpl(map);
+        BindingSource source = new BindingSourceImpl(map, interner);
 
         try
         {
@@ -195,7 +197,7 @@
 
         map.put(defaultPrefix, factory);
 
-        BindingSource source = new BindingSourceImpl(map);
+        BindingSource source = new BindingSourceImpl(map, interner);
 
         try
         {

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/log4j.properties?rev=745308&r1=745307&r2=745308&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/log4j.properties (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/log4j.properties Wed Feb 18 00:08:18 2009
@@ -23,9 +23,7 @@
 
 log4j.category.org.apache.tapestry5.integration.app2=debug
 
-log4j.category.tapestry.render=debug
-log4j.category.org.apache.tapestry5.internal.services.InternalModule.PageResponseRenderer=debug
-log4j.category.org.apache.tapestry5.internal.services.InternalModule.PageLoader=debug
+# log4j.category.tapestry.render=debug
 
 # log4j.category.org.apache.tapestry5.corelib.components=debug