From 75941e7c61f64d0707fc212d40e26f9524ef4ca0 Mon Sep 17 00:00:00 2001 From: honfika Date: Sun, 24 Aug 2014 12:57:36 +0200 Subject: [PATCH] combine push method fixed --- src/com/jpexs/decompiler/flash/action/Action.java | 1 + .../action/deobfuscation/ActionDeobfuscator.java | 14 +++++++++++--- .../flash/action/flashlite/ActionStrictMode.java | 1 + .../decompiler/flash/action/swf3/ActionGetURL.java | 1 + .../flash/action/swf3/ActionGoToLabel.java | 1 + .../flash/action/swf3/ActionGotoFrame.java | 1 + .../flash/action/swf3/ActionSetTarget.java | 1 + .../flash/action/swf3/ActionWaitForFrame.java | 1 + .../flash/action/swf4/ActionGetURL2.java | 1 + .../flash/action/swf4/ActionGotoFrame2.java | 1 + .../decompiler/flash/action/swf4/ActionIf.java | 1 + .../decompiler/flash/action/swf4/ActionJump.java | 1 + .../decompiler/flash/action/swf4/ActionPush.java | 2 +- .../flash/action/swf4/ActionWaitForFrame2.java | 1 + .../flash/action/swf5/ActionConstantPool.java | 1 + .../flash/action/swf5/ActionDefineFunction.java | 1 + .../flash/action/swf5/ActionStoreRegister.java | 1 + .../decompiler/flash/action/swf5/ActionWith.java | 1 + .../flash/action/swf7/ActionDefineFunction2.java | 1 + .../decompiler/flash/action/swf7/ActionTry.java | 1 + .../decompiler/flash/tags/CSMTextSettingsTag.java | 1 + .../jpexs/decompiler/flash/tags/DebugIDTag.java | 1 + .../decompiler/flash/tags/DefineBinaryDataTag.java | 1 + .../decompiler/flash/tags/DefineBitsJPEG2Tag.java | 1 + .../decompiler/flash/tags/DefineBitsJPEG3Tag.java | 1 + .../decompiler/flash/tags/DefineBitsJPEG4Tag.java | 1 + .../flash/tags/DefineBitsLossless2Tag.java | 1 + .../flash/tags/DefineBitsLosslessTag.java | 1 + .../jpexs/decompiler/flash/tags/DefineBitsTag.java | 1 + .../decompiler/flash/tags/DefineButton2Tag.java | 2 +- .../flash/tags/DefineButtonCxformTag.java | 1 + .../flash/tags/DefineButtonSoundTag.java | 1 + .../decompiler/flash/tags/DefineButtonTag.java | 1 + .../decompiler/flash/tags/DefineEditTextTag.java | 1 + .../decompiler/flash/tags/DefineFont2Tag.java | 1 + .../decompiler/flash/tags/DefineFont3Tag.java | 1 + .../decompiler/flash/tags/DefineFont4Tag.java | 1 + .../flash/tags/DefineFontAlignZonesTag.java | 1 + .../decompiler/flash/tags/DefineFontInfo2Tag.java | 1 + .../decompiler/flash/tags/DefineFontInfoTag.java | 1 + .../decompiler/flash/tags/DefineFontNameTag.java | 1 + .../jpexs/decompiler/flash/tags/DefineFontTag.java | 1 + .../flash/tags/DefineMorphShape2Tag.java | 1 + .../decompiler/flash/tags/DefineMorphShapeTag.java | 1 + .../flash/tags/DefineScalingGridTag.java | 1 + .../tags/DefineSceneAndFrameLabelDataTag.java | 1 + .../decompiler/flash/tags/DefineShape2Tag.java | 1 + .../decompiler/flash/tags/DefineShape3Tag.java | 1 + .../decompiler/flash/tags/DefineShape4Tag.java | 1 + .../decompiler/flash/tags/DefineShapeTag.java | 1 + .../decompiler/flash/tags/DefineSoundTag.java | 1 + .../decompiler/flash/tags/DefineSpriteTag.java | 1 + .../decompiler/flash/tags/DefineText2Tag.java | 1 + .../jpexs/decompiler/flash/tags/DefineTextTag.java | 1 + .../flash/tags/DefineVideoStreamTag.java | 1 + .../decompiler/flash/tags/DoABCDefineTag.java | 2 +- src/com/jpexs/decompiler/flash/tags/DoABCTag.java | 2 +- .../decompiler/flash/tags/DoInitActionTag.java | 1 + .../decompiler/flash/tags/EnableDebugger2Tag.java | 1 + .../decompiler/flash/tags/EnableDebuggerTag.java | 1 + .../decompiler/flash/tags/EnableTelemetryTag.java | 1 + .../decompiler/flash/tags/ExportAssetsTag.java | 1 + .../decompiler/flash/tags/FileAttributesTag.java | 1 + .../jpexs/decompiler/flash/tags/FrameLabelTag.java | 1 + .../decompiler/flash/tags/ImportAssets2Tag.java | 1 + .../decompiler/flash/tags/ImportAssetsTag.java | 1 + .../jpexs/decompiler/flash/tags/JPEGTablesTag.java | 1 + .../jpexs/decompiler/flash/tags/MetadataTag.java | 1 + .../decompiler/flash/tags/PlaceObject2Tag.java | 1 + .../decompiler/flash/tags/PlaceObject3Tag.java | 3 ++- .../decompiler/flash/tags/PlaceObject4Tag.java | 3 ++- .../decompiler/flash/tags/PlaceObjectTag.java | 1 + .../decompiler/flash/tags/ProductInfoTag.java | 1 + .../jpexs/decompiler/flash/tags/ProtectTag.java | 1 + .../decompiler/flash/tags/RemoveObject2Tag.java | 1 + .../decompiler/flash/tags/RemoveObjectTag.java | 1 + .../decompiler/flash/tags/ScriptLimitsTag.java | 1 + .../flash/tags/SetBackgroundColorTag.java | 1 + .../decompiler/flash/tags/SetTabIndexTag.java | 1 + .../decompiler/flash/tags/SoundStreamBlockTag.java | 1 + .../decompiler/flash/tags/SoundStreamHead2Tag.java | 1 + .../decompiler/flash/tags/SoundStreamHeadTag.java | 1 + .../jpexs/decompiler/flash/tags/StartSoundTag.java | 1 + .../decompiler/flash/tags/SymbolClassTag.java | 1 + src/com/jpexs/decompiler/flash/tags/Tag.java | 2 ++ .../jpexs/decompiler/flash/tags/VideoFrameTag.java | 1 + .../flash/tags/gfx/DefineCompactedFont.java | 1 + .../flash/tags/gfx/DefineExternalGradient.java | 1 + .../flash/tags/gfx/DefineExternalImage.java | 1 + .../flash/tags/gfx/DefineExternalImage2.java | 1 + .../flash/tags/gfx/DefineExternalSound.java | 1 + .../flash/tags/gfx/DefineExternalStreamSound.java | 1 + .../flash/tags/gfx/DefineGradientMap.java | 1 + .../decompiler/flash/tags/gfx/DefineSubImage.java | 1 + .../decompiler/flash/tags/gfx/ExporterInfoTag.java | 1 + .../decompiler/flash/tags/gfx/FontTextureInfo.java | 1 + 96 files changed, 109 insertions(+), 9 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/action/Action.java b/src/com/jpexs/decompiler/flash/action/Action.java index 7d1b2a9b5..daff9333f 100644 --- a/src/com/jpexs/decompiler/flash/action/Action.java +++ b/src/com/jpexs/decompiler/flash/action/Action.java @@ -347,6 +347,7 @@ public class Action implements GraphSourceItem { sos2.write(data); sos2.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos2.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java b/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java index f59d811b9..43f6116fe 100644 --- a/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java +++ b/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java @@ -97,9 +97,17 @@ public class ActionDeobfuscator implements SWFDecompilerListener { if (!actions.getReferencesFor(action2).hasNext()) { ActionPush push = (ActionPush) action; ActionPush push2 = (ActionPush) action2; - push.values.addAll(push2.values); - actions.remove(i + 1); - i--; + if (!(push.constantPool != null && push2.constantPool != null && push.constantPool != push.constantPool)) { + ActionPush newPush = new ActionPush(0); + newPush.constantPool = push.constantPool == null ? push2.constantPool : push.constantPool; + newPush.values.clear(); + newPush.values.addAll(push.values); + newPush.values.addAll(push2.values); + actions.addAction(i + 1, newPush); + actions.removeAction(i + 2); + actions.removeAction(i); + i--; + } } } } diff --git a/src/com/jpexs/decompiler/flash/action/flashlite/ActionStrictMode.java b/src/com/jpexs/decompiler/flash/action/flashlite/ActionStrictMode.java index f4cd1b047..8e141a107 100644 --- a/src/com/jpexs/decompiler/flash/action/flashlite/ActionStrictMode.java +++ b/src/com/jpexs/decompiler/flash/action/flashlite/ActionStrictMode.java @@ -51,6 +51,7 @@ public class ActionStrictMode extends Action { sos.writeUI8(mode); sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf3/ActionGetURL.java b/src/com/jpexs/decompiler/flash/action/swf3/ActionGetURL.java index f3fabf601..9f1a91756 100644 --- a/src/com/jpexs/decompiler/flash/action/swf3/ActionGetURL.java +++ b/src/com/jpexs/decompiler/flash/action/swf3/ActionGetURL.java @@ -70,6 +70,7 @@ public class ActionGetURL extends Action { sos.writeString(targetString); sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf3/ActionGoToLabel.java b/src/com/jpexs/decompiler/flash/action/swf3/ActionGoToLabel.java index 99df52ef7..d74fb1949 100644 --- a/src/com/jpexs/decompiler/flash/action/swf3/ActionGoToLabel.java +++ b/src/com/jpexs/decompiler/flash/action/swf3/ActionGoToLabel.java @@ -59,6 +59,7 @@ public class ActionGoToLabel extends Action { sos.writeString(label); sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf3/ActionGotoFrame.java b/src/com/jpexs/decompiler/flash/action/swf3/ActionGotoFrame.java index 5284dd49a..3a591f7c5 100644 --- a/src/com/jpexs/decompiler/flash/action/swf3/ActionGotoFrame.java +++ b/src/com/jpexs/decompiler/flash/action/swf3/ActionGotoFrame.java @@ -56,6 +56,7 @@ public class ActionGotoFrame extends Action { sos.writeUI16(frame); sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf3/ActionSetTarget.java b/src/com/jpexs/decompiler/flash/action/swf3/ActionSetTarget.java index 086e83ae9..03a0c6eb2 100644 --- a/src/com/jpexs/decompiler/flash/action/swf3/ActionSetTarget.java +++ b/src/com/jpexs/decompiler/flash/action/swf3/ActionSetTarget.java @@ -59,6 +59,7 @@ public class ActionSetTarget extends Action { sos.writeString(targetName); sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf3/ActionWaitForFrame.java b/src/com/jpexs/decompiler/flash/action/swf3/ActionWaitForFrame.java index 24cc4f02d..a4789d903 100644 --- a/src/com/jpexs/decompiler/flash/action/swf3/ActionWaitForFrame.java +++ b/src/com/jpexs/decompiler/flash/action/swf3/ActionWaitForFrame.java @@ -70,6 +70,7 @@ public class ActionWaitForFrame extends Action implements ActionStore { sos.writeUI8(skipCount); sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java b/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java index 9fc61ce37..9c118c23b 100644 --- a/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java +++ b/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java @@ -81,6 +81,7 @@ public class ActionGetURL2 extends Action { sos.writeUB(2, sendVarsMethod); sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java b/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java index 1c87bea16..5d1cc2d58 100644 --- a/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java +++ b/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java @@ -66,6 +66,7 @@ public class ActionGotoFrame2 extends Action { } sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf4/ActionIf.java b/src/com/jpexs/decompiler/flash/action/swf4/ActionIf.java index 694c20fdc..695a21451 100644 --- a/src/com/jpexs/decompiler/flash/action/swf4/ActionIf.java +++ b/src/com/jpexs/decompiler/flash/action/swf4/ActionIf.java @@ -69,6 +69,7 @@ public class ActionIf extends Action { sos.writeSI16(offset); sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf4/ActionJump.java b/src/com/jpexs/decompiler/flash/action/swf4/ActionJump.java index beac8cfb3..77e26c96a 100644 --- a/src/com/jpexs/decompiler/flash/action/swf4/ActionJump.java +++ b/src/com/jpexs/decompiler/flash/action/swf4/ActionJump.java @@ -70,6 +70,7 @@ public class ActionJump extends Action { sos.writeSI16(offset); sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java b/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java index 0a4c71f5d..04357730f 100644 --- a/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java +++ b/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java @@ -178,7 +178,7 @@ public class ActionPush extends Action { } sos.close(); } catch (IOException e) { - Logger.getLogger(ActionPush.class.getName()).log(Level.SEVERE, "Error during push to bytes", e); + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf4/ActionWaitForFrame2.java b/src/com/jpexs/decompiler/flash/action/swf4/ActionWaitForFrame2.java index b77bfef02..2ce5825d8 100644 --- a/src/com/jpexs/decompiler/flash/action/swf4/ActionWaitForFrame2.java +++ b/src/com/jpexs/decompiler/flash/action/swf4/ActionWaitForFrame2.java @@ -106,6 +106,7 @@ public class ActionWaitForFrame2 extends Action implements ActionStore { sos.writeUI8(skipCount); sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java b/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java index aebe71716..de85d5d5f 100644 --- a/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java +++ b/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java @@ -73,6 +73,7 @@ public class ActionConstantPool extends Action { } sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java b/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java index b88a37433..36cba2029 100644 --- a/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java +++ b/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java @@ -97,6 +97,7 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta baos2.write(surroundWithAction(baos.toByteArray(), version)); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos2.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java b/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java index 0ed9cd085..1c268379c 100644 --- a/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java +++ b/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java @@ -66,6 +66,7 @@ public class ActionStoreRegister extends Action implements StoreTypeAction { sos.writeUI8(registerNumber); sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java b/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java index d983e2190..637154f3a 100644 --- a/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java +++ b/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java @@ -70,6 +70,7 @@ public class ActionWith extends Action implements GraphSourceItemContainer { sos.close(); baos2.write(surroundWithAction(baos.toByteArray(), version)); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos2.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java b/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java index 86cd4ef16..3cd3108a8 100644 --- a/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java +++ b/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java @@ -154,6 +154,7 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont baos2.write(surroundWithAction(baos.toByteArray(), version)); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos2.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java b/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java index 7e67ff59a..7434a06e4 100644 --- a/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java +++ b/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java @@ -101,6 +101,7 @@ public class ActionTry extends Action implements GraphSourceItemContainer { } sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } diff --git a/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java b/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java index f02665385..9b72b06e0 100644 --- a/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java +++ b/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java @@ -77,6 +77,7 @@ public class CSMTextSettingsTag extends Tag { sos.writeFLOAT(sharpness); //F32 = FLOAT sos.writeUI8(reserved2); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java b/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java index 4217046d6..f30311d79 100644 --- a/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java @@ -50,6 +50,7 @@ public class DebugIDTag extends Tag { try { sos.write(debugId); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java b/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java index 7eec25c78..bdd9a7f9d 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java @@ -55,6 +55,7 @@ public class DefineBinaryDataTag extends CharacterTag { sos.writeUI32(reserved); sos.write(binaryData); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java index 0b1e23ea2..c42415997 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java @@ -96,6 +96,7 @@ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag { sos.writeUI16(characterID); sos.write(imageData); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java index 5bbda7136..f9940f0cc 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java @@ -132,6 +132,7 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag { sos.write(imageData); sos.writeBytesZlib(bitmapAlphaData); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java index 85c39efb7..c70a367c8 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java @@ -126,6 +126,7 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag { sos.write(imageData); sos.write(bitmapAlphaData); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java index fc3807021..ec9101bbb 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java @@ -171,6 +171,7 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag { } sos.write(zlibBitmapData); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java b/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java index edc4d726a..0c944000b 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java @@ -214,6 +214,7 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag { } sos.write(zlibBitmapData); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java b/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java index 08177480d..1edac1515 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java @@ -111,6 +111,7 @@ public class DefineBitsTag extends ImageTag { sos.writeUI16(characterID); sos.write(jpegData); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java index 562ea661e..4e4973348 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java @@ -147,7 +147,7 @@ public class DefineButton2Tag extends ButtonTag implements Container { sos.writeBUTTONCONDACTIONList(actions); sos.close(); } catch (IOException e) { - Logger.getLogger(DefineButton2Tag.class.getName()).log(Level.SEVERE, null, e); + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java b/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java index fad1f3a9c..ea4c97885 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java @@ -52,6 +52,7 @@ public class DefineButtonCxformTag extends Tag { sos.writeUI16(buttonId); sos.writeCXFORM(buttonColorTransform); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java b/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java index 214c5d090..affacc716 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java @@ -92,6 +92,7 @@ public class DefineButtonSoundTag extends CharacterIdTag { sos.writeSOUNDINFO(buttonSoundInfo3); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java b/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java index b64ba0591..826d3d050 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java @@ -129,6 +129,7 @@ public class DefineButtonTag extends ButtonTag implements ASMSource { //sos.write(Action.actionsToBytes(actions, true, version)); sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java b/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java index 4c8c33084..f21ffa5c0 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java @@ -690,6 +690,7 @@ public class DefineEditTextTag extends TextTag { } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java index db3a54b2a..3c04879b8 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java @@ -181,6 +181,7 @@ public class DefineFont2Tag extends FontTag { } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java index cd52280ef..5acf4988a 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java @@ -264,6 +264,7 @@ public class DefineFont3Tag extends FontTag { } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java index e087aa382..c96daa566 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java @@ -77,6 +77,7 @@ public class DefineFont4Tag extends CharacterTag { sos.writeString(fontName); sos.write(fontData); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java b/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java index 1ff481fb7..dcc9e7ec3 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java @@ -73,6 +73,7 @@ public class DefineFontAlignZonesTag extends Tag { sos.writeZONERECORD(z); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java index 69ab59fc0..b1d3008a7 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java @@ -81,6 +81,7 @@ public class DefineFontInfo2Tag extends Tag { sos.writeUI16(c); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java b/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java index 245470dc8..b187999f0 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java @@ -82,6 +82,7 @@ public class DefineFontInfoTag extends Tag { } } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java b/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java index 4ca136d0f..06ef77f04 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java @@ -55,6 +55,7 @@ public class DefineFontNameTag extends Tag { sos.writeString(fontName); sos.writeString(fontCopyright); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java b/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java index 77b818813..ed64a07c1 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java @@ -129,6 +129,7 @@ public class DefineFontTag extends FontTag { } sos.write(baos2.toByteArray()); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java index 869c6dc51..efa230ba6 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java @@ -142,6 +142,7 @@ public class DefineMorphShape2Tag extends CharacterTag implements MorphShapeTag sos.write(ba2); sos.writeSHAPE(endEdges, 2); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java b/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java index 4b8fa9ad3..1c26e8cf5 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java @@ -120,6 +120,7 @@ public class DefineMorphShapeTag extends CharacterTag implements MorphShapeTag { sos.writeSHAPE(endEdges, 1); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java b/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java index 35c55a969..3e75d7cbc 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java @@ -56,6 +56,7 @@ public class DefineScalingGridTag extends Tag { sos.writeUI16(characterId); sos.writeRECT(splitter); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java b/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java index 1befbf627..4f2dfd41d 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java @@ -71,6 +71,7 @@ public class DefineSceneAndFrameLabelDataTag extends Tag { sos.writeString(frameNames[i]); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java index 74fe9cbf8..932891b0a 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java @@ -94,6 +94,7 @@ public class DefineShape2Tag extends ShapeTag { sos.writeRECT(shapeBounds); sos.writeSHAPEWITHSTYLE(shapes, 2); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java index 6018bf647..c9f30db0e 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java @@ -94,6 +94,7 @@ public class DefineShape3Tag extends ShapeTag { sos.writeRECT(shapeBounds); sos.writeSHAPEWITHSTYLE(shapes, 3); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java index d2fb4131c..b76cd7d84 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java @@ -112,6 +112,7 @@ public class DefineShape4Tag extends ShapeTag { sos.writeUB(1, usesScalingStrokes ? 1 : 0); sos.writeSHAPEWITHSTYLE(shapes, 4); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java b/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java index dd5c08c36..b6e2dcb62 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java @@ -87,6 +87,7 @@ public class DefineShapeTag extends ShapeTag { sos.writeRECT(shapeBounds); sos.writeSHAPEWITHSTYLE(shapes, 1); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java b/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java index fde70006c..d4df5026f 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java @@ -89,6 +89,7 @@ public class DefineSoundTag extends CharacterTag implements SoundTag { sos.write(soundData); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java b/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java index 3be945980..b049e97d3 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java @@ -239,6 +239,7 @@ public class DefineSpriteTag extends CharacterTag implements Container, Drawable } sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java index 0fa1a820b..6162639cc 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java @@ -459,6 +459,7 @@ public class DefineText2Tag extends TextTag { } sos.writeUI8(0); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java b/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java index e015cd521..cb7d9d3ac 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java @@ -470,6 +470,7 @@ public class DefineTextTag extends TextTag { } sos.writeUI8(0); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java b/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java index 09889adf4..9eb28ab3c 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java @@ -93,6 +93,7 @@ public class DefineVideoStreamTag extends CharacterTag implements BoundedTag { sos.writeUB(1, videoFlagsSmoothing ? 1 : 0); sos.writeUI8(codecID); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java b/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java index 1c139ce5f..6e6a72a2a 100644 --- a/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java @@ -102,8 +102,8 @@ public class DoABCDefineTag extends Tag implements ABCContainerTag { } return bos.toByteArray(); } catch (IOException e) { + throw new Error("This should never happen.", e); } - return new byte[0]; } @Override diff --git a/src/com/jpexs/decompiler/flash/tags/DoABCTag.java b/src/com/jpexs/decompiler/flash/tags/DoABCTag.java index 9c7392c75..faf7673cc 100644 --- a/src/com/jpexs/decompiler/flash/tags/DoABCTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DoABCTag.java @@ -85,8 +85,8 @@ public class DoABCTag extends Tag implements ABCContainerTag { } return bos.toByteArray(); } catch (IOException e) { + throw new Error("This should never happen.", e); } - return new byte[0]; } @Override diff --git a/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java b/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java index 0ad674ce9..6fdc7c379 100644 --- a/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java @@ -83,6 +83,7 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource { //sos.write(Action.actionsToBytes(actions, true, version)); sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java b/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java index 4232a9816..560d219a1 100644 --- a/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java @@ -57,6 +57,7 @@ public class EnableDebugger2Tag extends Tag { sos.writeString(passwordHash); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java b/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java index 9a18bc8a2..a06ec82f4 100644 --- a/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java +++ b/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java @@ -51,6 +51,7 @@ public class EnableDebuggerTag extends Tag { sos.writeString(passwordHash); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java b/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java index 5ec38da15..626654d76 100644 --- a/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java +++ b/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java @@ -60,6 +60,7 @@ public class EnableTelemetryTag extends Tag { sos.write(passwordHash); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java b/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java index ab702627a..8cfb6cc7a 100644 --- a/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java +++ b/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java @@ -90,6 +90,7 @@ public class ExportAssetsTag extends Tag { sos.writeString(names.get(i)); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java b/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java index 10e66fd4f..32a7f2f88 100644 --- a/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java +++ b/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java @@ -85,6 +85,7 @@ public class FileAttributesTag extends Tag { sos.writeUB(1, useNetwork ? 1 : 0); sos.writeUB(24, reserved3); //reserved } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java b/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java index b5242efa8..4a28e42e2 100644 --- a/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java +++ b/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java @@ -63,6 +63,7 @@ public class FrameLabelTag extends Tag { sos.writeUI8(1); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java b/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java index 74b73c35e..898e21b76 100644 --- a/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java @@ -99,6 +99,7 @@ public class ImportAssets2Tag extends Tag implements ImportTag { sos.writeString(names.get(i)); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java b/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java index 3ad4cc781..5a05192e4 100644 --- a/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java +++ b/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java @@ -88,6 +88,7 @@ public class ImportAssetsTag extends Tag implements ImportTag { sos.writeString(names.get(i)); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java b/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java index c6f0fff62..fb161b747 100644 --- a/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java +++ b/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java @@ -48,6 +48,7 @@ public class JPEGTablesTag extends Tag { try { sos.write(jpegData); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/MetadataTag.java b/src/com/jpexs/decompiler/flash/tags/MetadataTag.java index f424ebded..c562bd0e3 100644 --- a/src/com/jpexs/decompiler/flash/tags/MetadataTag.java +++ b/src/com/jpexs/decompiler/flash/tags/MetadataTag.java @@ -51,6 +51,7 @@ public class MetadataTag extends Tag { try { sos.writeString(xmlMetadata); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java b/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java index 3632be366..98fe25bf8 100644 --- a/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java @@ -187,6 +187,7 @@ public class PlaceObject2Tag extends CharacterIdTag implements Container, PlaceO } sos.close(); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java b/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java index 3b6341e3f..07e5f1671 100644 --- a/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java @@ -290,7 +290,8 @@ public class PlaceObject3Tag extends CharacterIdTag implements Container, PlaceO sos.writeCLIPACTIONS(clipActions); } sos.close(); - } catch (IOException ex) { + } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java b/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java index f1f1d5e8d..3255d21fb 100644 --- a/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java @@ -292,7 +292,8 @@ public class PlaceObject4Tag extends CharacterIdTag implements Container, PlaceO sos.writeCLIPACTIONS(clipActions); } sos.close(); - } catch (IOException ex) { + } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java b/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java index f4adf35df..f0b71faea 100644 --- a/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java +++ b/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java @@ -93,6 +93,7 @@ public class PlaceObjectTag extends CharacterIdTag implements PlaceObjectTypeTag sos.writeCXFORM(colorTransform); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/ProductInfoTag.java b/src/com/jpexs/decompiler/flash/tags/ProductInfoTag.java index 6fdfb1d99..9edcf660a 100644 --- a/src/com/jpexs/decompiler/flash/tags/ProductInfoTag.java +++ b/src/com/jpexs/decompiler/flash/tags/ProductInfoTag.java @@ -88,6 +88,7 @@ public class ProductInfoTag extends Tag { sos.writeUI32(compilationDateLow); sos.writeUI32(compilationDateHigh); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/ProtectTag.java b/src/com/jpexs/decompiler/flash/tags/ProtectTag.java index 6b745a30f..a4ae1d8e9 100644 --- a/src/com/jpexs/decompiler/flash/tags/ProtectTag.java +++ b/src/com/jpexs/decompiler/flash/tags/ProtectTag.java @@ -51,6 +51,7 @@ public class ProtectTag extends Tag { sos.writeString(passwordHash); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/RemoveObject2Tag.java b/src/com/jpexs/decompiler/flash/tags/RemoveObject2Tag.java index 328232034..8f158ced9 100644 --- a/src/com/jpexs/decompiler/flash/tags/RemoveObject2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/RemoveObject2Tag.java @@ -50,6 +50,7 @@ public class RemoveObject2Tag extends Tag implements RemoveTag { try { sos.writeUI16(depth); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java b/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java index 8fbd63062..5070ce8db 100644 --- a/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java +++ b/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java @@ -60,6 +60,7 @@ public class RemoveObjectTag extends CharacterIdTag implements RemoveTag { sos.writeUI16(characterId); sos.writeUI16(depth); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/ScriptLimitsTag.java b/src/com/jpexs/decompiler/flash/tags/ScriptLimitsTag.java index a71319028..5d52c1381 100644 --- a/src/com/jpexs/decompiler/flash/tags/ScriptLimitsTag.java +++ b/src/com/jpexs/decompiler/flash/tags/ScriptLimitsTag.java @@ -55,6 +55,7 @@ public class ScriptLimitsTag extends Tag { sos.writeUI16(maxRecursionDepth); sos.writeUI16(scriptTimeoutSeconds); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/SetBackgroundColorTag.java b/src/com/jpexs/decompiler/flash/tags/SetBackgroundColorTag.java index 1c790dcb0..de56813e6 100644 --- a/src/com/jpexs/decompiler/flash/tags/SetBackgroundColorTag.java +++ b/src/com/jpexs/decompiler/flash/tags/SetBackgroundColorTag.java @@ -46,6 +46,7 @@ public class SetBackgroundColorTag extends Tag { try { sos.writeRGB(backgroundColor); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java b/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java index b7f7506f9..f61b5b281 100644 --- a/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java +++ b/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java @@ -58,6 +58,7 @@ public class SetTabIndexTag extends Tag { sos.writeUI16(depth); sos.writeUI16(tabIndex); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java b/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java index 06485b9e5..f6ba6c3b4 100644 --- a/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java +++ b/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java @@ -62,6 +62,7 @@ public class SoundStreamBlockTag extends Tag { try { sos.write(streamSoundData); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java b/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java index b4db65d30..b1b3baf6d 100644 --- a/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java @@ -130,6 +130,7 @@ public class SoundStreamHead2Tag extends CharacterIdTag implements SoundStreamHe sos.writeSI16(latencySeek); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java b/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java index e095876db..c5300ac2d 100644 --- a/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java +++ b/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java @@ -123,6 +123,7 @@ public class SoundStreamHeadTag extends CharacterIdTag implements SoundStreamHea sos.writeSI16(latencySeek); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java b/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java index 13417091a..87342aa25 100644 --- a/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java +++ b/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java @@ -52,6 +52,7 @@ public class StartSoundTag extends Tag { sos.writeUI16(soundId); sos.writeSOUNDINFO(soundInfo); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java b/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java index 915746908..9a8a20ba4 100644 --- a/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java +++ b/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java @@ -66,6 +66,7 @@ public class SymbolClassTag extends Tag { sos.writeString(names[ii]); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/Tag.java b/src/com/jpexs/decompiler/flash/tags/Tag.java index 546d640c1..e13e0ea4c 100644 --- a/src/com/jpexs/decompiler/flash/tags/Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/Tag.java @@ -299,6 +299,7 @@ public abstract class Tag implements NeedsCharacters, Exportable, ContainerItem, sos.writeSI32(tagLength); } } catch (IOException iex) { + throw new Error("This should never happen.", iex); } return baos.toByteArray(); } @@ -313,6 +314,7 @@ public abstract class Tag implements NeedsCharacters, Exportable, ContainerItem, sos.writeSI32(tagLength); } } catch (IOException iex) { + throw new Error("This should never happen.", iex); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java b/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java index 6f9c0537f..6c4a3d255 100644 --- a/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java +++ b/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java @@ -54,6 +54,7 @@ public class VideoFrameTag extends Tag { sos.writeUI16(frameNum); sos.write(videoData); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java index 955b377f4..3dd6f1339 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java @@ -78,6 +78,7 @@ public final class DefineCompactedFont extends FontTag implements DrawableTag { ft.write(new GFxOutputStream(sos)); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java index 64435f683..c1f8c3139 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java @@ -58,6 +58,7 @@ public class DefineExternalGradient extends Tag { sos.writeUI8(fileNameBytes.length); sos.write(fileNameBytes); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java index 92b2b0bb4..a02f764ef 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java @@ -60,6 +60,7 @@ public class DefineExternalImage extends Tag { sos.writeUI8(fileNameBytes.length); sos.write(fileNameBytes); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java index 372d95f31..355a3934a 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java @@ -68,6 +68,7 @@ public class DefineExternalImage2 extends Tag { sos.write(extraData); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java index 61d5d6cf8..aa41c1bed 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java @@ -68,6 +68,7 @@ public class DefineExternalSound extends Tag { sos.writeUI8(fileNameBytes.length); sos.write(fileNameBytes); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java index fd1304763..bbd939b3b 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java @@ -66,6 +66,7 @@ public class DefineExternalStreamSound extends Tag { sos.writeUI8(fileNameBytes.length); sos.write(fileNameBytes); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java index 1857ff35f..266c5556c 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java @@ -50,6 +50,7 @@ public class DefineGradientMap extends Tag { sos.writeUI16(indices[i]); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java index 3545a694b..319b2fd57 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java @@ -57,6 +57,7 @@ public class DefineSubImage extends Tag { sos.writeUI16(x2); sos.writeUI16(y2); } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java b/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java index 588418d24..bca67cd16 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java @@ -76,6 +76,7 @@ public class ExporterInfoTag extends Tag { } } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); } diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java b/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java index da1c61633..ca0bcbe38 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java @@ -79,6 +79,7 @@ public class FontTextureInfo extends Tag { fonts[i].write(new GFxOutputStream(sos)); } } catch (IOException e) { + throw new Error("This should never happen.", e); } return baos.toByteArray(); }