Skip to content

Commit

Permalink
Retain iteration order.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed May 14, 2018
1 parent ee68441 commit 9a7ecc2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions byte-buddy-dep/src/main/java/net/bytebuddy/asm/Advice.java
Expand Up @@ -6541,7 +6541,7 @@ protected Resolved(MethodDescription.InDefinedShape adviceMethod,
this.classReader = classReader;
}

protected abstract Map<Integer, TypeDefinition> resolveInitializationTypes(ArgumentHandler argumentHandler); // TODO: Rename
protected abstract Map<Integer, TypeDefinition> resolveInitializationTypes(ArgumentHandler argumentHandler);

/**
* Applies a resolution for a given instrumented method.
Expand Down Expand Up @@ -6916,7 +6916,7 @@ protected ForMethodEnter(MethodDescription.InDefinedShape adviceMethod,
adviceMethod.getDeclaredAnnotations().ofType(OnMethodEnter.class).getValue(SKIP_ON).resolve(TypeDescription.class),
classReader);
prependLineNumber = adviceMethod.getDeclaredAnnotations().ofType(OnMethodEnter.class).getValue(PREPEND_LINE_NUMBER).resolve(Boolean.class);
namedTypes = new HashMap<String, TypeDefinition>(); // TODO: Extract local variables
namedTypes = new HashMap<String, TypeDefinition>(); // TODO: move
for (ParameterDescription parameterDescription : adviceMethod.getParameters().filter(isAnnotatedWith(Local.class))) {
String name = parameterDescription.getDeclaredAnnotations().ofType(Local.class).loadSilent().value();
TypeDefinition previous = namedTypes.put(name, parameterDescription.getType());
Expand Down Expand Up @@ -6948,7 +6948,7 @@ protected static Resolved.ForMethodEnter of(MethodDescription.InDefinedShape adv

@Override
protected Map<Integer, TypeDefinition> resolveInitializationTypes(ArgumentHandler argumentHandler) {
Map<Integer, TypeDefinition> namedTypes = new HashMap<Integer, TypeDefinition>(); // TODO: Iteration order?
SortedMap<Integer, TypeDefinition> namedTypes = new TreeMap<Integer, TypeDefinition>();
for (Map.Entry<String, TypeDefinition> entry : this.namedTypes.entrySet()) {
namedTypes.put(argumentHandler.named(entry.getKey()), entry.getValue());
}
Expand Down

0 comments on commit 9a7ecc2

Please sign in to comment.