tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r698908 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/el/lang/ExpressionBuilder.java java/org/apache/el/lang/FunctionMapperImpl.java java/org/apache/el/lang/VariableMapperImpl.java webapps/docs/changelog.xml
Date Thu, 25 Sep 2008 09:42:01 GMT
Author: rjung
Date: Thu Sep 25 02:42:01 2008
New Revision: 698908

URL: http://svn.apache.org/viewvc?rev=698908&view=rev
Log:
Backport r696714 (more generics in EL).

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/el/lang/ExpressionBuilder.java
    tomcat/tc6.0.x/trunk/java/org/apache/el/lang/FunctionMapperImpl.java
    tomcat/tc6.0.x/trunk/java/org/apache/el/lang/VariableMapperImpl.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=698908&r1=698907&r2=698908&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Thu Sep 25 02:42:01 2008
@@ -179,16 +179,6 @@
   +1: markt, rjung, mturk
   -1: 
 
-* Use generics in EL to improve type safetyness.
-  Please check readExternal() in FunctionMapperImpl
-  and VariableMapperImpl. The type of the persisted
-  Map does change. Does this pose a consistency
-  problem with other components or older, already
-  persisted Maps?
-  http://svn.apache.org/viewvc?rev=696714&view=rev
-  +1: rjung, markt, mturk
-  -1: 
-
 * Fix ClassCastException in EL ExpressionBuilder when we
   try to cast a NullPointerException to an ELException.
   I still need to investigate where the NPE came from,

Modified: tomcat/tc6.0.x/trunk/java/org/apache/el/lang/ExpressionBuilder.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/el/lang/ExpressionBuilder.java?rev=698908&r1=698907&r2=698908&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/el/lang/ExpressionBuilder.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/el/lang/ExpressionBuilder.java Thu Sep 25 02:42:01
2008
@@ -50,7 +50,7 @@
  */
 public final class ExpressionBuilder implements NodeVisitor {
 
-    private static final ConcurrentCache cache = new ConcurrentCache(5000);
+    private static final ConcurrentCache<String, Node> cache = new ConcurrentCache<String,
Node>(5000);
 
     private FunctionMapper fnMapper;
 
@@ -87,7 +87,7 @@
             throw new ELException(MessageFactory.get("error.null"));
         }
 
-        Node n = (Node) cache.get(expr);
+        Node n = cache.get(expr);
         if (n == null) {
             try {
                 n = (new ELParser(new StringReader(expr)))

Modified: tomcat/tc6.0.x/trunk/java/org/apache/el/lang/FunctionMapperImpl.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/el/lang/FunctionMapperImpl.java?rev=698908&r1=698907&r2=698908&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/el/lang/FunctionMapperImpl.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/el/lang/FunctionMapperImpl.java Thu Sep 25 02:42:01
2008
@@ -39,7 +39,7 @@
 
     private static final long serialVersionUID = 1L;
 
-    protected Map functions = null;
+    protected Map<String, Function> functions = null;
 
     /*
      * (non-Javadoc)
@@ -49,7 +49,7 @@
      */
     public Method resolveFunction(String prefix, String localName) {
         if (this.functions != null) {
-            Function f = (Function) this.functions.get(prefix + ":" + localName);
+            Function f = this.functions.get(prefix + ":" + localName);
             return f.getMethod();
         }
         return null;
@@ -57,7 +57,7 @@
 
     public void addFunction(String prefix, String localName, Method m) {
         if (this.functions == null) {
-            this.functions = new HashMap();
+            this.functions = new HashMap<String, Function>();
         }
         Function f = new Function(prefix, localName, m);
         synchronized (this) {
@@ -81,7 +81,7 @@
      */
     public void readExternal(ObjectInput in) throws IOException,
             ClassNotFoundException {
-        this.functions = (Map) in.readObject();
+        this.functions = (Map<String, Function>) in.readObject();
     }
 
     public static class Function implements Externalizable {

Modified: tomcat/tc6.0.x/trunk/java/org/apache/el/lang/VariableMapperImpl.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/el/lang/VariableMapperImpl.java?rev=698908&r1=698907&r2=698908&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/el/lang/VariableMapperImpl.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/el/lang/VariableMapperImpl.java Thu Sep 25 02:42:01
2008
@@ -31,23 +31,23 @@
 
     private static final long serialVersionUID = 1L;
 
-    private Map vars = new HashMap();
+    private Map<String, ValueExpression> vars = new HashMap<String, ValueExpression>();
 
     public VariableMapperImpl() {
         super();
     }
 
     public ValueExpression resolveVariable(String variable) {
-        return (ValueExpression) this.vars.get(variable);
+        return this.vars.get(variable);
     }
 
     public ValueExpression setVariable(String variable,
             ValueExpression expression) {
-        return (ValueExpression) this.vars.put(variable, expression);
+        return this.vars.put(variable, expression);
     }
 
     public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        this.vars = (Map) in.readObject();
+        this.vars = (Map<String, ValueExpression>) in.readObject();
     }
 
     public void writeExternal(ObjectOutput out) throws IOException {

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=698908&r1=698907&r2=698908&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Thu Sep 25 02:42:01 2008
@@ -93,10 +93,13 @@
         <bug>45591</bug>: NPE on start-up failure in some cases. Based on a
         patch by Matt Passell. (markt)
       </fix>
-	</changelog>
+    </changelog>
   </subsection>
   <subsection name="Jasper">
     <changelog>
+      <update>
+        Use more generics in EL to improve type safety. (rjung)
+      </update>
       <fix>
         <bug>45511</bug>: The failure of the <code>empty</code> keyword
was a
         regression caused by the previous fix for <bug>42565</bug>. The original
@@ -120,7 +123,7 @@
   </subsection>
 </section>
 <section name="Tomcat 6.0.18 (remm)">
-  <subsection name="Cataina">
+  <subsection name="Catalina">
     <changelog>
       <fix>
         <bug>42727</bug>: Correctly handle request lines that are exact
@@ -807,7 +810,7 @@
         Fix FarmWarDeployer can be only configured as host subelement (pero)
       </fix>
       <fix>
-      	Fix wrong &amp;&amp; at ReplicationValve (pero)
+        Fix wrong &amp;&amp; at ReplicationValve (pero)
       </fix>
       <update>
         Add get/set methods for properties in the Tcp Failure detector.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message