If different identifiers can have same values, your third map will keep the last parsed one. E.g. :
File 1 :
- localId1 => “aaaa”
- localId2 => “bbbb”
- localId3 => “cccc”
- localId4 => “aaaa”
File 2:
- localId1 => “1111”
- localId2 => “2222”
- localId3 => “3333”
- localId4 => “4444”
Your first and second maps will store this mapping as it is in your files.
However, when you build your third map, you’ll get :
- “aaaa” => “4444”
- “bbbb” => “2222”
- “cccc” => “3333”
As you can see, when you’ll verify the parsing of your files, you’ll get an error with localId1 (“aaaa” in file 1, “1111” in file 2, but “aaaa” => “4444” in the third map).
If you can’t ensure the uniqueness of the values in your files, you can’t store mapping in a map “value in file 1” => “value in file 2”.
This can be an explanation of the 15% errors.
1
solved java changes String during processing?