Apache JDO Project - [jira] Commented: (JDO-218) checkValues() method of *MapStringValueCollections doesn't

This is Interesting: Free IT Magazines  
Home > Archive > Apache JDO Project > November 2005 > [jira] Commented: (JDO-218) checkValues() method of *MapStringValueCollections doesn't





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [jira] Commented: (JDO-218) checkValues() method of *MapStringValueCollections doesn't
Craig Russell (JIRA)

2005-11-18, 8:45 pm

[ http://issues.apache.org/jira/brows...action_12358029 ]

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(expectedKey);
+ String actualValue = (String)
+ actual.get(TestUtil.getBigDecimalKey(expectedKey,
+ actualKeySet));
+ 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(expectedKey);
+ String actualValue = (String)
+ actual.get(TestUtil.getBigDecimalKey(expectedKey,
+ actualKeySet));
+ if (expectedVal.equals(actualValue)) {continue;}
if (expectedVal instanceof Comparable && ((Comparable)expectedVal.compareTo(actualValue)) == 0) {continue;}
+ sbuf.append("\nFor element " + i +
+ " expected value = " + expectedVal +
+ " actual Value = " + actualValue);
+ }



> 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.


--
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


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com