Merge pull request #2868 from kubikrubikvkube/master

Functional interfaces annotation and bugfixes
This commit is contained in:
ingmargoudt 2017-02-15 20:27:21 +01:00 committed by GitHub
commit a1bc43d33e
96 changed files with 215 additions and 157 deletions

View file

@ -3,7 +3,7 @@ package mage.client.util;
/**
* @author nantuko
*/
@FunctionalInterface
public interface Command {
void execute();
}

View file

@ -34,6 +34,7 @@ import java.io.Serializable;
* @author BetaSteward_at_googlemail.com
* @param <E>
*/
@FunctionalInterface
public interface Listener<E extends Event> extends Serializable {
void event(E event);

View file

@ -23,6 +23,7 @@ public class TextboxRule {
// An attributed region in the text, which can be applied to an
// attributed string.
@FunctionalInterface
public interface AttributeRegion {
void applyToAttributedString(AttributedString str, Font normal, Font italic);

View file

@ -18,6 +18,7 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Collections;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@ -102,7 +103,7 @@ public class UI {
Object o = elem.getAttributes().getAttribute(StyleConstants.NameAttribute);
if (o instanceof HTML.Tag) {
HTML.Tag kind = (HTML.Tag) o;
if (kind == HTML.Tag.IMG) {
if (Objects.equals(kind, HTML.Tag.IMG)) {
return new ImageView(elem) {
@Override
public URL getImageURL() {

View file

@ -296,10 +296,10 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
}
} else if (card.getCardNumber().isEmpty() || "0".equals(card.getCardNumber())) {
System.err.println("There was a critical error!");
logger.error("Card has no collector ID and won't be sent to client: " + card);
logger.error("Card has no collector ID and won't be sent to client: " + card.getName());
} else if (card.getSetCode().isEmpty()) {
System.err.println("There was a critical error!");
logger.error("Card has no set name and won't be sent to client:" + card);
logger.error("Card has no set name and won't be sent to client:" + card.getName());
}
});
numberWithoutTokens = allCards.size();