diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheck.java index d7ce3250f48..6ec605ae82c 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheck.java @@ -35,32 +35,6 @@ * method, constructor and field declarations. *
*- * To configure the check: - *
- *- * <module name="InnerTypeLast"/> - *- *
Example:
- *- * class Test { - * private String s; // OK - * class InnerTest1 {} - * public void test() {} // violation, method should be declared before inner types. - * } - * - * class Test2 { - * static {}; // OK - * class InnerTest1 {} - * public Test2() {} // violation, constructor should be declared before inner types. - * } - * - * class Test3 { - * private String s; // OK - * public void test() {} // OK - * class InnerTest1 {} - * } - *- *
* Parent is {@code com.puppycrawl.tools.checkstyle.TreeWalker} *
*
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsJavaDocsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsJavaDocsTest.java
index 7d8ae08a139..bf55a79ba8b 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsJavaDocsTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsJavaDocsTest.java
@@ -116,7 +116,8 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport {
// We skip validation of examples section on modules that have this section generated
// until https://github.com/checkstyle/checkstyle/issues/13429
private static final Set
+
To configure the check:
Example: Example:> CHECK_PROPERTIES = new ArrayList<>();
diff --git a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheckExamplesTest.java b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheckExamplesTest.java
new file mode 100644
index 00000000000..0fb8a905387
--- /dev/null
+++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheckExamplesTest.java
@@ -0,0 +1,47 @@
+///////////////////////////////////////////////////////////////////////////////////////////////
+// checkstyle: Checks Java source code and other text files for adherence to a set of rules.
+// Copyright (C) 2001-2023 the original author or authors.
+//
+// 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 2.1 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; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+package com.puppycrawl.tools.checkstyle.checks.design;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport;
+
+@Disabled("until https://github.com/checkstyle/checkstyle/issues/13345")
+public class InnerTypeLastCheckExamplesTest extends AbstractModuleTestSupport {
+ @Override
+ protected String getResourceLocation() {
+ return "xdocs-examples";
+ }
+
+ @Override
+ protected String getPackageLocation() {
+ return "com/puppycrawl/tools/checkstyle/checks/design/innertypelast";
+ }
+
+ @Test
+ public void testExample1() throws Exception {
+ final String[] expected = {
+
+ };
+
+ verifyWithInlineConfigParser(getPath("Example1.txt"), expected);
+ }
+}
diff --git a/src/xdocs-examples/resources/com/puppycrawl/tools/checkstyle/checks/design/innertypelast/Example1.txt b/src/xdocs-examples/resources/com/puppycrawl/tools/checkstyle/checks/design/innertypelast/Example1.txt
new file mode 100644
index 00000000000..0a3d564fa69
--- /dev/null
+++ b/src/xdocs-examples/resources/com/puppycrawl/tools/checkstyle/checks/design/innertypelast/Example1.txt
@@ -0,0 +1,27 @@
+/*xml
+