Fixed a bug that would clear the debug listeners on "add".

This was caused by a bug in the abstract interval tree class that would
clear the entire tree instead of the subtree whenever a new entry was
added.

Never roll your own custom collection implementation ...
This commit is contained in:
Kristian S. Stangeland 2012-11-16 03:57:55 +01:00
parent a40df621d0
commit 15ca240bac
3 changed files with 11 additions and 2 deletions

View File

@ -4,7 +4,7 @@
<groupId>com.comphenix.protocol</groupId> <groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId> <artifactId>ProtocolLib</artifactId>
<name>ProtocolLib</name> <name>ProtocolLib</name>
<version>1.6.0</version> <version>1.6.1-SNAPSHOT</version>
<description>Provides read/write access to the Minecraft protocol.</description> <description>Provides read/write access to the Minecraft protocol.</description>
<url>http://dev.bukkit.org/server-mods/protocollib/</url> <url>http://dev.bukkit.org/server-mods/protocollib/</url>
<developers> <developers>

View File

@ -257,7 +257,7 @@ public abstract class AbstractIntervalTree<TKey extends Comparable<TKey>, TValue
private void getEntries(Set<Entry> destination, NavigableMap<TKey, EndPoint> map) { private void getEntries(Set<Entry> destination, NavigableMap<TKey, EndPoint> map) {
Map.Entry<TKey, EndPoint> last = null; Map.Entry<TKey, EndPoint> last = null;
for (Map.Entry<TKey, EndPoint> entry : bounds.entrySet()) { for (Map.Entry<TKey, EndPoint> entry : map.entrySet()) {
switch (entry.getValue().state) { switch (entry.getValue().state) {
case BOTH: case BOTH:
EndPoint point = entry.getValue(); EndPoint point = entry.getValue();

View File

@ -23,6 +23,8 @@ import javax.xml.stream.events.XMLEvent;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import com.google.common.base.Preconditions;
/** /**
* Check dev.bukkit.org to find updates for a given plugin, and download the updates if needed. * Check dev.bukkit.org to find updates for a given plugin, and download the updates if needed.
* <p> * <p>
@ -211,6 +213,13 @@ public class Updater
*/ */
public Updater(Plugin plugin, Logger logger, String slug, File file, String permission) public Updater(Plugin plugin, Logger logger, String slug, File file, String permission)
{ {
// I hate NULL
Preconditions.checkNotNull(plugin, "plugin");
Preconditions.checkNotNull(logger, "logger");
Preconditions.checkNotNull(slug, "slug");
Preconditions.checkNotNull(file, "file");
Preconditions.checkNotNull(permission, "permission");
this.plugin = plugin; this.plugin = plugin;
this.file = file; this.file = file;
this.slug = slug; this.slug = slug;