Fix loadbefore, soft, and normal dependencies with spaces. Fixes BUKKIT-5418

This change makes the lists of loadbefore, softdependency, and dependency
replace the spaces in the names with underscored to reflect the behavior
used with names.

By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
Bukkit/Spigot
2014-02-15 11:17:14 -06:00
parent 05512d64d0
commit edd5dc6155
2 changed files with 28 additions and 47 deletions

View File

@ -144,7 +144,7 @@ public final class SimplePluginManager implements PluginManager {
plugins.put(description.getName(), file);
Collection<String> softDependencySet = description.getSoftDepend();
if (softDependencySet != null) {
if (softDependencySet != null && !softDependencySet.isEmpty()) {
if (softDependencies.containsKey(description.getName())) {
// Duplicates do not matter, they will be removed together if applicable
softDependencies.get(description.getName()).addAll(softDependencySet);
@ -154,12 +154,12 @@ public final class SimplePluginManager implements PluginManager {
}
Collection<String> dependencySet = description.getDepend();
if (dependencySet != null) {
if (dependencySet != null && !dependencySet.isEmpty()) {
dependencies.put(description.getName(), new LinkedList<String>(dependencySet));
}
Collection<String> loadBeforeSet = description.getLoadBefore();
if (loadBeforeSet != null) {
if (loadBeforeSet != null && !loadBeforeSet.isEmpty()) {
for (String loadBeforeTarget : loadBeforeSet) {
if (softDependencies.containsKey(loadBeforeTarget)) {
softDependencies.get(loadBeforeTarget).add(description.getName());