https://issues.apache.org/bugzilla/show_bug.cgi?id=51177

             Bug #: 51177
           Summary: javax.el.MapELResolver getType returns class of kept
                    object instead of Object.class
           Product: Tomcat 6
           Version: 6.0.26
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Servlet & JSP API
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: f...@sql.ru
    Classification: Unclassified


Created attachment 26977
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=26977
JSP script reproduces the bug. Uncomment lines 46, 47 to see the real problem.

Hello, 

This is observed in Tomcat 6.0.26, Java 1.6 (Netbeans 6.9.1 bundle).

The MapELResolver getType method returns the class of the kept object instead
of Object.class. The Java specification says, "If the base object is a map,
[getType] returns the most general acceptable type for a value in this map",
which should mostly be Object.class.

This makes impossible, for example, 1) to set a String value to a map
expression, if previously that key was mapped to an Integer; 2) if we are
putting an Integer to the value which is currently the String, the Integer gets
coerced to the String (according to org.apache.el.parser.AstValue
implementation, see lines 153-157.)

The attached JSP script reproduces this bug.

I couldn't figure out whether it is connected with bug 44637 (seems that
request was reverse to mine).

Thanks!

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to