From 438f7e8eabcad277eaa5d4fb5247e33e04dc14ed Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Mon, 1 Jul 2013 09:16:07 +0400 Subject: [PATCH] IDEA-106897 JavaDoc formatting alignment for exception description broken --- .../formatter/java/JavadocFormatterTest.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavadocFormatterTest.java b/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavadocFormatterTest.java index fb876ae3d8dd..b28fcbd6b50a 100644 --- a/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavadocFormatterTest.java +++ b/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavadocFormatterTest.java @@ -179,4 +179,41 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { "}" ); } + + public void testExceptionAlignmentCorrect() { + getCurrentCodeStyleSettings().ENABLE_JAVADOC_FORMATTING = true; + getCurrentCodeStyleSettings().JD_ALIGN_EXCEPTION_COMMENTS = true; + + String before = + "public class Controller {\n" + + "\n" + + " /**\n" + + " * @throws NoSearchServersConfiguredException If no search engine servers are configured.\n" + + " * @throws SearchServerUnavailableException If the search engine server is not accessible.\n" + + " * @throws InvalidSearchServerResponseException If the search engine server response was invalid.\n" + + " * @throws NotificationEncodingException If the request could not be encoded to UTF-8.\n" + + " * @throws NotificationUnavailableException If the notification server is not available or sent back an invalid response code.\n" + + " */\n" + + " public int superDangerousMethod() {\n" + + " return 68;\n" + + " }\n" + + "}"; + + String after = + "public class Controller {\n" + + "\n" + + " /**\n" + + " * @throws NoSearchServersConfiguredException If no search engine servers are configured.\n" + + " * @throws SearchServerUnavailableException If the search engine server is not accessible.\n" + + " * @throws InvalidSearchServerResponseException If the search engine server response was invalid.\n" + + " * @throws NotificationEncodingException If the request could not be encoded to UTF-8.\n" + + " * @throws NotificationUnavailableException If the notification server is not available or sent back an invalid response code.\n" + + " */\n" + + " public int superDangerousMethod() {\n" + + " return 68;\n" + + " }\n" + + "}"; + + doTextTest(before, after); + } }