You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2011/05/09 13:18:04 UTC

DO NOT REPLY [Bug 51177] New: javax.el.MapELResolver getType returns class of kept object instead of Object.class

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: fedd@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 51177] javax.el.MapELResolver getType returns class of kept object instead of Object.class

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51177

--- Comment #6 from Fyodor Kravchenko <fe...@sql.ru> 2011-05-15 07:51:46 UTC ---
Thanks (if it's appropriate to thank here)!

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 51177] javax.el.MapELResolver getType returns class of kept object instead of Object.class

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51177

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Mark Thomas <ma...@apache.org> 2011-05-10 08:43:21 UTC ---
Fixed in 6.0.x and will be included in 6.0.33 onwards.

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 51177] javax.el.MapELResolver getType returns class of kept object instead of Object.class

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51177

--- Comment #3 from Konstantin Kolinko <kn...@gmail.com> 2011-05-09 18:35:53 UTC ---
ListELResolver.getType() has the same issue

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 51177] javax.el.MapELResolver getType returns class of kept object instead of Object.class

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51177

Fyodor Kravchenko <fe...@sql.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 51177] javax.el.MapELResolver getType returns class of kept object instead of Object.class

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51177

--- Comment #1 from Mark Thomas <ma...@apache.org> 2011-05-09 15:51:42 UTC ---
Thanks for the test case. I am looking at this now.

As an aside, the test JSP is invalid. You can't use hm.int since int is not a
valid Java identifier (it is a reserved word). Tomcat 6 lets you get away with
this. Tomcat 7 doesn't (unless you explicitly disable the check). This doesn't
affect the validity of this bug report. Replacing "int" with "integer" allows
the JSP to execute.

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 51177] javax.el.MapELResolver getType returns class of kept object instead of Object.class

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51177

--- Comment #4 from Mark Thomas <ma...@apache.org> 2011-05-09 18:44:50 UTC ---
Also fixed in 7.0.x for 7.0.14 and proposed for 6.0.x

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 51177] javax.el.MapELResolver getType returns class of kept object instead of Object.class

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51177

--- Comment #7 from Jackie Rosen <ja...@hushmail.com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


DO NOT REPLY [Bug 51177] javax.el.MapELResolver getType returns class of kept object instead of Object.class

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51177

Michael Heinen <mh...@googlemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mhn4dev@googlemail.com

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 51177] javax.el.MapELResolver getType returns class of kept object instead of Object.class

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51177

--- Comment #2 from Mark Thomas <ma...@apache.org> 2011-05-09 16:32:40 UTC ---
Fixed in 7.0.x for 7.0.14 onwards.

Proposed for 6.0.x.

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org