From 41d6b0018ed4ddf6c8a0962b280946e4966695be Mon Sep 17 00:00:00 2001 From: Skylot Date: Mon, 8 Apr 2024 21:03:37 +0100 Subject: [PATCH] fix: add missing " * " on new line for block comments, flip addCodeComment args (#2145) --- .../src/main/java/jadx/api/data/CommentStyle.java | 12 ++++++++---- .../dex/attributes/nodes/NotificationAttrNode.java | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/jadx-core/src/main/java/jadx/api/data/CommentStyle.java b/jadx-core/src/main/java/jadx/api/data/CommentStyle.java index c9945b397..4bf006ffb 100644 --- a/jadx-core/src/main/java/jadx/api/data/CommentStyle.java +++ b/jadx-core/src/main/java/jadx/api/data/CommentStyle.java @@ -9,29 +9,33 @@ public enum CommentStyle { */ LINE("// ", "// ", ""), + // @formatter:off /** *
 	 * /*
 	 *  * comment
-	 * */
+	 *  */
 	 * 
*/ - BLOCK("/*\n ", " ", "\n */"), + // @formatter:on + BLOCK("/*\n * ", " * ", "\n */"), /** *
 	 * /* comment */
 	 * 
*/ - BLOCK_CONDENSED("/* ", " ", " */"), + BLOCK_CONDENSED("/* ", " * ", " */"), + // @formatter:off /** *
 	 * /**
 	 *  * comment
-	 * */
+	 *  */
 	 * 
*/ + // @formatter:on JAVADOC("/**\n * ", " * ", "\n */"), /** diff --git a/jadx-core/src/main/java/jadx/core/dex/attributes/nodes/NotificationAttrNode.java b/jadx-core/src/main/java/jadx/core/dex/attributes/nodes/NotificationAttrNode.java index 9e8d2c601..e50c3d43a 100644 --- a/jadx-core/src/main/java/jadx/core/dex/attributes/nodes/NotificationAttrNode.java +++ b/jadx-core/src/main/java/jadx/core/dex/attributes/nodes/NotificationAttrNode.java @@ -30,7 +30,7 @@ public abstract class NotificationAttrNode extends LineAttrNode implements ICode addAttr(AType.CODE_COMMENTS, new CodeComment(comment, CommentStyle.LINE)); } - public void addCodeComment(CommentStyle style, String comment) { + public void addCodeComment(String comment, CommentStyle style) { addAttr(AType.CODE_COMMENTS, new CodeComment(comment, style)); }