From 2e1a43c2289295a8159684a34f649a9d75a98c82 Mon Sep 17 00:00:00 2001 From: eueln Date: Sun, 2 Nov 2014 13:00:01 -0600 Subject: [PATCH] Make MemoryFactions::load non-abstract. MemoryFactions::load was incorrectly marked as abstract, which wouldn't have been possible if not for an erroneous semicolon. Additionally, we need to call MemoryFactions::load from subclasses. Fixes #105 Fixes #106 --- .../factions/zcore/persist/MemoryFactions.java | 15 +++++++-------- .../factions/zcore/persist/json/JSONFactions.java | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFactions.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFactions.java index f9467a05..6606a33e 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFactions.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFactions.java @@ -1,23 +1,22 @@ package com.massivecraft.factions.zcore.persist; +import com.massivecraft.factions.Faction; +import com.massivecraft.factions.Factions; +import com.massivecraft.factions.util.MiscUtil; +import com.massivecraft.factions.zcore.util.TL; +import org.bukkit.ChatColor; + import java.util.ArrayList; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import org.bukkit.ChatColor; - -import com.massivecraft.factions.Faction; -import com.massivecraft.factions.Factions; -import com.massivecraft.factions.util.MiscUtil; -import com.massivecraft.factions.zcore.util.TL; - public abstract class MemoryFactions extends Factions { public Map factions = new ConcurrentHashMap(); public int nextId = 1; - public abstract void load(); { + public void load() { // Make sure the default neutral faction exists if (!factions.containsKey("0")) { Faction faction = generateFactionObject("0"); diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFactions.java b/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFactions.java index c88a80c1..291ff905 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFactions.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFactions.java @@ -67,11 +67,11 @@ public class JSONFactions extends MemoryFactions { } public void load() { + super.load(); Map factions = this.loadCore(); if (factions == null) { return ; } - this.factions.clear(); this.factions.putAll(factions); P.p.log("Loaded " + factions.size() + " Factions"); }