From a40db284659e40983d6f7a5490ab680ca249969b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Fri, 28 Dec 2012 16:02:07 +0100 Subject: [PATCH] Logging --- trunk/src/com/jpexs/asdec/Main.java | 97 ++++++++++++------- trunk/src/com/jpexs/asdec/abc/ABC.java | 17 +++- .../com/jpexs/asdec/abc/avm2/AVM2Code.java | 9 +- .../jpexs/asdec/abc/gui/ABCComboBoxModel.java | 2 + .../com/jpexs/asdec/abc/gui/MainFrame.java | 5 +- .../jpexs/asdec/tags/DefineButton2Tag.java | 5 +- .../com/jpexs/asdec/tags/DefineButtonTag.java | 4 +- trunk/src/com/jpexs/asdec/tags/DoABCTag.java | 8 +- .../src/com/jpexs/asdec/tags/DoActionTag.java | 8 +- .../com/jpexs/asdec/tags/DoInitActionTag.java | 6 +- trunk/src/com/jpexs/asdec/tags/Metadata.java | 5 +- .../jpexs/asdec/types/BUTTONCONDACTION.java | 7 +- .../jpexs/asdec/types/CLIPACTIONRECORD.java | 7 +- 13 files changed, 120 insertions(+), 60 deletions(-) diff --git a/trunk/src/com/jpexs/asdec/Main.java b/trunk/src/com/jpexs/asdec/Main.java index 8fbe8397e..7ed25e21d 100644 --- a/trunk/src/com/jpexs/asdec/Main.java +++ b/trunk/src/com/jpexs/asdec/Main.java @@ -35,6 +35,11 @@ import java.net.Socket; import java.util.ArrayList; import java.util.Calendar; import java.util.List; +import java.util.logging.ConsoleHandler; +import java.util.logging.FileHandler; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.logging.SimpleFormatter; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.swing.JFileChooser; @@ -80,7 +85,7 @@ public class Main { /** * Debug mode = throwing an error when comparing original file and recompiled */ - public static boolean DEBUG_MODE = false; + public static boolean debugMode = false; /** * Turn off reading unsafe tags (tags which can cause problems with * recompiling) @@ -186,22 +191,17 @@ public class Main { swf = parseSWF(Main.file); FileInputStream fis = new FileInputStream(file); DEBUG_COPY = true; - ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { swf.saveTo(baos); } catch (NotSameException nse) { - if (DEBUG_MODE) { - nse.printStackTrace(); - System.exit(0); - } + Logger.getLogger(Main.class.getName()).log(Level.FINE, null, nse); JOptionPane.showMessageDialog(null, "WARNING: The SWF decompiler may have problems saving this file. Recommended usage is READ ONLY."); } DEBUG_COPY = false; //DEBUG_COPY=true; } catch (Exception ex) { - if (DEBUG_MODE) { - ex.printStackTrace(); - } + Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); JOptionPane.showMessageDialog(null, "Cannot load SWF file."); loadingDialog.setVisible(false); return false; @@ -213,7 +213,7 @@ public class Main { } } - + if (false) { JOptionPane.showMessageDialog(null, "This SWF file does not contain any ActionScript parts"); loadingDialog.setVisible(false); @@ -424,7 +424,7 @@ public class Main { System.out.println("java -jar ASDec.jar -export pcode \"C:\\decompiled\\\" myfile.swf"); System.out.println("java -jar ASDec.jar -dumpSWF myfile.swf"); System.out.println("java -jar ASDec.jar -compress myfile.swf myfiledec.swf"); - System.out.println("java -jar ASDec.jar -deccompress myfiledec.swf myfile.swf"); + System.out.println("java -jar ASDec.jar -decompress myfiledec.swf myfile.swf"); } /** @@ -432,17 +432,25 @@ public class Main { */ public static void main(String[] args) throws IOException { View.setWinLookAndFeel(); - Configuration.load(); - if (args.length < 1) { + Configuration.load(); + int pos=0; + if(args.length>0){ + if(args[0].equals("-debug")){ + debugMode=true; + pos++; + } + } + initLogging(debugMode); + if (args.length < pos+1) { autoCheckForUpdates(); showModeFrame(); - } else { - if (args[0].equals("-proxy")) { + }else { + if (args[pos].equals("-proxy")) { int port = 55555; - for (int i = 0; i < args.length; i++) { + for (int i = pos; i < args.length; i++) { if (args[i].startsWith("-P")) { try { - port = Integer.parseInt(args[i].substring(2)); + port = Integer.parseInt(args[pos].substring(2)); } catch (NumberFormatException nex) { System.err.println("Bad port number"); } @@ -454,19 +462,19 @@ public class Main { proxyFrame.setPort(port); addTrayIcon(); switchProxy(); - } else if (args[0].equals("-export")) { - if (args.length < 4) { + } else if (args[pos].equals("-export")) { + if (args.length < pos+4) { badArguments(); } - String exportFormat = args[1]; + String exportFormat = args[pos+1]; if (!exportFormat.toLowerCase().equals("as")) { if (!exportFormat.toLowerCase().equals("pcode")) { System.err.println("Invalid export format:" + exportFormat); badArguments(); } } - File outDir = new File(args[2]); - File inFile = new File(args[3]); + File outDir = new File(args[pos+2]); + File inFile = new File(args[pos+3]); if (!inFile.exists()) { System.err.println("Input SWF file does not exist!"); badArguments(); @@ -494,50 +502,50 @@ public class Main { System.out.println("OK"); System.exit(0); } else { - System.err.println("FAIL: No ActionScript version 3 found in the input file."); + System.err.println("FAIL"); System.exit(1); } - } else if (args[0].equals("-compress")) { - if (args.length < 3) { + } else if (args[pos].equals("-compress")) { + if (args.length < pos+3) { badArguments(); } - if (SWF.fws2cws(new FileInputStream(args[1]), new FileOutputStream(args[2]))) { + if (SWF.fws2cws(new FileInputStream(args[pos+1]), new FileOutputStream(args[pos+2]))) { System.out.println("OK"); } else { System.err.println("FAIL"); } - } else if (args[0].equals("-decompress")) { + } else if (args[pos].equals("-decompress")) { if (args.length < 3) { badArguments(); } - if (SWF.cws2fws(new FileInputStream(args[1]), new FileOutputStream(args[2]))) { + if (SWF.cws2fws(new FileInputStream(args[pos+1]), new FileOutputStream(args[pos+2]))) { System.out.println("OK"); System.exit(0); } else { System.err.println("FAIL"); System.exit(1); } - } else if (args[0].equals("-dumpSWF")) { + } else if (args[pos].equals("-dumpSWF")) { if (args.length < 2) { badArguments(); } try { dump_tags = true; - parseSWF(args[1]); + parseSWF(args[pos+1]); } catch (Exception ex) { - System.err.println("Dump failed due to Exception - " + ex.getLocalizedMessage()); + Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); System.exit(1); } System.exit(0); - } else if (args[0].equals("-help") || args[0].equals("--help") || args[0].equals("/?")) { + } else if (args[pos].equals("-help") || args[pos].equals("--help") || args[pos].equals("/?")) { printHeader(); printCmdLineUsage(); System.exit(0); - } else if (args.length == 1) { + } else if (args.length == pos+1) { autoCheckForUpdates(); - openFile(args[0]); + openFile(args[pos]); } else { badArguments(); } @@ -722,4 +730,25 @@ public class Main { Configuration.setConfig("lastUpdatesCheckDate", Calendar.getInstance()); return false; } + + public static void initLogging(boolean debug) { + try { + Logger logger = Logger.getLogger(""); + logger.setLevel(debug?Level.CONFIG:Level.WARNING); + FileHandler fileTxt = new FileHandler("log.txt"); + + SimpleFormatter formatterTxt = new SimpleFormatter(); + fileTxt.setFormatter(formatterTxt); + logger.addHandler(fileTxt); + + if(debug){ + ConsoleHandler conHan=new ConsoleHandler(); + conHan.setFormatter(formatterTxt); + logger.addHandler(conHan); + } + + } catch (Exception ex) { + throw new RuntimeException("Problems with creating the log files"); + } + } } diff --git a/trunk/src/com/jpexs/asdec/abc/ABC.java b/trunk/src/com/jpexs/asdec/abc/ABC.java index c7a893fd5..e82c549f9 100644 --- a/trunk/src/com/jpexs/asdec/abc/ABC.java +++ b/trunk/src/com/jpexs/asdec/abc/ABC.java @@ -38,6 +38,8 @@ import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Stack; +import java.util.logging.Level; +import java.util.logging.Logger; import java.util.regex.Pattern; public class ABC { @@ -58,6 +60,8 @@ public class ABC { public static final boolean AUTOINIT_STATIC_VARIABLES = false; protected HashSet listeners = new HashSet(); + private static Logger logger =Logger.getLogger(ABC.class.getName()); + public void addEventListener(EventListener listener) { listeners.add(listener); } @@ -88,15 +92,16 @@ public class ABC { } public ABC(InputStream is) throws IOException { - ABCInputStream ais = new ABCInputStream(is); + ABCInputStream ais = new ABCInputStream(is); minor_version = ais.readU16(); major_version = ais.readU16(); + logger.log(Level.FINE, "ABC minor_version: {0}, major_version: {1}", new Object[]{minor_version, major_version}); constants = new ConstantPool(); //constant integers int constant_int_pool_count = ais.readU30(); constants.constant_int = new long[constant_int_pool_count]; - for (int i = 1; i < constant_int_pool_count; i++) { //index 0 not used. Values 1..n-1 - constants.constant_int[i] = ais.readS32(); + for (int i = 1; i < constant_int_pool_count; i++) { //index 0 not used. Values 1..n-1 + constants.constant_int[i] = ais.readS32(); } //constant unsigned integers @@ -253,7 +258,7 @@ public class ABC { /*for(ScriptInfo si:script_info){ System.out.println("--------------------------------------------"); System.out.println(findBody(si.init_index).toString(true, false, -1, this, constants, method_info,new Stack())); - }*/ + }*/ } public void saveToStream(OutputStream os) throws IOException { @@ -737,7 +742,9 @@ public class ABC { if ((packageName != null) && (!packageName.equals(""))) { fullName = packageName + "." + fullName; } - informListeners("export", "Exporting " + (i + 1) + "/" + instance_info.length + " " + fullName + " ..."); + String exStr="Exporting " + (i + 1) + "/" + instance_info.length + " " + fullName + " ..."; + informListeners("export", exStr); + logger.info(exStr); File outDir = new File(directory + File.separatorChar + packageName.replace('.', File.separatorChar)); if (!outDir.exists()) { outDir.mkdirs(); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java index 56e20864e..14eb4c7e9 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java @@ -16,6 +16,7 @@ */ package com.jpexs.asdec.abc.avm2; +import com.jpexs.asdec.Main; import com.jpexs.asdec.abc.ABC; import com.jpexs.asdec.abc.ABCInputStream; import com.jpexs.asdec.abc.CopyOutputStream; @@ -1597,9 +1598,7 @@ public class AVM2Code { if (ex instanceof UnknownJumpException) { throw (UnknownJumpException) ex; } - if (DEBUG_MODE) { - ex.printStackTrace(); - } + Logger.getLogger(AVM2Code.class.getName()).log(Level.SEVERE, null, ex); throw new ConvertException(ex.getClass().getSimpleName(), ip); } } @@ -1750,9 +1749,7 @@ public class AVM2Code { s = listToString(list, constants, localRegNames); } catch (Exception ex) { - if (DEBUG_MODE) { - ex.printStackTrace(); - } + Logger.getLogger(AVM2Code.class.getName()).log(Level.SEVERE, null, ex); s = "/*\r\n * Decompilation error\r\n * Code may be obfuscated\r\n * Error Message: " + ex.getMessage() + "\r\n */"; return s; } diff --git a/trunk/src/com/jpexs/asdec/abc/gui/ABCComboBoxModel.java b/trunk/src/com/jpexs/asdec/abc/gui/ABCComboBoxModel.java index 17c380965..922cd404b 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/ABCComboBoxModel.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/ABCComboBoxModel.java @@ -17,6 +17,7 @@ package com.jpexs.asdec.abc.gui; import com.jpexs.asdec.tags.DoABCTag; +import java.util.Collections; import java.util.List; import javax.swing.ComboBoxModel; import javax.swing.event.ListDataListener; @@ -28,6 +29,7 @@ public class ABCComboBoxModel implements ComboBoxModel { public ABCComboBoxModel(List list) { this.list = list; + Collections.sort(this.list); } public int getSize() { diff --git a/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java b/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java index 839d7378f..5c9672c2a 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java @@ -29,6 +29,8 @@ import java.awt.Dimension; import java.awt.event.*; import java.io.IOException; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.*; import javax.swing.border.BevelBorder; import javax.swing.table.*; @@ -390,7 +392,8 @@ public class MainFrame extends JFrame implements ActionListener, ItemListener { try { Main.saveFile(Main.file); } catch (IOException ex) { - ex.printStackTrace(); + Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex); + JOptionPane.showMessageDialog(null, "Cannot save file","Error",JOptionPane.ERROR_MESSAGE); } } if (e.getActionCommand().equals("SAVEAS")) { diff --git a/trunk/src/com/jpexs/asdec/tags/DefineButton2Tag.java b/trunk/src/com/jpexs/asdec/tags/DefineButton2Tag.java index aa7e852f3..f25657c7e 100644 --- a/trunk/src/com/jpexs/asdec/tags/DefineButton2Tag.java +++ b/trunk/src/com/jpexs/asdec/tags/DefineButton2Tag.java @@ -20,6 +20,7 @@ import com.jpexs.asdec.Main; import com.jpexs.asdec.SWFInputStream; import com.jpexs.asdec.SWFOutputStream; import com.jpexs.asdec.abc.CopyOutputStream; +import com.jpexs.asdec.abc.gui.MainFrame; import com.jpexs.asdec.types.BUTTONCONDACTION; import com.jpexs.asdec.types.BUTTONRECORD; import java.io.ByteArrayInputStream; @@ -28,6 +29,8 @@ import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Extends the capabilities of DefineButton by allowing any state transition to @@ -140,7 +143,7 @@ public class DefineButton2Tag extends Tag implements Container, TagName { sos.writeBUTTONCONDACTIONList(actions); sos.close(); } catch (IOException e) { - e.printStackTrace(); + Logger.getLogger(DefineButton2Tag.class.getName()).log(Level.SEVERE, null, e); } return baos.toByteArray(); } diff --git a/trunk/src/com/jpexs/asdec/tags/DefineButtonTag.java b/trunk/src/com/jpexs/asdec/tags/DefineButtonTag.java index b0c18ccb3..b55623ff1 100644 --- a/trunk/src/com/jpexs/asdec/tags/DefineButtonTag.java +++ b/trunk/src/com/jpexs/asdec/tags/DefineButtonTag.java @@ -28,6 +28,8 @@ import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Defines a button character @@ -124,7 +126,7 @@ public class DefineButtonTag extends Tag implements ASMSource, TagName { try { actions = (new SWFInputStream(new ByteArrayInputStream(actionBytes), version)).readActionList(); } catch (IOException ex) { - ex.printStackTrace(); + Logger.getLogger(DefineButtonTag.class.getName()).log(Level.SEVERE, null, ex); } return Action.actionsToString(actions, null, version); } diff --git a/trunk/src/com/jpexs/asdec/tags/DoABCTag.java b/trunk/src/com/jpexs/asdec/tags/DoABCTag.java index f46e0281a..bbb1b9aba 100644 --- a/trunk/src/com/jpexs/asdec/tags/DoABCTag.java +++ b/trunk/src/com/jpexs/asdec/tags/DoABCTag.java @@ -26,7 +26,7 @@ import java.io.*; /** * Defines a series of ActionScript 3 bytecodes to be executed */ -public class DoABCTag extends Tag { +public class DoABCTag extends Tag implements Comparable { /** * ActionScript 3 bytecodes @@ -94,4 +94,10 @@ public class DoABCTag extends Tag { } return new byte[0]; } + + public int compareTo(DoABCTag n) { + int lastCmp = name.compareTo(n.name); + return (lastCmp != 0 ? lastCmp + : name.compareTo(n.name)); + } } diff --git a/trunk/src/com/jpexs/asdec/tags/DoActionTag.java b/trunk/src/com/jpexs/asdec/tags/DoActionTag.java index 9824e533b..0d88c349d 100644 --- a/trunk/src/com/jpexs/asdec/tags/DoActionTag.java +++ b/trunk/src/com/jpexs/asdec/tags/DoActionTag.java @@ -22,6 +22,8 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Instructs Flash Player to perform a list of actions when the current frame is @@ -50,7 +52,7 @@ public class DoActionTag extends Tag implements ASMSource { //actions = sis.readActionList(); actionBytes = sis.readBytes(sis.available()); } catch (IOException e) { - e.printStackTrace(); + Logger.getLogger(DoActionTag.class.getName()).log(Level.SEVERE, null, e); } } @@ -76,7 +78,7 @@ public class DoActionTag extends Tag implements ASMSource { try { actions = (new SWFInputStream(new ByteArrayInputStream(actionBytes), version)).readActionList(); } catch (IOException ex) { - ex.printStackTrace(); + Logger.getLogger(DoActionTag.class.getName()).log(Level.SEVERE, null, ex); } return Action.actionsToString(actions, null, version); } @@ -104,7 +106,7 @@ public class DoActionTag extends Tag implements ASMSource { try { return (new SWFInputStream(new ByteArrayInputStream(actionBytes), version)).readActionList(); } catch (IOException ex) { - ex.printStackTrace(); + Logger.getLogger(DoActionTag.class.getName()).log(Level.SEVERE, null, ex); return new ArrayList(); } } diff --git a/trunk/src/com/jpexs/asdec/tags/DoInitActionTag.java b/trunk/src/com/jpexs/asdec/tags/DoInitActionTag.java index 4a16d7331..aff8fd9ab 100644 --- a/trunk/src/com/jpexs/asdec/tags/DoInitActionTag.java +++ b/trunk/src/com/jpexs/asdec/tags/DoInitActionTag.java @@ -24,6 +24,8 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; public class DoInitActionTag extends Tag implements ASMSource, TagName { @@ -111,7 +113,7 @@ public class DoInitActionTag extends Tag implements ASMSource, TagName { try { actions = (new SWFInputStream(new ByteArrayInputStream(actionBytes), version)).readActionList(); } catch (IOException ex) { - ex.printStackTrace(); + Logger.getLogger(DoInitActionTag.class.getName()).log(Level.SEVERE, null, ex); } return Action.actionsToString(actions, null, version); } @@ -120,7 +122,7 @@ public class DoInitActionTag extends Tag implements ASMSource, TagName { try { return (new SWFInputStream(new ByteArrayInputStream(actionBytes), version)).readActionList(); } catch (IOException ex) { - ex.printStackTrace(); + Logger.getLogger(DoInitActionTag.class.getName()).log(Level.SEVERE, null, ex); return new ArrayList(); } } diff --git a/trunk/src/com/jpexs/asdec/tags/Metadata.java b/trunk/src/com/jpexs/asdec/tags/Metadata.java index d8c668103..4bd5109a3 100644 --- a/trunk/src/com/jpexs/asdec/tags/Metadata.java +++ b/trunk/src/com/jpexs/asdec/tags/Metadata.java @@ -17,6 +17,8 @@ package com.jpexs.asdec.tags; import java.io.UnsupportedEncodingException; +import java.util.logging.Level; +import java.util.logging.Logger; public class Metadata extends Tag { @@ -27,8 +29,7 @@ public class Metadata extends Tag { try { xmlMetadata = new String(data, "UTF-8"); } catch (UnsupportedEncodingException e) { - // cannot get here - e.printStackTrace(); + //ignore } } diff --git a/trunk/src/com/jpexs/asdec/types/BUTTONCONDACTION.java b/trunk/src/com/jpexs/asdec/types/BUTTONCONDACTION.java index dd7c81d17..d283b8125 100644 --- a/trunk/src/com/jpexs/asdec/types/BUTTONCONDACTION.java +++ b/trunk/src/com/jpexs/asdec/types/BUTTONCONDACTION.java @@ -19,10 +19,13 @@ package com.jpexs.asdec.types; import com.jpexs.asdec.SWFInputStream; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.tags.ASMSource; +import com.jpexs.asdec.tags.DoInitActionTag; import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Actions to execute at particular button events @@ -113,7 +116,7 @@ public class BUTTONCONDACTION implements ASMSource { try { actions = (new SWFInputStream(new ByteArrayInputStream(actionBytes), version)).readActionList(); } catch (IOException ex) { - ex.printStackTrace(); + Logger.getLogger(BUTTONCONDACTION.class.getName()).log(Level.SEVERE, null, ex); } return Action.actionsToString(actions, null, version); } @@ -137,7 +140,7 @@ public class BUTTONCONDACTION implements ASMSource { try { return (new SWFInputStream(new ByteArrayInputStream(actionBytes), version)).readActionList(); } catch (IOException ex) { - ex.printStackTrace(); + Logger.getLogger(BUTTONCONDACTION.class.getName()).log(Level.SEVERE, null, ex); return new ArrayList(); } } diff --git a/trunk/src/com/jpexs/asdec/types/CLIPACTIONRECORD.java b/trunk/src/com/jpexs/asdec/types/CLIPACTIONRECORD.java index bee0ced9e..b7f978c34 100644 --- a/trunk/src/com/jpexs/asdec/types/CLIPACTIONRECORD.java +++ b/trunk/src/com/jpexs/asdec/types/CLIPACTIONRECORD.java @@ -19,10 +19,13 @@ package com.jpexs.asdec.types; import com.jpexs.asdec.SWFInputStream; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.tags.ASMSource; +import com.jpexs.asdec.tags.DoInitActionTag; import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Event handler @@ -80,7 +83,7 @@ public class CLIPACTIONRECORD implements ASMSource { try { actions = (new SWFInputStream(new ByteArrayInputStream(actionBytes), version)).readActionList(); } catch (IOException ex) { - ex.printStackTrace(); + Logger.getLogger(CLIPACTIONRECORD.class.getName()).log(Level.SEVERE, null, ex); } return Action.actionsToString(actions, null, version); } @@ -98,7 +101,7 @@ public class CLIPACTIONRECORD implements ASMSource { try { return (new SWFInputStream(new ByteArrayInputStream(actionBytes), version)).readActionList(); } catch (IOException ex) { - ex.printStackTrace(); + Logger.getLogger(CLIPACTIONRECORD.class.getName()).log(Level.SEVERE, null, ex); return new ArrayList(); } }