[Bleeding] Cleaned up unsafe casts. Addresses BUKKIT-844
Removed internal collection leaks from PluginDescriptionFile BREAKING: PluginDescriptionFile.getAuthors() now returns List instead of ArrayList Various places with unsafe generics, notably List<Object> getList() in Configurations are now referenced as <?>. This is nonbreaking, but sourcecode will need to be revised when compiled. By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
@ -99,7 +99,6 @@ public final class SimplePluginManager implements PluginManager {
|
||||
* @param directory Directory to check for plugins
|
||||
* @return A list of all plugins loaded
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Plugin[] loadPlugins(File directory) {
|
||||
Validate.notNull(directory, "Directory cannot be null");
|
||||
Validate.isTrue(directory.isDirectory(), "Directory must be a directory");
|
||||
@ -138,12 +137,12 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
||||
plugins.put(description.getName(), file);
|
||||
|
||||
Collection<? extends String> softDependencySet = (Collection<? extends String>) description.getSoftDepend();
|
||||
Collection<String> softDependencySet = description.getSoftDepend();
|
||||
if (softDependencySet != null) {
|
||||
softDependencies.put(description.getName(), new LinkedList<String>(softDependencySet));
|
||||
}
|
||||
|
||||
Collection<? extends String> dependencySet = (Collection<? extends String>) description.getDepend();
|
||||
Collection<String> dependencySet = description.getDepend();
|
||||
if (dependencySet != null) {
|
||||
dependencies.put(description.getName(), new LinkedList<String>(dependencySet));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user