Merge remote-tracking branch 'origin/GP-1025_Dan_ParameterMapOrder' into Ghidra_10.0

This commit is contained in:
ghidra1
2021-06-09 17:12:59 -04:00
3 changed files with 70 additions and 6 deletions

View File

@@ -201,7 +201,10 @@ public interface TargetMethod extends TargetObject {
* @return a map of descriptions by name
*/
static TargetParameterMap makeParameters(Stream<ParameterDescription<?>> params) {
return TargetParameterMap.copyOf(params.collect(Collectors.toMap(p -> p.name, p -> p)));
return TargetParameterMap
.copyOf(params.collect(Collectors.toMap(p -> p.name, p -> p, (a, b) -> {
throw new IllegalArgumentException("duplicate parameters: " + a + " and " + b);
}, LinkedHashMap::new)));
}
/**

View File

@@ -204,7 +204,7 @@ public enum CollectionUtils {
protected final Map<K, V> wrapped;
public AbstractNMap(Map<K, V> map) {
this.wrapped = Map.copyOf(map);
this.wrapped = Collections.unmodifiableMap(new LinkedHashMap<>(map));
}
@Override