You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gc...@apache.org on 2008/01/09 00:03:17 UTC
svn commit: r610217 -
/myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
Author: gcrawford
Date: Tue Jan 8 15:03:14 2008
New Revision: 610217
URL: http://svn.apache.org/viewvc?rev=610217&view=rev
Log:
TRINIDAD-887 perf: USE CORRECTLY SIZED STRINGBUILDERS IN GETCLIENTID
Use correctly sized stringBuilder to reduce excess memory allocation
Modified:
myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
Modified: myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java?rev=610217&r1=610216&r2=610217&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java (original)
+++ myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java Tue Jan 8 15:03:14 2008
@@ -6,9 +6,9 @@
* to you 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
@@ -61,7 +61,7 @@
* <li>Use of FacesBean for better and easier state saving</li>
* <li>Support of the LifecycleRenderer class for greater Renderer
* control over the lifecycle</li>
- * <li>Built-in support for both the "partialTriggers" attribute
+ * <li>Built-in support for both the "partialTriggers" attribute
* (declarative support for being a PPR target) and for triggering
* such components (for being a the source of a PPR-causing event).</li>
* </ul>
@@ -269,9 +269,10 @@
{
if (containerComponent instanceof NamingContainer)
{
- clientId = (containerComponent.getClientId(context) +
- NamingContainer.SEPARATOR_CHAR +
- clientId);
+ String contClientId = containerComponent.getClientId(context);
+ StringBuilder bld = new StringBuilder(contClientId.length() + 1 + clientId.length());
+ bld.append(contClientId).append(NamingContainer.SEPARATOR_CHAR).append(clientId);
+ clientId = bld.toString();
break;
}
@@ -582,7 +583,7 @@
{
childrenAndFacets.add(facet);
}
-
+
for(UIComponent child : _children)
{
childrenAndFacets.add(child);
@@ -616,9 +617,9 @@
adfContext.partialUpdateNotify(component);
}
- Iterator<FacesListener> iter =
+ Iterator<FacesListener> iter =
(Iterator<FacesListener>)getFacesBean().entries(_LISTENERS_KEY);
-
+
while (iter.hasNext())
{
FacesListener listener = iter.next();
@@ -1319,9 +1320,9 @@
private transient Renderer _cachedRenderer = _UNDEFINED_RENDERER;
private transient LifecycleRenderer _cachedLifecycleRenderer =
_UNDEFINED_LIFECYCLE_RENDERER;
-
+
// -= Simon Lessard =-
- // FIXME: _initialStateMarked is never read
+ // FIXME: _initialStateMarked is never read
// So commented out, is that ok? If so, this attribute should be deleted
//private transient boolean _initialStateMarked;
@@ -1378,7 +1379,7 @@
static private class ExtendedRendererImpl extends ExtendedRenderer
{
}
-
+
private static class EmptyIterator<T> implements Iterator<T>
{
public boolean hasNext()
@@ -1395,7 +1396,7 @@
{
throw new UnsupportedOperationException();
}
-
+
}
static private final LifecycleRenderer _UNDEFINED_LIFECYCLE_RENDERER =