vineflower
vineflower copied to clipboard
Inconsistent renaming when LVT entries clash
Vineflower version
1.11.1
Describe the bug
Conflicting LVT's within inner classes can cause variable references to reference the wrong variable
Additional information
The JAR file enclosed in the above zip generates the following code when decompiled:
public class Util {
public static <T, R> Function<T, R> memoize(final Function<T, R> $$0) {
return new Function<T, R>() {
private final Map<T, R> cache = new ConcurrentHashMap<>();
@Override
public R apply(T $$0x) {
return this.cache.computeIfAbsent($$0, $$0);
}
};
}
}
The first parameter to computeIfAbsent should be $$0x (the apply parameter), not $$0 (the function parameter in the enclosing method). The parameter's name in the LVT for the apply method is $$0, but because it conflicted with an outside variable, Vineflower renamed it to $$0x, but it didn't rename it's usage.