EsotericSoftware / EsotericSoftware/yamlbeans
Sets don't deserialise to something that equals the original
- Dominant language
- Java
- Stars
- 568
- Forks
- 146
- PR merge metrics
- No merged PRs in 30d
Description
The following junit test fails at the last assert with the error:
java.lang.AssertionError: expected: java.util.HashSet<[1]> but was: java.util.HashSet<[1]>
```
@Test
public void test_Set() throws YamlException {
Set set1 = new HashSet();
set1.add(1);
Set set2 = new HashSet();
set2.add(1);
assertEquals(set1, set2);
// serialise
Writer sb = new StringWriter();
YamlWriter writer = new YamlWriter(sb);
writer.write(set1);
writer.close();
String yaml = sb.toString();
// deserialise
YamlReader reader = new YamlReader(new StringReader(yaml));
Set set3 = (Set) reader.read();
assertEquals(set1, set3);
}
```
The yaml is:
```
!java.util.HashSet
- 1
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.