From bb187621b7087387e6d15f7c314c541e239313cc Mon Sep 17 00:00:00 2001 From: OMGeeky Date: Sat, 21 Jun 2025 18:19:25 +0200 Subject: [PATCH] remove a bunch of unused assignments --- hacked-libtiled/tiled/core/MapObject.java | 2 +- hacked-libtiled/tiled/core/Sprite.java | 2 +- hacked-libtiled/tiled/io/TMXMapWriter.java | 2 +- src/com/gpl/rpg/atcontentstudio/ATContentStudio.java | 2 +- src/com/gpl/rpg/atcontentstudio/Notification.java | 2 +- .../gpl/rpg/atcontentstudio/model/GameSource.java | 4 ++-- src/com/gpl/rpg/atcontentstudio/model/Project.java | 6 +++--- src/com/gpl/rpg/atcontentstudio/model/Workspace.java | 10 ++++------ .../model/bookmarks/BookmarksRoot.java | 4 ++-- .../gpl/rpg/atcontentstudio/model/maps/KeyArea.java | 6 +++--- .../rpg/atcontentstudio/model/maps/MapChange.java | 4 ++-- .../rpg/atcontentstudio/model/maps/ReplaceArea.java | 2 +- .../gpl/rpg/atcontentstudio/model/maps/TMXMap.java | 2 +- .../model/tools/resoptimizer/ResourcesCompactor.java | 3 +-- src/com/gpl/rpg/atcontentstudio/ui/Editor.java | 4 ++-- .../gpl/rpg/atcontentstudio/ui/JSONImportWizard.java | 12 +++++------- .../atcontentstudio/ui/ProjectCreationWizard.java | 6 ++---- src/com/gpl/rpg/atcontentstudio/ui/ProjectsTree.java | 2 +- .../gpl/rpg/atcontentstudio/ui/WorkspaceActions.java | 2 +- .../ui/WorldmapLabelEditionWizard.java | 2 +- .../ui/gamedataeditors/DialogueEditor.java | 4 ++-- .../ui/gamedataeditors/ItemEditor.java | 6 ++---- .../rpg/atcontentstudio/ui/map/MapColorFilters.java | 2 +- .../gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java | 8 ++++---- .../ui/sprites/SpritesheetEditor.java | 2 +- .../ui/tools/writermode/WriterModeEditor.java | 10 +++++----- src/net/launchpad/tobal/poparser/POFile.java | 2 +- src/net/launchpad/tobal/poparser/POParser.java | 9 +++------ 28 files changed, 55 insertions(+), 67 deletions(-) diff --git a/hacked-libtiled/tiled/core/MapObject.java b/hacked-libtiled/tiled/core/MapObject.java index 111b825..8e75282 100644 --- a/hacked-libtiled/tiled/core/MapObject.java +++ b/hacked-libtiled/tiled/core/MapObject.java @@ -43,7 +43,7 @@ public class MapObject implements Cloneable { private Properties properties = new Properties(); private ObjectGroup objectGroup; - private Rectangle bounds = new Rectangle(); + private Rectangle bounds; private String name = "Object"; private String type = ""; private String imageSource = ""; diff --git a/hacked-libtiled/tiled/core/Sprite.java b/hacked-libtiled/tiled/core/Sprite.java index 670bc4c..266c6ec 100644 --- a/hacked-libtiled/tiled/core/Sprite.java +++ b/hacked-libtiled/tiled/core/Sprite.java @@ -57,7 +57,7 @@ public class Sprite private String name = null; private int id = -1; - private int flags = KEY_LOOP; + private int flags; private float frameRate = 1.0f; //one fps private Tile[] frames; diff --git a/hacked-libtiled/tiled/io/TMXMapWriter.java b/hacked-libtiled/tiled/io/TMXMapWriter.java index 9004af8..600a409 100644 --- a/hacked-libtiled/tiled/io/TMXMapWriter.java +++ b/hacked-libtiled/tiled/io/TMXMapWriter.java @@ -588,7 +588,7 @@ public class TMXMapWriter } // Iterate while parents are the same - int shared = 0; + int shared; int maxShared = Math.min(fromParents.size(), toParents.size()); for (shared = 0; shared < maxShared; shared++) { String fromParent = fromParents.get(shared); diff --git a/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java b/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java index e53645f..8a1f295 100644 --- a/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java +++ b/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java @@ -62,7 +62,7 @@ public class ATContentStudio { */ public static void main(String[] args) { String fontScaling = System.getProperty(FONT_SCALE_ENV_VAR_NAME); - Float fontScale = null; + Float fontScale; if (fontScaling != null) { try { fontScale = Float.parseFloat(fontScaling); diff --git a/src/com/gpl/rpg/atcontentstudio/Notification.java b/src/com/gpl/rpg/atcontentstudio/Notification.java index fa25ebc..6cf184e 100644 --- a/src/com/gpl/rpg/atcontentstudio/Notification.java +++ b/src/com/gpl/rpg/atcontentstudio/Notification.java @@ -8,7 +8,7 @@ public class Notification { public static List notifs = new ArrayList(); private static List listeners = new CopyOnWriteArrayList(); - public static boolean showS = true, showI = true, showW = true, showE = true; + public static boolean showS, showI, showW, showE; static { boolean[] config = ConfigCache.getNotifViewConfig(); diff --git a/src/com/gpl/rpg/atcontentstudio/model/GameSource.java b/src/com/gpl/rpg/atcontentstudio/model/GameSource.java index f94751e..043d5d2 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/GameSource.java +++ b/src/com/gpl/rpg/atcontentstudio/model/GameSource.java @@ -57,7 +57,7 @@ public class GameSource implements ProjectTreeNode, Serializable { public File baseFolder; public Type type; - public transient Project parent = null; + public transient Project parent; public transient Map> referencedSourceFiles = null; @@ -105,7 +105,7 @@ public class GameSource implements ProjectTreeNode, Serializable { } public void readResourceList() { - File xmlFile = null; + File xmlFile; if (parent.sourceSetToUse == ResourceSet.gameData) { xmlFile = new File(baseFolder, DEFAULT_REL_PATH_FOR_GAME_RESOURCE); } else if (parent.sourceSetToUse == ResourceSet.debugData) { diff --git a/src/com/gpl/rpg/atcontentstudio/model/Project.java b/src/com/gpl/rpg/atcontentstudio/model/Project.java index a6dab19..61ffbf5 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/Project.java +++ b/src/com/gpl/rpg/atcontentstudio/model/Project.java @@ -103,7 +103,7 @@ public class Project implements ProjectTreeNode, Serializable { public transient Workspace parent; - public Properties knownSpritesheetsProperties = null; + public Properties knownSpritesheetsProperties; public static enum ResourceSet { gameData, @@ -111,7 +111,7 @@ public class Project implements ProjectTreeNode, Serializable { allFiles } - public ResourceSet sourceSetToUse = ResourceSet.allFiles; + public ResourceSet sourceSetToUse; public Project(Workspace w, String name, File source, ResourceSet sourceSet) { this.parent = w; @@ -237,7 +237,7 @@ public class Project implements ProjectTreeNode, Serializable { public static Project fromFolder(Workspace w, File projRoot) { - Project p = null; + Project p; File f = new File(projRoot, Project.SETTINGS_FILE); if (!f.exists()) { Notification.addError("Unable to find "+SETTINGS_FILE+" for project "+projRoot.getName()); diff --git a/src/com/gpl/rpg/atcontentstudio/model/Workspace.java b/src/com/gpl/rpg/atcontentstudio/model/Workspace.java index 8bf298a..1697279 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/Workspace.java +++ b/src/com/gpl/rpg/atcontentstudio/model/Workspace.java @@ -72,7 +72,7 @@ public class Workspace implements ProjectTreeNode, Serializable { } public static void setActive(File workspaceRoot) { - Workspace w = null; + Workspace w; File f = new File(workspaceRoot, WS_SETTINGS_FILE); if (!workspaceRoot.exists() || !f.exists()) { w = new Workspace(workspaceRoot); @@ -311,8 +311,7 @@ public class Workspace implements ProjectTreeNode, Serializable { Notification.addError("Error while deleting closed project " + cp.name + ". Files may remain in the workspace."); } - cp = null; - saveActive(); + saveActive(); } public static void deleteProject(Project p) { @@ -327,8 +326,7 @@ public class Workspace implements ProjectTreeNode, Serializable { Notification.addError("Error while deleting project " + p.name + ". Files may remain in the workspace."); } - p = null; - saveActive(); + saveActive(); } private static boolean delete(File f) { @@ -339,7 +337,7 @@ public class Workspace implements ProjectTreeNode, Serializable { for (File c : f.listFiles()) b &= delete(c); } - return b &= f.delete(); + return b & f.delete(); } @Override diff --git a/src/com/gpl/rpg/atcontentstudio/model/bookmarks/BookmarksRoot.java b/src/com/gpl/rpg/atcontentstudio/model/bookmarks/BookmarksRoot.java index 501cfff..588c1f3 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/bookmarks/BookmarksRoot.java +++ b/src/com/gpl/rpg/atcontentstudio/model/bookmarks/BookmarksRoot.java @@ -30,7 +30,7 @@ public class BookmarksRoot implements BookmarkNode { SavedSlotCollection v = new SavedSlotCollection(); - public transient Project parent = null; + public transient Project parent; BookmarkFolder ac, diag, dl, it, ic, npc, q, tmx, sp, wm; @@ -171,7 +171,7 @@ public class BookmarksRoot implements BookmarkNode { public void addBookmark(GameDataElement target) { BookmarkEntry node; - BookmarkFolder folder = null; + BookmarkFolder folder; if (target instanceof ActorCondition) { folder = ac; } else if (target instanceof Dialogue) { diff --git a/src/com/gpl/rpg/atcontentstudio/model/maps/KeyArea.java b/src/com/gpl/rpg/atcontentstudio/model/maps/KeyArea.java index c583328..c5669fd 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/maps/KeyArea.java +++ b/src/com/gpl/rpg/atcontentstudio/model/maps/KeyArea.java @@ -9,10 +9,10 @@ import com.gpl.rpg.atcontentstudio.ui.DefaultIcons; public class KeyArea extends MapObject { - public String dialogue_id = null; + public String dialogue_id; public Dialogue dialogue = null; - public Requirement requirement = null; - public boolean oldSchoolRequirement = true; + public Requirement requirement; + public boolean oldSchoolRequirement; public KeyArea(tiled.core.MapObject obj) { dialogue_id = obj.getProperties().getProperty("phrase"); diff --git a/src/com/gpl/rpg/atcontentstudio/model/maps/MapChange.java b/src/com/gpl/rpg/atcontentstudio/model/maps/MapChange.java index f0e93bd..75b579d 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/maps/MapChange.java +++ b/src/com/gpl/rpg/atcontentstudio/model/maps/MapChange.java @@ -9,9 +9,9 @@ import com.gpl.rpg.atcontentstudio.ui.DefaultIcons; public class MapChange extends MapObject { - public String map_id = null; + public String map_id; public TMXMap map = null; - public String place_id = null; + public String place_id; public MapChange(tiled.core.MapObject obj) { this.map_id = obj.getProperties().getProperty("map"); diff --git a/src/com/gpl/rpg/atcontentstudio/model/maps/ReplaceArea.java b/src/com/gpl/rpg/atcontentstudio/model/maps/ReplaceArea.java index eaea296..b14d41d 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/maps/ReplaceArea.java +++ b/src/com/gpl/rpg/atcontentstudio/model/maps/ReplaceArea.java @@ -11,7 +11,7 @@ import com.gpl.rpg.atcontentstudio.ui.DefaultIcons; public class ReplaceArea extends MapObject { - public Requirement requirement = null; + public Requirement requirement; public boolean oldSchoolRequirement = false; public List replacements = null; diff --git a/src/com/gpl/rpg/atcontentstudio/model/maps/TMXMap.java b/src/com/gpl/rpg/atcontentstudio/model/maps/TMXMap.java index 38da7fc..8691bf1 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/maps/TMXMap.java +++ b/src/com/gpl/rpg/atcontentstudio/model/maps/TMXMap.java @@ -54,7 +54,7 @@ public class TMXMap extends GameDataElement { bluetint } - public File tmxFile = null; + public File tmxFile; public tiled.core.Map tmxMap = null; public Set usedSpritesheets = null; public List groups = null; diff --git a/src/com/gpl/rpg/atcontentstudio/model/tools/resoptimizer/ResourcesCompactor.java b/src/com/gpl/rpg/atcontentstudio/model/tools/resoptimizer/ResourcesCompactor.java index b294fdd..e69f272 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/tools/resoptimizer/ResourcesCompactor.java +++ b/src/com/gpl/rpg/atcontentstudio/model/tools/resoptimizer/ResourcesCompactor.java @@ -206,8 +206,7 @@ public class ResourcesCompactor { compactMap(tmx, map.id); clone.tmxMap = null; clone.groups.clear(); - clone = null; - } + } } private void compactMap(tiled.core.Map tmx, String name) { diff --git a/src/com/gpl/rpg/atcontentstudio/ui/Editor.java b/src/com/gpl/rpg/atcontentstudio/ui/Editor.java index b430bc7..a129f3f 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/Editor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/Editor.java @@ -919,8 +919,8 @@ public abstract class Editor extends JPanel implements ProjectElementListener { private static final long serialVersionUID = 6819681566800482793L; - private boolean includeType = false; - private boolean writable = false; + private boolean includeType; + private boolean writable; public GDERenderer(boolean includeType, boolean writable) { super(); diff --git a/src/com/gpl/rpg/atcontentstudio/ui/JSONImportWizard.java b/src/com/gpl/rpg/atcontentstudio/ui/JSONImportWizard.java index dafc1ee..a391382 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/JSONImportWizard.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/JSONImportWizard.java @@ -293,8 +293,8 @@ public class JSONImportWizard extends JDialog { errors.add("Invalid JSON content: neither an array nor an object."); } if (jsonObjects != null) { - JSONElement node = null; - JSONElement existingNode = null; + JSONElement node; + JSONElement existingNode; int i = 0; for (Map jsonObject : jsonObjects) { switch ((DataType)dataTypeCombo.getSelectedItem()) { @@ -342,10 +342,8 @@ public class JSONImportWizard extends JDialog { node.jsonFile = existingNode.jsonFile; warnings.add("An item with id "+node.id+" exists in the used game source. This one will be inserted as \"altered\""); } - existingNode = null; - } - node = null; - } else { + } + } else { warnings.add("Failed to load element #"+i); } } @@ -508,7 +506,7 @@ public class JSONImportWizard extends JDialog { private static final long serialVersionUID = 6819681566800482793L; - private boolean includeType = false; + private boolean includeType; public GDERenderer(boolean includeType) { super(); diff --git a/src/com/gpl/rpg/atcontentstudio/ui/ProjectCreationWizard.java b/src/com/gpl/rpg/atcontentstudio/ui/ProjectCreationWizard.java index b0958a9..dcdff60 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/ProjectCreationWizard.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/ProjectCreationWizard.java @@ -234,10 +234,8 @@ public class ProjectCreationWizard extends JDialog { buttonPane.setLayout(new GridBagLayout()); GridBagConstraints c2 = new GridBagConstraints(); c2.fill = GridBagConstraints.HORIZONTAL; - c2.gridx = 1; - c2.weightx = 80; - - c2.gridx = 1; + + c2.gridx = 1; c2.weightx = 80; buttonPane.add(new JLabel(), c2); diff --git a/src/com/gpl/rpg/atcontentstudio/ui/ProjectsTree.java b/src/com/gpl/rpg/atcontentstudio/ui/ProjectsTree.java index 0d8148b..4b050aa 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/ProjectsTree.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/ProjectsTree.java @@ -685,7 +685,7 @@ public class ProjectsTree extends JPanel { JLabel label = (JLabel)c; String text = ((ProjectTreeNode)value).getDesc(); if (text != null) label.setText(text); - Image img = null; + Image img; if (leaf) img = ((ProjectTreeNode)value).getLeafIcon(); else if (expanded) img = ((ProjectTreeNode)value).getOpenIcon(); else img = ((ProjectTreeNode)value).getClosedIcon(); diff --git a/src/com/gpl/rpg/atcontentstudio/ui/WorkspaceActions.java b/src/com/gpl/rpg/atcontentstudio/ui/WorkspaceActions.java index 4ef50c6..7f4d10c 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/WorkspaceActions.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/WorkspaceActions.java @@ -171,7 +171,7 @@ public class WorkspaceActions { @Override public void run() { final List events = new ArrayList(); - List catEvents = null; + List catEvents; for (GameDataCategory category : impactedCategories.keySet()) { for (File f : impactedCategories.get(category)) { catEvents = category.attemptSave(true, f.getName()); diff --git a/src/com/gpl/rpg/atcontentstudio/ui/WorldmapLabelEditionWizard.java b/src/com/gpl/rpg/atcontentstudio/ui/WorldmapLabelEditionWizard.java index 6c97d71..ff593ab 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/WorldmapLabelEditionWizard.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/WorldmapLabelEditionWizard.java @@ -32,7 +32,7 @@ public class WorldmapLabelEditionWizard extends JDialog { final WorldmapSegment segment; final WorldmapSegment.NamedArea label; - boolean createMode = false; + boolean createMode; public WorldmapLabelEditionWizard(WorldmapSegment segment) { this(segment, new WorldmapSegment.NamedArea(null, null, null), true); diff --git a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/DialogueEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/DialogueEditor.java index 67aeecb..11513cd 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/DialogueEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/DialogueEditor.java @@ -972,7 +972,7 @@ public class DialogueEditor extends JSONElementEditor { } else if (source == rewardValue) { //Backlink removal to quest stages when selecting another quest are handled in the addQuestStageBox() method. Too complex too handle here Quest quest = null; - QuestStage stage = null; + QuestStage stage; if (rewardValue instanceof JComboBox) { quest = ((Quest)selectedReward.reward_obj); if (quest != null && selectedReward.reward_value != null) { @@ -1048,7 +1048,7 @@ public class DialogueEditor extends JSONElementEditor { } else if (source == requirementValue) { //Backlink removal to quest stages when selecting another quest are handled in the addQuestStageBox() method. Too complex too handle here Quest quest = null; - QuestStage stage = null; + QuestStage stage; if (requirementValue instanceof JComboBox) { quest = ((Quest)selectedRequirement.required_obj); if (quest != null && selectedRequirement.required_value != null) { diff --git a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java index bab43f5..66dbc11 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java @@ -1429,10 +1429,8 @@ public class ItemEditor extends JSONElementEditor { ItemEditor.this.repaint(); } else if (item.category.action_type == ItemCategory.ActionType.equip) { equipEffectPane.setVisible(true); - updateEquip = true; - hitEffectPane.setVisible(true); - updateEquip = true; - killEffectPane.setVisible(true); + hitEffectPane.setVisible(true); + killEffectPane.setVisible(true); updateKill = true; hitReceivedEffectPane.setVisible(true); updateEquip = true; diff --git a/src/com/gpl/rpg/atcontentstudio/ui/map/MapColorFilters.java b/src/com/gpl/rpg/atcontentstudio/ui/map/MapColorFilters.java index 19bf5de..593cb04 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/map/MapColorFilters.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/map/MapColorFilters.java @@ -14,7 +14,7 @@ public class MapColorFilters { Composite oldComp = g2d.getComposite(); Rectangle clip = g2d.getClipBounds(); MatrixComposite newComp = null; - float f=0.0f; + float f; switch(colorFilter) { case black20: f=0.8f; diff --git a/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java index 011ae09..69fc64c 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java @@ -1173,7 +1173,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe public class ReplacementsLayersComboModel implements ComboBoxModel { ReplaceArea area; - boolean modelForSource = false; + boolean modelForSource; public List availableLayers = new ArrayList(); @@ -1542,7 +1542,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe private static final long serialVersionUID = 6819681566800482793L; - private boolean includeType = false; + private boolean includeType; public SpritesheetCellRenderer(boolean includeType) { super(); @@ -2032,7 +2032,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe if (selectedMapObject instanceof KeyArea) { KeyArea area = (KeyArea) selectedMapObject; Quest quest = null; - QuestStage stage = null; + QuestStage stage; if (requirementValue instanceof JComboBox) { quest = ((Quest)area.requirement.required_obj); if (quest != null && area.requirement.required_value != null) { @@ -2053,7 +2053,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe } else if (selectedMapObject instanceof ReplaceArea) { ReplaceArea area = (ReplaceArea) selectedMapObject; Quest quest = null; - QuestStage stage = null; + QuestStage stage; if (requirementValue instanceof JComboBox) { quest = ((Quest)area.requirement.required_obj); if (quest != null && area.requirement.required_value != null) { diff --git a/src/com/gpl/rpg/atcontentstudio/ui/sprites/SpritesheetEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/sprites/SpritesheetEditor.java index 9759e90..2eba1c0 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/sprites/SpritesheetEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/sprites/SpritesheetEditor.java @@ -386,7 +386,7 @@ public class SpritesheetEditor extends Editor { private static final long serialVersionUID = 6819681566800482793L; - private boolean includeType = false; + private boolean includeType; public BacklinkCellRenderer(boolean includeType) { super(); diff --git a/src/com/gpl/rpg/atcontentstudio/ui/tools/writermode/WriterModeEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/tools/writermode/WriterModeEditor.java index 5d663cb..9895edb 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/tools/writermode/WriterModeEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/tools/writermode/WriterModeEditor.java @@ -93,7 +93,7 @@ public class WriterModeEditor extends Editor { private Display view; final private WriterModeData data; - private WriterNode selected = null; + private WriterNode selected; private WriterNode prevSelected = null; public WriterModeEditor(WriterModeData data) { @@ -708,8 +708,8 @@ public class WriterModeEditor extends Editor { public void actionPerformed(ActionEvent e) { commitAreaText(); stopPendingEdge(); - WriterDialogue newWrNode = null; - Node newNode = null; + WriterDialogue newWrNode; + Node newNode; if (selected instanceof WriterDialogue) { EmptyReply temp = data.new EmptyReply((WriterDialogue) selected); newWrNode = data.new WriterDialogue(((WriterDialogue) selected).id_prefix); @@ -737,8 +737,8 @@ public class WriterModeEditor extends Editor { public void actionPerformed(ActionEvent e) { commitAreaText(); stopPendingEdge(); - WriterReply newWrNode = null; - Node newNode = null; + WriterReply newWrNode; + Node newNode; if (selected instanceof WriterReply) { newWrNode = data.new WriterReply(((WriterReply) selected).parent); newNode = addReplyNode(newWrNode); diff --git a/src/net/launchpad/tobal/poparser/POFile.java b/src/net/launchpad/tobal/poparser/POFile.java index 919db09..c83677c 100644 --- a/src/net/launchpad/tobal/poparser/POFile.java +++ b/src/net/launchpad/tobal/poparser/POFile.java @@ -73,7 +73,7 @@ public class POFile public boolean checkFlag(String flag, int entryIndex) { boolean status = false; - Vector strings = new Vector(); + Vector strings; strings = entries[entryIndex].getStringsByType(POEntry.StringType.FLAG); if (strings != null) { diff --git a/src/net/launchpad/tobal/poparser/POParser.java b/src/net/launchpad/tobal/poparser/POParser.java index 1fee0cc..ae03217 100644 --- a/src/net/launchpad/tobal/poparser/POParser.java +++ b/src/net/launchpad/tobal/poparser/POParser.java @@ -126,7 +126,6 @@ public class POParser { String str = rawentry.get(i); tempheader.addLine(POEntry.StringType.HEADER, str); - str = new String(); } return tempheader; } @@ -138,7 +137,7 @@ public class POParser private POEntry[] parseEntries(Vector> vectors) { - String line = new String(); + String line; boolean thereIsHeader = false; // is this header @@ -228,8 +227,7 @@ public class POParser subStrIndex = 16; } } - String str = new String(); - str = line.substring(subStrIndex); + String str = line.substring(subStrIndex); entry.addLine(strType, str); } else if(line.startsWith("msg")) @@ -253,9 +251,8 @@ public class POParser parserMode = strType; subStrIndex = 7; } - String str = new String(); // TODO: is unquoting nessessary? - str = unQuote(line.substring(subStrIndex)); + String str = unQuote(line.substring(subStrIndex)); entry.addLine(strType, str); } else