diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimple.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimple.java index 0bc9894dd..1591bf7cf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimple.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimple.java @@ -155,7 +155,7 @@ public class AVM2DeobfuscatorSimple implements SWFDecompilerListener { private boolean removeObfuscationIfs(int classIndex, boolean isStatic, int scriptIndex, ABC abc, AVM2ConstantPool cpool, Trait trait, MethodInfo minfo, MethodBody body) throws InterruptedException { AVM2Code code = body.getCode(); - if (code.code.size() == 0) { + if (code.code.isEmpty()) { return false; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java index 0dc79bf08..42171b0dc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java @@ -79,7 +79,6 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.SubtractAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.TypeOfAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.URShiftAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.parser.AVM2ParseException; -import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.Namespace; import com.jpexs.decompiler.flash.action.swf4.ActionIf; import com.jpexs.decompiler.flash.configuration.Configuration; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java index 5b7817d48..2f2b05c51 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java @@ -28,7 +28,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallSuperVoidI import com.jpexs.decompiler.flash.abc.avm2.instructions.other.FindPropertyStrictIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetGlobalScopeIns; import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; -import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.ValueKind; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionList.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionList.java index 423d48bdf..882cf7ed4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionList.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionList.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.action; -import com.jpexs.decompiler.flash.DisassemblyListener; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.action.special.ActionNop; import com.jpexs.decompiler.flash.action.special.ActionStore; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java index dc7fc4b49..35fea0962 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.action.deobfuscation; -import com.jpexs.decompiler.flash.DisassemblyListener; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.abc.ABC; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java index fe267e33a..6943653e7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.action.ActionList; import com.jpexs.decompiler.flash.action.model.FunctionActionItem; import com.jpexs.decompiler.flash.action.parser.ActionParseException; import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; -import com.jpexs.decompiler.flash.action.parser.script.VariableActionItem; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItemContainer; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java index fb5e7bf96..83742a7bd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java @@ -1,28 +1,25 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library. */ package com.jpexs.decompiler.flash.action.swf5; import com.jpexs.decompiler.flash.action.Action; -import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; import com.jpexs.decompiler.flash.action.model.EnumerateActionItem; -import com.jpexs.decompiler.flash.ecma.Null; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java index 33bf86221..3fd1b3d44 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.action.ActionList; import com.jpexs.decompiler.flash.action.model.FunctionActionItem; import com.jpexs.decompiler.flash.action.parser.ActionParseException; import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; -import com.jpexs.decompiler.flash.action.parser.script.VariableActionItem; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.types.annotations.Reserved; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/BitmapExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/BitmapExporter.java index 74fd20416..64021afaf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/BitmapExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/BitmapExporter.java @@ -67,7 +67,7 @@ public class BitmapExporter extends ShapeExporterBase { private final SWF swf; - private GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD); //For correct intersections display; + private final GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD); //For correct intersections display; private Paint fillPathPaint; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java index 262d601ab..169e58a7b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java @@ -172,7 +172,6 @@ public class XFLConverter { //p = mat.apply(p); if (scr.stateMoveTo) { ret.append("! ").append(p.x).append(" ").append(p.y); - return; } } else if (record instanceof StraightEdgeRecord) { StraightEdgeRecord ser = (StraightEdgeRecord) record; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TranslateStack.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TranslateStack.java index bea2098c1..92c5c2f98 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TranslateStack.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TranslateStack.java @@ -29,7 +29,7 @@ public class TranslateStack extends Stack { private static PopItem pop = new PopItem(null); - private String path; + private final String path; public TranslateStack(String path) { this.path = path; diff --git a/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java b/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java index cef0c67a0..064516cf7 100644 --- a/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java @@ -122,9 +122,9 @@ public class AdvancedSettingsDialog extends AppDialog { private static class SkinSelect { - private String name; + private final String name; - private String className; + private final String className; public SkinSelect(String name, String className) { this.name = name; @@ -267,7 +267,7 @@ public class AdvancedSettingsDialog extends AppDialog { for (String name : keys) { Field field = fields.get(name); ConfigurationCategory cat = field.getAnnotation(ConfigurationCategory.class); - String scat = (cat == null || cat.value().equals("")) ? "other" : cat.value(); + String scat = (cat == null || cat.value().isEmpty()) ? "other" : cat.value(); if (!categorized.containsKey(scat)) { categorized.put(scat, new HashMap<>()); } diff --git a/src/com/jpexs/decompiler/flash/gui/ComboBoxItem.java b/src/com/jpexs/decompiler/flash/gui/ComboBoxItem.java index 618c0210f..3ed8b7487 100644 --- a/src/com/jpexs/decompiler/flash/gui/ComboBoxItem.java +++ b/src/com/jpexs/decompiler/flash/gui/ComboBoxItem.java @@ -22,9 +22,9 @@ package com.jpexs.decompiler.flash.gui; */ public class ComboBoxItem { - private String title; + private final String title; - private E value; + private final E value; public ComboBoxItem(String title, E value) { this.title = title; diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java index 1561cd16a..568bfd145 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java @@ -60,7 +60,7 @@ public class MainFrameClassicMenu extends MainFrameMenu { } String parentPath = ""; if (path.contains("/")) { - parentPath = path.substring(0, path.lastIndexOf("/")); + parentPath = path.substring(0, path.lastIndexOf('/')); } MenuElement parentMenu = menuElements.get(parentPath); if (parentMenu == null) { @@ -110,7 +110,7 @@ public class MainFrameClassicMenu extends MainFrameMenu { } String parentPath = ""; if (path.contains("/")) { - parentPath = path.substring(0, path.lastIndexOf("/")); + parentPath = path.substring(0, path.lastIndexOf('/')); } MenuElement parentMenu = menuElements.get(parentPath); if (parentMenu == null) { @@ -136,7 +136,7 @@ public class MainFrameClassicMenu extends MainFrameMenu { path = mapping(path); String parentPath = ""; if (path.contains("/")) { - parentPath = path.substring(0, path.lastIndexOf("/")); + parentPath = path.substring(0, path.lastIndexOf('/')); } MenuElement parentMenu = menuElements.get(parentPath); if (parentMenu == null) { @@ -287,7 +287,7 @@ public class MainFrameClassicMenu extends MainFrameMenu { if (me instanceof JMenu) { JMenu jm = (JMenu) me; if (jm.getMenuComponentCount() == 1) { - String parentPath = path.contains("/") ? path.substring(0, path.lastIndexOf("/")) : ""; + String parentPath = path.contains("/") ? path.substring(0, path.lastIndexOf('/')) : ""; MenuElement parMe = menuElements.get(parentPath); JMenuItem mi = (JMenuItem) jm.getMenuComponent(0); jm.remove(mi); diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java index 1b424b829..2fc063eb5 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java @@ -411,7 +411,7 @@ public class MainFrameRibbonMenu extends MainFrameMenu { @Override public void addMenuItem(String path, String title, String icon, ActionListener action, int priority, ActionListener subLoader, boolean isLeaf) { - String parentPath = path.contains("/") ? path.substring(0, path.lastIndexOf("/")) : ""; + String parentPath = path.contains("/") ? path.substring(0, path.lastIndexOf('/')) : ""; if (!menuSubs.containsKey(parentPath)) { throw new IllegalArgumentException("No parent menu exists: " + parentPath); } diff --git a/src/com/jpexs/decompiler/flash/gui/ReplaceTraceDialog.java b/src/com/jpexs/decompiler/flash/gui/ReplaceTraceDialog.java index ca3fde489..4e52abf89 100644 --- a/src/com/jpexs/decompiler/flash/gui/ReplaceTraceDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/ReplaceTraceDialog.java @@ -31,11 +31,11 @@ import javax.swing.JRadioButton; */ public class ReplaceTraceDialog extends AppDialog { - private JRadioButton debugAlertRadio; + private final JRadioButton debugAlertRadio; - private JRadioButton debugConsoleRadio; + private final JRadioButton debugConsoleRadio; - private JRadioButton debugSocketRadio; + private final JRadioButton debugSocketRadio; private String value = null; diff --git a/src/com/jpexs/decompiler/flash/gui/SelectLanguageDialog.java b/src/com/jpexs/decompiler/flash/gui/SelectLanguageDialog.java index 6050f1758..ea508bafc 100644 --- a/src/com/jpexs/decompiler/flash/gui/SelectLanguageDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/SelectLanguageDialog.java @@ -37,7 +37,7 @@ import jsyntaxpane.DefaultSyntaxKit; */ public class SelectLanguageDialog extends AppDialog { - private JComboBox languageCombobox = new JComboBox<>(); + private final JComboBox languageCombobox = new JComboBox<>(); public String languageCode = null; diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java b/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java index 1ac8e253d..b4377bc10 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java @@ -33,11 +33,11 @@ import javax.swing.tree.TreePath; public class ClassesListTreeModel extends AS3ClassTreeItem implements TreeModel { - private SWF swf; + private final SWF swf; private List list; - private AS3Package root; + private final AS3Package root; private final List listeners = new ArrayList<>(); diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index 0d7e649ff..0d60adc6b 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.gui.abc; -import com.jpexs.decompiler.flash.gui.editor.LineMarkedEditorPane; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.CachedDecompilation; @@ -37,6 +36,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; import com.jpexs.decompiler.flash.gui.AppStrings; import com.jpexs.decompiler.flash.gui.View; +import com.jpexs.decompiler.flash.gui.editor.LineMarkedEditorPane; import com.jpexs.decompiler.flash.helpers.hilight.HighlightData; import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType; import com.jpexs.decompiler.flash.helpers.hilight.Highlighting; diff --git a/src/com/jpexs/decompiler/flash/gui/player/PlayerControls.java b/src/com/jpexs/decompiler/flash/gui/player/PlayerControls.java index 97eec12b1..6b06ffc76 100644 --- a/src/com/jpexs/decompiler/flash/gui/player/PlayerControls.java +++ b/src/com/jpexs/decompiler/flash/gui/player/PlayerControls.java @@ -67,8 +67,6 @@ public class PlayerControls extends JPanel implements MediaDisplayListener { private final JButton loopButton; - private boolean paused = false; - private MediaDisplay display; private JProgressBar progress;