ivanov-alex
ivanov-alex
Below is output of "maven-failsafe-plugin": ``` OverloadMethodsDeclarationOrderTest.overloadMethodsTest:41->BaseCheckTestSupport.verify:94->BaseCheckTestSupport.verify:109->BaseCheckTestSupport.verify:135 error message 0 expected: but was: VariableDeclarationUsageDistanceTest.arrayTypeStyleTest:42->BaseCheckTestSupport.verify:94->BaseCheckTestSupport.verify:109->BaseCheckTestSupport.verify:140 error message 0 expected: but was: MethodNameTest.methodNameTest:60->BaseCheckTestSupport.verify:94->BaseCheckTestSupport.verify:109->BaseCheckTestSupport.verify:135 error message 0 expected: but was: AbbreviationAsWordInNameTest.abbreviationAsWordInNameTest:49->BaseCheckTestSupport.verify:94->BaseCheckTestSupport.verify:109->BaseCheckTestSupport.verify:135 error message...
Checkstyle throws exception ``` SEVERE: StringIndexOutOfBoundsException occurred during the analysis of file StaticImportExample.java. java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1919) at com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck.isExempt(AvoidStaticImportCheck.java:126) at com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck.visitToken(AvoidStaticImportCheck.java:102) at com.puppycrawl.tools.checkstyle.TreeWalker.notifyVisit(TreeWalker.java:393) at com.puppycrawl.tools.checkstyle.TreeWalker.processIter(TreeWalker.java:482)...
There is a problem with SAME_PACKAGE(n) group. In example below you can see that it tends to include imports from packages that are higher in hierarchy into the SAME_PACKAGE group....
CustomImportOrder check: first import which does not belong to any group causes incorrect behavior
When first import in a file does not belong to any of the groups, Checksyle reports a problem with other imports, not with first one. It should be at the...
According to documentation THIRD_PARTY_PACKAGE imports should exclude SAME_PACKAGE(n) imports: `3) THIRD_PARTY_PACKAGE group. This group sets ordering of third party imports. Third party imports are all imports except STATIC, SAME_PACKAGE(n), STANDARD_JAVA_PACKAGE...
This issue was entered to write down the problem, research performed to find solution and decision so that it can be changed to better in the future. ImportOrderCheck contains following...
In some cases ImportOrderCheck requires line separator between static imports, in some cases not. Checkstyle 6.8 Config: ``` xml ``` ``` java import static com.puppycrawl.tools.checkstyle.ImportOrderCheck.MSG_SEPARATION; import static javax.lang.model.element.ElementKind.CONSTRUCTOR; import static...
ImportOrder check is not used in default configuration on Checkstyle. It should be added. We should also try to minimize amount of conflicts with default configurations of formatters in most...
Default configurations of Eclipse, IDEA, NetBeans should have corresponding Checkstyle configuration of ImportOrder and CustomImportOrder that works from the box
In example below I run ImportOrder and CustomImportOrder on one file. It has 2 imports in a wrong lexical order. ImportOrder fires 2 violation (message starts with "Wrong order"), while...