From 6e5f4387c6b07ac7fbc8c1fb7d60f59efb5477fb Mon Sep 17 00:00:00 2001 From: fhanik Date: Fri, 1 Jun 2007 07:40:37 +0000 Subject: [PATCH] Forward port of BZ 42509 and BZ 42515 git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@543414 13f79535-47bb-0310-9956-ffa450edef68 --- java/javax/el/BeanELResolver.java | 28 +++++++++++++++------- java/javax/el/ResourceBundleELResolver.java | 2 +- .../servlet/jsp/el/ScopedAttributeELResolver.java | 2 +- java/javax/servlet/jsp/tagext/TagInfo.java | 6 ++--- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/java/javax/el/BeanELResolver.java b/java/javax/el/BeanELResolver.java index 109f6cea2..186ffa443 100644 --- a/java/javax/el/BeanELResolver.java +++ b/java/javax/el/BeanELResolver.java @@ -81,7 +81,7 @@ public class BeanELResolver extends ELResolver { } context.setPropertyResolved(true); - return this.property(context, base, property).getType(); + return this.property(context, base, property).getPropertyType(); } public void setValue(ELContext context, Object base, Object property, @@ -105,7 +105,7 @@ public class BeanELResolver extends ELResolver { Method m = this.property(context, base, property).write(context); try { - m.invoke(base, new Object[] { value }); + m.invoke(base, value); } catch (IllegalAccessException e) { throw new ELException(e); } catch (InvocationTargetException e) { @@ -187,7 +187,7 @@ public class BeanELResolver extends ELResolver { } } - public BeanProperty get(ELContext ctx, String name) { + private BeanProperty get(ELContext ctx, String name) { BeanProperty property = this.properties.get(name); if (property == null) { throw new PropertyNotFoundException(message(ctx, @@ -196,8 +196,12 @@ public class BeanELResolver extends ELResolver { } return property; } + + public BeanProperty getBeanProperty(String name) { + return get(null, name); + } - public Class getType() { + private Class getType() { return type; } } @@ -213,13 +217,13 @@ public class BeanELResolver extends ELResolver { private Method write; - public BeanProperty(Class owner, PropertyDescriptor descriptor) { + public BeanProperty(Class owner, PropertyDescriptor descriptor) { this.owner = owner; this.descriptor = descriptor; this.type = descriptor.getPropertyType(); } - public Class getType() { + public Class getPropertyType() { return this.type; } @@ -228,7 +232,15 @@ public class BeanELResolver extends ELResolver { && (null == (this.write = getMethod(this.owner, descriptor.getWriteMethod()))); } - public Method write(ELContext ctx) { + 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) { @@ -240,7 +252,7 @@ public class BeanELResolver extends ELResolver { return this.write; } - public Method read(ELContext ctx) { + private Method read(ELContext ctx) { if (this.read == null) { this.read = getMethod(this.owner, descriptor.getReadMethod()); if (this.read == null) { diff --git a/java/javax/el/ResourceBundleELResolver.java b/java/javax/el/ResourceBundleELResolver.java index 0f1a6bb10..b7c5eea3a 100644 --- a/java/javax/el/ResourceBundleELResolver.java +++ b/java/javax/el/ResourceBundleELResolver.java @@ -95,7 +95,7 @@ public class ResourceBundleELResolver extends ELResolver { return true; } - public Iterator getFeatureDescriptors(ELContext context, Object base) { + public Iterator getFeatureDescriptors(ELContext context, Object base) { if (base instanceof ResourceBundle) { List feats = new ArrayList(); Enumeration e = ((ResourceBundle) base).getKeys(); diff --git a/java/javax/servlet/jsp/el/ScopedAttributeELResolver.java b/java/javax/servlet/jsp/el/ScopedAttributeELResolver.java index 456801404..d78dbd8b9 100644 --- a/java/javax/servlet/jsp/el/ScopedAttributeELResolver.java +++ b/java/javax/servlet/jsp/el/ScopedAttributeELResolver.java @@ -57,7 +57,7 @@ public class ScopedAttributeELResolver extends ELResolver { return null; } - public Class getType(ELContext context, Object base, Object property) + public Class getType(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); diff --git a/java/javax/servlet/jsp/tagext/TagInfo.java b/java/javax/servlet/jsp/tagext/TagInfo.java index 33b597fee..749e82966 100644 --- a/java/javax/servlet/jsp/tagext/TagInfo.java +++ b/java/javax/servlet/jsp/tagext/TagInfo.java @@ -38,21 +38,21 @@ public class TagInfo { * Static constant for getBodyContent() when it is Tag dependent. */ - public static final String BODY_CONTENT_TAG_DEPENDENT = "TAGDEPENDENT"; + public static final String BODY_CONTENT_TAG_DEPENDENT = "tagdependent"; /** * Static constant for getBodyContent() when it is empty. */ - public static final String BODY_CONTENT_EMPTY = "EMPTY"; + public static final String BODY_CONTENT_EMPTY = "empty"; /** * Static constant for getBodyContent() when it is scriptless. * * @since 2.0 */ - public static final String BODY_CONTENT_SCRIPTLESS = "SCRIPTLESS"; + public static final String BODY_CONTENT_SCRIPTLESS = "scriptless"; /** * Constructor for TagInfo from data in the JSP 1.1 format for TLD. -- 2.11.0