You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/01/13 20:18:09 UTC
svn commit: r898897 - /tomcat/trunk/java/javax/el/
Author: markt
Date: Wed Jan 13 19:18:08 2010
New Revision: 898897
URL: http://svn.apache.org/viewvc?rev=898897&view=rev
Log:
Tab police, fix Eclipse warnings, add @since Javadoc
Modified:
tomcat/trunk/java/javax/el/BeanELResolver.java
tomcat/trunk/java/javax/el/CompositeELResolver.java
tomcat/trunk/java/javax/el/ELContextEvent.java
tomcat/trunk/java/javax/el/ELException.java
tomcat/trunk/java/javax/el/ELResolver.java
tomcat/trunk/java/javax/el/Expression.java
tomcat/trunk/java/javax/el/MethodNotFoundException.java
tomcat/trunk/java/javax/el/PropertyNotFoundException.java
tomcat/trunk/java/javax/el/PropertyNotWritableException.java
Modified: tomcat/trunk/java/javax/el/BeanELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/BeanELResolver.java?rev=898897&r1=898896&r2=898897&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/BeanELResolver.java (original)
+++ tomcat/trunk/java/javax/el/BeanELResolver.java Wed Jan 13 19:18:08 2010
@@ -35,174 +35,174 @@
public class BeanELResolver extends ELResolver {
- private final boolean readOnly;
+ private final boolean readOnly;
- private final ConcurrentCache<String, BeanProperties> cache =
- new ConcurrentCache<String, BeanProperties>(1000);
+ private final ConcurrentCache<String, BeanProperties> cache =
+ new ConcurrentCache<String, BeanProperties>(1000);
- public BeanELResolver() {
- this.readOnly = false;
- }
+ public BeanELResolver() {
+ this.readOnly = false;
+ }
- public BeanELResolver(boolean readOnly) {
- this.readOnly = readOnly;
- }
+ public BeanELResolver(boolean readOnly) {
+ this.readOnly = readOnly;
+ }
- @Override
+ @Override
public Object getValue(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
- if (base == null || property == null) {
- return null;
- }
-
- context.setPropertyResolved(true);
- Method m = this.property(context, base, property).read(context);
- try {
- return m.invoke(base, (Object[]) null);
- } catch (IllegalAccessException e) {
- throw new ELException(e);
- } catch (InvocationTargetException e) {
- throw new ELException(message(context, "propertyReadError",
- new Object[] { base.getClass().getName(),
- property.toString() }), e.getCause());
- } catch (Exception e) {
- throw new ELException(e);
- }
- }
+ throws NullPointerException, PropertyNotFoundException, ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+ if (base == null || property == null) {
+ return null;
+ }
- @Override
+ context.setPropertyResolved(true);
+ Method m = this.property(context, base, property).read(context);
+ try {
+ return m.invoke(base, (Object[]) null);
+ } catch (IllegalAccessException e) {
+ throw new ELException(e);
+ } catch (InvocationTargetException e) {
+ throw new ELException(message(context, "propertyReadError",
+ new Object[] { base.getClass().getName(),
+ property.toString() }), e.getCause());
+ } catch (Exception e) {
+ throw new ELException(e);
+ }
+ }
+
+ @Override
public Class<?> getType(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
- if (base == null || property == null) {
- return null;
- }
-
- context.setPropertyResolved(true);
- return this.property(context, base, property).getPropertyType();
- }
+ throws NullPointerException, PropertyNotFoundException, ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+ if (base == null || property == null) {
+ return null;
+ }
- @Override
+ context.setPropertyResolved(true);
+ return this.property(context, base, property).getPropertyType();
+ }
+
+ @Override
public void setValue(ELContext context, Object base, Object property,
- Object value) throws NullPointerException,
- PropertyNotFoundException, PropertyNotWritableException,
- ELException {
- if (context == null) {
- throw new NullPointerException();
- }
- if (base == null || property == null) {
- return;
- }
-
- context.setPropertyResolved(true);
-
- if (this.readOnly) {
- throw new PropertyNotWritableException(message(context,
- "resolverNotWriteable", new Object[] { base.getClass()
- .getName() }));
- }
-
- Method m = this.property(context, base, property).write(context);
- try {
- m.invoke(base, value);
- } catch (IllegalAccessException e) {
- throw new ELException(e);
- } catch (InvocationTargetException e) {
- throw new ELException(message(context, "propertyWriteError",
- new Object[] { base.getClass().getName(),
- property.toString() }), e.getCause());
- } catch (Exception e) {
- throw new ELException(e);
- }
- }
+ Object value) throws NullPointerException,
+ PropertyNotFoundException, PropertyNotWritableException,
+ ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+ if (base == null || property == null) {
+ return;
+ }
+
+ context.setPropertyResolved(true);
+
+ if (this.readOnly) {
+ throw new PropertyNotWritableException(message(context,
+ "resolverNotWriteable", new Object[] { base.getClass()
+ .getName() }));
+ }
- @Override
+ Method m = this.property(context, base, property).write(context);
+ try {
+ m.invoke(base, value);
+ } catch (IllegalAccessException e) {
+ throw new ELException(e);
+ } catch (InvocationTargetException e) {
+ throw new ELException(message(context, "propertyWriteError",
+ new Object[] { base.getClass().getName(),
+ property.toString() }), e.getCause());
+ } catch (Exception e) {
+ throw new ELException(e);
+ }
+ }
+
+ @Override
public boolean isReadOnly(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
- if (base == null || property == null) {
- return false;
- }
-
- context.setPropertyResolved(true);
- return this.readOnly
- || this.property(context, base, property).isReadOnly();
- }
+ throws NullPointerException, PropertyNotFoundException, ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+ if (base == null || property == null) {
+ return false;
+ }
+
+ context.setPropertyResolved(true);
+ return this.readOnly
+ || this.property(context, base, property).isReadOnly();
+ }
- @Override
+ @Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
- if (context == null) {
- throw new NullPointerException();
- }
-
- if (base == null) {
- return null;
- }
-
- try {
- BeanInfo info = Introspector.getBeanInfo(base.getClass());
- PropertyDescriptor[] pds = info.getPropertyDescriptors();
- for (int i = 0; i < pds.length; i++) {
- pds[i].setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.TRUE);
- pds[i].setValue(TYPE, pds[i].getPropertyType());
- }
- return Arrays.asList((FeatureDescriptor[]) pds).iterator();
- } catch (IntrospectionException e) {
- //
- }
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ if (base == null) {
+ return null;
+ }
+
+ try {
+ BeanInfo info = Introspector.getBeanInfo(base.getClass());
+ PropertyDescriptor[] pds = info.getPropertyDescriptors();
+ for (int i = 0; i < pds.length; i++) {
+ pds[i].setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.TRUE);
+ pds[i].setValue(TYPE, pds[i].getPropertyType());
+ }
+ return Arrays.asList((FeatureDescriptor[]) pds).iterator();
+ } catch (IntrospectionException e) {
+ //
+ }
- return null;
- }
+ return null;
+ }
- @Override
+ @Override
public Class<?> getCommonPropertyType(ELContext context, Object base) {
- if (context == null) {
- throw new NullPointerException();
- }
-
- if (base != null) {
- return Object.class;
- }
-
- return null;
- }
-
- protected final static class BeanProperties {
- private final Map<String, BeanProperty> properties;
-
- private final Class<?> type;
-
- public BeanProperties(Class<?> type) throws ELException {
- this.type = type;
- this.properties = new HashMap<String, BeanProperty>();
- try {
- BeanInfo info = Introspector.getBeanInfo(this.type);
- PropertyDescriptor[] pds = info.getPropertyDescriptors();
- for (int i = 0; i < pds.length; i++) {
- this.properties.put(pds[i].getName(), new BeanProperty(
- type, pds[i]));
- }
- } catch (IntrospectionException ie) {
- throw new ELException(ie);
- }
- }
-
- private BeanProperty get(ELContext ctx, String name) {
- BeanProperty property = this.properties.get(name);
- if (property == null) {
- throw new PropertyNotFoundException(message(ctx,
- "propertyNotFound",
- new Object[] { type.getName(), name }));
- }
- return property;
- }
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ if (base != null) {
+ return Object.class;
+ }
+
+ return null;
+ }
+
+ protected final static class BeanProperties {
+ private final Map<String, BeanProperty> properties;
+
+ private final Class<?> type;
+
+ public BeanProperties(Class<?> type) throws ELException {
+ this.type = type;
+ this.properties = new HashMap<String, BeanProperty>();
+ try {
+ BeanInfo info = Introspector.getBeanInfo(this.type);
+ PropertyDescriptor[] pds = info.getPropertyDescriptors();
+ for (int i = 0; i < pds.length; i++) {
+ this.properties.put(pds[i].getName(), new BeanProperty(
+ type, pds[i]));
+ }
+ } catch (IntrospectionException ie) {
+ throw new ELException(ie);
+ }
+ }
+
+ private BeanProperty get(ELContext ctx, String name) {
+ BeanProperty property = this.properties.get(name);
+ if (property == null) {
+ throw new PropertyNotFoundException(message(ctx,
+ "propertyNotFound",
+ new Object[] { type.getName(), name }));
+ }
+ return property;
+ }
public BeanProperty getBeanProperty(String name) {
return get(null, name);
@@ -211,201 +211,205 @@
private Class<?> getType() {
return type;
}
- }
+ }
protected final static class BeanProperty {
- private final Class<?> type;
+ private final Class<?> type;
- private final Class<?> owner;
+ private final Class<?> owner;
- private final PropertyDescriptor descriptor;
+ private final PropertyDescriptor descriptor;
- private Method read;
+ private Method read;
- private Method write;
+ private Method write;
- public BeanProperty(Class<?> owner, PropertyDescriptor descriptor) {
- this.owner = owner;
- this.descriptor = descriptor;
- this.type = descriptor.getPropertyType();
- }
+ public BeanProperty(Class<?> owner, PropertyDescriptor descriptor) {
+ this.owner = owner;
+ this.descriptor = descriptor;
+ this.type = descriptor.getPropertyType();
+ }
- // Can't use Class<?> because API needs to match specification
+ // Can't use Class<?> because API needs to match specification
public @SuppressWarnings("unchecked") Class getPropertyType() {
- return this.type;
- }
+ return this.type;
+ }
+
+ public boolean isReadOnly() {
+ return this.write == null
+ && (null == (this.write = getMethod(this.owner, descriptor.getWriteMethod())));
+ }
+
+ public Method getWriteMethod() {
+ return write(null);
+ }
+
+ public Method getReadMethod() {
+ return this.read(null);
+ }
+
+ private Method write(ELContext ctx) {
+ if (this.write == null) {
+ this.write = getMethod(this.owner, descriptor.getWriteMethod());
+ if (this.write == null) {
+ throw new PropertyNotFoundException(message(ctx,
+ "propertyNotWritable", new Object[] {
+ type.getName(), descriptor.getName() }));
+ }
+ }
+ return this.write;
+ }
+
+ private Method read(ELContext ctx) {
+ if (this.read == null) {
+ this.read = getMethod(this.owner, descriptor.getReadMethod());
+ if (this.read == null) {
+ throw new PropertyNotFoundException(message(ctx,
+ "propertyNotReadable", new Object[] {
+ type.getName(), descriptor.getName() }));
+ }
+ }
+ return this.read;
+ }
+ }
+
+ private final BeanProperty property(ELContext ctx, Object base,
+ Object property) {
+ Class<?> type = base.getClass();
+ String prop = property.toString();
+
+ BeanProperties props = this.cache.get(type.getName());
+ if (props == null || type != props.getType()) {
+ props = new BeanProperties(type);
+ this.cache.put(type.getName(), props);
+ }
+
+ return props.get(ctx, prop);
+ }
- public boolean isReadOnly() {
- return this.write == null
- && (null == (this.write = getMethod(this.owner, descriptor.getWriteMethod())));
- }
-
- public Method getWriteMethod() {
- return write(null);
- }
-
- public Method getReadMethod() {
- return this.read(null);
- }
-
- private Method write(ELContext ctx) {
- if (this.write == null) {
- this.write = getMethod(this.owner, descriptor.getWriteMethod());
- if (this.write == null) {
- throw new PropertyNotFoundException(message(ctx,
- "propertyNotWritable", new Object[] {
- type.getName(), descriptor.getName() }));
- }
- }
- return this.write;
- }
-
- private Method read(ELContext ctx) {
- if (this.read == null) {
- this.read = getMethod(this.owner, descriptor.getReadMethod());
- if (this.read == null) {
- throw new PropertyNotFoundException(message(ctx,
- "propertyNotReadable", new Object[] {
- type.getName(), descriptor.getName() }));
- }
- }
- return this.read;
- }
- }
-
- private final BeanProperty property(ELContext ctx, Object base,
- Object property) {
- Class<?> type = base.getClass();
- String prop = property.toString();
-
- BeanProperties props = this.cache.get(type.getName());
- if (props == null || type != props.getType()) {
- props = new BeanProperties(type);
- this.cache.put(type.getName(), props);
- }
-
- return props.get(ctx, prop);
- }
-
- private final static Method getMethod(Class<?> type, Method m) {
- if (m == null || Modifier.isPublic(type.getModifiers())) {
- return m;
- }
- Class<?>[] inf = type.getInterfaces();
- Method mp = null;
- for (int i = 0; i < inf.length; i++) {
- try {
- mp = inf[i].getMethod(m.getName(), m.getParameterTypes());
- mp = getMethod(mp.getDeclaringClass(), mp);
- if (mp != null) {
- return mp;
- }
- } catch (NoSuchMethodException e) {
- // Ignore
- }
- }
- Class<?> sup = type.getSuperclass();
- if (sup != null) {
- try {
- mp = sup.getMethod(m.getName(), m.getParameterTypes());
- mp = getMethod(mp.getDeclaringClass(), mp);
- if (mp != null) {
- return mp;
- }
- } catch (NoSuchMethodException e) {
- // Ignore
- }
- }
- return null;
- }
-
- private final static class ConcurrentCache<K,V> {
-
- private final int size;
- private final Map<K,V> eden;
- private final Map<K,V> longterm;
-
- public ConcurrentCache(int size) {
- this.size = size;
- this.eden = new ConcurrentHashMap<K,V>(size);
- this.longterm = new WeakHashMap<K,V>(size);
- }
-
- public V get(K key) {
- V value = this.eden.get(key);
- if (value == null) {
- value = this.longterm.get(key);
- if (value != null) {
- this.eden.put(key, value);
- }
- }
- return value;
- }
-
- public void put(K key, V value) {
- if (this.eden.size() >= this.size) {
- this.longterm.putAll(this.eden);
- this.eden.clear();
- }
- this.eden.put(key, value);
- }
-
- }
-
- @Override
+ private final static Method getMethod(Class<?> type, Method m) {
+ if (m == null || Modifier.isPublic(type.getModifiers())) {
+ return m;
+ }
+ Class<?>[] inf = type.getInterfaces();
+ Method mp = null;
+ for (int i = 0; i < inf.length; i++) {
+ try {
+ mp = inf[i].getMethod(m.getName(), m.getParameterTypes());
+ mp = getMethod(mp.getDeclaringClass(), mp);
+ if (mp != null) {
+ return mp;
+ }
+ } catch (NoSuchMethodException e) {
+ // Ignore
+ }
+ }
+ Class<?> sup = type.getSuperclass();
+ if (sup != null) {
+ try {
+ mp = sup.getMethod(m.getName(), m.getParameterTypes());
+ mp = getMethod(mp.getDeclaringClass(), mp);
+ if (mp != null) {
+ return mp;
+ }
+ } catch (NoSuchMethodException e) {
+ // Ignore
+ }
+ }
+ return null;
+ }
+
+ private final static class ConcurrentCache<K,V> {
+
+ private final int size;
+ private final Map<K,V> eden;
+ private final Map<K,V> longterm;
+
+ public ConcurrentCache(int size) {
+ this.size = size;
+ this.eden = new ConcurrentHashMap<K,V>(size);
+ this.longterm = new WeakHashMap<K,V>(size);
+ }
+
+ public V get(K key) {
+ V value = this.eden.get(key);
+ if (value == null) {
+ value = this.longterm.get(key);
+ if (value != null) {
+ this.eden.put(key, value);
+ }
+ }
+ return value;
+ }
+
+ public void put(K key, V value) {
+ if (this.eden.size() >= this.size) {
+ this.longterm.putAll(this.eden);
+ this.eden.clear();
+ }
+ this.eden.put(key, value);
+ }
+
+ }
+
+ /**
+ * @since EL 2.2
+ */
+ @Override
public Object invoke(ELContext context, Object base, Object method,
Class<?>[] paramTypes, Object[] params) {
if (context == null) {
throw new NullPointerException();
}
- if (base == null || method == null) {
- return null;
- }
+ if (base == null || method == null) {
+ return null;
+ }
- ExpressionFactory factory = ExpressionFactory.newInstance();
+ ExpressionFactory factory = ExpressionFactory.newInstance();
+
+ String methodName = (String) factory.coerceToType(method, String.class);
- String methodName = (String) factory.coerceToType(method, String.class);
-
- // Find the matching method
- Method matchingMethod = null;
- Class<?> clazz = base.getClass();
- if (paramTypes != null) {
- try {
- matchingMethod = clazz.getMethod(methodName, paramTypes);
- } catch (NoSuchMethodException e) {
- throw new MethodNotFoundException(e);
- }
- } else {
- int paramCount = 0;
- if (params != null) {
- paramCount = params.length;
- }
- Method[] methods = clazz.getMethods();
- for (Method m : methods) {
- if (m.getParameterTypes().length == paramCount) {
- // Same number of parameters - use the first match
- matchingMethod = m;
- break;
- }
- if (m.isVarArgs()) {
+ // Find the matching method
+ Method matchingMethod = null;
+ Class<?> clazz = base.getClass();
+ if (paramTypes != null) {
+ try {
+ matchingMethod = clazz.getMethod(methodName, paramTypes);
+ } catch (NoSuchMethodException e) {
+ throw new MethodNotFoundException(e);
+ }
+ } else {
+ int paramCount = 0;
+ if (params != null) {
+ paramCount = params.length;
+ }
+ Method[] methods = clazz.getMethods();
+ for (Method m : methods) {
+ if (m.getParameterTypes().length == paramCount) {
+ // Same number of parameters - use the first match
matchingMethod = m;
- }
- }
- if (matchingMethod == null) {
- throw new MethodNotFoundException(
- "Unable to find method [" + methodName + "] with ["
- + paramCount + "] parameters");
- }
- }
-
- Class<?>[] parameterTypes = matchingMethod.getParameterTypes();
- Object[] parameters = null;
- if (parameterTypes.length >0) {
- parameters = new Object[parameterTypes.length];
- if (matchingMethod.isVarArgs()) {
- int varArgIndex = parameterTypes.length - 1;
- int paramCount = params.length;
- // First argCount-1 parameters are standard
+ break;
+ }
+ if (m.isVarArgs()) {
+ matchingMethod = m;
+ }
+ }
+ if (matchingMethod == null) {
+ throw new MethodNotFoundException(
+ "Unable to find method [" + methodName + "] with ["
+ + paramCount + "] parameters");
+ }
+ }
+
+ Class<?>[] parameterTypes = matchingMethod.getParameterTypes();
+ Object[] parameters = null;
+ if (parameterTypes.length > 0) {
+ parameters = new Object[parameterTypes.length];
+ @SuppressWarnings("null") // params.length >= parameterTypes.length
+ int paramCount = params.length;
+ if (matchingMethod.isVarArgs()) {
+ int varArgIndex = parameterTypes.length - 1;
+ // First argCount-1 parameters are standard
for (int i = 0; (i < varArgIndex - 1); i++) {
parameters[i] = factory.coerceToType(params[i],
parameterTypes[i]);
@@ -421,17 +425,17 @@
factory.coerceToType(params[i], varArgClass));
parameters[varArgIndex] = varargs;
}
- } else {
- parameters = new Object[parameterTypes.length];
- for (int i = 0; i < parameterTypes.length; i++) {
- parameters[i] = factory.coerceToType(params[i],
- parameterTypes[i]);
- }
- }
- }
- Object result = null;
- try {
- result = matchingMethod.invoke(base, parameters);
+ } else {
+ parameters = new Object[parameterTypes.length];
+ for (int i = 0; i < parameterTypes.length; i++) {
+ parameters[i] = factory.coerceToType(params[i],
+ parameterTypes[i]);
+ }
+ }
+ }
+ Object result = null;
+ try {
+ result = matchingMethod.invoke(base, parameters);
} catch (IllegalArgumentException e) {
throw new ELException(e);
} catch (IllegalAccessException e) {
@@ -439,7 +443,7 @@
} catch (InvocationTargetException e) {
throw new ELException(e.getCause());
}
-
+
context.setPropertyResolved(true);
return result;
}
Modified: tomcat/trunk/java/javax/el/CompositeELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/CompositeELResolver.java?rev=898897&r1=898896&r2=898897&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/CompositeELResolver.java (original)
+++ tomcat/trunk/java/javax/el/CompositeELResolver.java Wed Jan 13 19:18:08 2010
@@ -124,6 +124,9 @@
return null;
}
+ /**
+ * @since EL 2.2
+ */
@Override
public Object invoke(ELContext context, Object base, Object method,
Class<?>[] paramTypes, Object[] params) {
@@ -195,9 +198,9 @@
public FeatureDescriptor next() {
if (!hasNext())
throw new NoSuchElementException();
- FeatureDescriptor next = this.next;
+ FeatureDescriptor result = this.next;
this.next = null;
- return next;
+ return result;
}
Modified: tomcat/trunk/java/javax/el/ELContextEvent.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELContextEvent.java?rev=898897&r1=898896&r2=898897&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ELContextEvent.java (original)
+++ tomcat/trunk/java/javax/el/ELContextEvent.java Wed Jan 13 19:18:08 2010
@@ -24,6 +24,8 @@
*/
public class ELContextEvent extends EventObject {
+ private static final long serialVersionUID = 1255131906285426769L;
+
/**
* @param source
*/
Modified: tomcat/trunk/java/javax/el/ELException.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELException.java?rev=898897&r1=898896&r2=898897&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ELException.java (original)
+++ tomcat/trunk/java/javax/el/ELException.java Wed Jan 13 19:18:08 2010
@@ -25,42 +25,44 @@
*/
public class ELException extends RuntimeException {
- /**
- * Creates an ELException with no detail message
- */
- public ELException() {
- super();
- }
+ private static final long serialVersionUID = -6228042809457459161L;
- /**
- * Creates an ELException with the provided detail message.
- *
- * @param message
- * the detail message
- */
- public ELException(String message) {
- super(message);
- }
+ /**
+ * Creates an ELException with no detail message
+ */
+ public ELException() {
+ super();
+ }
- /**
- * Creates an ELException with the given detail message and root cause.
- *
- * @param message
- * the detail message
- * @param cause
- * the originating cause of this exception
- */
- public ELException(String message, Throwable cause) {
- super(message, cause);
- }
+ /**
+ * Creates an ELException with the provided detail message.
+ *
+ * @param message
+ * the detail message
+ */
+ public ELException(String message) {
+ super(message);
+ }
- /**
- * Creates an ELException with the given cause
- *
- * @param cause
- * the originating cause of this exception
- */
- public ELException(Throwable cause) {
- super(cause);
- }
+ /**
+ * Creates an ELException with the given detail message and root cause.
+ *
+ * @param message
+ * the detail message
+ * @param cause
+ * the originating cause of this exception
+ */
+ public ELException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Creates an ELException with the given cause
+ *
+ * @param cause
+ * the originating cause of this exception
+ */
+ public ELException(Throwable cause) {
+ super(cause);
+ }
}
Modified: tomcat/trunk/java/javax/el/ELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELResolver.java?rev=898897&r1=898896&r2=898897&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ELResolver.java Wed Jan 13 19:18:08 2010
@@ -28,28 +28,28 @@
*
*/
public abstract class ELResolver {
-
- static String message(ELContext context, String name, Object[] props) {
- Locale locale = context.getLocale();
- if (locale == null) {
- locale = Locale.getDefault();
- if (locale == null) {
- return "";
- }
- }
- ResourceBundle bundle = ResourceBundle.getBundle(
- "javax.el.LocalStrings", locale);
- try {
- String template = bundle.getString(name);
- if (props != null) {
- template = MessageFormat.format(template, props);
- }
- return template;
- } catch (MissingResourceException e) {
- return "Missing Resource: '" + name + "' for Locale "
- + locale.getDisplayName();
- }
- }
+
+ static String message(ELContext context, String name, Object[] props) {
+ Locale locale = context.getLocale();
+ if (locale == null) {
+ locale = Locale.getDefault();
+ if (locale == null) {
+ return "";
+ }
+ }
+ ResourceBundle bundle = ResourceBundle.getBundle(
+ "javax.el.LocalStrings", locale);
+ try {
+ String template = bundle.getString(name);
+ if (props != null) {
+ template = MessageFormat.format(template, props);
+ }
+ return template;
+ } catch (MissingResourceException e) {
+ return "Missing Resource: '" + name + "' for Locale "
+ + locale.getDisplayName();
+ }
+ }
public final static String RESOLVABLE_AT_DESIGN_TIME = "resolvableAtDesignTime";
@@ -67,6 +67,9 @@
public abstract Class<?> getCommonPropertyType(ELContext context, Object base);
+ /**
+ * @since EL 2.2
+ */
public Object invoke(@SuppressWarnings("unused") ELContext context,
@SuppressWarnings("unused") Object base,
@SuppressWarnings("unused") Object method,
Modified: tomcat/trunk/java/javax/el/Expression.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/Expression.java?rev=898897&r1=898896&r2=898897&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/Expression.java (original)
+++ tomcat/trunk/java/javax/el/Expression.java Wed Jan 13 19:18:08 2010
@@ -24,6 +24,8 @@
*/
public abstract class Expression implements Serializable {
+ private static final long serialVersionUID = -6663767980471823812L;
+
@Override
public abstract boolean equals(Object obj);
Modified: tomcat/trunk/java/javax/el/MethodNotFoundException.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/MethodNotFoundException.java?rev=898897&r1=898896&r2=898897&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/MethodNotFoundException.java (original)
+++ tomcat/trunk/java/javax/el/MethodNotFoundException.java Wed Jan 13 19:18:08 2010
@@ -22,6 +22,8 @@
*/
public class MethodNotFoundException extends ELException {
+ private static final long serialVersionUID = -3631968116081480328L;
+
/**
*
*/
Modified: tomcat/trunk/java/javax/el/PropertyNotFoundException.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/PropertyNotFoundException.java?rev=898897&r1=898896&r2=898897&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/PropertyNotFoundException.java (original)
+++ tomcat/trunk/java/javax/el/PropertyNotFoundException.java Wed Jan 13 19:18:08 2010
@@ -22,6 +22,8 @@
*/
public class PropertyNotFoundException extends ELException {
+ private static final long serialVersionUID = -3799200961303506745L;
+
/**
*
*/
Modified: tomcat/trunk/java/javax/el/PropertyNotWritableException.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/PropertyNotWritableException.java?rev=898897&r1=898896&r2=898897&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/PropertyNotWritableException.java (original)
+++ tomcat/trunk/java/javax/el/PropertyNotWritableException.java Wed Jan 13 19:18:08 2010
@@ -22,6 +22,8 @@
*/
public class PropertyNotWritableException extends ELException {
+ private static final long serialVersionUID = 827987155471214717L;
+
/**
*
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org