Java 6 compatible

This commit is contained in:
gravitylow 2014-04-15 15:19:00 -04:00
parent 8453ab3e76
commit 6c4cfd337e
5 changed files with 13 additions and 13 deletions

View File

@ -32,8 +32,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.3.2</version>
<configuration> <configuration>
<source>1.7</source> <source>1.6</source>
<target>1.7</target> <target>1.6</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@ -233,7 +233,7 @@ public class Board {
// -------------------------------------------- // // -------------------------------------------- //
public static Map<String, Map<String, String>> dumpAsSaveFormat() { public static Map<String, Map<String, String>> dumpAsSaveFormat() {
Map<String, Map<String, String>> worldCoordIds = new HashMap<>(); Map<String, Map<String, String>> worldCoordIds = new HashMap<String, Map<String, String>>();
String worldName, coords; String worldName, coords;
String id; String id;

View File

@ -24,11 +24,11 @@ public class Faction extends Entity implements EconomyParticipator {
private Map<String, Relation> relationWish; private Map<String, Relation> relationWish;
// FIELD: claimOwnership // FIELD: claimOwnership
private Map<FLocation, Set<String>> claimOwnership = new ConcurrentHashMap<>(); private Map<FLocation, Set<String>> claimOwnership = new ConcurrentHashMap<FLocation, Set<String>>();
// FIELD: fplayers // FIELD: fplayers
// speedy lookup of players in faction // speedy lookup of players in faction
private transient Set<FPlayer> fplayers = new HashSet<>(); private transient Set<FPlayer> fplayers = new HashSet<FPlayer>();
// FIELD: invites // FIELD: invites
// Where string is a lowercase player name // Where string is a lowercase player name
@ -217,7 +217,7 @@ public class Faction extends Entity implements EconomyParticipator {
// -------------------------------------------- // // -------------------------------------------- //
public Faction() { public Faction() {
this.relationWish = new HashMap<>(); this.relationWish = new HashMap<String, Relation>();
this.invites = new HashSet<String>(); this.invites = new HashSet<String>();
this.open = Conf.newFactionsDefaultOpen; this.open = Conf.newFactionsDefaultOpen;
this.tag = "???"; this.tag = "???";
@ -395,12 +395,12 @@ public class Faction extends Entity implements EconomyParticipator {
public Set<FPlayer> getFPlayers() { public Set<FPlayer> getFPlayers() {
// return a shallow copy of the FPlayer list, to prevent tampering and concurrency issues // return a shallow copy of the FPlayer list, to prevent tampering and concurrency issues
Set<FPlayer> ret = new HashSet<>(fplayers); Set<FPlayer> ret = new HashSet<FPlayer>(fplayers);
return ret; return ret;
} }
public Set<FPlayer> getFPlayersWhereOnline(boolean online) { public Set<FPlayer> getFPlayersWhereOnline(boolean online) {
Set<FPlayer> ret = new HashSet<>(); Set<FPlayer> ret = new HashSet<FPlayer>();
for (FPlayer fplayer : fplayers) { for (FPlayer fplayer : fplayers) {
if (fplayer.isOnline() == online) { if (fplayer.isOnline() == online) {
@ -423,7 +423,7 @@ public class Faction extends Entity implements EconomyParticipator {
} }
public ArrayList<FPlayer> getFPlayersWhereRole(Role role) { public ArrayList<FPlayer> getFPlayersWhereRole(Role role) {
ArrayList<FPlayer> ret = new ArrayList<>(); ArrayList<FPlayer> ret = new ArrayList<FPlayer>();
if (!this.isNormal()) return ret; if (!this.isNormal()) return ret;
for (FPlayer fplayer : fplayers) { for (FPlayer fplayer : fplayers) {
@ -436,7 +436,7 @@ public class Faction extends Entity implements EconomyParticipator {
} }
public ArrayList<Player> getOnlinePlayers() { public ArrayList<Player> getOnlinePlayers() {
ArrayList<Player> ret = new ArrayList<>(); ArrayList<Player> ret = new ArrayList<Player>();
if (this.isPlayerFreeType()) return ret; if (this.isPlayerFreeType()) return ret;
for (Player player : P.p.getServer().getOnlinePlayers()) { for (Player player : P.p.getServer().getOnlinePlayers()) {

View File

@ -184,7 +184,7 @@ public abstract class EntityCollection<E extends Entity> {
if (saveIsRunning) return true; if (saveIsRunning) return true;
saveIsRunning = true; saveIsRunning = true;
Map<String, E> entitiesThatShouldBeSaved = new HashMap<>(); Map<String, E> entitiesThatShouldBeSaved = new HashMap<String, E>();
for (E entity : this.entities) { for (E entity : this.entities) {
if (entity.shouldBeSaved()) { if (entity.shouldBeSaved()) {
entitiesThatShouldBeSaved.put(entity.getId(), entity); entitiesThatShouldBeSaved.put(entity.getId(), entity);
@ -212,7 +212,7 @@ public abstract class EntityCollection<E extends Entity> {
private Map<String, E> loadCore() { private Map<String, E> loadCore() {
if (!this.file.exists()) { if (!this.file.exists()) {
return new HashMap<>(); return new HashMap<String, E>();
} }
String content = DiscUtil.readCatch(this.file); String content = DiscUtil.readCatch(this.file);

View File

@ -82,4 +82,4 @@ public class UUIDFetcher implements Callable<Map<String, UUID>> {
} }
return JSONValue.toJSONString(lookups); return JSONValue.toJSONString(lookups);
} }
} }