Fix ClassCastException in tryClimb building inheritance map
The interface uses the generic Collection type but the implementation an ArrayList. Fix by creating an ArrayList from the Collection. Resolves this crash observed when updating MCPC+'s plugin loader: https://gist.github.com/agaricusb/5471423
This commit is contained in:
parent
04069fb8b9
commit
d33223562d
@ -127,8 +127,8 @@ public class InheritanceMap implements InheritanceProvider {
|
||||
return inheritanceMap.get(className);
|
||||
}
|
||||
|
||||
public void setParents(String className, ArrayList<String> parents) {
|
||||
inheritanceMap.put(className, parents);
|
||||
public void setParents(String className, Collection<String> parents) {
|
||||
inheritanceMap.put(className, new ArrayList<String>(parents));
|
||||
}
|
||||
|
||||
public int size() {
|
||||
|
@ -81,7 +81,7 @@ public class JarMapping {
|
||||
parents = inheritanceMap.getParents(owner);
|
||||
} else if (fallbackInheritanceProvider != null) {
|
||||
parents = fallbackInheritanceProvider.getParents(owner);
|
||||
inheritanceMap.setParents(owner, (ArrayList<String>) parents);
|
||||
inheritanceMap.setParents(owner, parents);
|
||||
}
|
||||
|
||||
if (parents != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user