mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-1025: Preserving order of TargetMethod parameters.
This commit is contained in:
parent
1b0bd54560
commit
c711a6c5be
3 changed files with 70 additions and 6 deletions
|
@ -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)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue