Explicitly set Java language level to 1.8 + using diamonds
This commit is contained in:
parent
fefd9022a8
commit
973133c40c
2
pom.xml
2
pom.xml
|
@ -17,6 +17,8 @@
|
|||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
|
|
|
@ -37,7 +37,7 @@ public final class CustomCardFormatHelper {
|
|||
|
||||
public static String formatBlackCard(final JSONArray textParts) {
|
||||
// TODO this is going to need some work to look pretty.
|
||||
final List<String> strs = new ArrayList<String>(textParts.size());
|
||||
final List<String> strs = new ArrayList<>(textParts.size());
|
||||
for (final Object o : textParts) {
|
||||
strs.add((String) o);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public final class CustomCardFormatHelper {
|
|||
|
||||
public static String formatWhiteCard(final JSONArray textParts) {
|
||||
// The white cards should only ever have one element in text, but let's be safe.
|
||||
final List<String> strs = new ArrayList<String>(textParts.size());
|
||||
final List<String> strs = new ArrayList<>(textParts.size());
|
||||
for (final Object o : textParts) {
|
||||
final String cardCastString = (String) o;
|
||||
if (cardCastString.isEmpty()) {
|
||||
|
|
|
@ -249,7 +249,7 @@ public class CustomCardsService {
|
|||
|
||||
private void putCache(CustomDeck deck, long timeout, String url, String hash) {
|
||||
synchronized (cache) {
|
||||
cache.add(new SoftReference<CacheEntry>(new CacheEntry(timeout + System.currentTimeMillis(), deck, url, hash)));
|
||||
cache.add(new SoftReference<>(new CacheEntry(timeout + System.currentTimeMillis(), deck, url, hash)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -295,16 +295,13 @@ public class CustomCardsService {
|
|||
return null;
|
||||
}
|
||||
|
||||
final InputStream is = conn.getInputStream();
|
||||
try {
|
||||
try (InputStream is = conn.getInputStream()) {
|
||||
return new ByteSource() {
|
||||
@Override
|
||||
public InputStream openStream() {
|
||||
return is;
|
||||
}
|
||||
}.asCharSource(Charsets.UTF_8).read();
|
||||
} finally {
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ public class CustomDeck extends CardSet {
|
|||
private final int id;
|
||||
private final String name;
|
||||
private final String description;
|
||||
private final Set<CustomBlackCard> blackCards = new HashSet<CustomBlackCard>();
|
||||
private final Set<CustomWhiteCard> whiteCards = new HashSet<CustomWhiteCard>();
|
||||
private final Set<CustomBlackCard> blackCards = new HashSet<>();
|
||||
private final Set<CustomWhiteCard> whiteCards = new HashSet<>();
|
||||
|
||||
public CustomDeck(final int id, final String name, final String description) {
|
||||
this.id = id;
|
||||
|
|
|
@ -30,7 +30,7 @@ public class AddCardsetHandler extends GameWithPlayerHandler {
|
|||
@Override
|
||||
public Map<ReturnableData, Object> handleWithUserInGame(final RequestWrapper request,
|
||||
final HttpSession session, final User user, final Game game) {
|
||||
final Map<ReturnableData, Object> data = new HashMap<ReturnableData, Object>();
|
||||
final Map<ReturnableData, Object> data = new HashMap<>();
|
||||
|
||||
if (game.getHost() != user) {
|
||||
return error(ErrorCode.NOT_GAME_HOST);
|
||||
|
|
|
@ -31,7 +31,7 @@ public class ListCardsetsHandler extends GameWithPlayerHandler {
|
|||
@Override
|
||||
public Map<ReturnableData, Object> handleWithUserInGame(final RequestWrapper request,
|
||||
final HttpSession session, final User user, final Game game) {
|
||||
final Map<ReturnableData, Object> data = new HashMap<ReturnableData, Object>();
|
||||
final Map<ReturnableData, Object> data = new HashMap<>();
|
||||
|
||||
final List<Map<CardSetData, Object>> setDatas = new ArrayList<>();
|
||||
for (final Integer deckId : game.getCustomDeckIds().toArray(new Integer[0])) {
|
||||
|
|
|
@ -30,7 +30,7 @@ public class RemoveCardsetHandler extends GameWithPlayerHandler {
|
|||
@Override
|
||||
public Map<ReturnableData, Object> handleWithUserInGame(final RequestWrapper request,
|
||||
final HttpSession session, final User user, final Game game) {
|
||||
final Map<ReturnableData, Object> data = new HashMap<ReturnableData, Object>();
|
||||
final Map<ReturnableData, Object> data = new HashMap<>();
|
||||
|
||||
if (game.getHost() != user) {
|
||||
return error(ErrorCode.NOT_GAME_HOST);
|
||||
|
|
Loading…
Reference in New Issue