[ 
https://issues.apache.org/jira/browse/VALIDATOR-492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17818848#comment-17818848
 ] 

Tobias Wildgruber commented on VALIDATOR-492:
---------------------------------------------

[https://github.com/apache/commons-validator/commit/273b687f81a1e48f2dc1bd1850f223ed21a8ebb5#diff-89a6acf0c6feec72707708d50292e9d15f3efafd6de0c52caa1a8ff6d5a65974R144]

This is where the bug was introduced, FastHashMap seems to be incompatible with 
forEach().

> ValidatorUtils.copyFastHashMap is broken
> ----------------------------------------
>
>                 Key: VALIDATOR-492
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-492
>             Project: Commons Validator
>          Issue Type: Bug
>    Affects Versions: 1.8.0
>            Reporter: Tobias Wildgruber
>            Priority: Major
>
> ValidatorUtils.copyFastHashMap is broken which in turn causes Field#clone() 
> to loose hVars and hMsgs. Field#clone().
> This is f.e. used in ValidatorAction#
> handleIndexedField() causing validation to misbehave when using 
> indexedListProperty (which is where we found this).
> Test case that fails in 1.8.0 but works in 1.7:
> {{public void testCopyFastHashMap() {}}
> {{  final FastHashMap original = new FastHashMap();}}
> {{  original.put("key1", "value1");}}
> {{  original.put("key2", "value2");}}
> {{  original.put("key3", "value3");}}
> {{  original.setFast(true);}}
> {{  final FastHashMap copy = ValidatorUtils.copyFastHashMap(original);}}
> {{  assertEquals(original, copy);}}
> {{}}}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to