11-19-05 01:45 AM
[ [url]http://issues.apache.org/jira/browse/JDO-218?page=comments#action_12358029[/
url] ]
Craig Russell commented on JDO-218:
-----------------------------------
It seems like this code has a similar problem in case there is a BigDecimal
as a value.
+ String expectedVal = (String) expected.get(expe
ctedKey);
+ String actualValue = (String)
+ actual.get(TestUtil.getBigDecimalKey(expecte
dKey,
+ actualK
eySet));
+ if (!expectedVal.equals(actualValue)) {
+ sbuf.append("\nFor element " + i +
+ " expected value = " + expectedVal +
+ " actual Value = " + actualValue);
+ }
Could it be rewritten to use compareTo instead:
+ String expectedVal = (String) expected.get(expe
ctedKey);
+ String actualValue = (String)
+ actual.get(TestUtil.getBigDecimalKey(expecte
dKey,
+ actualK
eySet));
+ if (expectedVal.equals(actualValue)) {cont
inue;}
if (expectedVal instanceof Comparable && ((Comparable)expectedVal.compareTo(
actualValue)) == 0) {continue;}
+ sbuf.append("\nFor element " + i +
+ " expected value = " + expectedVal +
+ " actual Value = " + actualValue);
+ }
[vbcol=seagreen]
> checkValues() method of *MapStringValueCollections doesn't work
> ---------------------------------------------------------------
>
> Key: JDO-218
> URL: http://issues.apache.org/jira/browse/JDO-218
> Project: JDO
> Type: Bug
> Components: tck20
> Reporter: Michelle Caisse
> Assignee: Michelle Caisse
> Attachments: JDO-218.patch
>
> No map fields with BigDecimal values compare okay. There are several problems.[/v
bcol]
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secur...nistrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[ Post a follow-up to this message ]
|