diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java index 9874c3ad6..91059566b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java @@ -90,7 +90,7 @@ public class ForEachInAVM2Item extends LoopItem implements Block { } } writer.unindent(); - writer.append("}").newLine(); + writer.append("}"); if (writer instanceof NulWriter) { LoopWithType loopOjb = ((NulWriter)writer).endLoop(loop.id); labelUsed = loopOjb.used; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java index d0e9bf25a..0642766e6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java @@ -90,7 +90,7 @@ public class ForInAVM2Item extends LoopItem implements Block { } } writer.unindent(); - writer.append("}").newLine(); + writer.append("}"); if (writer instanceof NulWriter) { LoopWithType loopOjb = ((NulWriter)writer).endLoop(loop.id); labelUsed = loopOjb.used; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java index abbc67317..3ccd755c2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java @@ -132,9 +132,9 @@ public abstract class Trait implements Serializable { writer.appendNoHilight("{").newLine(); writer.indent(); toString(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); - writer.newLine(); writer.unindent(); writer.appendNoHilight("}"); + writer.newLine(); } return writer; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java index 3df3d240a..165e3030d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java @@ -405,16 +405,22 @@ public class TraitClass extends Trait implements TraitWithSlot { } } + boolean hasImport = false; for (String imp : imports) { if (!imp.startsWith(".")) { writer.appendNoHilight("import " + imp + ";").newLine(); + hasImport = true; } } - writer.newLine(); + if (hasImport) { + writer.newLine(); + } for (String us : uses) { writer.appendNoHilight("use namespace " + us + ";").newLine(); } - writer.newLine(); + if (uses.size() > 0) { + writer.newLine(); + } //class header String classHeader = abc.instance_info[class_info].getClassHeaderStr(abc, fullyQualifiedNames); @@ -488,6 +494,7 @@ public class TraitClass extends Trait implements TraitWithSlot { writer.unindent(); writer.appendNoHilight("}"); // class writer.endClass(); + writer.newLine(); return writer; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java index 5989d72ed..cd70f5833 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java @@ -79,6 +79,7 @@ public class TraitFunction extends Trait implements TraitWithSlot { writer.newLine(); writer.appendNoHilight("}"); } + writer.newLine(); return writer; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java index 96d225333..3ce9fa487 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java @@ -97,6 +97,7 @@ public class TraitMethodGetterSetter extends Trait { } writer.appendNoHilight("}"); } + writer.newLine(); return writer; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java index 2ee72ea6d..acd92b3c9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java @@ -144,7 +144,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot { writer.appendNoHilight(" = "); getValueStr(parent, writer, abc, fullyQualifiedNames); } - return writer.appendNoHilight(";"); + return writer.appendNoHilight(";").newLine(); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java index fddecf6d6..16092fd1d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java @@ -149,8 +149,6 @@ public class Traits implements Serializable { } else { writer.endTrait(); } - - writer.newLine(); } return writer; } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java index cb457feb7..2a774f876 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java @@ -92,7 +92,7 @@ public class ForInActionItem extends LoopActionItem implements Block { ti.toStringSemicoloned(writer, localData).newLine(); } writer.unindent(); - writer.append("}").newLine(); + writer.append("}"); if (writer instanceof NulWriter) { LoopWithType loopOjb = ((NulWriter)writer).endLoop(loop.id); labelUsed = loopOjb.used; diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java index d07672e38..fa17d6322 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java @@ -98,7 +98,7 @@ public class ForItem extends LoopItem implements Block { } } writer.unindent(); - writer.append("}").newLine(); + writer.append("}"); if (writer instanceof NulWriter) { LoopWithType loopOjb = ((NulWriter)writer).endLoop(loop.id); labelUsed = loopOjb.used;