[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:
Bukkit/Spigot
2012-02-29 08:32:25 -06:00
parent e7c9a43100
commit 5906da7948
14 changed files with 174 additions and 183 deletions

View File

@ -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));
}