Bug 46325 - ELSupport coerceToNumber() problems
Summary: ELSupport coerceToNumber() problems
Status: RESOLVED DUPLICATE of bug 43656
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Servlet & JSP API (show other bugs)
Version: 6.0.18
Hardware: PC Mac OS X 10.4
: P2 regression (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-02 10:03 UTC by Stephan Bublava
Modified: 2008-12-02 10:57 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Bublava 2008-12-02 10:03:28 UTC
1) ELSupport.coerceToNumber() cannot coerce java.math.BigDecimal to java.lang.Number which is basically a no-op. This is a regression from 6.0.16.

Test-case:

@Test
public void testNumberCoercion() {
	BigDecimal d = new BigDecimal("23");
	try {
		Assert.assertEquals(d, ELSupport.coerceToNumber(d, Number.class));
	} catch (IllegalArgumentException ex) {
		fail("conversion failed");
	}
}

2) BigDecimal is immutable. The code to convert from BigDecimal to BigDecimal should therefore return its input, not a copy. (ELSupport.java line 235)
Comment 1 Mark Thomas 2008-12-02 10:22:21 UTC

*** This bug has been marked as a duplicate of bug 43656 ***
Comment 2 Stephan Bublava 2008-12-02 10:57:29 UTC
> *** This bug has been marked as a duplicate of bug 43656 ***

I only searched open issues before creating a new ticket. Sorry ...