Skip to content

Commit a9f036b

Browse files
committed
VPackInstanceCreators preserve collections entries order
1 parent 2dc1c3a commit a9f036b

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
66

77
## [Unreleased]
88

9+
- Map and Set VPackInstanceCreators preserve collections entries order (based on `LinkedHashSet` and `LinkedHashMap`)
10+
911
## [2.1.0] - 2019-12-20
1012

1113
- added [tags support](https://github.com/arangodb/velocypack/blob/master/VelocyPack.md#tagging)

src/main/java/com/arangodb/velocypack/internal/VPackInstanceCreators.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,10 @@
2020

2121
package com.arangodb.velocypack.internal;
2222

23-
import java.util.ArrayList;
24-
import java.util.Collection;
25-
import java.util.HashMap;
26-
import java.util.HashSet;
27-
import java.util.List;
28-
import java.util.Map;
29-
import java.util.Set;
30-
3123
import com.arangodb.velocypack.VPackInstanceCreator;
3224

25+
import java.util.*;
26+
3327
/**
3428
* @author Mark Vollmary
3529
*
@@ -56,13 +50,13 @@ public List createInstance() {
5650
public static final VPackInstanceCreator<Set> SET = new VPackInstanceCreator<Set>() {
5751
@Override
5852
public Set createInstance() {
59-
return new HashSet();
53+
return new LinkedHashSet();
6054
}
6155
};
6256
public static final VPackInstanceCreator<Map> MAP = new VPackInstanceCreator<Map>() {
6357
@Override
6458
public Map createInstance() {
65-
return new HashMap();
59+
return new LinkedHashMap();
6660
}
6761
};
6862

0 commit comments

Comments
 (0)