remove a bunch of unused assignments

This commit is contained in:
OMGeeky
2025-06-21 18:19:25 +02:00
parent a4b431efdd
commit bb187621b7
28 changed files with 55 additions and 67 deletions

View File

@@ -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 = "";

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);

View File

@@ -8,7 +8,7 @@ public class Notification {
public static List<Notification> notifs = new ArrayList<Notification>();
private static List<NotificationListener> listeners = new CopyOnWriteArrayList<NotificationListener>();
public static boolean showS = true, showI = true, showW = true, showE = true;
public static boolean showS, showI, showW, showE;
static {
boolean[] config = ConfigCache.getNotifViewConfig();

View File

@@ -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<String, List<String>> 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) {

View File

@@ -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());

View File

@@ -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

View File

@@ -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) {

View File

@@ -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");

View File

@@ -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");

View File

@@ -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<ReplaceArea.Replacement> replacements = null;

View File

@@ -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<Spritesheet> usedSpritesheets = null;
public List<MapObjectGroup> groups = null;

View File

@@ -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) {

View File

@@ -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();

View File

@@ -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();

View File

@@ -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);

View File

@@ -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();

View File

@@ -171,7 +171,7 @@ public class WorkspaceActions {
@Override
public void run() {
final List<SaveEvent> events = new ArrayList<SaveEvent>();
List<SaveEvent> catEvents = null;
List<SaveEvent> catEvents;
for (GameDataCategory<JSONElement> category : impactedCategories.keySet()) {
for (File f : impactedCategories.get(category)) {
catEvents = category.attemptSave(true, f.getName());

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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;

View File

@@ -1173,7 +1173,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
public class ReplacementsLayersComboModel implements ComboBoxModel<String> {
ReplaceArea area;
boolean modelForSource = false;
boolean modelForSource;
public List<String> availableLayers = new ArrayList<String>();
@@ -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) {

View File

@@ -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();

View File

@@ -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);

View File

@@ -73,7 +73,7 @@ public class POFile
public boolean checkFlag(String flag, int entryIndex)
{
boolean status = false;
Vector<String> strings = new Vector<String>();
Vector<String> strings;
strings = entries[entryIndex].getStringsByType(POEntry.StringType.FLAG);
if (strings != null)
{

View File

@@ -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<Vector<String>> 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