You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2011/11/10 00:40:13 UTC
svn commit: r1200042 [2/3] - in
/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared:
component/ config/ renderkit/html/ renderkit/html/util/ resource/ taglib/
util/ util/el/
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java Wed Nov 9 23:40:12 2011
@@ -147,7 +147,8 @@ public class HtmlOutcomeTargetButtonRend
}
else
{
- CommonPropertyUtils.renderEventPropertiesWithoutOnclick(writer, commonPropertiesMarked, uiComponent);
+ CommonPropertyUtils.renderEventPropertiesWithoutOnclick(
+ writer, commonPropertiesMarked, uiComponent);
CommonPropertyUtils.renderFocusBlurEventProperties(writer, commonPropertiesMarked, uiComponent);
}
}
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java Wed Nov 9 23:40:12 2011
@@ -102,7 +102,8 @@ public class HtmlSecretRendererBase
}
else
{
- isRedisplay = org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(uiComponent, JSFAttr.REDISPLAY_ATTR, false);
+ isRedisplay = org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(uiComponent,
+ JSFAttr.REDISPLAY_ATTR, false);
}
if (isRedisplay)
{
@@ -111,13 +112,15 @@ public class HtmlSecretRendererBase
}
Map<String, List<ClientBehavior>> behaviors = null;
- if (uiComponent instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (uiComponent instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
+ facesContext.getExternalContext()))
{
behaviors = ((ClientBehaviorHolder) uiComponent).getClientBehaviors();
HtmlRendererUtils.renderBehaviorizedOnchangeEventHandler(facesContext, writer, uiComponent, behaviors);
HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, uiComponent, behaviors);
- HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchange(facesContext, writer, uiComponent, behaviors);
+ HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchange(
+ facesContext, writer, uiComponent, behaviors);
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
CommonPropertyUtils.renderInputPassthroughPropertiesWithoutDisabledAndEvents(writer,
@@ -125,7 +128,8 @@ public class HtmlSecretRendererBase
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
+ HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
+ HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
}
}
else
@@ -137,7 +141,8 @@ public class HtmlSecretRendererBase
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED);
+ HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
+ HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED);
}
}
@@ -198,7 +203,8 @@ public class HtmlSecretRendererBase
}
}
- public Object getConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object submittedValue) throws ConverterException
+ public Object getConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object submittedValue)
+ throws ConverterException
{
RendererUtils.checkParamValidity(facesContext, uiComponent, UIOutput.class);
return RendererUtils.getConvertedUIOutputValue(facesContext,
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextareaRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextareaRendererBase.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextareaRendererBase.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextareaRendererBase.java Wed Nov 9 23:40:12 2011
@@ -18,14 +18,10 @@
*/
package org.apache.myfaces.shared.renderkit.html;
-import org.apache.myfaces.shared.renderkit.RendererUtils;
-import org.apache.myfaces.shared.renderkit.html.HTML;
-import org.apache.myfaces.shared.renderkit.html.HtmlRenderer;
-import org.apache.myfaces.shared.renderkit.html.HtmlRendererUtils;
-import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
-import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
-import javax.faces.component.EditableValueHolder;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.component.UIOutput;
@@ -35,9 +31,10 @@ import javax.faces.component.html.HtmlIn
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.convert.ConverterException;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
+
+import org.apache.myfaces.shared.renderkit.RendererUtils;
+import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
+import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
/**
@@ -59,7 +56,8 @@ public class HtmlTextareaRendererBase
behaviors = ((ClientBehaviorHolder) uiComponent).getClientBehaviors();
if (!behaviors.isEmpty())
{
- ResourceUtils.renderDefaultJsfJsInlineIfNecessary(facesContext, facesContext.getResponseWriter());
+ ResourceUtils.renderDefaultJsfJsInlineIfNecessary(facesContext,
+ facesContext.getResponseWriter());
}
}
@@ -67,7 +65,9 @@ public class HtmlTextareaRendererBase
}
- protected void encodeTextArea(FacesContext facesContext, UIComponent uiComponent) throws IOException {
+ protected void encodeTextArea(FacesContext facesContext, UIComponent uiComponent)
+ throws IOException
+ {
//allow subclasses to render custom attributes by separating rendering begin and end
renderTextAreaBegin(facesContext, uiComponent);
renderTextAreaValue(facesContext, uiComponent);
@@ -83,7 +83,8 @@ public class HtmlTextareaRendererBase
writer.startElement(HTML.TEXTAREA_ELEM, uiComponent);
Map<String, List<ClientBehavior>> behaviors = null;
- if (uiComponent instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (uiComponent instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
+ facesContext.getExternalContext()))
{
behaviors = ((ClientBehaviorHolder) uiComponent).getClientBehaviors();
if (!behaviors.isEmpty())
@@ -97,7 +98,8 @@ public class HtmlTextareaRendererBase
}
HtmlRendererUtils.renderBehaviorizedOnchangeEventHandler(facesContext, writer, uiComponent, behaviors);
HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, uiComponent, behaviors);
- HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchange(facesContext, writer, uiComponent, behaviors);
+ HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchange(
+ facesContext, writer, uiComponent, behaviors);
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
CommonPropertyUtils.renderCommonFieldPassthroughPropertiesWithoutDisabledAndEvents(writer,
@@ -106,7 +108,8 @@ public class HtmlTextareaRendererBase
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TEXTAREA_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
+ HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
+ HTML.TEXTAREA_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
}
}
else
@@ -121,7 +124,8 @@ public class HtmlTextareaRendererBase
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TEXTAREA_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED);
+ HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
+ HTML.TEXTAREA_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED);
}
}
@@ -153,7 +157,8 @@ public class HtmlTextareaRendererBase
return ((HtmlInputTextarea)uiComponent).isDisabled();
}
- return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(uiComponent, HTML.DISABLED_ATTR, false);
+ return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(
+ uiComponent, HTML.DISABLED_ATTR, false);
}
@@ -168,7 +173,8 @@ public class HtmlTextareaRendererBase
}
}
- public Object getConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object submittedValue) throws ConverterException
+ public Object getConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object submittedValue)
+ throws ConverterException
{
RendererUtils.checkParamValidity(facesContext, uiComponent, UIOutput.class);
return org.apache.myfaces.shared.renderkit.RendererUtils.getConvertedUIOutputValue(facesContext,
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java Wed Nov 9 23:40:12 2011
@@ -100,9 +100,14 @@ public abstract class HTMLEncoder
app = "<br/>";
}
break;
+ default:
+ break;
}
- } else if (encodeNonLatin && (int)c > 0x80) {
- switch(c) {
+ }
+ else if (encodeNonLatin && (int)c > 0x80)
+ {
+ switch(c)
+ {
//german umlauts
case '\u00E4' : app = "ä"; break;
case '\u00C4' : app = "Ä"; break;
@@ -132,7 +137,9 @@ public abstract class HTMLEncoder
sb = new StringBuilder(string.substring(0, i));
}
sb.append(app);
- } else {
+ }
+ else
+ {
if (sb != null)
{
sb.append(c);
@@ -161,7 +168,8 @@ public abstract class HTMLEncoder
/**
* Variant of {@link #encode} where encodeNbsp is true.
*/
- public static void encode (char[] string, int offset, int length, boolean encodeNewline, Writer writer) throws IOException
+ public static void encode (char[] string, int offset, int length, boolean encodeNewline, Writer writer)
+ throws IOException
{
encode(string, offset, length, encodeNewline, true, writer);
}
@@ -169,7 +177,8 @@ public abstract class HTMLEncoder
/**
* Variant of {@link #encode} where encodeNbsp and encodeNonLatin are true
*/
- public static void encode (char[] string, int offset, int length, boolean encodeNewline, boolean encodeSubsequentBlanksToNbsp, Writer writer) throws IOException
+ public static void encode (char[] string, int offset, int length, boolean encodeNewline,
+ boolean encodeSubsequentBlanksToNbsp, Writer writer) throws IOException
{
encode(string, offset, length, encodeNewline, encodeSubsequentBlanksToNbsp, true, writer);
}
@@ -226,9 +235,14 @@ public abstract class HTMLEncoder
app = "<br/>";
}
break;
+ default:
+ break;
}
- } else if (encodeNonLatin && (int)c > 0x80) {
- switch(c) {
+ }
+ else if (encodeNonLatin && (int)c > 0x80)
+ {
+ switch(c)
+ {
//german umlauts
case '\u00E4' : app = "ä"; break;
case '\u00C4' : app = "Ä"; break;
@@ -259,7 +273,9 @@ public abstract class HTMLEncoder
sb.append(string, offset, i - offset);
}
sb.append(app);
- } else {
+ }
+ else
+ {
if (sb != null)
{
sb.append(c);
@@ -480,7 +496,9 @@ public abstract class HTMLEncoder
sb = new StringBuilder(string.substring(0, i));
}
sb.append(app);
- } else {
+ }
+ else
+ {
if (sb != null)
{
sb.append(c);
@@ -572,13 +590,14 @@ public abstract class HTMLEncoder
c = string.charAt(i);
// - From %00 to %20 (' ' %20 could encode as +, but %20 also works, so we keep %20)
- // - <"> %22 (If there is encode of "%", there is a risk of duplicate encoding, so we make easier and omit this one)
+ // - <"> %22 (If there is encode of "%", there is a risk of duplicate encoding, so
+ // we make easier and omit this one)
// - "<" %3C, ">" %3E,
// - "\" %5C, "^" %5E, "`" %60
// - "{" %7B, "|" %7C, "}" %7D
// - From %7F ad infinitum (each character as many bytes as necessary but take into account
- // that a single char should contain 2,3 or more bytes!. This data should be encoded translating from the document
- // character encoding to percent encoding)
+ // that a single char should contain 2,3 or more bytes!. This data should be encoded
+ // translating from the document character encoding to percent encoding)
//
// "&" should be encoded as "&" because this link is inside an html page, and
// put & is invalid in this context
@@ -646,7 +665,9 @@ public abstract class HTMLEncoder
sb = new StringBuilder(string.substring(0, i));
}
sb.append(app);
- } else {
+ }
+ else
+ {
if (sb != null)
{
sb.append(c);
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java Wed Nov 9 23:40:12 2011
@@ -19,7 +19,6 @@
package org.apache.myfaces.shared.renderkit.html.util;
import java.io.IOException;
-import java.lang.String;
import java.util.HashMap;
import java.util.Map;
@@ -28,7 +27,6 @@ import javax.faces.component.UIComponent
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam;
import org.apache.myfaces.shared.config.MyfacesConfig;
import org.apache.myfaces.shared.renderkit.JSFAttr;
import org.apache.myfaces.shared.renderkit.html.HTML;
@@ -38,7 +36,8 @@ import org.apache.myfaces.shared.renderk
* @version $Revision$ $Date$
* @since 4.0.1
*/
-public class ResourceUtils {
+public class ResourceUtils
+{
public final static String JAVAX_FACES_LIBRARY_NAME = "javax.faces";
public final static String JSF_JS_RESOURCE_NAME = "jsf.js";
@@ -59,7 +58,8 @@ public class ResourceUtils {
public final static String JSF_MYFACES_JSFJS_EXPERIMENTAL = "jsf-experimental.js";
public final static String JSF_MYFACES_JSFJS_LEGACY = "jsf-legacy.js";
- private final static String RENDERED_STYLESHEET_RESOURCES_SET = "org.apache.myfaces.RENDERED_STYLESHEET_RESOURCES_SET";
+ private final static String RENDERED_STYLESHEET_RESOURCES_SET =
+ "org.apache.myfaces.RENDERED_STYLESHEET_RESOURCES_SET";
private final static String RENDERED_SCRIPT_RESOURCES_SET = "org.apache.myfaces.RENDERED_SCRIPT_RESOURCES_SET";
private final static String RENDERED_JSF_JS = "org.apache.myfaces.RENDERED_JSF_JS";
public final static String HEAD_TARGET = "head";
@@ -81,7 +81,8 @@ public class ResourceUtils {
@SuppressWarnings("unchecked")
private static Map<String, Boolean> getRenderedStylesheetResources(FacesContext facesContext)
{
- Map<String, Boolean> map = (Map<String, Boolean>) facesContext.getAttributes().get(RENDERED_STYLESHEET_RESOURCES_SET);
+ Map<String, Boolean> map = (Map<String, Boolean>) facesContext.getAttributes().get(
+ RENDERED_STYLESHEET_RESOURCES_SET);
if (map == null)
{
map = new HashMap<String, Boolean>();
@@ -100,7 +101,8 @@ public class ResourceUtils {
@SuppressWarnings("unchecked")
private static Map<String, Boolean> getRenderedScriptResources(FacesContext facesContext)
{
- Map<String, Boolean> map = (Map<String, Boolean>) facesContext.getAttributes().get(RENDERED_SCRIPT_RESOURCES_SET);
+ Map<String, Boolean> map = (Map<String, Boolean>) facesContext.getAttributes().get(
+ RENDERED_SCRIPT_RESOURCES_SET);
if (map == null)
{
map = new HashMap<String, Boolean>();
@@ -111,32 +113,38 @@ public class ResourceUtils {
public static void markScriptAsRendered(FacesContext facesContext, String libraryName, String resourceName)
{
- getRenderedScriptResources(facesContext).put(libraryName != null ? libraryName+'/'+resourceName : resourceName, Boolean.TRUE);
+ getRenderedScriptResources(facesContext).put(
+ libraryName != null ? libraryName+'/'+resourceName : resourceName, Boolean.TRUE);
if (JAVAX_FACES_LIBRARY_NAME.equals(libraryName) &&
JSF_JS_RESOURCE_NAME.equals(resourceName))
{
// If we are calling this method, it is expected myfaces core is being used as runtime and note
// oamSubmit script is included inside jsf.js, so mark this one too.
- getRenderedScriptResources(facesContext).put(MYFACES_LIBRARY_NAME+'/'+MYFACES_JS_RESOURCE_NAME, Boolean.TRUE);
+ getRenderedScriptResources(facesContext).put(
+ MYFACES_LIBRARY_NAME+'/'+MYFACES_JS_RESOURCE_NAME, Boolean.TRUE);
}
}
public static void markStylesheetAsRendered(FacesContext facesContext, String libraryName, String resourceName)
{
- getRenderedStylesheetResources(facesContext).put(libraryName != null ? libraryName+'/'+resourceName : resourceName, Boolean.TRUE);
+ getRenderedStylesheetResources(facesContext).put(
+ libraryName != null ? libraryName+'/'+resourceName : resourceName, Boolean.TRUE);
}
public static boolean isRenderedScript(FacesContext facesContext, String libraryName, String resourceName)
{
- return getRenderedScriptResources(facesContext).containsKey(libraryName != null ? libraryName+'/'+resourceName : resourceName);
+ return getRenderedScriptResources(facesContext).containsKey(
+ libraryName != null ? libraryName+'/'+resourceName : resourceName);
}
public static boolean isRenderedStylesheet(FacesContext facesContext, String libraryName, String resourceName)
{
- return getRenderedStylesheetResources(facesContext).containsKey(libraryName != null ? libraryName+'/'+resourceName : resourceName);
+ return getRenderedStylesheetResources(facesContext).containsKey(
+ libraryName != null ? libraryName+'/'+resourceName : resourceName);
}
- public static void writeScriptInline(FacesContext facesContext, ResponseWriter writer, String libraryName, String resourceName) throws IOException
+ public static void writeScriptInline(FacesContext facesContext, ResponseWriter writer, String libraryName,
+ String resourceName) throws IOException
{
if (!ResourceUtils.isRenderedScript(facesContext, libraryName, resourceName))
{
@@ -152,7 +160,8 @@ public class ResourceUtils {
else
{
//Fast shortcut, don't create component instance and do what HtmlScriptRenderer do.
- Resource resource = facesContext.getApplication().getResourceHandler().createResource(resourceName, libraryName);
+ Resource resource = facesContext.getApplication().getResourceHandler().createResource(
+ resourceName, libraryName);
markScriptAsRendered(facesContext, libraryName, resourceName);
writer.startElement(HTML.SCRIPT_ELEM, null);
writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR, HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT , null);
@@ -162,7 +171,8 @@ public class ResourceUtils {
}
}
- public static void renderDefaultJsfJsInlineIfNecessary(FacesContext facesContext, ResponseWriter writer) throws IOException
+ public static void renderDefaultJsfJsInlineIfNecessary(FacesContext facesContext, ResponseWriter writer)
+ throws IOException
{
if (facesContext.getAttributes().containsKey(RENDERED_JSF_JS))
{
@@ -210,7 +220,8 @@ public class ResourceUtils {
else
{
//Fast shortcut, don't create component instance and do what HtmlScriptRenderer do.
- Resource resource = facesContext.getApplication().getResourceHandler().createResource(JSF_JS_RESOURCE_NAME, JAVAX_FACES_LIBRARY_NAME);
+ Resource resource = facesContext.getApplication().getResourceHandler().createResource(
+ JSF_JS_RESOURCE_NAME, JAVAX_FACES_LIBRARY_NAME);
markScriptAsRendered(facesContext, JAVAX_FACES_LIBRARY_NAME, JSF_JS_RESOURCE_NAME);
writer.startElement(HTML.SCRIPT_ELEM, null);
writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR, HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT, null);
@@ -223,8 +234,11 @@ public class ResourceUtils {
return;
}
- public static void renderMyfacesJSInlineIfNecessary(FacesContext facesContext, ResponseWriter writer) throws IOException {
- if (facesContext.getAttributes().containsKey(RENDERED_MYFACES_JS)) {
+ public static void renderMyfacesJSInlineIfNecessary(FacesContext facesContext, ResponseWriter writer)
+ throws IOException
+ {
+ if (facesContext.getAttributes().containsKey(RENDERED_MYFACES_JS))
+ {
return;
}
@@ -238,7 +252,8 @@ public class ResourceUtils {
}
// Check first if we have lucky, we are using myfaces and the script has
// been previously rendered
- if (isRenderedScript(facesContext, MYFACES_LIBRARY_NAME, MYFACES_JS_RESOURCE_NAME)) {
+ if (isRenderedScript(facesContext, MYFACES_LIBRARY_NAME, MYFACES_JS_RESOURCE_NAME))
+ {
facesContext.getAttributes().put(RENDERED_MYFACES_JS, Boolean.TRUE);
return;
}
@@ -268,7 +283,8 @@ public class ResourceUtils {
else
{
//Fast shortcut, don't create component instance and do what HtmlScriptRenderer do.
- Resource resource = facesContext.getApplication().getResourceHandler().createResource(MYFACES_JS_RESOURCE_NAME, MYFACES_LIBRARY_NAME);
+ Resource resource = facesContext.getApplication().getResourceHandler().createResource(
+ MYFACES_JS_RESOURCE_NAME, MYFACES_LIBRARY_NAME);
markScriptAsRendered(facesContext, MYFACES_LIBRARY_NAME, MYFACES_JS_RESOURCE_NAME);
writer.startElement(HTML.SCRIPT_ELEM, null);
writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR, HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT, null);
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/UnicodeEncoder.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/UnicodeEncoder.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/UnicodeEncoder.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/UnicodeEncoder.java Wed Nov 9 23:40:12 2011
@@ -42,7 +42,8 @@ public abstract class UnicodeEncoder
c = string.charAt(i);
if (((int)c) >= 0x80)
{
- if( sb == null ){
+ if( sb == null )
+ {
sb = new StringBuilder( string.length()+4 );
sb.append( string.substring(0,i) );
}
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/BaseResourceHandlerSupport.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/BaseResourceHandlerSupport.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/BaseResourceHandlerSupport.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/BaseResourceHandlerSupport.java Wed Nov 9 23:40:12 2011
@@ -38,7 +38,8 @@ public class BaseResourceHandlerSupport
{
/**
- * Set the max time in miliseconds set on the "Expires" header for a resource rendered by the default ResourceHandler.
+ * Set the max time in miliseconds set on the "Expires" header for a resource rendered by
+ * the default ResourceHandler.
* (default to one week in miliseconds or 604800000)
*/
@JSFWebConfigParam(since="2.0", defaultValue="604800000", group="resources", tags="performance")
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ClassLoaderResourceLoader.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ClassLoaderResourceLoader.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ClassLoaderResourceLoader.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ClassLoaderResourceLoader.java Wed Nov 9 23:40:12 2011
@@ -21,10 +21,6 @@ package org.apache.myfaces.shared.resour
import java.io.InputStream;
import java.net.URL;
-import javax.faces.application.ProjectStage;
-import javax.faces.context.FacesContext;
-
-import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
import org.apache.myfaces.shared.util.ClassUtils;
/**
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ExternalContextResourceLoader.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ExternalContextResourceLoader.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ExternalContextResourceLoader.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ExternalContextResourceLoader.java Wed Nov 9 23:40:12 2011
@@ -39,14 +39,14 @@ public class ExternalContextResourceLoad
*
* Used on getLibraryVersion to filter resource directories
**/
- protected static Pattern VERSION_CHECKER = Pattern.compile("/\\p{Digit}+(_\\p{Digit}*)*/");
+ protected static final Pattern VERSION_CHECKER = Pattern.compile("/\\p{Digit}+(_\\p{Digit}*)*/");
/**
* It checks version like this: /1.js, /1_0.js, /1_0_0.js, /100_100.js
*
* Used on getResourceVersion to filter resources
**/
- protected static Pattern RESOURCE_VERSION_CHECKER = Pattern.compile("/\\p{Digit}+(_\\p{Digit}*)*\\..*");
+ protected static final Pattern RESOURCE_VERSION_CHECKER = Pattern.compile("/\\p{Digit}+(_\\p{Digit}*)*\\..*");
public ExternalContextResourceLoader(String prefix)
{
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ResourceLoaderUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ResourceLoaderUtils.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ResourceLoaderUtils.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ResourceLoaderUtils.java Wed Nov 9 23:40:12 2011
@@ -40,14 +40,14 @@ public class ResourceLoaderUtils
"EEE, dd MMM yyyy HH:mm:ss zzz", "EEEEEE, dd-MMM-yy HH:mm:ss zzz",
"EEE MMMM d HH:mm:ss yyyy" };
- private static TimeZone __GMT = TimeZone.getTimeZone("GMT");
+ private static final TimeZone GMT = TimeZone.getTimeZone("GMT");
public static String formatDateHeader(long value)
{
SimpleDateFormat format = new SimpleDateFormat(
HTTP_RESPONSE_DATE_HEADER,
Locale.US);
- format.setTimeZone(__GMT);
+ format.setTimeZone(GMT);
return format.format(new Date(value));
}
@@ -60,12 +60,11 @@ public class ResourceLoaderUtils
{
SimpleDateFormat format = new SimpleDateFormat(
HTTP_REQUEST_DATE_HEADER[i], Locale.US);
- format.setTimeZone(__GMT);
+ format.setTimeZone(GMT);
date = format.parse(value);
}
catch (ParseException e)
{
- ;
}
}
if (date == null)
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentELTagBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentELTagBase.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentELTagBase.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentELTagBase.java Wed Nov 9 23:40:12 2011
@@ -30,8 +30,7 @@ import javax.faces.webapp.UIComponentELT
* @author Bruno Aranda (JSR-252)
* @version $Revision$ $Date$
*/
-public abstract class UIComponentELTagBase
- extends UIComponentELTag
+public abstract class UIComponentELTagBase extends UIComponentELTag
{
//private static final Log log = LogFactory.getLog(UIComponentTagBase.class);
@@ -48,16 +47,18 @@ public abstract class UIComponentELTagBa
//Special UIComponent attributes (ValueHolder, ConvertibleValueHolder)
private ValueExpression _value;
private ValueExpression _converter;
+
//attributes id, rendered and binding are handled by UIComponentTag
- public void release() {
+ public void release()
+ {
super.release();
_forceId = null;
_forceIdIndex = null;
- _value=null;
- _converter=null;
+ _value = null;
+ _converter = null;
_javascriptLocation = null;
_imageLocation = null;
@@ -68,11 +69,26 @@ public abstract class UIComponentELTagBa
{
super.setProperties(component);
- setBooleanProperty(component, org.apache.myfaces.shared.renderkit.JSFAttr.FORCE_ID_ATTR, _forceId);
- setBooleanProperty(component, org.apache.myfaces.shared.renderkit.JSFAttr.FORCE_ID_INDEX_ATTR, _forceIdIndex, DEFAULT_FORCE_ID_INDEX_VALUE);
- if (_javascriptLocation != null) setStringProperty(component, JSFAttr.JAVASCRIPT_LOCATION, _javascriptLocation);
- if (_imageLocation != null) setStringProperty(component, JSFAttr.IMAGE_LOCATION, _imageLocation);
- if (_styleLocation != null) setStringProperty(component, JSFAttr.STYLE_LOCATION, _styleLocation);
+ setBooleanProperty(component,
+ org.apache.myfaces.shared.renderkit.JSFAttr.FORCE_ID_ATTR,
+ _forceId);
+ setBooleanProperty(
+ component,
+ org.apache.myfaces.shared.renderkit.JSFAttr.FORCE_ID_INDEX_ATTR,
+ _forceIdIndex, DEFAULT_FORCE_ID_INDEX_VALUE);
+ if (_javascriptLocation != null)
+ {
+ setStringProperty(component, JSFAttr.JAVASCRIPT_LOCATION,
+ _javascriptLocation);
+ }
+ if (_imageLocation != null)
+ {
+ setStringProperty(component, JSFAttr.IMAGE_LOCATION, _imageLocation);
+ }
+ if (_styleLocation != null)
+ {
+ setStringProperty(component, JSFAttr.STYLE_LOCATION, _styleLocation);
+ }
//rendererType already handled by UIComponentTag
@@ -113,7 +129,6 @@ public abstract class UIComponentELTagBa
_converter = converter;
}
-
/**
* Sets the javascript location attribute of the tag. NOTE: Not every tag that extends this class will
* actually make use of this attribute. Check the TLD to see which components actually implement it.
@@ -149,111 +164,141 @@ public abstract class UIComponentELTagBa
// sub class helpers
- protected void setIntegerProperty(UIComponent component, String propName, ValueExpression value)
+ protected void setIntegerProperty(UIComponent component, String propName,
+ ValueExpression value)
{
UIComponentELTagUtils.setIntegerProperty(component, propName, value);
}
- protected void setIntegerProperty(UIComponent component, String propName, ValueExpression value, Integer defaultValue)
+ protected void setIntegerProperty(UIComponent component, String propName,
+ ValueExpression value, Integer defaultValue)
{
- UIComponentELTagUtils.setIntegerProperty(component, propName, value, defaultValue);
+ UIComponentELTagUtils.setIntegerProperty(component, propName, value,
+ defaultValue);
}
- protected void setLongProperty(UIComponent component, String propName, ValueExpression value)
+ protected void setLongProperty(UIComponent component, String propName,
+ ValueExpression value)
{
UIComponentELTagUtils.setLongProperty(component, propName, value);
}
- protected void setLongProperty(UIComponent component, String propName, ValueExpression value, Long defaultValue)
+ protected void setLongProperty(UIComponent component, String propName,
+ ValueExpression value, Long defaultValue)
{
- UIComponentELTagUtils.setLongProperty(component, propName, value, defaultValue);
+ UIComponentELTagUtils.setLongProperty(component, propName, value,
+ defaultValue);
}
@Deprecated
- protected void setStringProperty(UIComponent component, String propName, String value)
+ protected void setStringProperty(UIComponent component, String propName,
+ String value)
{
- UIComponentTagUtils.setStringProperty(getFacesContext(), component, propName, value);
+ UIComponentTagUtils.setStringProperty(getFacesContext(), component,
+ propName, value);
}
- protected void setStringProperty(UIComponent component, String propName, ValueExpression value)
+ protected void setStringProperty(UIComponent component, String propName,
+ ValueExpression value)
{
UIComponentELTagUtils.setStringProperty(component, propName, value);
}
- protected void setStringProperty(UIComponent component, String propName, ValueExpression value, String defaultValue)
+ protected void setStringProperty(UIComponent component, String propName,
+ ValueExpression value, String defaultValue)
{
- UIComponentELTagUtils.setStringProperty(component, propName, value, defaultValue);
+ UIComponentELTagUtils.setStringProperty(component, propName, value,
+ defaultValue);
}
@Deprecated
- protected void setBooleanProperty(UIComponent component, String propName, String value)
+ protected void setBooleanProperty(UIComponent component, String propName,
+ String value)
{
- UIComponentTagUtils.setBooleanProperty(getFacesContext(), component, propName, value);
+ UIComponentTagUtils.setBooleanProperty(getFacesContext(), component,
+ propName, value);
}
- protected void setBooleanProperty(UIComponent component, String propName, ValueExpression value)
+ protected void setBooleanProperty(UIComponent component, String propName,
+ ValueExpression value)
{
UIComponentELTagUtils.setBooleanProperty(component, propName, value);
}
- protected void setBooleanProperty(UIComponent component, String propName, ValueExpression value, Boolean defaultValue)
+ protected void setBooleanProperty(UIComponent component, String propName,
+ ValueExpression value, Boolean defaultValue)
{
- UIComponentELTagUtils.setBooleanProperty(component, propName, value, defaultValue);
+ UIComponentELTagUtils.setBooleanProperty(component, propName, value,
+ defaultValue);
}
private void setValueProperty(UIComponent component, ValueExpression value)
{
- UIComponentELTagUtils.setValueProperty(getFacesContext(), component, value);
+ UIComponentELTagUtils.setValueProperty(getFacesContext(), component,
+ value);
}
- private void setConverterProperty(UIComponent component, ValueExpression value)
+ private void setConverterProperty(UIComponent component,
+ ValueExpression value)
{
- UIComponentELTagUtils.setConverterProperty(getFacesContext(), component, value);
+ UIComponentELTagUtils.setConverterProperty(getFacesContext(),
+ component, value);
}
- protected void addValidatorProperty(UIComponent component, MethodExpression value)
+ protected void addValidatorProperty(UIComponent component,
+ MethodExpression value)
{
- UIComponentELTagUtils.addValidatorProperty(getFacesContext(), component, value);
+ UIComponentELTagUtils.addValidatorProperty(getFacesContext(),
+ component, value);
}
@Deprecated
protected void setActionProperty(UIComponent component, String action)
{
- UIComponentTagUtils.setActionProperty(getFacesContext(), component, action);
+ UIComponentTagUtils.setActionProperty(getFacesContext(), component,
+ action);
}
- protected void setActionProperty(UIComponent component, MethodExpression action)
+ protected void setActionProperty(UIComponent component,
+ MethodExpression action)
{
- UIComponentELTagUtils.setActionProperty(getFacesContext(), component, action);
+ UIComponentELTagUtils.setActionProperty(getFacesContext(), component,
+ action);
}
@Deprecated
- protected void setActionListenerProperty(UIComponent component, String actionListener)
+ protected void setActionListenerProperty(UIComponent component,
+ String actionListener)
{
- UIComponentTagUtils.setActionListenerProperty(getFacesContext(), component, actionListener);
+ UIComponentTagUtils.setActionListenerProperty(getFacesContext(),
+ component, actionListener);
}
- protected void setActionListenerProperty(UIComponent component, MethodExpression actionListener)
+ protected void setActionListenerProperty(UIComponent component,
+ MethodExpression actionListener)
{
- UIComponentELTagUtils.addActionListenerProperty(getFacesContext(), component, actionListener);
+ UIComponentELTagUtils.addActionListenerProperty(getFacesContext(),
+ component, actionListener);
}
- protected void addValueChangedListenerProperty(UIComponent component, MethodExpression valueChangedListener)
+ protected void addValueChangedListenerProperty(UIComponent component,
+ MethodExpression valueChangedListener)
{
- UIComponentELTagUtils.addValueChangedListenerProperty(getFacesContext(), component, valueChangedListener);
+ UIComponentELTagUtils.addValueChangedListenerProperty(
+ getFacesContext(), component, valueChangedListener);
}
- protected void setValueBinding(UIComponent component,
- String propName,
- ValueExpression value)
+ protected void setValueBinding(UIComponent component, String propName,
+ ValueExpression value)
{
- UIComponentELTagUtils.setValueBinding(getFacesContext(), component, propName, value);
+ UIComponentELTagUtils.setValueBinding(getFacesContext(), component,
+ propName, value);
}
-
+
protected Object evaluateValueExpression(ValueExpression expression)
{
- return UIComponentELTagUtils.evaluateValueExpression(getFacesContext().getELContext(), expression);
+ return UIComponentELTagUtils.evaluateValueExpression(getFacesContext()
+ .getELContext(), expression);
}
-
}
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentELTagUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentELTagUtils.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentELTagUtils.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentELTagUtils.java Wed Nov 9 23:40:12 2011
@@ -47,16 +47,18 @@ import javax.faces.validator.MethodExpre
public class UIComponentELTagUtils
{
//private static final Log log = LogFactory.getLog(UIComponentELTagUtils.class);
- private static final Logger log = Logger.getLogger(UIComponentELTagUtils.class.getName());
+ private static final Logger log = Logger
+ .getLogger(UIComponentELTagUtils.class.getName());
- private UIComponentELTagUtils() {} //util class, no instantiation allowed
+ private UIComponentELTagUtils()
+ {
+ } //util class, no instantiation allowed
/**
* @since 1.2
*/
public static void setIntegerProperty(UIComponent component,
- String propName,
- ValueExpression value)
+ String propName, ValueExpression value)
{
setIntegerProperty(component, propName, value, null);
}
@@ -65,15 +67,14 @@ public class UIComponentELTagUtils
* @since 1.2
*/
public static void setIntegerProperty(UIComponent component,
- String propName,
- ValueExpression value,
- Integer defaultValue)
+ String propName, ValueExpression value, Integer defaultValue)
{
if (value != null)
{
if (value.isLiteralText())
{
- component.getAttributes().put(propName, Integer.valueOf(value.getExpressionString()));
+ component.getAttributes().put(propName,
+ Integer.valueOf(value.getExpressionString()));
}
else
{
@@ -89,13 +90,11 @@ public class UIComponentELTagUtils
}
}
-
/**
* @since 1.2
*/
- public static void setLongProperty(UIComponent component,
- String propName,
- ValueExpression value)
+ public static void setLongProperty(UIComponent component, String propName,
+ ValueExpression value)
{
setLongProperty(component, propName, value, null);
}
@@ -103,16 +102,15 @@ public class UIComponentELTagUtils
/**
* @since 1.2
*/
- public static void setLongProperty(UIComponent component,
- String propName,
- ValueExpression value,
- Long defaultValue)
+ public static void setLongProperty(UIComponent component, String propName,
+ ValueExpression value, Long defaultValue)
{
if (value != null)
{
if (value.isLiteralText())
{
- component.getAttributes().put(propName, Long.valueOf(value.getExpressionString()));
+ component.getAttributes().put(propName,
+ Long.valueOf(value.getExpressionString()));
}
else
{
@@ -132,8 +130,7 @@ public class UIComponentELTagUtils
* @since 1.2
*/
public static void setStringProperty(UIComponent component,
- String propName,
- ValueExpression value)
+ String propName, ValueExpression value)
{
setStringProperty(component, propName, value, null);
}
@@ -142,15 +139,14 @@ public class UIComponentELTagUtils
* @since 1.2
*/
public static void setStringProperty(UIComponent component,
- String propName,
- ValueExpression value,
- String defaultValue)
+ String propName, ValueExpression value, String defaultValue)
{
if (value != null)
{
if (value.isLiteralText())
{
- component.getAttributes().put(propName, value.getExpressionString());
+ component.getAttributes().put(propName,
+ value.getExpressionString());
}
else
{
@@ -166,13 +162,11 @@ public class UIComponentELTagUtils
}
}
-
/**
* @since 1.2
*/
public static void setBooleanProperty(UIComponent component,
- String propName,
- ValueExpression value)
+ String propName, ValueExpression value)
{
setBooleanProperty(component, propName, value, null);
}
@@ -181,15 +175,14 @@ public class UIComponentELTagUtils
* @since 1.2
*/
public static void setBooleanProperty(UIComponent component,
- String propName,
- ValueExpression value,
- Boolean defaultValue)
+ String propName, ValueExpression value, Boolean defaultValue)
{
if (value != null)
{
if (value.isLiteralText())
{
- component.getAttributes().put(propName, Boolean.valueOf(value.getExpressionString()));
+ component.getAttributes().put(propName,
+ Boolean.valueOf(value.getExpressionString()));
}
else
{
@@ -209,40 +202,43 @@ public class UIComponentELTagUtils
* @since 1.2
*/
public static void setValueProperty(FacesContext context,
- UIComponent component,
- ValueExpression value)
+ UIComponent component, ValueExpression value)
{
if (value != null)
{
if (!value.isLiteralText())
{
- component.setValueExpression(org.apache.myfaces.shared.renderkit.JSFAttr.VALUE_ATTR, value);
+ component.setValueExpression(
+ org.apache.myfaces.shared.renderkit.JSFAttr.VALUE_ATTR,
+ value);
}
else if (component instanceof UICommand)
{
- ((UICommand)component).setValue(value.getExpressionString());
+ ((UICommand) component).setValue(value.getExpressionString());
}
else if (component instanceof UIParameter)
{
- ((UIParameter)component).setValue(value.getExpressionString());
+ ((UIParameter) component).setValue(value.getExpressionString());
}
else if (component instanceof UISelectBoolean)
{
- ((UISelectBoolean)component).setValue(Boolean.valueOf(value.getExpressionString()));
+ ((UISelectBoolean) component).setValue(Boolean.valueOf(value
+ .getExpressionString()));
}
else if (component instanceof UIGraphic)
{
- ((UIGraphic)component).setValue(value.getExpressionString());
+ ((UIGraphic) component).setValue(value.getExpressionString());
}
//Since many input components are ValueHolders the special components
//must come first, ValueHolder is the last resort.
else if (component instanceof ValueHolder)
{
- ((ValueHolder)component).setValue(value.getExpressionString());
+ ((ValueHolder) component).setValue(value.getExpressionString());
}
else
{
- log.severe("Component " + component.getClass().getName() + " is no ValueHolder, cannot set value.");
+ log.severe("Component " + component.getClass().getName()
+ + " is no ValueHolder, cannot set value.");
}
}
}
@@ -251,8 +247,7 @@ public class UIComponentELTagUtils
* @since 1.2
*/
public static void setConverterProperty(FacesContext context,
- UIComponent component,
- ValueExpression value)
+ UIComponent component, ValueExpression value)
{
if (value != null)
{
@@ -260,18 +255,24 @@ public class UIComponentELTagUtils
{
if (value.isLiteralText())
{
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Converter converter = facesContext.getApplication().createConverter(value.getExpressionString());
- ((ValueHolder)component).setConverter(converter);
+ FacesContext facesContext = FacesContext
+ .getCurrentInstance();
+ Converter converter = facesContext.getApplication()
+ .createConverter(value.getExpressionString());
+ ((ValueHolder) component).setConverter(converter);
}
else
{
- component.setValueExpression(org.apache.myfaces.shared.renderkit.JSFAttr.CONVERTER_ATTR, value);
+ component
+ .setValueExpression(
+ org.apache.myfaces.shared.renderkit.JSFAttr.CONVERTER_ATTR,
+ value);
}
}
else
{
- log.severe("Component " + component.getClass().getName() + " is no ValueHolder, cannot set value.");
+ log.severe("Component " + component.getClass().getName()
+ + " is no ValueHolder, cannot set value.");
}
}
}
@@ -280,17 +281,19 @@ public class UIComponentELTagUtils
* @since 1.2
*/
public static void addValidatorProperty(FacesContext context,
- UIComponent component,
- MethodExpression validator)
+ UIComponent component, MethodExpression validator)
{
if (validator != null)
{
if (!(component instanceof EditableValueHolder))
{
- throw new IllegalArgumentException("Component " + component.getClientId(context) + " is no EditableValueHolder");
+ throw new IllegalArgumentException("Component "
+ + component.getClientId(context)
+ + " is no EditableValueHolder");
}
- ((EditableValueHolder)component).addValidator(new MethodExpressionValidator(validator));
+ ((EditableValueHolder) component)
+ .addValidator(new MethodExpressionValidator(validator));
}
}
@@ -298,9 +301,7 @@ public class UIComponentELTagUtils
* @since 1.2
*/
public static void setValueBinding(FacesContext context,
- UIComponent component,
- String propName,
- ValueExpression value)
+ UIComponent component, String propName, ValueExpression value)
{
if (value != null)
{
@@ -310,7 +311,9 @@ public class UIComponentELTagUtils
}
else
{
- throw new IllegalArgumentException("Component " + component.getClientId(context) + " attribute " + propName + " must be a value reference, was " + value);
+ throw new IllegalArgumentException("Component "
+ + component.getClientId(context) + " attribute "
+ + propName + " must be a value reference, was " + value);
}
}
}
@@ -319,17 +322,18 @@ public class UIComponentELTagUtils
* @since 1.2
*/
public static void setActionProperty(FacesContext context,
- UIComponent component,
- MethodExpression action)
+ UIComponent component, MethodExpression action)
{
if (action != null)
{
if (!(component instanceof ActionSource2))
{
- throw new IllegalArgumentException("Component " + component.getClientId(context) + " is no ActionSource2");
+ throw new IllegalArgumentException("Component "
+ + component.getClientId(context)
+ + " is no ActionSource2");
}
- ((ActionSource2)component).setActionExpression(action);
+ ((ActionSource2) component).setActionExpression(action);
}
}
@@ -337,17 +341,20 @@ public class UIComponentELTagUtils
* @since 1.2
*/
public static void addActionListenerProperty(FacesContext context,
- UIComponent component,
- MethodExpression actionListener)
+ UIComponent component, MethodExpression actionListener)
{
if (actionListener != null)
{
if (!(component instanceof ActionSource2))
{
- throw new IllegalArgumentException("Component " + component.getClientId(context) + " is no ActionSource");
+ throw new IllegalArgumentException("Component "
+ + component.getClientId(context)
+ + " is no ActionSource");
}
- ((ActionSource2)component).addActionListener(new MethodExpressionActionListener(actionListener));
+ ((ActionSource2) component)
+ .addActionListener(new MethodExpressionActionListener(
+ actionListener));
}
}
@@ -355,48 +362,56 @@ public class UIComponentELTagUtils
* @since 1.2
*/
public static void addValueChangedListenerProperty(FacesContext context,
- UIComponent component,
- MethodExpression valueChangedListener)
+ UIComponent component, MethodExpression valueChangedListener)
{
if (valueChangedListener != null)
{
if (!(component instanceof EditableValueHolder))
{
- throw new IllegalArgumentException("Component " + component.getClientId(context) + " is no EditableValueHolder");
+ throw new IllegalArgumentException("Component "
+ + component.getClientId(context)
+ + " is no EditableValueHolder");
}
- ((EditableValueHolder)component).addValueChangeListener(
- new MethodExpressionValueChangeListener(valueChangedListener));
+ ((EditableValueHolder) component)
+ .addValueChangeListener(new MethodExpressionValueChangeListener(
+ valueChangedListener));
}
}
/**
* @since 1.2
*/
- public static Object evaluateValueExpression(ELContext elContext, ValueExpression valueExpression )
+ public static Object evaluateValueExpression(ELContext elContext,
+ ValueExpression valueExpression)
{
- return valueExpression.isLiteralText() ? valueExpression.getExpressionString() : valueExpression.getValue(elContext);
+ return valueExpression.isLiteralText() ? valueExpression
+ .getExpressionString() : valueExpression.getValue(elContext);
}
/**
* @since 1.2
*/
- public static Boolean getBooleanValue(ELContext elContext, ValueExpression valueExpression)
+ public static Boolean getBooleanValue(ELContext elContext,
+ ValueExpression valueExpression)
{
- if (valueExpression.isLiteralText()){
+ if (valueExpression.isLiteralText())
+ {
return Boolean.valueOf(valueExpression.getExpressionString());
}
-
+
return (Boolean) valueExpression.getValue(elContext);
}
- public static Integer getIntegerValue(ELContext elContext, ValueExpression valueExpression)
+ public static Integer getIntegerValue(ELContext elContext,
+ ValueExpression valueExpression)
{
- if (valueExpression.isLiteralText()){
+ if (valueExpression.isLiteralText())
+ {
return Integer.valueOf(valueExpression.getExpressionString());
}
-
- return (Integer) valueExpression.getValue(elContext);
+
+ return (Integer) valueExpression.getValue(elContext);
}
}
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentTagUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentTagUtils.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentTagUtils.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentTagUtils.java Wed Nov 9 23:40:12 2011
@@ -47,33 +47,32 @@ import org.apache.myfaces.shared.el.Simp
public class UIComponentTagUtils
{
//private static final Log log = LogFactory.getLog(UIComponentTagUtils.class);
- private static final Logger log = Logger.getLogger(UIComponentTagUtils.class.getName());
+ private static final Logger log = Logger
+ .getLogger(UIComponentTagUtils.class.getName());
- private static final Class[] VALIDATOR_ARGS = {FacesContext.class,
- UIComponent.class,
- Object.class};
- private static final Class[] ACTION_LISTENER_ARGS = {ActionEvent.class};
- private static final Class[] VALUE_LISTENER_ARGS = {ValueChangeEvent.class};
-
- private UIComponentTagUtils() {} //util class, no instantiation allowed
+ private static final Class[] VALIDATOR_ARGS = { FacesContext.class,
+ UIComponent.class, Object.class };
+ private static final Class[] ACTION_LISTENER_ARGS = { ActionEvent.class };
+ private static final Class[] VALUE_LISTENER_ARGS = { ValueChangeEvent.class };
+ private UIComponentTagUtils()
+ {
+ } //util class, no instantiation allowed
public static boolean isValueReference(String v)
{
return UIComponentTag.isValueReference(v);
}
-
public static void setIntegerProperty(FacesContext context,
- UIComponent component,
- String propName,
- String value)
+ UIComponent component, String propName, String value)
{
if (value != null)
{
if (isValueReference(value))
{
- ValueBinding vb = context.getApplication().createValueBinding(value);
+ ValueBinding vb = context.getApplication().createValueBinding(
+ value);
component.setValueBinding(propName, vb);
}
else
@@ -85,15 +84,14 @@ public class UIComponentTagUtils
}
public static void setLongProperty(FacesContext context,
- UIComponent component,
- String propName,
- String value)
+ UIComponent component, String propName, String value)
{
if (value != null)
{
if (isValueReference(value))
{
- ValueBinding vb = context.getApplication().createValueBinding(value);
+ ValueBinding vb = context.getApplication().createValueBinding(
+ value);
component.setValueBinding(propName, vb);
}
else
@@ -105,15 +103,14 @@ public class UIComponentTagUtils
}
public static void setStringProperty(FacesContext context,
- UIComponent component,
- String propName,
- String value)
+ UIComponent component, String propName, String value)
{
if (value != null)
{
if (isValueReference(value))
{
- ValueBinding vb = context.getApplication().createValueBinding(value);
+ ValueBinding vb = context.getApplication().createValueBinding(
+ value);
component.setValueBinding(propName, vb);
}
else
@@ -124,17 +121,15 @@ public class UIComponentTagUtils
}
}
-
public static void setBooleanProperty(FacesContext context,
- UIComponent component,
- String propName,
- String value)
+ UIComponent component, String propName, String value)
{
if (value != null)
{
if (isValueReference(value))
{
- ValueBinding vb = context.getApplication().createValueBinding(value);
+ ValueBinding vb = context.getApplication().createValueBinding(
+ value);
component.setValueBinding(propName, vb);
}
else
@@ -145,51 +140,51 @@ public class UIComponentTagUtils
}
}
-
public static void setValueProperty(FacesContext context,
- UIComponent component,
- String value)
+ UIComponent component, String value)
{
if (value != null)
{
if (isValueReference(value))
{
- ValueBinding vb = context.getApplication().createValueBinding(value);
- component.setValueBinding(org.apache.myfaces.shared.renderkit.JSFAttr.VALUE_ATTR, vb);
+ ValueBinding vb = context.getApplication().createValueBinding(
+ value);
+ component.setValueBinding(
+ org.apache.myfaces.shared.renderkit.JSFAttr.VALUE_ATTR,
+ vb);
}
else if (component instanceof UICommand)
{
- ((UICommand)component).setValue(value);
+ ((UICommand) component).setValue(value);
}
else if (component instanceof UIParameter)
{
- ((UIParameter)component).setValue(value);
+ ((UIParameter) component).setValue(value);
}
else if (component instanceof UISelectBoolean)
{
- ((UISelectBoolean)component).setValue(Boolean.valueOf(value));
+ ((UISelectBoolean) component).setValue(Boolean.valueOf(value));
}
else if (component instanceof UIGraphic)
{
- ((UIGraphic)component).setValue(value);
+ ((UIGraphic) component).setValue(value);
}
//Since many input components are ValueHolders the special components
//must come first, ValueHolder is the last resort.
else if (component instanceof ValueHolder)
{
- ((ValueHolder)component).setValue(value);
+ ((ValueHolder) component).setValue(value);
}
else
{
- log.severe("Component " + component.getClass().getName() + " is no ValueHolder, cannot set value.");
+ log.severe("Component " + component.getClass().getName()
+ + " is no ValueHolder, cannot set value.");
}
}
}
-
public static void setConverterProperty(FacesContext context,
- UIComponent component,
- String value)
+ UIComponent component, String value)
{
if (value != null)
{
@@ -197,75 +192,85 @@ public class UIComponentTagUtils
{
if (isValueReference(value))
{
- ValueBinding vb = context.getApplication().createValueBinding(value);
- component.setValueBinding(org.apache.myfaces.shared.renderkit.JSFAttr.CONVERTER_ATTR, vb);
+ ValueBinding vb = context.getApplication()
+ .createValueBinding(value);
+ component
+ .setValueBinding(
+ org.apache.myfaces.shared.renderkit.JSFAttr.CONVERTER_ATTR,
+ vb);
}
else
{
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Converter converter = facesContext.getApplication().createConverter(value);
- ((ValueHolder)component).setConverter(converter);
+ FacesContext facesContext = FacesContext
+ .getCurrentInstance();
+ Converter converter = facesContext.getApplication()
+ .createConverter(value);
+ ((ValueHolder) component).setConverter(converter);
}
}
else
{
- log.severe("Component " + component.getClass().getName() + " is no ValueHolder, cannot set value.");
+ log.severe("Component " + component.getClass().getName()
+ + " is no ValueHolder, cannot set value.");
}
}
}
-
public static void setValidatorProperty(FacesContext context,
- UIComponent component,
- String validator)
+ UIComponent component, String validator)
{
if (validator != null)
{
if (!(component instanceof EditableValueHolder))
{
- throw new IllegalArgumentException("Component " + component.getClientId(context) + " is no EditableValueHolder");
+ throw new IllegalArgumentException("Component "
+ + component.getClientId(context)
+ + " is no EditableValueHolder");
}
if (isValueReference(validator))
{
- MethodBinding mb = context.getApplication().createMethodBinding(validator,
- VALIDATOR_ARGS);
- ((EditableValueHolder)component).setValidator(mb);
+ MethodBinding mb = context.getApplication()
+ .createMethodBinding(validator, VALIDATOR_ARGS);
+ ((EditableValueHolder) component).setValidator(mb);
}
else
{
- log.severe("Component " + component.getClientId(context) + " has invalid validation expression " + validator);
+ log.severe("Component " + component.getClientId(context)
+ + " has invalid validation expression " + validator);
}
}
}
public static void setValueBinding(FacesContext context,
- UIComponent component,
- String propName,
- String value)
+ UIComponent component, String propName, String value)
{
if (value != null)
{
if (isValueReference(value))
{
- ValueBinding vb = context.getApplication().createValueBinding(value);
+ ValueBinding vb = context.getApplication().createValueBinding(
+ value);
component.setValueBinding(propName, vb);
}
else
{
- throw new IllegalArgumentException("Component " + component.getClientId(context) + " attribute " + propName + " must be a value reference, was " + value);
+ throw new IllegalArgumentException("Component "
+ + component.getClientId(context) + " attribute "
+ + propName + " must be a value reference, was " + value);
}
}
}
public static void setActionProperty(FacesContext context,
- UIComponent component,
- String action)
+ UIComponent component, String action)
{
if (action != null)
{
if (!(component instanceof ActionSource))
{
- throw new IllegalArgumentException("Component " + component.getClientId(context) + " is no ActionSource");
+ throw new IllegalArgumentException("Component "
+ + component.getClientId(context)
+ + " is no ActionSource");
}
MethodBinding mb;
if (isValueReference(action))
@@ -276,24 +281,26 @@ public class UIComponentTagUtils
{
mb = new SimpleActionMethodBinding(action);
}
- ((ActionSource)component).setAction(mb);
+ ((ActionSource) component).setAction(mb);
}
}
public static void setActionListenerProperty(FacesContext context,
- UIComponent component,
- String actionListener)
+ UIComponent component, String actionListener)
{
if (actionListener != null)
{
if (!(component instanceof ActionSource))
{
- throw new IllegalArgumentException("Component " + component.getClientId(context) + " is no ActionSource");
+ throw new IllegalArgumentException("Component "
+ + component.getClientId(context)
+ + " is no ActionSource");
}
if (isValueReference(actionListener))
{
- MethodBinding mb = context.getApplication().createMethodBinding(actionListener,
- ACTION_LISTENER_ARGS);
+ MethodBinding mb = context.getApplication()
+ .createMethodBinding(actionListener,
+ ACTION_LISTENER_ARGS);
/**
if(! Void.class.equals(mb.getType(context)))
@@ -304,29 +311,33 @@ public class UIComponentTagUtils
}
*/
- ((ActionSource)component).setActionListener(mb);
+ ((ActionSource) component).setActionListener(mb);
}
else
{
- log.severe("Component " + component.getClientId(context) + " has invalid actionListener value: " + actionListener);
+ log.severe("Component " + component.getClientId(context)
+ + " has invalid actionListener value: "
+ + actionListener);
}
}
}
public static void setValueChangedListenerProperty(FacesContext context,
- UIComponent component,
- String valueChangedListener)
+ UIComponent component, String valueChangedListener)
{
if (valueChangedListener != null)
{
if (!(component instanceof EditableValueHolder))
{
- throw new IllegalArgumentException("Component " + component.getClientId(context) + " is no EditableValueHolder");
+ throw new IllegalArgumentException("Component "
+ + component.getClientId(context)
+ + " is no EditableValueHolder");
}
if (isValueReference(valueChangedListener))
{
- MethodBinding mb = context.getApplication().createMethodBinding(valueChangedListener,
- VALUE_LISTENER_ARGS);
+ MethodBinding mb = context.getApplication()
+ .createMethodBinding(valueChangedListener,
+ VALUE_LISTENER_ARGS);
/**
if(! Void.class.equals(mb.getType(context)))
{
@@ -336,11 +347,13 @@ public class UIComponentTagUtils
}
*/
- ((EditableValueHolder)component).setValueChangeListener(mb);
+ ((EditableValueHolder) component).setValueChangeListener(mb);
}
else
{
- log.severe("Component " + component.getClientId(context) + " has invalid valueChangedListener expression " + valueChangedListener);
+ log.severe("Component " + component.getClientId(context)
+ + " has invalid valueChangedListener expression "
+ + valueChangedListener);
}
}
}
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/BiLevelCacheMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/BiLevelCacheMap.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/BiLevelCacheMap.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/BiLevelCacheMap.java Wed Nov 9 23:40:12 2011
@@ -67,14 +67,16 @@ public abstract class BiLevelCacheMap im
public boolean isEmpty()
{
- synchronized (_cacheL2) {
+ synchronized (_cacheL2)
+ {
return _cacheL1.isEmpty() && _cacheL2.isEmpty();
}
}
public void clear()
{
- synchronized (_cacheL2) {
+ synchronized (_cacheL2)
+ {
_cacheL1 = new HashMap(); // dafault size
_cacheL2.clear();
}
@@ -82,14 +84,16 @@ public abstract class BiLevelCacheMap im
public boolean containsKey(Object key)
{
- synchronized (_cacheL2) {
+ synchronized (_cacheL2)
+ {
return _cacheL1.containsKey(key) || _cacheL2.containsKey(key);
}
}
public boolean containsValue(Object value)
{
- synchronized (_cacheL2) {
+ synchronized (_cacheL2)
+ {
return _cacheL1.containsValue(value) || _cacheL2.containsValue(value);
}
}
@@ -117,14 +121,16 @@ public abstract class BiLevelCacheMap im
// Has another thread merged caches while we were waiting on the mutex? Then check L1 again
if (cacheL1 != _cacheL1)
{
- if ((retval = _cacheL1.get(key)) != null)
+ retval = _cacheL1.get(key);
+ if (retval != null)
{
// do not update miss count (it is not a miss anymore)
return retval;
}
}
- if ((retval = _cacheL2.get(key)) == null)
+ retval = _cacheL2.get(key);
+ if (retval == null)
{
retval = newInstance(key);
if (retval != null)
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/ClassLoaderExtension.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/ClassLoaderExtension.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/ClassLoaderExtension.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/ClassLoaderExtension.java Wed Nov 9 23:40:12 2011
@@ -23,14 +23,16 @@ package org.apache.myfaces.shared.util;
*
* @author Werner Punz
*/
-public class ClassLoaderExtension {
+public class ClassLoaderExtension
+{
/**
* standard forName for the loader
*
* @param name
* @return
*/
- public Class forName(String name) {
+ public Class forName(String name)
+ {
return null;
}
}
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/ExceptionUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/ExceptionUtils.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/ExceptionUtils.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/ExceptionUtils.java Wed Nov 9 23:40:12 2011
@@ -36,8 +36,9 @@ public final class ExceptionUtils
/**
* <p>
* returns a list of all throwables (including the one you passed in) wrapped by the given throwable.
- * In contrast to a simple call to <code>getClause()</code> on each throwable it will also check if the throwable class
- * contain a method <code>getRootCause()</code> (e.g. ServletException or JspException) and call it instead.
+ * In contrast to a simple call to <code>getClause()</code> on each throwable it will also check if
+ * the throwable class contain a method <code>getRootCause()</code> (e.g. ServletException or JspException)
+ * and call it instead.
* </p>
* <p>
* The first list element will your passed in exception, the last list element is the cause.
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/HashMapUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/HashMapUtils.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/HashMapUtils.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/HashMapUtils.java Wed Nov 9 23:40:12 2011
@@ -76,7 +76,8 @@ public class HashMapUtils
/**
* spit out each name/value pair
*/
- public static String mapToString(Map map){
+ public static String mapToString(Map map)
+ {
Set entries = map.entrySet();
Iterator iter = entries.iterator();
StringBuffer buff = new StringBuffer();
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/NullEnumeration.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/NullEnumeration.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/NullEnumeration.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/NullEnumeration.java Wed Nov 9 23:40:12 2011
@@ -29,11 +29,11 @@ import java.util.NoSuchElementException;
*/
public final class NullEnumeration implements Enumeration
{
- private static final NullEnumeration s_nullEnumeration = new NullEnumeration();
+ private static final NullEnumeration NULL_ENUMERATION = new NullEnumeration();
public static final NullEnumeration instance()
{
- return s_nullEnumeration;
+ return NULL_ENUMERATION;
}
public boolean hasMoreElements()
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/SelectItemsIterator.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/SelectItemsIterator.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/SelectItemsIterator.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/SelectItemsIterator.java Wed Nov 9 23:40:12 2011
@@ -69,7 +69,8 @@ public class SelectItemsIterator impleme
public SelectItemsIterator(UIComponent selectItemsParent, FacesContext facesContext)
{
- _children = selectItemsParent.getChildCount() > 0 ? selectItemsParent.getChildren().iterator() : _EMPTY_UICOMPONENT_ITERATOR;
+ _children = selectItemsParent.getChildCount() > 0 ?
+ selectItemsParent.getChildren().iterator() : _EMPTY_UICOMPONENT_ITERATOR;
_facesContext = facesContext;
}
@@ -136,7 +137,8 @@ public class SelectItemsIterator impleme
ValueExpression expression = uiSelectItem.getValueExpression("value");
throw new IllegalArgumentException("ValueExpression '"
+ (expression == null ? null : expression.getExpressionString()) + "' of UISelectItem : "
- + RendererUtils.getPathToComponent(child) + " does not reference an Object of type SelectItem");
+ + RendererUtils.getPathToComponent(child) +
+ " does not reference an Object of type SelectItem");
}
_nextItem = (SelectItem) item;
return true;