| 
14 | 14 | 
 
  | 
15 | 15 | import java.util.Arrays;  | 
16 | 16 | import java.util.Collections;  | 
17 |  | -import java.util.HashMap;  | 
18 | 17 | import java.util.Map;  | 
19 | 18 | import java.util.Set;  | 
 | 19 | +import java.util.TreeMap;  | 
20 | 20 | 
 
  | 
21 | 21 | public class FieldCapabilitiesBuilder {  | 
22 | 22 |     private final String name;  | 
@@ -77,27 +77,27 @@ public FieldCapabilitiesBuilder indices(String... indices) {  | 
77 | 77 |     }  | 
78 | 78 | 
 
  | 
79 | 79 |     public FieldCapabilitiesBuilder nonSearchableIndices(String... nonSearchableIndices) {  | 
80 |  | -        this.nonSearchableIndices = nonSearchableIndices;  | 
 | 80 | +        this.nonSearchableIndices = Arrays.copyOf(nonSearchableIndices, nonAggregatableIndices.length);  | 
81 | 81 |         return this;  | 
82 | 82 |     }  | 
83 | 83 | 
 
  | 
84 | 84 |     public FieldCapabilitiesBuilder nonAggregatableIndices(String... nonAggregatableIndices) {  | 
85 |  | -        this.nonAggregatableIndices = nonAggregatableIndices;  | 
 | 85 | +        this.nonAggregatableIndices = Arrays.copyOf(nonAggregatableIndices, nonAggregatableIndices.length);  | 
86 | 86 |         return this;  | 
87 | 87 |     }  | 
88 | 88 | 
 
  | 
89 | 89 |     public FieldCapabilitiesBuilder nonDimensionIndices(String... nonDimensionIndices) {  | 
90 |  | -        this.nonDimensionIndices = nonDimensionIndices;  | 
 | 90 | +        this.nonDimensionIndices = Arrays.copyOf(nonDimensionIndices, nonDimensionIndices.length);  | 
91 | 91 |         return this;  | 
92 | 92 |     }  | 
93 | 93 | 
 
  | 
94 | 94 |     public FieldCapabilitiesBuilder metricConflictsIndices(String... metricConflictsIndices) {  | 
95 |  | -        this.metricConflictsIndices = metricConflictsIndices;  | 
 | 95 | +        this.metricConflictsIndices = Arrays.copyOf(metricConflictsIndices, metricConflictsIndices.length);  | 
96 | 96 |         return this;  | 
97 | 97 |     }  | 
98 | 98 | 
 
  | 
99 | 99 |     public FieldCapabilitiesBuilder meta(Map<String, Set<String>> meta) {  | 
100 |  | -        this.meta = new HashMap<>(meta);  | 
 | 100 | +        this.meta = new TreeMap<>(meta);  | 
101 | 101 |         return this;  | 
102 | 102 |     }  | 
103 | 103 | 
 
  | 
 | 
0 commit comments