SECTION: Modified Files
----------------------------
M jsf-api/src/javax/faces/application/FacesMessage.java
M jsf-api/src/javax/faces/event/PhaseEvent.java
- fixed potential serialization issues. Both classes had a non
transient field referring to an
object that is not serializable. Changed these fields to be
primitive int and update class
logic to reconstruct the object based on the int value.
M jsf-api/src/javax/faces/model/ResultSetDataModel.java
- inner class, ResultSetMap was serializable, but the
parent class was not. Instead of extending TreeMap,
extend AbstractMap and use a TreeMap as a backing map.
M jsf-api/template-src/MethodExpressionMethodBindingAdapter.java
- made the MethodInfo field 'info' transient.
M jsf-ri/src/com/sun/faces/RIConstants.java
- removed mutable fields IS_UNIT_TEST_MODE, HTML_TLV_ACTIVE,
CORE_TLV_ACTIVE
M jsf-ri/src/com/sun/faces/config/ConfigureListener.java
M jsf-ri/src/com/sun/faces/context/ExternalContextImpl.java
M jsf-ri/src/com/sun/faces/taglib/html_basic/HtmlBasicValidator.java
M jsf-ri/src/com/sun/faces/taglib/jsf_core/CoreValidator.java
M jsf-ri/test/com/sun/faces/FacesTestCaseService.java
M jsf-ri/test/com/sun/faces/config/StoreServletContext.java
M jsf-ri/test/com/sun/faces/lifecycle/TestLifecycleImpl.java
M jsf-ri/test/com/sun/faces/taglib/jsf_core/TestCoreTagsVBEnabled.java
M jsf-ri/test/com/sun/faces/taglib/jsf_core/TestValidatorTags.java
- removed references to the fields removed in RIConstants - now call
the methods added to Util to
achieve the same effect
M jsf-ri/src/com/sun/faces/el/ELConstants.java
M jsf-ri/src/com/sun/faces/el/ImplicitObjectELResolver.java
- moved IMPLICIT_OBJECTS array to ImplicitObjectELResolver
M jsf-ri/src/com/sun/faces/el/ImplicitObjectELResolverForJsp.java
- extend ImplicitObjectELResolver to obtain access to IMPLICIT_OBJECTS
M jsf-ri/src/com/sun/faces/renderkit/html_basic/ButtonRenderer.java
- delegate null check to String.equals()
M jsf-ri/src/com/sun/faces/util/DebugUtil.java
- removed unecessary null check
M jsf-ri/src/com/sun/faces/util/Util.java
- added private constants and methods for accessing said constants
in place of the mutable references in RIConstants.
- Removed == equality check (though technically it was ok)
M jsf-tools/build.xml
- added source="1.4" to use 1.4 assertion facility
M jsf-tools/src/com/sun/faces/config/rules/AttributeRule.java
M jsf-tools/src/com/sun/faces/config/rules/ComponentRule.java
M jsf-tools/src/com/sun/faces/config/rules/ConverterRule.java
M jsf-tools/src/com/sun/faces/config/rules/DescriptionTextRule.java
M jsf-tools/src/com/sun/faces/config/rules/ListEntriesRule.java
M jsf-tools/src/com/sun/faces/config/rules/MapEntriesRule.java
M jsf-tools/src/com/sun/faces/config/rules/MapEntryRule.java
M jsf-tools/src/com/sun/faces/config/rules/NavigationCaseRule.java
M jsf-tools/src/com/sun/faces/config/rules/NavigationRuleRule.java
M jsf-tools/src/com/sun/faces/config/rules/PropertyRule.java
M jsf-tools/src/com/sun/faces/config/rules/ReferencedBeanRule.java
M jsf-tools/src/com/sun/faces/config/rules/RenderKitRule.java
M jsf-tools/src/com/sun/faces/config/rules/RendererRule.java
M jsf-tools/src/com/sun/faces/config/rules/ValidatorRule.java
- replace casting check for stack sanity check with assert keyword.
SECTION: Diffs
----------------------------
Index: jsf-api/src/javax/faces/application/FacesMessage.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-api/src/javax/faces/application/FacesMessage.java,v
retrieving revision 1.12
diff -u -r1.12 FacesMessage.java
--- jsf-api/src/javax/faces/application/FacesMessage.java 19 May 2005
13:26:56 -0000 1.12
+++ jsf-api/src/javax/faces/application/FacesMessage.java 23 May 2005
20:12:31 -0000
@@ -122,7 +122,16 @@
*/
private static final Severity[] values =
{ SEVERITY_INFO, SEVERITY_WARN, SEVERITY_ERROR, SEVERITY_FATAL };
-
+
+ private static Map severityOrdinalMap = null;
+ static {
+ severityOrdinalMap = new HashMap();
+ for (int i = 0, size = values.length; i < size; i++) {
+ severityOrdinalMap.put(new Integer(values[i].getOrdinal()),
+ values[i]);
+ }
+ }
+
/**
* <p>Immutable <code>List</code> of valid {_at_link
javax.faces.application.FacesMessage.Severity}
@@ -146,8 +155,7 @@
*/
public final static Map VALUES_MAP =
Collections.unmodifiableMap(_MODIFIABLE_MAP);
-
- private static final long serialVersionUID = -1180773928220076822L;
+ private static final long serialVersionUID = -3578142643126324601L;
// ------------------------------------------------------------
Constructors
@@ -221,7 +229,7 @@
// ------------------------------------------------------ Instance
Variables
- private Severity severity = FacesMessage.SEVERITY_INFO;
+ private int severity = FacesMessage.SEVERITY_INFO.getOrdinal();
private String summary = null;
private String detail = null;
@@ -261,8 +269,8 @@
* <p>Return the severity level.</p>
*/
public Severity getSeverity() {
-
- return (this.severity);
+
+ return ((Severity) severityOrdinalMap.get(new Integer(severity)));
}
@@ -276,12 +284,13 @@
* is not one of the supported values
*/
public void setSeverity(Severity severity) {
-
- if ((severity.getOrdinal() < SEVERITY_INFO.getOrdinal()) ||
- (severity.getOrdinal() > SEVERITY_FATAL.getOrdinal())) {
+
+ int tempSeverity = severity.getOrdinal();
+ if ((tempSeverity < SEVERITY_INFO.getOrdinal()) ||
+ (tempSeverity > SEVERITY_FATAL.getOrdinal())) {
throw new IllegalArgumentException("" + severity);
}
- this.severity = severity;
+ this.severity = tempSeverity;
}
Index: jsf-api/src/javax/faces/event/PhaseEvent.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-api/src/javax/faces/event/PhaseEvent.java,v
retrieving revision 1.4
diff -u -r1.4 PhaseEvent.java
--- jsf-api/src/javax/faces/event/PhaseEvent.java 26 Feb 2004
20:31:01 -0000 1.4
+++ jsf-api/src/javax/faces/event/PhaseEvent.java 23 May 2005
20:12:31 -0000
@@ -11,6 +11,9 @@
import java.util.EventObject;
+import java.util.Map;
+import java.util.HashMap;
+
import javax.faces.context.FacesContext;
import javax.faces.lifecycle.Lifecycle;
@@ -23,6 +26,17 @@
public class PhaseEvent extends EventObject {
+ private static Map phaseOrdinalMap;
+ static {
+ phaseOrdinalMap = new HashMap();
+ for (int i = 0, size = PhaseId.VALUES.size(); i < size; i++) {
+ PhaseId current = (PhaseId) PhaseId.VALUES.get(i);
+ phaseOrdinalMap.put(
+ new Integer(current.getOrdinal()),
+ current);
+ }
+ }
+
// -----------------------------------------------------------
Constructors
@@ -45,7 +59,7 @@
if ( phaseId == null || context == null || lifecycle == null) {
throw new NullPointerException();
}
- this.phaseId = phaseId;
+ this.phaseId = phaseId.getOrdinal();
this.context = context;
}
@@ -65,7 +79,7 @@
}
- private PhaseId phaseId = null;
+ private int phaseId;
/**
@@ -74,7 +88,7 @@
*/
public PhaseId getPhaseId() {
- return (this.phaseId);
+ return ((PhaseId) phaseOrdinalMap.get(new Integer(phaseId)));
}
Index: jsf-api/src/javax/faces/model/ResultSetDataModel.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-api/src/javax/faces/model/ResultSetDataModel.java,v
retrieving revision 1.30
diff -u -r1.30 ResultSetDataModel.java
--- jsf-api/src/javax/faces/model/ResultSetDataModel.java 20 May 2005
14:49:55 -0000 1.30
+++ jsf-api/src/javax/faces/model/ResultSetDataModel.java 23 May 2005
20:12:31 -0000
@@ -21,6 +21,7 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
+import java.util.AbstractMap;
import javax.faces.FacesException;
@@ -328,16 +329,17 @@
// Private implementation of Map that delegates column get and put
// operations to the underlying ResultSet, after setting the required
// row index
- private class ResultSetMap extends TreeMap {
+ private class ResultSetMap extends AbstractMap {
+
+ private TreeMap backingMap;
public ResultSetMap(Comparator comparator) throws SQLException {
- super(comparator);
+ backingMap = new TreeMap(comparator);
index = ResultSetDataModel.this.index;
resultSet.absolute(index + 1);
- int n = metadata.getColumnCount();
- for (int i = 1; i <= n; i++) {
- super.put(metadata.getColumnName(i),
- metadata.getColumnName(i));
+ for (int i = 1, n = metadata.getColumnCount(); i <= n; i++) {
+ backingMap.put(metadata.getColumnName(i),
+ metadata.getColumnName(i));
}
}
@@ -366,6 +368,22 @@
return (false);
}
+
+ public boolean containsKey(Object key) {
+ return backingMap.containsKey(key);
+ }
+
+
+ public int size() {
+ return backingMap.size();
+ }
+
+
+ public boolean isEmpty() {
+ return backingMap.isEmpty();
+ }
+
+
public Set entrySet() {
return (new ResultSetEntries(this));
}
@@ -413,7 +431,7 @@
public void putAll(Map map) {
for (Iterator i = map.entrySet().iterator(); i.hasNext(); ) {
Map.Entry entry = (Map.Entry) i.next();
- put(entry.getKey(), entry.getValue());
+ backingMap.put(entry.getKey(), entry.getValue());
}
}
@@ -427,11 +445,11 @@
}
Object realKey(Object key) {
- return (super.get(key));
+ return (backingMap.get(key));
}
Iterator realKeys() {
- return (super.keySet().iterator());
+ return (backingMap.keySet().iterator());
}
}
Index: jsf-api/template-src/MethodExpressionMethodBindingAdapter.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-api/template-src/MethodExpressionMethodBindingAdapter.java,v
retrieving revision 1.2
diff -u -r1.2 MethodExpressionMethodBindingAdapter.java
--- jsf-api/template-src/MethodExpressionMethodBindingAdapter.java 19
May 2005 13:26:58 -0000 1.2
+++ jsf-api/template-src/MethodExpressionMethodBindingAdapter.java 23
May 2005 20:12:32 -0000
@@ -41,7 +41,7 @@
// Methods from MethodExpression
//
- private MethodInfo info = null;
+ private transient MethodInfo info = null;
public MethodInfo getMethodInfo(ELContext context) throws ELException {
assert(null != binding);
Index: jsf-ri/src/com/sun/faces/RIConstants.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/RIConstants.java,v
retrieving revision 1.73
diff -u -r1.73 RIConstants.java
--- jsf-ri/src/com/sun/faces/RIConstants.java 16 May 2005 20:16:13
-0000 1.73
+++ jsf-ri/src/com/sun/faces/RIConstants.java 23 May 2005 20:12:33 -0000
@@ -106,8 +106,6 @@
public static final String PARAM_VALUES_IMPLICIT_OBJ = "paramValues";
public static final String VIEW_IMPLICIT_OBJ = "view";
- public static boolean IS_UNIT_TEST_MODE = false;
-
/*
* <p>TLV Resource Bundle Location </p>
*/
@@ -115,10 +113,8 @@
FACES_PREFIX + "resources.Resources";
public static final Object NO_VALUE = "";
-
- public static boolean HTML_TLV_ACTIVE = true;
- public static boolean CORE_TLV_ACTIVE = true;
- public static final String CORE_NAMESPACE =
+
+ public static final String CORE_NAMESPACE =
"
http://java.sun.com/jsf/core";
public static final String HTML_NAMESPACE =
"
http://java.sun.com/jsf/html";
Index: jsf-ri/src/com/sun/faces/config/ConfigureListener.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/config/ConfigureListener.java,v
retrieving revision 1.35
diff -u -r1.35 ConfigureListener.java
--- jsf-ri/src/com/sun/faces/config/ConfigureListener.java 20 May
2005 14:49:58 -0000 1.35
+++ jsf-ri/src/com/sun/faces/config/ConfigureListener.java 23 May
2005 20:12:34 -0000
@@ -229,7 +229,7 @@
};
static ThreadLocal getThreadLocalExternalContext() {
- if (RIConstants.IS_UNIT_TEST_MODE) {
+ if (Util.isUnitTestModeEnabled()) {
return tlsExternalContext;
}
return null;
@@ -280,7 +280,7 @@
// see if we're operating in the unit test environment
try {
- if (RIConstants.IS_UNIT_TEST_MODE) {
+ if (Util.isUnitTestModeEnabled()) {
// if so, put the fcb in the servletContext
context.setAttribute(FACES_CONFIG_BEAN_KEY, fcb);
}
@@ -292,8 +292,8 @@
}
// see if we need to disable our TLValidator
- RIConstants.HTML_TLV_ACTIVE =
- isFeatureEnabled(context, ENABLE_HTML_TLV);
+ Util.setHtmlTLVActive(
+ isFeatureEnabled(context, ENABLE_HTML_TLV));
URL url = null;
if (log.isDebugEnabled()) {
@@ -1338,13 +1338,11 @@
if (jspFactory == null) {
return;
}
- if (jspFactory.getDefaultFactory() == null) {
- return;
- }
+
try {
jspFactory.getClass().getMethod("getJspApplicationContext",
new Class[] {
ServletContext.class });
- } catch (Exception e) {
+ } catch (NoSuchMethodException nsme) {
log.warn(Util.getExceptionMessage(Util.INCORRECT_JSP_VERSION_ID,
new Object [] {
"getJspApplicationContext" }));
return;
Index: jsf-ri/src/com/sun/faces/context/ExternalContextImpl.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/context/ExternalContextImpl.java,v
retrieving revision 1.31
diff -u -r1.31 ExternalContextImpl.java
--- jsf-ri/src/com/sun/faces/context/ExternalContextImpl.java 20 May
2005 14:49:59 -0000 1.31
+++ jsf-ri/src/com/sun/faces/context/ExternalContextImpl.java 23 May
2005 20:12:36 -0000
@@ -86,7 +86,7 @@
// PENDING(edburns): Craig's workaround breaks
// TestValidatorTags.java because Cactus expects a certain type
// to be present for the value of the request.
- if (RIConstants.IS_UNIT_TEST_MODE) {
+ if (Util.isUnitTestModeEnabled()) {
this.request = request;
} else {
// PENDING(craigmcc) - Work around a Tomcat 4.1 and 5.0 bug
Index: jsf-ri/src/com/sun/faces/el/ELConstants.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/el/ELConstants.java,v
retrieving revision 1.1
diff -u -r1.1 ELConstants.java
--- jsf-ri/src/com/sun/faces/el/ELConstants.java 5 May 2005 20:51:22
-0000 1.1
+++ jsf-ri/src/com/sun/faces/el/ELConstants.java 23 May 2005 20:12:36
-0000
@@ -10,9 +10,7 @@
/**
* @author jhook
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
+ *
*/
public interface ELConstants {
public static final int APPLICATION = 0;
@@ -42,9 +40,5 @@
public static final int SESSION_SCOPE = 12;
public static final int VIEW = 13;
-
- public static final String[] IMPLICIT_OBJECTS = new String[] {
- "application", "applicationScope", "cookie", "facesContext",
- "header", "headerValues", "initParam", "param", "paramValues",
- "request", "requestScope", "session", "sessionScope", "view" };
+
}
Index: jsf-ri/src/com/sun/faces/el/ImplicitObjectELResolver.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/el/ImplicitObjectELResolver.java,v
retrieving revision 1.1
diff -u -r1.1 ImplicitObjectELResolver.java
--- jsf-ri/src/com/sun/faces/el/ImplicitObjectELResolver.java 5 May
2005 20:51:22 -0000 1.1
+++ jsf-ri/src/com/sun/faces/el/ImplicitObjectELResolver.java 23 May
2005 20:12:36 -0000
@@ -8,28 +8,30 @@
package com.sun.faces.el;
-import java.util.Arrays;
+import java.beans.FeatureDescriptor;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.Map;
-import java.beans.FeatureDescriptor;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.component.UIViewRoot;
-import javax.el.ELException;
-import javax.el.PropertyNotWritableException;
-import javax.el.PropertyNotFoundException;
-import javax.el.PropertyNotFoundException;
import javax.el.ELContext;
+import javax.el.ELException;
import javax.el.ELResolver;
+import javax.el.PropertyNotFoundException;
+import javax.el.PropertyNotWritableException;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
-import com.sun.faces.el.ELConstants;
import com.sun.faces.util.Util;
public class ImplicitObjectELResolver extends ELResolver implements
ELConstants{
+ static final String[] IMPLICIT_OBJECTS = new String[] {
+ "application", "applicationScope", "cookie", "facesContext",
+ "header", "headerValues", "initParam", "param", "paramValues",
+ "request", "requestScope", "session", "sessionScope", "view" };
+
public ImplicitObjectELResolver() {
}
@@ -40,7 +42,7 @@
if (base != null) {
return null;
}
- if ( base == null && property == null) {
+ if (property == null) {
String message = Util.getExceptionMessageString
(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID);
message = message + " base " + base + " property " + property;
@@ -108,7 +110,7 @@
if (base != null) {
return;
}
- if ( base == null && property == null) {
+ if (property == null) {
String message = Util.getExceptionMessageString
(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID);
message = message + " base " + base + " property " + property;
@@ -116,7 +118,7 @@
}
int index = Arrays.binarySearch(IMPLICIT_OBJECTS, property);
- if ((base == null) && (index > 0)) {
+ if (index > 0) {
throw new PropertyNotWritableException((String)property);
}
}
@@ -126,7 +128,7 @@
if (base != null) {
return false;
}
- if ( base == null && property == null) {
+ if (property == null) {
String message = Util.getExceptionMessageString
(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID);
message = message + " base " + base + " property " + property;
@@ -134,7 +136,7 @@
}
int index = Arrays.binarySearch(IMPLICIT_OBJECTS, property);
- if ((base == null) && (index > 0)) {
+ if (index > 0) {
context.setPropertyResolved(true);
return true;
}
@@ -146,7 +148,7 @@
if (base != null) {
return null;
}
- if ( base == null && property == null) {
+ if (property == null) {
String message = Util.getExceptionMessageString
(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID);
message = message + " base " + base + " property " + property;
@@ -154,7 +156,7 @@
}
int index = Arrays.binarySearch(IMPLICIT_OBJECTS, property);
- if ((base == null) && (index > 0)) {
+ if (index > 0) {
context.setPropertyResolved(true);
}
return null;
@@ -204,7 +206,7 @@
}
return String.class;
}
-
+
private FeatureDescriptor getFeatureDescriptor(String name, String
displayName, String desc, boolean expert, boolean hidden,
boolean preferred, Object type, Boolean designTime) {
Index: jsf-ri/src/com/sun/faces/el/ImplicitObjectELResolverForJsp.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/el/ImplicitObjectELResolverForJsp.java,v
retrieving revision 1.1
diff -u -r1.1 ImplicitObjectELResolverForJsp.java
--- jsf-ri/src/com/sun/faces/el/ImplicitObjectELResolverForJsp.java 5
May 2005 20:51:23 -0000 1.1
+++ jsf-ri/src/com/sun/faces/el/ImplicitObjectELResolverForJsp.java
23 May 2005 20:12:36 -0000
@@ -22,8 +22,7 @@
import com.sun.faces.util.Util;
-public class ImplicitObjectELResolverForJsp extends ELResolver implements
- ELConstants{
+public class ImplicitObjectELResolverForJsp extends
ImplicitObjectELResolver {
public ImplicitObjectELResolverForJsp() {
}
@@ -35,7 +34,7 @@
if (base != null) {
return null;
}
- if ( base == null && property == null) {
+ if (property == null) {
String message = Util.getExceptionMessageString
(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID);
message = message + " base " + base + " property " + property;
@@ -67,7 +66,7 @@
if (base != null) {
return null;
}
- if ( base == null && property == null) {
+ if (property == null) {
String message = Util.getExceptionMessageString
(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID);
message = message + " base " + base + " property " + property;
@@ -80,9 +79,9 @@
}
switch (index) {
case FACES_CONTEXT:
- context.setPropertyResolved(true);
case VIEW:
context.setPropertyResolved(true);
+ return null;
default:
return null;
}
@@ -93,7 +92,7 @@
if (base != null) {
return;
}
- if ( base == null && property == null) {
+ if (property == null) {
String message = Util.getExceptionMessageString
(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID);
message = message + " base " + base + " property " + property;
@@ -120,7 +119,7 @@
if (base != null) {
return false;
}
- if ( base == null && property == null) {
+ if (property == null) {
String message = Util.getExceptionMessageString
(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID);
message = message + " base " + base + " property " + property;
Index: jsf-ri/src/com/sun/faces/renderkit/html_basic/ButtonRenderer.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/ButtonRenderer.java,v
retrieving revision 1.86
diff -u -r1.86 ButtonRenderer.java
--- jsf-ri/src/com/sun/faces/renderkit/html_basic/ButtonRenderer.java
16 May 2005 20:16:25 -0000 1.86
+++ jsf-ri/src/com/sun/faces/renderkit/html_basic/ButtonRenderer.java
23 May 2005 20:12:36 -0000
@@ -299,13 +299,11 @@
String
rendererType = curNode.getRendererType(),
family = curNode.getFamily();
- if (null != rendererType &&
- rendererType.equals("javax.faces.Link") &&
- null != family &
- family.equals("javax.faces.Command")) {
- keepGoing = false;
-
- }
+ if ("javax.faces.Link".equals(rendererType)
+ && "javax.faces.Command".equals(family)) {
+ keepGoing = false;
+
+ }
return keepGoing;
}
};
Index: jsf-ri/src/com/sun/faces/taglib/html_basic/HtmlBasicValidator.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/taglib/html_basic/HtmlBasicValidator.java,v
retrieving revision 1.13
diff -u -r1.13 HtmlBasicValidator.java
--- jsf-ri/src/com/sun/faces/taglib/html_basic/HtmlBasicValidator.java
2 Dec 2004 18:42:23 -0000 1.13
+++ jsf-ri/src/com/sun/faces/taglib/html_basic/HtmlBasicValidator.java
23 May 2005 20:12:36 -0000
@@ -12,11 +12,10 @@
import com.sun.faces.taglib.FacesValidator;
import com.sun.faces.taglib.ValidatorInfo;
import com.sun.faces.util.Util;
+
import org.xml.sax.Attributes;
import org.xml.sax.helpers.DefaultHandler;
-import com.sun.faces.RIConstants;
-
/**
* <p>Top level validator for the html_basic tld</p>
@@ -61,7 +60,7 @@
// don't run the TLV if we're in designTime, or the RIConstants
// says not to.
if (java.beans.Beans.isDesignTime() ||
- !RIConstants.HTML_TLV_ACTIVE) {
+ !Util.isHtmlTLVActive()) {
return null;
}
Index: jsf-ri/src/com/sun/faces/taglib/jsf_core/CoreValidator.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/taglib/jsf_core/CoreValidator.java,v
retrieving revision 1.15
diff -u -r1.15 CoreValidator.java
--- jsf-ri/src/com/sun/faces/taglib/jsf_core/CoreValidator.java 8 Dec
2004 17:55:35 -0000 1.15
+++ jsf-ri/src/com/sun/faces/taglib/jsf_core/CoreValidator.java 23
May 2005 20:12:37 -0000
@@ -9,9 +9,10 @@
package com.sun.faces.taglib.jsf_core;
-import com.sun.faces.RIConstants;
import com.sun.faces.taglib.FacesValidator;
import com.sun.faces.taglib.ValidatorInfo;
+import com.sun.faces.util.Util;
+
import org.xml.sax.Attributes;
import org.xml.sax.helpers.DefaultHandler;
@@ -80,7 +81,7 @@
*/
protected DefaultHandler getSAXHandler() {
if (java.beans.Beans.isDesignTime() ||
- !RIConstants.CORE_TLV_ACTIVE) {
+ !Util.isCoreTLVActive()) {
return null;
}
DefaultHandler h = new CoreValidatorHandler();
Index: jsf-ri/src/com/sun/faces/util/DebugUtil.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/util/DebugUtil.java,v
retrieving revision 1.27
diff -u -r1.27 DebugUtil.java
--- jsf-ri/src/com/sun/faces/util/DebugUtil.java 21 Apr 2005 18:55:39
-0000 1.27
+++ jsf-ri/src/com/sun/faces/util/DebugUtil.java 23 May 2005 20:12:37
-0000
@@ -11,17 +11,17 @@
// DebugUtil.java
-import javax.faces.component.UIComponent;
-import javax.faces.component.ValueHolder;
-import javax.faces.model.SelectItem;
-
+import java.io.IOException;
import java.io.PrintStream;
-import java.io.Writer;
import java.io.PrintWriter;
import java.io.StringWriter;
-import java.io.IOException;
+import java.io.Writer;
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+import javax.faces.component.ValueHolder;
+import javax.faces.model.SelectItem;
+
/**
* <B>DebugUtil</B> is a class ...
* <p/>
@@ -154,7 +154,7 @@
}
indentPrintln(out, " }");
} else {
- if (null != root && (root instanceof ValueHolder)) {
+ if (root instanceof ValueHolder) {
value = ((ValueHolder)root).getValue();
}
indentPrintln(out, "value= " + value);
Index: jsf-ri/src/com/sun/faces/util/Util.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/util/Util.java,v
retrieving revision 1.161
diff -u -r1.161 Util.java
--- jsf-ri/src/com/sun/faces/util/Util.java 23 May 2005 14:38:34
-0000 1.161
+++ jsf-ri/src/com/sun/faces/util/Util.java 23 May 2005 20:12:38 -0000
@@ -81,6 +81,23 @@
static {
logger = getLogger(FACES_LOGGER);
}
+
+
+ /**
+ * Flag that enables special RI behavior in the case where we are
+ * running unit tests.
+ */
+ private static boolean unitTestModeEnabled = false;
+
+ /**
+ * Flag that enables/disables the core TLV.
+ */
+ private static boolean coreTLVEnabled = true;
+
+ /**
+ * Flag that enables/disables the core TLV.
+ */
+ private static boolean htmlTLVEnabled = true;
// README - make sure to add the message identifier constant
// (ex: Util.CONVERSION_ERROR_MESSAGE_ID) and the number of
substitution
@@ -445,6 +462,31 @@
//
// Class methods
//
+
+ public static void setUnitTestMode(boolean enabled) {
+ unitTestModeEnabled = enabled;
+ }
+
+ public static boolean isUnitTestModeEnabled() {
+ return unitTestModeEnabled;
+ }
+
+ public static void setCoreTLVActive(boolean active) {
+ coreTLVEnabled = active;
+ }
+
+ public static boolean isCoreTLVActive() {
+ return coreTLVEnabled;
+ }
+
+ public static void setHtmlTLVActive(boolean active) {
+ htmlTLVEnabled = active;
+ }
+
+ public static boolean isHtmlTLVActive() {
+ return htmlTLVEnabled;
+ }
+
public static Class loadClass(String name,
Object fallbackClass)
throws ClassNotFoundException {
@@ -580,26 +622,27 @@
throws FacesException {
Map applicationMap = facesContext.getExternalContext()
.getApplicationMap();
- Boolean result = null;
String className =
"javax.servlet.jsp.jstl.fmt.LocalizationContext";
Object[] params = {className};
-
+ Boolean result;
+
// Have we checked before?
if (null != (result = (Boolean)
applicationMap.get(RIConstants.HAS_REQUIRED_CLASSES_ATTR))) {
// yes, and the check failed.
- if (Boolean.FALSE == result) {
+ if (Boolean.FALSE.equals(result)) {
throw new
FacesException(
- Util.getExceptionMessageString(
- Util.MISSING_CLASS_ERROR_MESSAGE_ID, params));
+ Util.getExceptionMessageString(
+ Util.MISSING_CLASS_ERROR_MESSAGE_ID, params));
} else {
// yes, and the check passed.
return;
}
}
- //
+
+ //
// We've not checked before, so do the check now!
//
Index: jsf-ri/test/com/sun/faces/FacesTestCaseService.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/FacesTestCaseService.java,v
retrieving revision 1.43
diff -u -r1.43 FacesTestCaseService.java
--- jsf-ri/test/com/sun/faces/FacesTestCaseService.java 5 Apr 2005
22:03:01 -0000 1.43
+++ jsf-ri/test/com/sun/faces/FacesTestCaseService.java 23 May 2005
20:12:41 -0000
@@ -11,14 +11,16 @@
package com.sun.faces;
-import com.sun.faces.config.ConfigureListener;
-import com.sun.faces.application.ApplicationAssociate;
-import com.sun.faces.util.Util;
-import org.apache.cactus.server.ServletContextWrapper;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.LineNumberReader;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
import javax.faces.FactoryFinder;
import javax.faces.context.FacesContext;
-import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContextFactory;
import javax.faces.context.ResponseWriter;
import javax.faces.lifecycle.Lifecycle;
@@ -26,18 +28,14 @@
import javax.faces.webapp.FacesServlet;
import javax.servlet.ServletContextEvent;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.LineNumberReader;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
+import com.sun.faces.application.ApplicationAssociate;
+import com.sun.faces.config.ConfigureListener;
+import com.sun.faces.util.Util;
-import com.sun.faces.RIConstants;
+import org.apache.cactus.server.ServletContextWrapper;
/**
@@ -120,7 +118,7 @@
public void setUp() {
HttpServletResponse response = null;
- RIConstants.IS_UNIT_TEST_MODE = true;
+ Util.setUnitTestMode(true);
// make sure the ApplicationAssociate is aware of the ServletContext
com.sun.faces.config.StoreServletContext storeSC =
Index: jsf-ri/test/com/sun/faces/config/StoreServletContext.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/config/StoreServletContext.java,v
retrieving revision 1.4
diff -u -r1.4 StoreServletContext.java
--- jsf-ri/test/com/sun/faces/config/StoreServletContext.java 2 May
2005 12:49:59 -0000 1.4
+++ jsf-ri/test/com/sun/faces/config/StoreServletContext.java 23 May
2005 20:12:42 -0000
@@ -10,17 +10,17 @@
package com.sun.faces.config;
-import javax.servlet.ServletContext;
-import javax.faces.context.ExternalContext;
-
+import java.util.Iterator;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
-import java.util.Locale;
-import java.util.Iterator;
+
+import javax.faces.context.ExternalContext;
+import javax.servlet.ServletContext;
/**
* <p>The purpose of this class is to call the package private
* getThreadLocalServletContext() method to set the ServletContext into
- * ThreadLocalStorage, if IS_UNIT_TEST_MODE == true.</p>
+ * ThreadLocalStorage, if Util.isUnitTestModeEnabled() == true.</p>
*/
public class StoreServletContext extends Object {
Index: jsf-ri/test/com/sun/faces/lifecycle/TestLifecycleImpl.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/lifecycle/TestLifecycleImpl.java,v
retrieving revision 1.34
diff -u -r1.34 TestLifecycleImpl.java
--- jsf-ri/test/com/sun/faces/lifecycle/TestLifecycleImpl.java 2 May
2005 19:27:15 -0000 1.34
+++ jsf-ri/test/com/sun/faces/lifecycle/TestLifecycleImpl.java 23 May
2005 20:12:43 -0000
@@ -11,11 +11,6 @@
package com.sun.faces.lifecycle;
-import com.sun.faces.JspFacesTestCase;
-import com.sun.faces.RIConstants;
-import com.sun.faces.util.Util;
-import org.apache.cactus.WebRequest;
-
import javax.faces.component.UIForm;
import javax.faces.component.UIInput;
import javax.faces.component.UIViewRoot;
@@ -23,7 +18,11 @@
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
-import javax.servlet.http.HttpSession;
+
+import com.sun.faces.JspFacesTestCase;
+import com.sun.faces.util.Util;
+
+import org.apache.cactus.WebRequest;
/**
* <B>TestLifecycleImpl</B> is a class ...
@@ -98,7 +97,7 @@
public void setUp() {
- RIConstants.IS_UNIT_TEST_MODE = true;
+ Util.setUnitTestMode(true);
super.setUp();
FacesContext context = getFacesContext();
UIViewRoot root =
Util.getViewHandler(context).createView(context, null);
Index: jsf-ri/test/com/sun/faces/taglib/jsf_core/TestCoreTagsVBEnabled.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/taglib/jsf_core/TestCoreTagsVBEnabled.java,v
retrieving revision 1.6
diff -u -r1.6 TestCoreTagsVBEnabled.java
---
jsf-ri/test/com/sun/faces/taglib/jsf_core/TestCoreTagsVBEnabled.java
7 Apr 2004 17:53:03 -0000 1.6
+++
jsf-ri/test/com/sun/faces/taglib/jsf_core/TestCoreTagsVBEnabled.java
23 May 2005 20:12:43 -0000
@@ -9,20 +9,20 @@
package com.sun.faces.taglib.jsf_core;
+import java.util.Iterator;
+
+import javax.faces.component.NamingContainer;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+
import com.sun.faces.JspFacesTestCase;
-import com.sun.faces.RIConstants;
import com.sun.faces.lifecycle.ApplyRequestValuesPhase;
import com.sun.faces.lifecycle.Phase;
import com.sun.faces.lifecycle.ProcessValidationsPhase;
import com.sun.faces.lifecycle.RenderResponsePhase;
import com.sun.faces.util.Util;
-import org.apache.cactus.WebRequest;
-import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
-
-import java.util.Iterator;
+import org.apache.cactus.WebRequest;
/**
* <B>TestValidatorTags</B> is a class ...
@@ -103,7 +103,7 @@
public void setUp() {
- RIConstants.IS_UNIT_TEST_MODE = true;
+ Util.setUnitTestMode(true);
super.setUp();
(getFacesContext().getExternalContext().getRequestMap()).put("intMin",
new Integer(
@@ -203,7 +203,7 @@
assertTrue(messages.hasNext());
- RIConstants.IS_UNIT_TEST_MODE = false;
+ Util.setUnitTestMode(false);
}
Index: jsf-ri/test/com/sun/faces/taglib/jsf_core/TestValidatorTags.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/taglib/jsf_core/TestValidatorTags.java,v
retrieving revision 1.27
diff -u -r1.27 TestValidatorTags.java
--- jsf-ri/test/com/sun/faces/taglib/jsf_core/TestValidatorTags.java
7 Apr 2004 17:53:03 -0000 1.27
+++ jsf-ri/test/com/sun/faces/taglib/jsf_core/TestValidatorTags.java
23 May 2005 20:12:44 -0000
@@ -11,20 +11,20 @@
package com.sun.faces.taglib.jsf_core;
+import java.util.Iterator;
+
+import javax.faces.component.NamingContainer;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+
import com.sun.faces.JspFacesTestCase;
-import com.sun.faces.RIConstants;
import com.sun.faces.lifecycle.ApplyRequestValuesPhase;
import com.sun.faces.lifecycle.Phase;
import com.sun.faces.lifecycle.ProcessValidationsPhase;
import com.sun.faces.lifecycle.RenderResponsePhase;
import com.sun.faces.util.Util;
-import org.apache.cactus.WebRequest;
-import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
-
-import java.util.Iterator;
+import org.apache.cactus.WebRequest;
/**
* <B>TestValidatorTags</B> is a class ...
@@ -129,7 +129,7 @@
public void setUp() {
- RIConstants.IS_UNIT_TEST_MODE = true;
+ Util.setUnitTestMode(true);
super.setUp();
}
@@ -250,7 +250,7 @@
getFacesContext().getMessages(comp.getClientId(getFacesContext()))));
assertTrue(messages.hasNext());
- RIConstants.IS_UNIT_TEST_MODE = false;
+ Util.setUnitTestMode(false);
}
Index: jsf-tools/build.xml
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-tools/build.xml,v
retrieving revision 1.44
diff -u -r1.44 build.xml
--- jsf-tools/build.xml 19 May 2005 18:46:54 -0000 1.44
+++ jsf-tools/build.xml 23 May 2005 20:12:45 -0000
@@ -213,7 +213,8 @@
destdir="${build.classes}"
debug="${debug}"
deprecation="${deprecation}"
- optimize="${optimize}" >
+ optimize="${optimize}"
+ source="1.4">
<classpath refid="compile.classpath" />
<classpath refid="run.classpath" />
</javac>
Index: jsf-tools/src/com/sun/faces/config/rules/AttributeRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/AttributeRule.java,v
retrieving revision 1.4
diff -u -r1.4 AttributeRule.java
--- jsf-tools/src/com/sun/faces/config/rules/AttributeRule.java 10
Mar 2005 21:39:17 -0000 1.4
+++ jsf-tools/src/com/sun/faces/config/rules/AttributeRule.java 23
May 2005 20:12:46 -0000
@@ -47,13 +47,8 @@
public void begin(String namespace, String name,
Attributes attributes) throws Exception {
- AttributeHolder ah = null;
- try {
- ah = (AttributeHolder) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent AttributeHolder on object stack");
- }
+ assert (digester.peek() instanceof AttributeHolder);
+
if (digester.getLogger().isDebugEnabled()) {
digester.getLogger().debug("[AttributeRule]{" +
digester.getMatch() +
Index: jsf-tools/src/com/sun/faces/config/rules/ComponentRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/ComponentRule.java,v
retrieving revision 1.4
diff -u -r1.4 ComponentRule.java
--- jsf-tools/src/com/sun/faces/config/rules/ComponentRule.java 10
Mar 2005 21:39:18 -0000 1.4
+++ jsf-tools/src/com/sun/faces/config/rules/ComponentRule.java 23
May 2005 20:12:46 -0000
@@ -10,11 +10,11 @@
package com.sun.faces.config.rules;
-import org.apache.commons.digester.Rule;
-import org.xml.sax.Attributes;
import com.sun.faces.config.beans.ComponentBean;
import com.sun.faces.config.beans.FacesConfigBean;
+import org.xml.sax.Attributes;
+
/**
* <p>Digester rule for the <code><component></code> element.</p>
@@ -47,13 +47,8 @@
public void begin(String namespace, String name,
Attributes attributes) throws Exception {
- FacesConfigBean fcb = null;
- try {
- fcb = (FacesConfigBean) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent FacesConfigBean on object stack");
- }
+ assert (digester.peek() instanceof FacesConfigBean);
+
if (digester.getLogger().isDebugEnabled()) {
digester.getLogger().debug("[ComponentRule]{" +
digester.getMatch() +
Index: jsf-tools/src/com/sun/faces/config/rules/ConverterRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/ConverterRule.java,v
retrieving revision 1.4
diff -u -r1.4 ConverterRule.java
--- jsf-tools/src/com/sun/faces/config/rules/ConverterRule.java 10
Mar 2005 21:39:18 -0000 1.4
+++ jsf-tools/src/com/sun/faces/config/rules/ConverterRule.java 23
May 2005 20:12:46 -0000
@@ -10,11 +10,11 @@
package com.sun.faces.config.rules;
-import org.apache.commons.digester.Rule;
-import org.xml.sax.Attributes;
import com.sun.faces.config.beans.ConverterBean;
import com.sun.faces.config.beans.FacesConfigBean;
+import org.xml.sax.Attributes;
+
/**
* <p>Digester rule for the <code><converter></code> element.</p>
@@ -45,15 +45,10 @@
* of type FacesConfigBean
*/
public void begin(String namespace, String name,
- Attributes attributes) throws Exception {
+ Attributes attributes) throws Exception {
+
+ assert (digester.peek() instanceof FacesConfigBean);
- FacesConfigBean fcb = null;
- try {
- fcb = (FacesConfigBean) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent FacesConfigBean on object stack");
- }
if (digester.getLogger().isDebugEnabled()) {
digester.getLogger().debug("[ConverterRule]{" +
digester.getMatch() +
Index: jsf-tools/src/com/sun/faces/config/rules/DescriptionTextRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/DescriptionTextRule.java,v
retrieving revision 1.3
diff -u -r1.3 DescriptionTextRule.java
--- jsf-tools/src/com/sun/faces/config/rules/DescriptionTextRule.java
4 Feb 2004 23:46:21 -0000 1.3
+++ jsf-tools/src/com/sun/faces/config/rules/DescriptionTextRule.java
23 May 2005 20:12:47 -0000
@@ -10,13 +10,13 @@
package com.sun.faces.config.rules;
+import com.sun.faces.config.beans.DescriptionBean;
+
import org.apache.commons.digester.NodeCreateRule;
-import org.apache.commons.digester.Rule;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.Attributes;
-import com.sun.faces.config.beans.DescriptionBean;
/**
@@ -63,16 +63,9 @@
* of type FeatureBean
*/
public void begin(String namespace, String name,
- Attributes attributes) throws Exception {
+ Attributes attributes) throws Exception {
- // Ensure that the current top-of-stack object is a DescriptionBean
- DescriptionBean db = null;
- try {
- db = (DescriptionBean) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent DescriptionBean on object stack");
- }
+ assert (digester.peek() instanceof DescriptionBean);
// Perform our standard superclass processing
if (digester.getLogger().isDebugEnabled()) {
Index: jsf-tools/src/com/sun/faces/config/rules/ListEntriesRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/ListEntriesRule.java,v
retrieving revision 1.4
diff -u -r1.4 ListEntriesRule.java
--- jsf-tools/src/com/sun/faces/config/rules/ListEntriesRule.java 10
Mar 2005 21:39:18 -0000 1.4
+++ jsf-tools/src/com/sun/faces/config/rules/ListEntriesRule.java 23
May 2005 20:12:47 -0000
@@ -10,11 +10,12 @@
package com.sun.faces.config.rules;
-import org.apache.commons.digester.Rule;
-import org.xml.sax.Attributes;
import com.sun.faces.config.beans.ListEntriesBean;
import com.sun.faces.config.beans.ListEntriesHolder;
+import org.apache.commons.digester.Rule;
+import org.xml.sax.Attributes;
+
/**
* <p>Digester rule for the <code><list-entries></code> element.</p>
@@ -45,15 +46,10 @@
* of type ListEntriesHolder
*/
public void begin(String namespace, String name,
- Attributes attributes) throws Exception {
+ Attributes attributes) throws Exception {
+
+ assert (digester.peek() instanceof ListEntriesHolder);
- ListEntriesHolder leh = null;
- try {
- leh = (ListEntriesHolder) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent ListEntriesHolder on object stack");
- }
if (digester.getLogger().isDebugEnabled()) {
digester.getLogger().debug("[ListEntriesRule]{" +
digester.getMatch() +
Index: jsf-tools/src/com/sun/faces/config/rules/MapEntriesRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/MapEntriesRule.java,v
retrieving revision 1.4
diff -u -r1.4 MapEntriesRule.java
--- jsf-tools/src/com/sun/faces/config/rules/MapEntriesRule.java 10
Mar 2005 21:39:18 -0000 1.4
+++ jsf-tools/src/com/sun/faces/config/rules/MapEntriesRule.java 23
May 2005 20:12:47 -0000
@@ -10,12 +10,13 @@
package com.sun.faces.config.rules;
-import org.apache.commons.digester.Rule;
-import org.xml.sax.Attributes;
import com.sun.faces.config.beans.MapEntriesBean;
import com.sun.faces.config.beans.MapEntriesHolder;
import com.sun.faces.config.beans.MapEntryBean;
+import org.apache.commons.digester.Rule;
+import org.xml.sax.Attributes;
+
/**
* <p>Digester rule for the <code><map-entries></code> element.</p>
@@ -46,15 +47,10 @@
* of type MapEntriesHolder
*/
public void begin(String namespace, String name,
- Attributes attributes) throws Exception {
+ Attributes attributes) throws Exception {
+
+ assert (digester.peek() instanceof MapEntriesHolder);
- MapEntriesHolder meh = null;
- try {
- meh = (MapEntriesHolder) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent MapEntriesHolder on object stack");
- }
if (digester.getLogger().isDebugEnabled()) {
digester.getLogger().debug("[MapEntriesRule]{" +
digester.getMatch() +
Index: jsf-tools/src/com/sun/faces/config/rules/MapEntryRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/MapEntryRule.java,v
retrieving revision 1.3
diff -u -r1.3 MapEntryRule.java
--- jsf-tools/src/com/sun/faces/config/rules/MapEntryRule.java 4 Feb
2004 23:46:22 -0000 1.3
+++ jsf-tools/src/com/sun/faces/config/rules/MapEntryRule.java 23 May
2005 20:12:47 -0000
@@ -10,11 +10,12 @@
package com.sun.faces.config.rules;
-import org.apache.commons.digester.Rule;
-import org.xml.sax.Attributes;
import com.sun.faces.config.beans.MapEntriesBean;
import com.sun.faces.config.beans.MapEntryBean;
+import org.apache.commons.digester.Rule;
+import org.xml.sax.Attributes;
+
/**
* <p>Digester rule for the <code><map-entry></code> element.</p>
@@ -45,15 +46,10 @@
* of type MapEntryHolder
*/
public void begin(String namespace, String name,
- Attributes attributes) throws Exception {
+ Attributes attributes) throws Exception {
+
+ assert (digester.peek() instanceof MapEntriesBean);
- MapEntriesBean mesb = null;
- try {
- mesb = (MapEntriesBean) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent MapEntriesBean on object stack");
- }
if (digester.getLogger().isDebugEnabled()) {
digester.getLogger().debug("[MapEntryRule]{" +
digester.getMatch() +
Index: jsf-tools/src/com/sun/faces/config/rules/NavigationCaseRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/NavigationCaseRule.java,v
retrieving revision 1.3
diff -u -r1.3 NavigationCaseRule.java
--- jsf-tools/src/com/sun/faces/config/rules/NavigationCaseRule.java
4 Feb 2004 23:46:23 -0000 1.3
+++ jsf-tools/src/com/sun/faces/config/rules/NavigationCaseRule.java
23 May 2005 20:12:47 -0000
@@ -10,11 +10,11 @@
package com.sun.faces.config.rules;
-import org.apache.commons.digester.Rule;
-import org.xml.sax.Attributes;
import com.sun.faces.config.beans.NavigationCaseBean;
import com.sun.faces.config.beans.NavigationRuleBean;
+import org.xml.sax.Attributes;
+
/**
* <p>Digester rule for the <code><navigation-case></code> element.
@@ -47,14 +47,9 @@
*/
public void begin(String namespace, String name,
Attributes attributes) throws Exception {
+
+ assert (digester.peek() instanceof NavigationRuleBean);
- NavigationRuleBean nrb = null;
- try {
- nrb = (NavigationRuleBean) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent NavigationRuleBean on object stack");
- }
if (digester.getLogger().isDebugEnabled()) {
digester.getLogger().debug("[NavigationCaseRule]{" +
digester.getMatch() +
Index: jsf-tools/src/com/sun/faces/config/rules/NavigationRuleRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/NavigationRuleRule.java,v
retrieving revision 1.4
diff -u -r1.4 NavigationRuleRule.java
--- jsf-tools/src/com/sun/faces/config/rules/NavigationRuleRule.java
10 Mar 2005 21:39:18 -0000 1.4
+++ jsf-tools/src/com/sun/faces/config/rules/NavigationRuleRule.java
23 May 2005 20:12:48 -0000
@@ -10,11 +10,11 @@
package com.sun.faces.config.rules;
-import org.apache.commons.digester.Rule;
-import org.xml.sax.Attributes;
+import com.sun.faces.config.beans.FacesConfigBean;
import com.sun.faces.config.beans.NavigationCaseBean;
import com.sun.faces.config.beans.NavigationRuleBean;
-import com.sun.faces.config.beans.FacesConfigBean;
+
+import org.xml.sax.Attributes;
/**
@@ -46,15 +46,10 @@
* of type FacesConfigBean
*/
public void begin(String namespace, String name,
- Attributes attributes) throws Exception {
+ Attributes attributes) throws Exception {
+
+ assert (digester.peek() instanceof FacesConfigBean);
- FacesConfigBean fcb = null;
- try {
- fcb = (FacesConfigBean) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent FacesConfigBean on object stack");
- }
if (digester.getLogger().isDebugEnabled()) {
digester.getLogger().debug("[NavigationRuleRule]{" +
digester.getMatch() +
Index: jsf-tools/src/com/sun/faces/config/rules/PropertyRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/PropertyRule.java,v
retrieving revision 1.4
diff -u -r1.4 PropertyRule.java
--- jsf-tools/src/com/sun/faces/config/rules/PropertyRule.java 10 Mar
2005 21:39:19 -0000 1.4
+++ jsf-tools/src/com/sun/faces/config/rules/PropertyRule.java 23 May
2005 20:12:48 -0000
@@ -10,11 +10,11 @@
package com.sun.faces.config.rules;
-import org.apache.commons.digester.Rule;
-import org.xml.sax.Attributes;
import com.sun.faces.config.beans.PropertyBean;
import com.sun.faces.config.beans.PropertyHolder;
+import org.xml.sax.Attributes;
+
/**
* <p>Digester rule for the <code><property></code> element.</p>
@@ -45,15 +45,10 @@
* of type FacesConfigBean
*/
public void begin(String namespace, String name,
- Attributes attributes) throws Exception {
+ Attributes attributes) throws Exception {
+
+ assert (digester.peek() instanceof PropertyHolder);
- PropertyHolder ph = null;
- try {
- ph = (PropertyHolder) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent PropertyHolder on object stack");
- }
if (digester.getLogger().isDebugEnabled()) {
digester.getLogger().debug("[PropertyRule]{" +
digester.getMatch() +
Index: jsf-tools/src/com/sun/faces/config/rules/ReferencedBeanRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/ReferencedBeanRule.java,v
retrieving revision 1.4
diff -u -r1.4 ReferencedBeanRule.java
--- jsf-tools/src/com/sun/faces/config/rules/ReferencedBeanRule.java
10 Mar 2005 21:39:19 -0000 1.4
+++ jsf-tools/src/com/sun/faces/config/rules/ReferencedBeanRule.java
23 May 2005 20:12:48 -0000
@@ -10,11 +10,11 @@
package com.sun.faces.config.rules;
-import org.apache.commons.digester.Rule;
-import org.xml.sax.Attributes;
import com.sun.faces.config.beans.FacesConfigBean;
import com.sun.faces.config.beans.ReferencedBeanBean;
+import org.xml.sax.Attributes;
+
/**
* <p>Digester rule for the <code><referenced-bean></code>
element.</p>
@@ -45,15 +45,10 @@
* of type FacesConfigBean
*/
public void begin(String namespace, String name,
- Attributes attributes) throws Exception {
+ Attributes attributes) throws Exception {
+
+ assert (digester.peek() instanceof FacesConfigBean);
- FacesConfigBean fcb = null;
- try {
- fcb = (FacesConfigBean) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent FacesConfigBean on object stack");
- }
if (digester.getLogger().isDebugEnabled()) {
digester.getLogger().debug("[ReferencedBeanRule]{" +
digester.getMatch() +
Index: jsf-tools/src/com/sun/faces/config/rules/RenderKitRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/RenderKitRule.java,v
retrieving revision 1.3
diff -u -r1.3 RenderKitRule.java
--- jsf-tools/src/com/sun/faces/config/rules/RenderKitRule.java 4 Feb
2004 23:46:23 -0000 1.3
+++ jsf-tools/src/com/sun/faces/config/rules/RenderKitRule.java 23
May 2005 20:12:48 -0000
@@ -10,11 +10,11 @@
package com.sun.faces.config.rules;
-import org.apache.commons.digester.Rule;
-import org.xml.sax.Attributes;
import com.sun.faces.config.beans.FacesConfigBean;
import com.sun.faces.config.beans.RenderKitBean;
+import org.xml.sax.Attributes;
+
/**
* <p>Digester rule for the <code><renderKit></code> element.</p>
@@ -46,14 +46,9 @@
*/
public void begin(String namespace, String name,
Attributes attributes) throws Exception {
+
+ assert (digester.peek() instanceof FacesConfigBean);
- FacesConfigBean fcb = null;
- try {
- fcb = (FacesConfigBean) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent FacesConfigBean on object stack");
- }
if (digester.getLogger().isDebugEnabled()) {
digester.getLogger().debug("[RenderKitRule]{" +
digester.getMatch() +
Index: jsf-tools/src/com/sun/faces/config/rules/RendererRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/RendererRule.java,v
retrieving revision 1.5
diff -u -r1.5 RendererRule.java
--- jsf-tools/src/com/sun/faces/config/rules/RendererRule.java 10 Mar
2005 21:39:19 -0000 1.5
+++ jsf-tools/src/com/sun/faces/config/rules/RendererRule.java 23 May
2005 20:12:48 -0000
@@ -10,10 +10,10 @@
package com.sun.faces.config.rules;
-import org.apache.commons.digester.Rule;
-import org.xml.sax.Attributes;
-import com.sun.faces.config.beans.RendererBean;
import com.sun.faces.config.beans.RenderKitBean;
+import com.sun.faces.config.beans.RendererBean;
+
+import org.xml.sax.Attributes;
/**
@@ -47,13 +47,8 @@
public void begin(String namespace, String name,
Attributes attributes) throws Exception {
- RenderKitBean rkb = null;
- try {
- rkb = (RenderKitBean) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent RenderKitBean on object stack");
- }
+ assert (digester.peek() instanceof RenderKitBean);
+
if (digester.getLogger().isDebugEnabled()) {
digester.getLogger().debug("[RendererRule]{" +
digester.getMatch() +
Index: jsf-tools/src/com/sun/faces/config/rules/ValidatorRule.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-tools/src/com/sun/faces/config/rules/ValidatorRule.java,v
retrieving revision 1.4
diff -u -r1.4 ValidatorRule.java
--- jsf-tools/src/com/sun/faces/config/rules/ValidatorRule.java 10
Mar 2005 21:39:19 -0000 1.4
+++ jsf-tools/src/com/sun/faces/config/rules/ValidatorRule.java 23
May 2005 20:12:49 -0000
@@ -10,11 +10,11 @@
package com.sun.faces.config.rules;
-import org.apache.commons.digester.Rule;
-import org.xml.sax.Attributes;
import com.sun.faces.config.beans.FacesConfigBean;
import com.sun.faces.config.beans.ValidatorBean;
+import org.xml.sax.Attributes;
+
/**
* <p>Digester rule for the <code><validator></code> element.</p>
@@ -45,15 +45,10 @@
* of type FacesConfigBean
*/
public void begin(String namespace, String name,
- Attributes attributes) throws Exception {
+ Attributes attributes) throws Exception {
+
+ assert (digester.peek() instanceof FacesConfigBean);
- FacesConfigBean fcb = null;
- try {
- fcb = (FacesConfigBean) digester.peek();
- } catch (Exception e) {
- throw new IllegalStateException
- ("No parent FacesConfigBean on object stack");
- }
if (digester.getLogger().isDebugEnabled()) {
digester.getLogger().debug("[ValidatorRule]{" +
digester.getMatch() +