From ef34bb535b54e20ad2529d0daeb9f3e92b28b4c2 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sun, 16 Nov 2014 21:03:17 +0100 Subject: [PATCH] small fixes, unused code removed --- .../src/com/jpexs/decompiler/flash/SWF.java | 2 +- .../decompiler/flash/SWFInputStream.java | 2 +- .../com/jpexs/decompiler/flash/SWFSearch.java | 5 +- .../flash/gui/LoadFromMemoryFrame.java | 3 +- .../jpexs/decompiler/flash/gui/MainPanel.java | 90 ------------------- 5 files changed, 6 insertions(+), 96 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index ec449db5d..d27970947 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -648,7 +648,7 @@ public final class SWF implements SWFContainerItem, Timelined { } private void findABCTags() { - List objs = new ArrayList<>(); + List objs = new ArrayList<>(tags.size()); objs.addAll(tags); ArrayList newAbcList = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java index c7746a634..773911a5e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -2209,9 +2209,9 @@ public class SWFInputStream implements AutoCloseable { * @throws IOException */ public List readFILTERLIST(String name) throws IOException { - List ret = new ArrayList<>(); newDumpLevel(name, "FILTERLIST"); int numberOfFilters = readUI8("numberOfFilters"); + List ret = new ArrayList<>(numberOfFilters); for (int i = 0; i < numberOfFilters; i++) { ret.add(readFILTER("filter")); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFSearch.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFSearch.java index 93d6a6fc0..5e86cf853 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFSearch.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFSearch.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash; import com.jpexs.helpers.Helper; @@ -61,7 +62,7 @@ public class SWFSearch { } public void process() { - Map ret = new HashMap<>(); + Map ret; ret = s.search(new ProgressListener() { @Override public void progress(int p) { diff --git a/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java b/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java index ed2793e19..584916067 100644 --- a/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java +++ b/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java @@ -118,11 +118,10 @@ public class LoadFromMemoryFrame extends AppFrame implements ActionListener { @Override protected List doInBackground() throws Exception { - Map ret = new HashMap<>(); List swfStreams = new ArrayList<>(); for (com.jpexs.process.Process proc : procs) { publish(proc); - ret = proc.search(new ProgressListener() { + Map ret = proc.search(new ProgressListener() { @Override public void progress(int p) { setProgress(p); diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index aa5a9e6ae..d4aa6dbb1 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -807,96 +807,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec } } - public static void getShapes(List list, List shapes) { - for (ContainerItem t : list) { - if (t instanceof Container) { - getShapes(((Container) t).getSubItems(), shapes); - } - if ((t instanceof DefineShapeTag) - || (t instanceof DefineShape2Tag) - || (t instanceof DefineShape3Tag) - || (t instanceof DefineShape4Tag)) { - shapes.add((Tag) t); - } - } - } - - public static void getFonts(List list, List fonts) { - for (ContainerItem t : list) { - if (t instanceof Container) { - getFonts(((Container) t).getSubItems(), fonts); - } - if ((t instanceof DefineFontTag) - || (t instanceof DefineFont2Tag) - || (t instanceof DefineFont3Tag) - || (t instanceof DefineFont4Tag)) { - fonts.add((Tag) t); - } - } - } - - public static void getMorphShapes(List list, List morphShapes) { - for (ContainerItem t : list) { - if (t instanceof Container) { - getMorphShapes(((Container) t).getSubItems(), morphShapes); - } - if ((t instanceof DefineMorphShapeTag) || (t instanceof DefineMorphShape2Tag)) { - morphShapes.add((Tag) t); - } - } - } - - public static void getImages(List list, List images) { - for (ContainerItem t : list) { - if (t instanceof Container) { - getImages(((Container) t).getSubItems(), images); - } - if ((t instanceof DefineBitsTag) - || (t instanceof DefineBitsJPEG2Tag) - || (t instanceof DefineBitsJPEG3Tag) - || (t instanceof DefineBitsJPEG4Tag) - || (t instanceof DefineBitsLosslessTag) - || (t instanceof DefineBitsLossless2Tag)) { - images.add((Tag) t); - } - } - } - - public static void getTexts(List list, List texts) { - for (ContainerItem t : list) { - if (t instanceof Container) { - getTexts(((Container) t).getSubItems(), texts); - } - if ((t instanceof DefineTextTag) - || (t instanceof DefineText2Tag) - || (t instanceof DefineEditTextTag)) { - texts.add((Tag) t); - } - } - } - - public static void getSprites(List list, List sprites) { - for (ContainerItem t : list) { - if (t instanceof Container) { - getSprites(((Container) t).getSubItems(), sprites); - } - if (t instanceof DefineSpriteTag) { - sprites.add((Tag) t); - } - } - } - - public static void getButtons(List list, List buttons) { - for (ContainerItem t : list) { - if (t instanceof Container) { - getButtons(((Container) t).getSubItems(), buttons); - } - if ((t instanceof DefineButtonTag) || (t instanceof DefineButton2Tag)) { - buttons.add((Tag) t); - } - } - } - public void renameIdentifier(SWF swf, String identifier) throws InterruptedException { String oldName = identifier; String newName = View.showInputDialog(translate("rename.enternew"), oldName);