more cleanup

This commit is contained in:
honfika@gmail.com
2015-07-05 21:54:30 +02:00
parent bf2c6cb822
commit dcb20d84f0
20 changed files with 23 additions and 35 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -29,7 +29,7 @@ public class TranslateStack extends Stack<GraphTargetItem> {
private static PopItem pop = new PopItem(null);
private String path;
private final String path;
public TranslateStack(String path) {
this.path = path;

View File

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

View File

@@ -22,9 +22,9 @@ package com.jpexs.decompiler.flash.gui;
*/
public class ComboBoxItem<E> {
private String title;
private final String title;
private E value;
private final E value;
public ComboBoxItem(String title, E value) {
this.title = title;

View File

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

View File

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

View File

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

View File

@@ -37,7 +37,7 @@ import jsyntaxpane.DefaultSyntaxKit;
*/
public class SelectLanguageDialog extends AppDialog {
private JComboBox<Language> languageCombobox = new JComboBox<>();
private final JComboBox<Language> languageCombobox = new JComboBox<>();
public String languageCode = null;

View File

@@ -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<ScriptPack> list;
private AS3Package root;
private final AS3Package root;
private final List<TreeModelListener> listeners = new ArrayList<>();

View File

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

View File

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