From 31eb284b60838982da79f947e195ca905fa5e6c8 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Tue, 7 Jul 2015 16:24:43 +0200 Subject: [PATCH] no more string concatenation in graph text writer --- .../abc/avm2/model/AlchemyLoadAVM2Item.java | 2 +- .../avm2/model/AlchemySignExtendAVM2Item.java | 8 ++--- .../abc/avm2/model/AlchemyStoreAVM2Item.java | 2 +- .../abc/avm2/model/FloatValueAVM2Item.java | 11 ++++--- .../abc/avm2/model/IntegerValueAVM2Item.java | 2 +- .../flash/abc/avm2/model/ScriptAVM2Item.java | 11 ++++--- .../abc/avm2/model/SetGlobalSlotAVM2Item.java | 11 ++++--- .../abc/avm2/model/SetLocalAVM2Item.java | 11 ++++--- .../flash/abc/avm2/model/StringAVM2Item.java | 2 +- .../avm2/model/clauses/ForEachInAVM2Item.java | 2 +- .../abc/avm2/model/clauses/ForInAVM2Item.java | 2 +- .../model/DefineRegisterActionItem.java | 2 +- .../action/model/DirectValueActionItem.java | 4 +-- .../action/model/GetPropertyActionItem.java | 2 +- .../flash/action/model/GetURL2ActionItem.java | 2 +- .../flash/action/model/GetURLActionItem.java | 4 ++- .../action/model/GotoFrameActionItem.java | 11 ++++--- .../action/model/LoadMovieActionItem.java | 2 +- .../action/model/LoadMovieNumActionItem.java | 2 +- .../action/model/LoadVariablesActionItem.java | 2 +- .../model/LoadVariablesNumActionItem.java | 2 +- .../action/model/SetPropertyActionItem.java | 4 +-- .../action/model/StoreRegisterActionItem.java | 2 +- .../action/model/StrictModeActionItem.java | 12 ++++--- .../action/model/UnsupportedActionItem.java | 11 ++++--- .../action/model/clauses/ForInActionItem.java | 2 +- .../flash/exporters/swf/SwfJavaExporter.java | 6 ++-- .../flash/helpers/GraphTextWriter.java | 16 ++++++++++ .../decompiler/flash/helpers/NulWriter.java | 18 +++++++++++ .../flash/tags/DefineEditTextTag.java | 30 ++++++++--------- .../flash/tags/base/StaticTextTag.java | 32 +++++++++---------- .../decompiler/graph/GraphTargetItem.java | 4 +++ .../com/jpexs/decompiler/graph/MarkItem.java | 11 ++++--- .../decompiler/graph/model/BreakItem.java | 2 +- .../decompiler/graph/model/ContinueItem.java | 2 +- .../decompiler/graph/model/DoWhileItem.java | 2 +- .../jpexs/decompiler/graph/model/ForItem.java | 2 +- .../decompiler/graph/model/GotoItem.java | 2 +- .../graph/model/IntegerValueItem.java | 8 ++--- .../decompiler/graph/model/LabelItem.java | 2 +- .../decompiler/graph/model/SwitchItem.java | 2 +- .../graph/model/UniversalLoopItem.java | 2 +- .../decompiler/graph/model/WhileItem.java | 2 +- 43 files changed, 160 insertions(+), 111 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java index 5c3c4d79d..7e746d3ff 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java @@ -53,7 +53,7 @@ public class AlchemyLoadAVM2Item extends AVM2Item { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { - writer.append("l" + type + size + "("); + writer.append("l").append(type).append(size).append("("); ofs.toString(writer, localData); return writer.append(")"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java index 18095c337..ebc015ead 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java @@ -1,16 +1,16 @@ /* * 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. */ @@ -46,7 +46,7 @@ public class AlchemySignExtendAVM2Item extends AVM2Item { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { - writer.append("si" + size + "("); + writer.append("si").append(size).append("("); value.toString(writer, localData); return writer.append(")"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java index 94e689126..b7de46ed9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java @@ -54,7 +54,7 @@ public class AlchemyStoreAVM2Item extends AVM2Item { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { - writer.append("s" + type + size + "("); + writer.append("s").append(type).append(size).append("("); ofs.toString(writer, localData); writer.append(","); value.toString(writer, localData); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FloatValueAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FloatValueAVM2Item.java index 35b8a168d..55b09abcf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FloatValueAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FloatValueAVM2Item.java @@ -1,18 +1,19 @@ /* * 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. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -40,7 +41,7 @@ public class FloatValueAVM2Item extends NumberValueAVM2Item { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { - return writer.append("" + value); + return writer.append(value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java index cb252b2b3..7fe0682dc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java @@ -44,7 +44,7 @@ public class IntegerValueAVM2Item extends NumberValueAVM2Item implements Integer @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { - return writer.append("" + value); + return writer.append(value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ScriptAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ScriptAVM2Item.java index 046962d66..e88f99304 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ScriptAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ScriptAVM2Item.java @@ -1,18 +1,19 @@ /* * 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. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -35,7 +36,7 @@ public class ScriptAVM2Item extends AVM2Item { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { - return writer.append("script" + scriptIndex); + return writer.append("script").append(scriptIndex); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java index c95e2498c..172caa23e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java @@ -1,18 +1,19 @@ /* * 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. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; @@ -43,7 +44,7 @@ public class SetGlobalSlotAVM2Item extends AVM2Item { writer.append("setglobalslot"); writer.spaceBeforeCallParenthesies(2); writer.append("("); - writer.append(slotId + ","); + writer.append(slotId).append(","); value.toString(writer, localData); return writer.append(")"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java index e46e4ae76..a95553c3f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java @@ -1,18 +1,19 @@ /* * 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. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -48,7 +49,7 @@ public class SetLocalAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assig public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String localName = localRegName(localData.localRegNames, regIndex); srcData.localName = localName; - writer.append(localName + " = "); + writer.append(localName).append(" = "); return value.toString(writer, localData); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java index b2d84022a..2f14ce4c0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java @@ -43,7 +43,7 @@ public class StringAVM2Item extends AVM2Item implements SimpleValue { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { - return writer.append("\"" + Helper.escapeActionScriptString(value) + "\""); + return writer.append("\"").append(Helper.escapeActionScriptString(value)).append("\""); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java index af8903a24..7a0dbe3fc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java @@ -86,7 +86,7 @@ public class ForEachInAVM2Item extends LoopItem implements Block { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } if (labelUsed) { - writer.append("loop" + loop.id + ":").newLine(); + writer.append("loop").append(loop.id).append(":").newLine(); } writer.append("for each"); if (writer.getFormatting().spaceBeforeParenthesesForEachParentheses) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java index 4f7f288df..f8d5019f4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java @@ -86,7 +86,7 @@ public class ForInAVM2Item extends LoopItem implements Block { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } if (labelUsed) { - writer.append("loop" + loop.id + ":").newLine(); + writer.append("loop").append(loop.id).append(":").newLine(); } writer.append("for"); if (writer.getFormatting().spaceBeforeParenthesesForParentheses) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DefineRegisterActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DefineRegisterActionItem.java index fe0ff8950..e8b49b581 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DefineRegisterActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DefineRegisterActionItem.java @@ -37,7 +37,7 @@ public class DefineRegisterActionItem extends ActionItem { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { - return writer.append("var " + identifier); + return writer.append("var ").append(identifier); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java index 4dc97afc0..bb317a57c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java @@ -172,10 +172,10 @@ public class DirectValueActionItem extends ActionItem implements SimpleValue { } } if (value instanceof String) { - return writer.append("\"" + Helper.escapeActionScriptString((String) value) + "\""); + return writer.append("\"").append(Helper.escapeActionScriptString((String) value)).append("\""); } if (value instanceof ConstantIndex) { - return writer.append("\"" + Helper.escapeActionScriptString(this.constants.get(((ConstantIndex) value).index)) + "\""); + return writer.append("\"").append(Helper.escapeActionScriptString(this.constants.get(((ConstantIndex) value).index))).append("\""); } if (value instanceof RegisterNumber) { return writer.append(((RegisterNumber) value).translate()); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java index ef6ffe260..0a7753bc3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java @@ -55,7 +55,7 @@ public class GetPropertyActionItem extends ActionItem { return writer.append(Action.propertyNames[propertyIndex]); } target.toString(writer, localData); - return writer.append("." + Action.propertyNames[propertyIndex]); + return writer.append(".").append(Action.propertyNames[propertyIndex]); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java index 830714bf9..8b76cbd32 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java @@ -60,7 +60,7 @@ public class GetURL2ActionItem extends ActionItem { urlString.toString(writer, localData); writer.append(","); targetString.toString(writer, localData); - return writer.append(methodStr + ")"); + return writer.append(methodStr).append(")"); } public GetURL2ActionItem(GraphSourceItem instruction, GraphTargetItem urlString, GraphTargetItem targetString, int method) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java index 74c122f6b..81dc1b75e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java @@ -37,7 +37,9 @@ public class GetURLActionItem extends ActionItem { writer.append("getUrl"); writer.spaceBeforeCallParenthesies(2); writer.append("(\""); - writer.append(Helper.escapeActionScriptString(urlString) + "\", \"" + Helper.escapeActionScriptString(targetString)); + writer.append(Helper.escapeActionScriptString(urlString)); + writer.append("\", \""); + writer.append(Helper.escapeActionScriptString(targetString)); return writer.append("\")"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java index 09957933c..3a4a167ee 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java @@ -1,18 +1,19 @@ /* * 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. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -38,7 +39,7 @@ public class GotoFrameActionItem extends ActionItem { writer.append("gotoAndStop"); writer.spaceBeforeCallParenthesies(1); writer.append("("); - writer.append("" + (frame + 1)); + writer.append(frame + 1); return writer.append(")"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java index 0335fc478..b8cc692ff 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java @@ -69,7 +69,7 @@ public class LoadMovieActionItem extends ActionItem { urlString.toString(writer, localData); writer.append(","); targetString.toString(writer, localData); - return writer.append(methodStr + ")"); + return writer.append(methodStr).append(")"); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java index 6e1a1286b..4808b43c1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java @@ -71,7 +71,7 @@ public class LoadMovieNumActionItem extends ActionItem { urlString.toString(writer, localData); writer.append(","); num.toString(writer, localData); - return writer.append(methodStr + ")"); + return writer.append(methodStr).append(")"); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java index 94d11e5eb..ff39e9c65 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java @@ -69,7 +69,7 @@ public class LoadVariablesActionItem extends ActionItem { urlString.toString(writer, localData); writer.append(","); targetString.toString(writer, localData); - return writer.append(methodStr + ")"); + return writer.append(methodStr).append(")"); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java index 2c3a328a8..ad7f7e0b6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java @@ -71,7 +71,7 @@ public class LoadVariablesNumActionItem extends ActionItem { urlString.toString(writer, localData); writer.append(","); num.toString(writer, localData); - return writer.append(methodStr + ")"); + return writer.append(methodStr).append(")"); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java index 320dc546a..5bcd1a600 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java @@ -77,11 +77,11 @@ public class SetPropertyActionItem extends ActionItem implements SetTypeActionIt @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (isEmptyString(target)) { - writer.append(Action.propertyNames[propertyIndex] + " = "); + writer.append(Action.propertyNames[propertyIndex]).append(" = "); return value.toString(writer, localData); } target.toString(writer, localData); - writer.append("." + Action.propertyNames[propertyIndex] + " = "); + writer.append("." + Action.propertyNames[propertyIndex]).append(" = "); return value.toString(writer, localData); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java index c80f97cc7..ac9e8e35c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java @@ -81,7 +81,7 @@ public class StoreRegisterActionItem extends ActionItem implements SetTypeAction if (define) { writer.append("var "); } - writer.append(register.translate() + " = "); + writer.append(register.translate()).append(" = "); value.toString(writer, localData); } return writer; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StrictModeActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StrictModeActionItem.java index 10ea3804b..1f4a95de2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StrictModeActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StrictModeActionItem.java @@ -1,18 +1,19 @@ /* * 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. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -32,7 +33,8 @@ public class StrictModeActionItem extends ActionItem { public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { writer.append("StrictMode"); writer.spaceBeforeCallParenthesies(0); - return writer.append("(" + mode + ");"); //I still don't know how AS source of Strict Mode instruction looks like, assuming this... + // I still don't know how AS source of Strict Mode instruction looks like, assuming this... + return writer.append("(").append(mode).append(");"); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java index e50670f23..fea9f818b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java @@ -1,18 +1,19 @@ /* * 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. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.AppResources; @@ -31,7 +32,7 @@ public class UnsupportedActionItem extends ActionItem { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { - return writer.append("// " + AppResources.translate("decompilation.unsupported") + ":" + value); + return writer.append("// ").append(AppResources.translate("decompilation.unsupported")).append(":").append(value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java index 527acaa5c..66f0286b8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java @@ -81,7 +81,7 @@ public class ForInActionItem extends LoopActionItem implements Block { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } if (labelUsed) { - writer.append("loop" + loop.id + ":").newLine(); + writer.append("loop").append(loop.id).append(":").newLine(); } writer.append("for"); if (writer.getFormatting().spaceBeforeParenthesesForParentheses) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/swf/SwfJavaExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/swf/SwfJavaExporter.java index 8449eb159..4a08663ce 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/swf/SwfJavaExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/swf/SwfJavaExporter.java @@ -242,11 +242,11 @@ public class SwfJavaExporter { } } - writer.append("private " + className + " " + tagObjName + "(" + (isSwf ? "" : "SWF swf") + ") {").newLine(); + writer.append("private ").append(className).append(" ").append(tagObjName).append("(").append(isSwf ? "" : "SWF swf").append(") {").newLine(); writer.indent(); - writer.append(className + " " + resultName + " = new " + className + "(" + (obj instanceof Tag ? "swf" : "") + ");" + Helper.newLine); + writer.append(className).append(" ").append(resultName).append(" = new ").append(className).append("(").append(obj instanceof Tag ? "swf" : "").append(");").newLine(); writer.append(sb2.toString()); - writer.append(indent + "return " + resultName + ";").newLine(); + writer.append(indent).append("return ").append(resultName).append(";").newLine(); writer.unindent(); writer.append("}").newLine().newLine(); value = tagObjName + "(swf)"; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/GraphTextWriter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/GraphTextWriter.java index 92aeefd97..2cf5f25c9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/GraphTextWriter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/GraphTextWriter.java @@ -130,6 +130,22 @@ public abstract class GraphTextWriter { public abstract GraphTextWriter appendWithData(String str, HighlightData data); + public GraphTextWriter append(char value) { + return append(Character.toString(value)); + } + + public GraphTextWriter append(int value) { + return append(Integer.toString(value)); + } + + public GraphTextWriter append(long value) { + return append(Long.toString(value)); + } + + public GraphTextWriter append(double value) { + return append(Double.toString(value)); + } + public abstract GraphTextWriter append(String str); public abstract GraphTextWriter append(String str, long offset); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/NulWriter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/NulWriter.java index 3a5f2ea74..6594b74fb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/NulWriter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/NulWriter.java @@ -101,6 +101,24 @@ public class NulWriter extends GraphTextWriter { return this; } + @Override + public GraphTextWriter append(char value) { + stringAdded = true; + return this; + } + + @Override + public GraphTextWriter append(int value) { + stringAdded = true; + return this; + } + + @Override + public GraphTextWriter append(long value) { + stringAdded = true; + return this; + } + @Override public NulWriter append(String str) { stringAdded = true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java index 7ad9b8ac9..ebd40a6ca 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java @@ -505,10 +505,10 @@ public class DefineEditTextTag extends TextTag { alignment = "unknown"; } writer.newLine(); - writer.append("xmin " + bounds.Xmin).newLine(); - writer.append("ymin " + bounds.Ymin).newLine(); - writer.append("xmax " + bounds.Xmax).newLine(); - writer.append("ymax " + bounds.Ymax).newLine(); + writer.append("xmin ").append(bounds.Xmin).newLine(); + writer.append("ymin ").append(bounds.Ymin).newLine(); + writer.append("xmax ").append(bounds.Xmax).newLine(); + writer.append("ymax ").append(bounds.Ymax).newLine(); if (wordWrap) { writer.append("wordwrap 1").newLine(); } @@ -540,27 +540,27 @@ public class DefineEditTextTag extends TextTag { writer.append("useoutlines 1").newLine(); } if (hasFont) { - writer.append("font " + fontId).newLine(); - writer.append("height " + fontHeight).newLine(); + writer.append("font ").append(fontId).newLine(); + writer.append("height ").append(fontHeight).newLine(); } if (hasTextColor) { - writer.append("color " + textColor.toHexARGB()).newLine(); + writer.append("color ").append(textColor.toHexARGB()).newLine(); } if (hasFontClass) { - writer.append("fontclass " + fontClass).newLine(); + writer.append("fontclass ").append(fontClass).newLine(); } if (hasMaxLength) { - writer.append("maxlength " + maxLength).newLine(); + writer.append("maxlength ").append(maxLength).newLine(); } - writer.append("align " + alignment).newLine(); + writer.append("align ").append(alignment).newLine(); if (hasLayout) { - writer.append("leftmargin " + leftMargin).newLine(); - writer.append("rightmargin " + rightMargin).newLine(); - writer.append("indent " + indent).newLine(); - writer.append("leading " + leading).newLine(); + writer.append("leftmargin ").append(leftMargin).newLine(); + writer.append("rightmargin ").append(rightMargin).newLine(); + writer.append("indent ").append(indent).newLine(); + writer.append("leading ").append(leading).newLine(); } if (!variableName.isEmpty()) { - writer.append("variablename " + variableName).newLine(); + writer.append("variablename ").append(variableName).newLine(); } writer.append("]"); if (hasText) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/StaticTextTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/StaticTextTag.java index 7e173df12..cdbded97d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/StaticTextTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/StaticTextTag.java @@ -231,23 +231,23 @@ public abstract class StaticTextTag extends TextTag { FontTag fnt = null; HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), true); writer.append("[").newLine(); - writer.append("xmin " + textBounds.Xmin).newLine(); - writer.append("ymin " + textBounds.Ymin).newLine(); - writer.append("xmax " + textBounds.Xmax).newLine(); - writer.append("ymax " + textBounds.Ymax).newLine(); + writer.append("xmin ").append(textBounds.Xmin).newLine(); + writer.append("ymin ").append(textBounds.Ymin).newLine(); + writer.append("xmax ").append(textBounds.Xmax).newLine(); + writer.append("ymax ").append(textBounds.Ymax).newLine(); if (textMatrix.translateX != 0) { - writer.append("translatex " + textMatrix.translateX).newLine(); + writer.append("translatex ").append(textMatrix.translateX).newLine(); } if (textMatrix.translateY != 0) { - writer.append("translatey " + textMatrix.translateY).newLine(); + writer.append("translatey ").append(textMatrix.translateY).newLine(); } if (textMatrix.hasScale) { - writer.append("scalex " + textMatrix.scaleX).newLine(); - writer.append("scaley " + textMatrix.scaleY).newLine(); + writer.append("scalex ").append(textMatrix.scaleX).newLine(); + writer.append("scaley ").append(textMatrix.scaleY).newLine(); } if (textMatrix.hasRotate) { - writer.append("rotateskew0 " + textMatrix.rotateSkew0).newLine(); - writer.append("rotateskew1 " + textMatrix.rotateSkew1).newLine(); + writer.append("rotateskew0 ").append(textMatrix.rotateSkew0).newLine(); + writer.append("rotateskew1 ").append(textMatrix.rotateSkew1).newLine(); } writer.append("]"); for (TEXTRECORD rec : textRecords) { @@ -258,21 +258,21 @@ public abstract class StaticTextTag extends TextTag { if (fnt2 != null) { fnt = fnt2; } - writer.append("font " + rec.fontId).newLine(); - writer.append("height " + rec.textHeight).newLine(); + writer.append("font ").append(rec.fontId).newLine(); + writer.append("height ").append(rec.textHeight).newLine(); } if (rec.styleFlagsHasColor) { if (getTextNum() == 1) { - writer.append("color " + rec.textColor.toHexRGB()).newLine(); + writer.append("color ").append(rec.textColor.toHexRGB()).newLine(); } else { - writer.append("color " + rec.textColorA.toHexARGB()).newLine(); + writer.append("color ").append(rec.textColorA.toHexARGB()).newLine(); } } if (rec.styleFlagsHasXOffset) { - writer.append("x " + rec.xOffset).newLine(); + writer.append("x ").append(rec.xOffset).newLine(); } if (rec.styleFlagsHasYOffset) { - writer.append("y " + rec.yOffset).newLine(); + writer.append("y ").append(rec.yOffset).newLine(); } writer.append("]"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java index 02aacec7d..81f02f912 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java @@ -148,6 +148,10 @@ public abstract class GraphTargetItem implements Serializable, Cloneable { } public GraphTextWriter toString(GraphTextWriter writer, LocalData localData) throws InterruptedException { + if (Thread.currentThread().isInterrupted()) { + throw new InterruptedException(); + } + writer.startOffset(src, pos, srcData); appendTo(writer, localData); writer.endOffset(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/MarkItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/MarkItem.java index 86d9a5108..6efa91e21 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/MarkItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/MarkItem.java @@ -1,18 +1,19 @@ /* * 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. */ + * License along with this library. + */ package com.jpexs.decompiler.graph; import com.jpexs.decompiler.flash.AppResources; @@ -34,7 +35,7 @@ public class MarkItem extends GraphTargetItem { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { - return writer.append("// " + AppResources.translate("decompilerMark") + ":" + mark); + return writer.append("// ").append(AppResources.translate("decompilerMark")).append(":").append(mark); } public String getMark() { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/BreakItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/BreakItem.java index fa0a13748..c1a7c953c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/BreakItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/BreakItem.java @@ -52,7 +52,7 @@ public class BreakItem extends GraphTargetItem { } } if (labelRequired) { - writer.append(" loop" + loopId); + writer.append(" loop").append(loopId); } return writer; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ContinueItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ContinueItem.java index 8c4df05e6..30d9cd91c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ContinueItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ContinueItem.java @@ -52,7 +52,7 @@ public class ContinueItem extends GraphTargetItem { } } if (labelRequired) { - writer.append(" loop" + loopId); + writer.append(" loop").append(loopId); } return writer; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/DoWhileItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/DoWhileItem.java index a172349c5..4a4fe79ce 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/DoWhileItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/DoWhileItem.java @@ -64,7 +64,7 @@ public class DoWhileItem extends LoopItem implements Block { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } if (labelUsed) { - writer.append("loop" + loop.id + ":").newLine(); + writer.append("loop").append(loop.id).append(":").newLine(); } writer.append("do"); writer.startBlock(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ForItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ForItem.java index 0f0c86545..e29fc752d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ForItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ForItem.java @@ -71,7 +71,7 @@ public class ForItem extends LoopItem implements Block { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } if (labelUsed) { - writer.append("loop" + loop.id + ":").newLine(); + writer.append("loop").append(loop.id).append(":").newLine(); } writer.append("for"); if (writer.getFormatting().spaceBeforeParenthesesForParentheses) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/GotoItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/GotoItem.java index 019bf84ac..975c9c345 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/GotoItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/GotoItem.java @@ -36,7 +36,7 @@ public class GotoItem extends GraphTargetItem { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { - writer.append("§§goto(" + labelName + ")"); + writer.append("§§goto(").append(labelName).append(")"); return writer; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/IntegerValueItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/IntegerValueItem.java index 0a684b339..02a5bc941 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/IntegerValueItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/IntegerValueItem.java @@ -1,16 +1,16 @@ /* * 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. */ @@ -37,7 +37,7 @@ public class IntegerValueItem extends GraphTargetItem implements IntegerValueTyp @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { - return writer.append("" + intValue); + return writer.append(intValue); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/LabelItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/LabelItem.java index e60d623a9..b062937d2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/LabelItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/LabelItem.java @@ -36,7 +36,7 @@ public class LabelItem extends GraphTargetItem { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { - writer.append(labelName + ":"); + writer.append(labelName).append(":"); return writer; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/SwitchItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/SwitchItem.java index 0a90ab698..8fbad0ef9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/SwitchItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/SwitchItem.java @@ -74,7 +74,7 @@ public class SwitchItem extends LoopItem implements Block { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_SWITCH); } if (labelUsed) { - writer.append("loop" + loop.id + ":").newLine(); + writer.append("loop").append(loop.id).append(":").newLine(); } writer.append("switch"); if (writer.getFormatting().spaceBeforeParenthesesSwitchParentheses) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java index e33789b06..6773c4d02 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java @@ -52,7 +52,7 @@ public class UniversalLoopItem extends LoopItem implements Block { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } if (labelUsed) { - writer.append("loop" + loop.id + ":").newLine(); + writer.append("loop").append(loop.id).append(":").newLine(); } writer.append("while"); if (writer.getFormatting().spaceBeforeParenthesesWhileParentheses) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/WhileItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/WhileItem.java index cdccf9b4e..109ab9156 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/WhileItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/WhileItem.java @@ -59,7 +59,7 @@ public class WhileItem extends LoopItem implements Block { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } if (labelUsed) { - writer.append("loop" + loop.id + ":").newLine(); + writer.append("loop").append(loop.id).append(":").newLine(); } writer.append("while"); if (writer.getFormatting().spaceBeforeParenthesesWhileParentheses) {