Issue #2428: remove dependency to commons-lang3 library
This commit is contained in:
parent
4ca654c7cb
commit
167dd96d8c
|
|
@ -17,7 +17,6 @@
|
|||
<allow pkg="javax.xml.parsers"/>
|
||||
<allow pkg="org.apache.commons.beanutils"/>
|
||||
<allow pkg="org.apache.commons.logging"/>
|
||||
<allow pkg="org.apache.commons.lang3"/>
|
||||
<allow pkg="org.xml.sax"/>
|
||||
<allow pkg="com.puppycrawl.tools.checkstyle"/>
|
||||
<allow pkg="java.lang.reflect"/>
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@
|
|||
See https://github.com/checkstyle/checkstyle/issues/2285-->
|
||||
<suppress checks="IllegalCatch"
|
||||
files="Checker.java"
|
||||
lines="316"/>
|
||||
lines="315"/>
|
||||
<suppress checks="IllegalCatch"
|
||||
files="Checker.java"
|
||||
lines="321"/>
|
||||
lines="320"/>
|
||||
<!--Test to reproduce error catching in Checker and satisfy coverage rate. -->
|
||||
<suppress checks="IllegalCatch"
|
||||
files="CheckerTest.java"
|
||||
|
|
@ -122,9 +122,9 @@
|
|||
<suppress checks="MethodCount" files="[\\/]JavadocMethodCheck.java$"/>
|
||||
|
||||
<!-- getDetails() method - huge Switch, it has to be monolithic -->
|
||||
<suppress checks="ExecutableStatementCount" files="RightCurlyCheck\.java" lines="317"/>
|
||||
<suppress checks="JavaNCSS" files="RightCurlyCheck\.java" lines="317"/>
|
||||
<suppress checks="CyclomaticComplexity" files="RightCurlyCheck\.java" lines="317"/>
|
||||
<suppress checks="ExecutableStatementCount" files="RightCurlyCheck\.java" lines="316"/>
|
||||
<suppress checks="JavaNCSS" files="RightCurlyCheck\.java" lines="316"/>
|
||||
<suppress checks="CyclomaticComplexity" files="RightCurlyCheck\.java" lines="316"/>
|
||||
|
||||
<!-- we need that set of converters -->
|
||||
<suppress checks="ClassDataAbstractionCoupling" files="AutomaticBean\.java"/>
|
||||
|
|
|
|||
5
pom.xml
5
pom.xml
|
|
@ -218,11 +218,6 @@
|
|||
</pluginRepositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>antlr</groupId>
|
||||
<artifactId>antlr</artifactId>
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
package com.google.checkstyle.test.base;
|
||||
|
||||
import static org.apache.commons.lang3.ArrayUtils.EMPTY_INTEGER_OBJECT_ARRAY;
|
||||
import static org.apache.commons.lang3.ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
import static com.puppycrawl.tools.checkstyle.utils.CommonUtils.EMPTY_INTEGER_OBJECT_ARRAY;
|
||||
import static com.puppycrawl.tools.checkstyle.utils.CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@ import static com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck.MSG_
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class OuterTypeFilenameTest extends BaseCheckTestSupport {
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ public class OuterTypeFilenameTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void outerTypeFilenameTest1() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("OuterTypeFilename");
|
||||
final String filePath = getPath("InputOuterTypeFilename1.java");
|
||||
|
|
@ -54,7 +54,7 @@ public class OuterTypeFilenameTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void outerTypeFilenameTest2() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("OuterTypeFilename");
|
||||
final String filePath = getPath("InputOuterTypeFilename2.java");
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@ package com.google.checkstyle.test.chapter3filestructure.rule332nolinewrap;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck;
|
||||
import com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class NoLineWrapTest extends BaseCheckTestSupport {
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ public class NoLineWrapTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void goodLineWrapTest() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("NoLineWrap");
|
||||
final String filePath = getPath("InputNoLineWrapGood.java");
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ package com.google.checkstyle.test.chapter3filestructure.rule333orderingandspaci
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class CustomImportOrderTest extends BaseCheckTestSupport {
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ public class CustomImportOrderTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void validTest() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("CustomImportOrder");
|
||||
final String filePath = getPath("InputCustomImportOrderValid.java");
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ package com.google.checkstyle.test.chapter3filestructure.rule341onetoplevel;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.design.OneTopLevelClassCheck;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class OneTopLevelClassTest extends BaseCheckTestSupport {
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ public class OneTopLevelClassTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void goodTest() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("OneTopLevelClass");
|
||||
final String filePath = getPath("InputOneTopLevelClassGood.java");
|
||||
|
|
|
|||
|
|
@ -25,13 +25,13 @@ import static com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck.MSG_
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck;
|
||||
import com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyOption;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class RightCurlyTest extends BaseCheckTestSupport {
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ public class RightCurlyTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration newCheckConfig = createCheckConfig(RightCurlyCheck.class);
|
||||
newCheckConfig.addAttribute("option", RightCurlyOption.SAME.toString());
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final String filePath = getPath("InputRightCurlySame.java");
|
||||
final Integer[] warnList = getLinesWithWarn(filePath);
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ package com.google.checkstyle.test.chapter4formatting.rule413emptyblocks;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyCatchBlockCheck;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class EmptyCatchBlockTest extends BaseCheckTestSupport {
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ public class EmptyCatchBlockTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testNoViolations() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("EmptyCatchBlock");
|
||||
final String filePath = getPath("InputEmptyCatchBlockNoViolations.java");
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ package com.google.checkstyle.test.chapter4formatting.rule462horizontalwhitespac
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class WhitespaceAroundTest extends BaseCheckTestSupport {
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ public class WhitespaceAroundTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void whitespaceAroundEmptyTypesCyclesTest() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("WhitespaceAround");
|
||||
final String filePath = getPath("InputWhitespaceAroundEmptyTypesAndCycles.java");
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ package com.google.checkstyle.test.chapter4formatting.rule4841indentation;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.checkstyle.test.base.BaseIndentationCheckSupport;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class IndentationTest extends BaseIndentationCheckSupport {
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ public class IndentationTest extends BaseIndentationCheckSupport {
|
|||
@Test
|
||||
public void correctClassTest() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("Indentation");
|
||||
final String filePath = getPath("InputIndentationCorrectClass.java");
|
||||
|
|
@ -51,7 +51,7 @@ public class IndentationTest extends BaseIndentationCheckSupport {
|
|||
@Test
|
||||
public void correctFieldTest() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("Indentation");
|
||||
final String filePath = getPath("InputIndentationCorrectFieldAndParameter.java");
|
||||
|
|
@ -63,7 +63,7 @@ public class IndentationTest extends BaseIndentationCheckSupport {
|
|||
@Test
|
||||
public void correctForTest() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("Indentation");
|
||||
final String filePath = getPath("InputIndentationCorrectForAndParameter.java");
|
||||
|
|
@ -75,7 +75,7 @@ public class IndentationTest extends BaseIndentationCheckSupport {
|
|||
@Test
|
||||
public void correctIfTest() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("Indentation");
|
||||
final String filePath = getPath("InputIndentationCorrectIfAndParameter.java");
|
||||
|
|
@ -87,7 +87,7 @@ public class IndentationTest extends BaseIndentationCheckSupport {
|
|||
@Test
|
||||
public void correctTest() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("Indentation");
|
||||
final String filePath = getPath("InputIndentationCorrect.java");
|
||||
|
|
@ -99,7 +99,7 @@ public class IndentationTest extends BaseIndentationCheckSupport {
|
|||
@Test
|
||||
public void correctReturnTest() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("Indentation");
|
||||
final String filePath = getPath("InputIndentationCorrectReturnAndParameter.java");
|
||||
|
|
@ -111,7 +111,7 @@ public class IndentationTest extends BaseIndentationCheckSupport {
|
|||
@Test
|
||||
public void correctWhileTest() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("Indentation");
|
||||
final String filePath = getPath("InputIndentationCorrectWhileDoWhileAndParameter.java");
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@ package com.google.checkstyle.test.chapter5naming.rule521packagenames;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class PackageNameTest extends BaseCheckTestSupport {
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ public class PackageNameTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void goodPackageNameTest() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final String filePath = getPath("packagenames", "InputPackageNameGood.java");
|
||||
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ package com.google.checkstyle.test.chapter7javadoc.rule712paragraphs;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class JavadocParagraphTest extends BaseCheckTestSupport {
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ public class JavadocParagraphTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void javadocParagraphCorrectTest() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("JavadocParagraph");
|
||||
final String filePath = getPath("InputCorrectJavadocParagraphCheck.java");
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ package com.google.checkstyle.test.chapter7javadoc.rule713atclauses;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.javadoc.AtclauseOrderCheck;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class AtclauseOrderTest extends BaseCheckTestSupport {
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ public class AtclauseOrderTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testCorrect() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("AtclauseOrder");
|
||||
final String filePath = getPath("InputCorrectAtClauseOrderCheck.java");
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ package com.google.checkstyle.test.chapter7javadoc.rule72thesummaryfragment;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class SummaryJavadocTest extends BaseCheckTestSupport {
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ public class SummaryJavadocTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testCorrect() throws Exception {
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
final Configuration checkConfig = getCheckConfig("SummaryJavadoc");
|
||||
final String filePath = getPath("InputCorrectSummaryJavaDocCheck.java");
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import java.util.Locale;
|
|||
import java.util.Set;
|
||||
import java.util.SortedSet;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
|
@ -95,7 +94,7 @@ public class Checker extends AutomaticBean implements MessageDispatcher {
|
|||
private Context childContext;
|
||||
|
||||
/** The file extensions that are accepted. */
|
||||
private String[] fileExtensions = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
private String[] fileExtensions = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
/**
|
||||
* The severity level of any violations found by submodules.
|
||||
|
|
|
|||
|
|
@ -22,9 +22,8 @@ package com.puppycrawl.tools.checkstyle.api;
|
|||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -93,7 +92,7 @@ public abstract class AbstractCheck extends AbstractViolationReporter {
|
|||
* @see TokenTypes
|
||||
*/
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.SortedSet;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -45,7 +43,7 @@ public abstract class AbstractFileSetCheck
|
|||
private MessageDispatcher messageDispatcher;
|
||||
|
||||
/** The file extensions that are accepted by this filter. */
|
||||
private String[] fileExtensions = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
private String[] fileExtensions = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
/**
|
||||
* Called to process a file that matches the specified file extensions.
|
||||
|
|
|
|||
|
|
@ -38,8 +38,6 @@ import java.util.List;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.google.common.io.Closeables;
|
||||
|
||||
/**
|
||||
|
|
@ -154,7 +152,12 @@ public final class FileText extends AbstractList<String> {
|
|||
charset = fileText.charset;
|
||||
fullText = fileText.fullText;
|
||||
lines = fileText.lines.clone();
|
||||
lineBreaks = ArrayUtils.clone(fileText.lineBreaks);
|
||||
if (fileText.lineBreaks == null) {
|
||||
lineBreaks = null;
|
||||
}
|
||||
else {
|
||||
lineBreaks = fileText.lineBreaks.clone();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ package com.puppycrawl.tools.checkstyle.api;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
/**
|
||||
* Represents a full identifier, including dots, with associated
|
||||
|
|
@ -76,7 +76,7 @@ public final class FullIdent {
|
|||
* @return the text
|
||||
*/
|
||||
public String getText() {
|
||||
return StringUtils.join(elements, "");
|
||||
return Joiner.on("").join(elements);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -22,12 +22,11 @@ package com.puppycrawl.tools.checkstyle.checks;
|
|||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import antlr.collections.AST;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
import com.puppycrawl.tools.checkstyle.utils.TokenUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -204,7 +203,7 @@ public class DescendantTokenCheck extends AbstractCheck {
|
|||
/** Whether to sum the number of tokens found. */
|
||||
private boolean sumTokenCounts;
|
||||
/** Limited tokens. */
|
||||
private int[] limitedTokens = ArrayUtils.EMPTY_INT_ARRAY;
|
||||
private int[] limitedTokens = CommonUtils.EMPTY_INT_ARRAY;
|
||||
/** Error message when minimum count not reached. */
|
||||
private String minimumMessage;
|
||||
/** Error message when maximum count exceeded. */
|
||||
|
|
@ -214,16 +213,16 @@ public class DescendantTokenCheck extends AbstractCheck {
|
|||
* Counts of descendant tokens.
|
||||
* Indexed by (token ID - 1) for performance.
|
||||
*/
|
||||
private int[] counts = ArrayUtils.EMPTY_INT_ARRAY;
|
||||
private int[] counts = CommonUtils.EMPTY_INT_ARRAY;
|
||||
|
||||
@Override
|
||||
public int[] getDefaultTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.FileContents;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* Holds the current file contents for global access when configured
|
||||
|
|
@ -51,7 +50,7 @@ public class FileContentsHolder
|
|||
|
||||
@Override
|
||||
public int[] getAcceptableTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -21,13 +21,12 @@ package com.puppycrawl.tools.checkstyle.checks;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CheckUtils;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* Check that method/constructor/catch/foreach parameters are final.
|
||||
|
|
@ -109,7 +108,7 @@ public class FinalParametersCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
|
|
@ -136,17 +134,17 @@ public class TrailingCommentCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getDefaultTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAcceptableTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.annotation;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* Check location of annotation on language elements.
|
||||
|
|
@ -208,7 +207,7 @@ public class AnnotationLocationCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ package com.puppycrawl.tools.checkstyle.checks.annotation;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
|
|
@ -148,7 +146,7 @@ public class SuppressWarningsCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ package com.puppycrawl.tools.checkstyle.checks.blocks;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.beanutils.ConversionException;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* Checks for empty blocks. The policy to verify is specified using the {@link
|
||||
|
|
@ -136,7 +136,7 @@ public class EmptyBlockCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -200,7 +200,7 @@ public class EmptyBlockCheck
|
|||
// Handle braces on the same line
|
||||
final String txt = lines[slistLineNo - 1]
|
||||
.substring(slistColNo + 1, rcurlyColNo);
|
||||
if (StringUtils.isNotBlank(txt)) {
|
||||
if (!CharMatcher.WHITESPACE.matchesAllOf(txt)) {
|
||||
returnValue = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ package com.puppycrawl.tools.checkstyle.checks.blocks;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.beanutils.ConversionException;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
|
|
@ -174,7 +173,7 @@ public class LeftCurlyCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.blocks;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -194,7 +193,7 @@ public class NeedBracesCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ package com.puppycrawl.tools.checkstyle.checks.blocks;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.beanutils.ConversionException;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
|
|
@ -168,7 +167,7 @@ public class RightCurlyCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.coding;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
import com.puppycrawl.tools.checkstyle.utils.TokenUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -76,7 +75,7 @@ public class IllegalTokenCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -21,8 +21,6 @@ package com.puppycrawl.tools.checkstyle.checks.coding;
|
|||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
|
@ -79,7 +77,7 @@ public class IllegalTokenTextCheck
|
|||
|
||||
@Override
|
||||
public int[] getDefaultTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -89,7 +87,7 @@ public class IllegalTokenTextCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -21,12 +21,11 @@ package com.puppycrawl.tools.checkstyle.checks.coding;
|
|||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CheckUtils;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
import com.puppycrawl.tools.checkstyle.utils.ScopeUtils;
|
||||
import com.puppycrawl.tools.checkstyle.utils.TokenUtils;
|
||||
|
||||
|
|
@ -203,7 +202,7 @@ public class MagicNumberCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -399,7 +398,7 @@ public class MagicNumberCheck extends AbstractCheck {
|
|||
*/
|
||||
public void setIgnoreNumbers(double... list) {
|
||||
if (list.length == 0) {
|
||||
ignoreNumbers = ArrayUtils.EMPTY_DOUBLE_ARRAY;
|
||||
ignoreNumbers = CommonUtils.EMPTY_DOUBLE_ARRAY;
|
||||
}
|
||||
else {
|
||||
ignoreNumbers = new double[list.length];
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.coding;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -188,7 +187,7 @@ public class UnnecessaryParenthesesCheck extends AbstractCheck {
|
|||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
// Check can work with any of acceptable tokens
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import java.util.Deque;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
|
|
@ -161,7 +161,7 @@ public class FinalClassCheck
|
|||
qualifiedNameParts.add(0, traverse.findFirstToken(TokenTypes.IDENT).getText());
|
||||
traverse = traverse.findFirstToken(TokenTypes.DOT);
|
||||
}
|
||||
className = StringUtils.join(qualifiedNameParts, PACKAGE_SEPARATOR);
|
||||
className = Joiner.on(PACKAGE_SEPARATOR).join(qualifiedNameParts);
|
||||
}
|
||||
else {
|
||||
className = classExtend.findFirstToken(TokenTypes.IDENT).getText();
|
||||
|
|
|
|||
|
|
@ -23,11 +23,10 @@ import java.util.Map;
|
|||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* Checks that each top-level class, interface
|
||||
|
|
@ -109,7 +108,7 @@ public class OneTopLevelClassCheck extends AbstractCheck {
|
|||
// ZERO tokens as Check do Traverse of Tree himself, he does not need to subscribed to Tokens
|
||||
@Override
|
||||
public int[] getAcceptableTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ import java.util.List;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.beanutils.ConversionException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.io.Closeables;
|
||||
|
|
@ -92,7 +92,7 @@ public abstract class AbstractHeaderCheck extends AbstractFileSetCheck {
|
|||
* @throws CheckstyleException if fileName is empty.
|
||||
*/
|
||||
public void setHeaderFile(String fileName) throws CheckstyleException {
|
||||
if (StringUtils.isBlank(fileName)) {
|
||||
if (fileName == null || CharMatcher.WHITESPACE.matchesAllOf(fileName)) {
|
||||
throw new CheckstyleException(
|
||||
"property 'headerFile' is missing or invalid in module "
|
||||
+ getConfiguration().getName());
|
||||
|
|
@ -142,7 +142,7 @@ public abstract class AbstractHeaderCheck extends AbstractFileSetCheck {
|
|||
* @throws ConversionException if the header cannot be interpreted
|
||||
*/
|
||||
public void setHeader(String header) {
|
||||
if (StringUtils.isBlank(header)) {
|
||||
if (header == null || CharMatcher.WHITESPACE.matchesAllOf(header)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ import java.util.regex.Pattern;
|
|||
import java.util.regex.PatternSyntaxException;
|
||||
|
||||
import org.apache.commons.beanutils.ConversionException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ public class RegexpHeaderCheck extends AbstractHeaderCheck {
|
|||
*/
|
||||
@Override
|
||||
public void setHeader(String header) {
|
||||
if (StringUtils.isBlank(header)) {
|
||||
if (header == null || CharMatcher.WHITESPACE.matchesAllOf(header)) {
|
||||
return;
|
||||
}
|
||||
if (!CommonUtils.isPatternValid(header)) {
|
||||
|
|
|
|||
|
|
@ -19,12 +19,11 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.imports;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.FullIdent;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -73,7 +72,7 @@ public class AvoidStaticImportCheck
|
|||
public static final String MSG_KEY = "import.avoidStatic";
|
||||
|
||||
/** The classes/static members to exempt from this check. */
|
||||
private String[] excludes = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
private String[] excludes = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
@Override
|
||||
public int[] getDefaultTokens() {
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ import java.io.File;
|
|||
import java.net.URI;
|
||||
|
||||
import org.apache.commons.beanutils.ConversionException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
|
|
@ -143,7 +143,7 @@ public class ImportControlCheck extends AbstractCheck {
|
|||
*/
|
||||
public void setFile(final String name) {
|
||||
// Handle empty param
|
||||
if (StringUtils.isBlank(name)) {
|
||||
if (name == null || CharMatcher.WHITESPACE.matchesAllOf(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ public class ImportControlCheck extends AbstractCheck {
|
|||
*/
|
||||
public void setUrl(final String url) {
|
||||
// Handle empty param
|
||||
if (StringUtils.isBlank(url)) {
|
||||
if (url == null || CharMatcher.WHITESPACE.matchesAllOf(url)) {
|
||||
return;
|
||||
}
|
||||
final URI uri;
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@ import java.util.ArrayDeque;
|
|||
import java.util.Deque;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
|
|
@ -99,7 +97,7 @@ public class CommentsIndentationCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@ import java.util.Locale;
|
|||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.google.common.collect.ImmutableSortedSet;
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
|
|
@ -36,6 +34,7 @@ import com.puppycrawl.tools.checkstyle.api.Scope;
|
|||
import com.puppycrawl.tools.checkstyle.api.TextBlock;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CheckUtils;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
import com.puppycrawl.tools.checkstyle.utils.ScopeUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -134,7 +133,7 @@ public class JavadocStyleCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@ import java.util.List;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.FileContents;
|
||||
|
|
@ -187,7 +185,7 @@ public class JavadocTypeCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.FileContents;
|
||||
|
|
@ -151,7 +149,7 @@ public class WriteTagCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -22,11 +22,10 @@ package com.puppycrawl.tools.checkstyle.checks.modifier;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* Checks for redundant modifiers in interface and annotation definitions,
|
||||
|
|
@ -120,7 +119,7 @@ public class RedundantModifierCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -25,11 +25,10 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -195,7 +194,7 @@ public class AbbreviationAsWordInNameCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,10 +19,9 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.naming;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
import com.puppycrawl.tools.checkstyle.utils.ScopeUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -73,7 +72,7 @@ public class LocalFinalVariableNameCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,9 +19,8 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.naming;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -78,6 +77,6 @@ public class TypeNameCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ package com.puppycrawl.tools.checkstyle.checks.regexp;
|
|||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter;
|
||||
|
||||
|
|
@ -228,8 +228,8 @@ public final class DetectorOptions {
|
|||
* @return DetectorOptions instance.
|
||||
*/
|
||||
public DetectorOptions build() {
|
||||
message = ObjectUtils.defaultIfNull(message, "");
|
||||
suppressor = ObjectUtils.defaultIfNull(suppressor, NeverSuppress.INSTANCE);
|
||||
message = Objects.firstNonNull(message, "");
|
||||
suppressor = Objects.firstNonNull(suppressor, NeverSuppress.INSTANCE);
|
||||
return DetectorOptions.this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ package com.puppycrawl.tools.checkstyle.checks.regexp;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.FileContents;
|
||||
|
|
@ -183,7 +181,7 @@ public class RegexpCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getAcceptableTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -21,10 +21,9 @@ package com.puppycrawl.tools.checkstyle.checks.regexp;
|
|||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* Implementation of a check that looks for a single line in Java files.
|
||||
|
|
@ -53,7 +52,7 @@ public class RegexpSinglelineJavaCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getAcceptableTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -21,8 +21,6 @@ package com.puppycrawl.tools.checkstyle.checks.sizes;
|
|||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
|
@ -103,17 +101,17 @@ public class LineLengthCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getDefaultTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAcceptableTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,12 +19,11 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.sizes;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.FileContents;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -85,7 +84,7 @@ public class MethodLengthCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,12 +19,11 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.sizes;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.AnnotationUtility;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -117,7 +116,7 @@ public class ParameterNumberCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,12 +19,11 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.whitespace;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.FileContents;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* Checks for empty line separators after header, package, all import declarations,
|
||||
|
|
@ -214,7 +213,7 @@ public class EmptyLineSeparatorCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.beanutils.ConversionException;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
|
|
@ -116,7 +115,7 @@ public class MethodParamPadCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.whitespace;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* <p>Checks that chosen statements are not line-wrapped.
|
||||
|
|
@ -91,7 +90,7 @@ public class NoLineWrapCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.whitespace;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -96,7 +95,7 @@ public class NoWhitespaceBeforeCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -22,9 +22,8 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.beanutils.ConversionException;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
|
|
@ -198,7 +197,7 @@ public class OperatorWrapCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -222,7 +221,8 @@ public class OperatorWrapCheck
|
|||
// itself.
|
||||
if (option == WrapOption.NL
|
||||
&& !text.equals(currentLine.trim())
|
||||
&& StringUtils.isBlank(currentLine.substring(colNo + text.length()))) {
|
||||
&& CharMatcher.WHITESPACE.matchesAllOf(
|
||||
currentLine.substring(colNo + text.length()))) {
|
||||
log(lineNo, colNo, MSG_LINE_NEW, text);
|
||||
}
|
||||
else if (option == WrapOption.EOL
|
||||
|
|
|
|||
|
|
@ -21,10 +21,9 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace;
|
|||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* <p>Checks the padding of parentheses; that is whether a space is required
|
||||
|
|
@ -110,7 +109,7 @@ public class ParenPadCheck extends AbstractParenPadCheck {
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.beanutils.ConversionException;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -139,7 +139,7 @@ public class SeparatorWrapCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.whitespace;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -85,7 +84,7 @@ public class WhitespaceAfterCheck
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.checks.whitespace;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* Checks that a token is surrounded by whitespace.
|
||||
|
|
@ -308,7 +307,7 @@ public class WhitespaceAroundCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.utils;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.FullIdent;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
|
|
@ -147,7 +146,7 @@ public final class AnnotationUtility {
|
|||
throw new IllegalArgumentException("the annotation is null");
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(annotation)) {
|
||||
if (CharMatcher.WHITESPACE.matchesAllOf(annotation)) {
|
||||
throw new IllegalArgumentException(
|
||||
"the annotation is empty or spaces");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,19 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
|||
*/
|
||||
public final class CommonUtils {
|
||||
|
||||
/** Copied from org.apache.commons.lang3.ArrayUtils. */
|
||||
public static final String[] EMPTY_STRING_ARRAY = new String[0];
|
||||
/** Copied from org.apache.commons.lang3.ArrayUtils. */
|
||||
public static final Integer[] EMPTY_INTEGER_OBJECT_ARRAY = new Integer[0];
|
||||
/** Copied from org.apache.commons.lang3.ArrayUtils. */
|
||||
public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
|
||||
/** Copied from org.apache.commons.lang3.ArrayUtils. */
|
||||
public static final int[] EMPTY_INT_ARRAY = new int[0];
|
||||
/** Copied from org.apache.commons.lang3.ArrayUtils. */
|
||||
public static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
|
||||
/** Copied from org.apache.commons.lang3.ArrayUtils. */
|
||||
public static final double[] EMPTY_DOUBLE_ARRAY = new double[0];
|
||||
|
||||
/** Prefix for the exception when unable to find resource. */
|
||||
private static final String UNABLE_TO_FIND_EXCEPTION_PREFIX = "Unable to find: ";
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@ import java.util.List;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
|
|
@ -88,7 +86,7 @@ public final class JavadocUtils {
|
|||
|
||||
final Field[] fields = JavadocTokenTypes.class.getDeclaredFields();
|
||||
|
||||
String[] tempTokenValueToName = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
String[] tempTokenValueToName = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
for (final Field field : fields) {
|
||||
|
||||
|
|
|
|||
|
|
@ -22,10 +22,8 @@ package com.puppycrawl.tools.checkstyle.utils;
|
|||
import java.lang.reflect.Field;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.google.common.collect.ImmutableCollection;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.primitives.Ints;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
|
||||
/**
|
||||
|
|
@ -54,7 +52,7 @@ public final class TokenUtils {
|
|||
final ImmutableMap.Builder<String, Integer> builder =
|
||||
ImmutableMap.builder();
|
||||
final Field[] fields = TokenTypes.class.getDeclaredFields();
|
||||
String[] tempTokenValueToName = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
String[] tempTokenValueToName = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
for (final Field field : fields) {
|
||||
// Only process the int declarations.
|
||||
if (field.getType() != Integer.TYPE) {
|
||||
|
|
@ -75,9 +73,7 @@ public final class TokenUtils {
|
|||
|
||||
TOKEN_NAME_TO_VALUE = builder.build();
|
||||
TOKEN_VALUE_TO_NAME = tempTokenValueToName;
|
||||
final ImmutableCollection<Integer> values = TOKEN_NAME_TO_VALUE.values();
|
||||
final Integer[] ids = values.toArray(new Integer[values.size()]);
|
||||
TOKEN_IDS = ArrayUtils.toPrimitive(ids);
|
||||
TOKEN_IDS = Ints.toArray(TOKEN_NAME_TO_VALUE.values());
|
||||
}
|
||||
|
||||
/** Stop instances being created. **/
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ import java.util.List;
|
|||
import java.util.Locale;
|
||||
import java.util.SortedSet;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assume;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
|
@ -54,6 +53,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration;
|
|||
import com.puppycrawl.tools.checkstyle.api.LocalizedMessage;
|
||||
import com.puppycrawl.tools.checkstyle.checks.TranslationCheck;
|
||||
import com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class CheckerTest extends BaseCheckTestSupport {
|
||||
|
||||
|
|
@ -391,7 +391,7 @@ public class CheckerTest extends BaseCheckTestSupport {
|
|||
checker.addListener(new BriefUtLogger(stream));
|
||||
|
||||
final String pathToEmptyFile = temporaryFolder.newFile("file.java").getPath();
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checker, pathToEmptyFile, pathToEmptyFile, expected);
|
||||
// one more time to reuse cache
|
||||
|
|
@ -419,7 +419,7 @@ public class CheckerTest extends BaseCheckTestSupport {
|
|||
checker.addListener(new BriefUtLogger(stream));
|
||||
|
||||
final String pathToEmptyFile = temporaryFolder.newFile("file.java").getPath();
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checker, pathToEmptyFile, pathToEmptyFile, expected);
|
||||
|
||||
|
|
@ -476,7 +476,7 @@ public class CheckerTest extends BaseCheckTestSupport {
|
|||
checker.addListener(new BriefUtLogger(stream));
|
||||
|
||||
final String pathToEmptyFile = temporaryFolder.newFile("file.java").getPath();
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checker, pathToEmptyFile, pathToEmptyFile, expected);
|
||||
checker.clearCache();
|
||||
|
|
@ -504,7 +504,7 @@ public class CheckerTest extends BaseCheckTestSupport {
|
|||
checker.addListener(new BriefUtLogger(stream));
|
||||
|
||||
final String pathToEmptyFile = temporaryFolder.newFile("file.java").getPath();
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checker, pathToEmptyFile, pathToEmptyFile, expected);
|
||||
checker.clearCache();
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle;
|
||||
|
||||
import static org.apache.commons.lang3.ArrayUtils.EMPTY_BYTE_ARRAY;
|
||||
import static com.puppycrawl.tools.checkstyle.utils.CommonUtils.EMPTY_BYTE_ARRAY;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import java.util.ArrayList;
|
|||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
|
|
@ -44,6 +43,7 @@ import com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck;
|
|||
import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck;
|
||||
import com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck;
|
||||
import com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class TreeWalkerTest extends BaseCheckTestSupport {
|
||||
@Rule
|
||||
|
|
@ -75,7 +75,7 @@ public class TreeWalkerTest extends BaseCheckTestSupport {
|
|||
final String content = "public class Main { public static final int k = 5 + 4; }";
|
||||
writer.write(content);
|
||||
}
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, file.getPath(), expected);
|
||||
}
|
||||
|
||||
|
|
@ -86,8 +86,8 @@ public class TreeWalkerTest extends BaseCheckTestSupport {
|
|||
createCheckConfig(HiddenFieldCheck.class);
|
||||
checkConfig.addAttribute("tokens", "VARIABLE_DEF, ENUM_DEF, CLASS_DEF, METHOD_DEF,"
|
||||
+ "IMPORT");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
try {
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputMain.java"), expected);
|
||||
fail("CheckstyleException is expected");
|
||||
}
|
||||
|
|
@ -104,7 +104,7 @@ public class TreeWalkerTest extends BaseCheckTestSupport {
|
|||
public void testOnEmptyFile() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(HiddenFieldCheck.class);
|
||||
final String pathToEmptyFile = temporaryFolder.newFile("file.java").getPath();
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, pathToEmptyFile, expected);
|
||||
}
|
||||
|
|
@ -112,9 +112,9 @@ public class TreeWalkerTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testWithCheckNotHavingTreeWalkerAsParent() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(JavadocPackageCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
try {
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, temporaryFolder.newFile().getPath(), expected);
|
||||
fail("CheckstyleException is expected");
|
||||
}
|
||||
|
|
@ -135,9 +135,9 @@ public class TreeWalkerTest extends BaseCheckTestSupport {
|
|||
public void testForInvalidCheckImplementation() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(BadJavaDocCheck.class);
|
||||
final String pathToEmptyFile = temporaryFolder.newFile("file.java").getPath();
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
try {
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, pathToEmptyFile, expected);
|
||||
}
|
||||
catch (CheckstyleException ex) {
|
||||
|
|
@ -215,9 +215,9 @@ public class TreeWalkerTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(RequiredTokenIsNotInDefaultsCheck.class);
|
||||
final String pathToEmptyFile = temporaryFolder.newFile("file.java").getPath();
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
try {
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, pathToEmptyFile, expected);
|
||||
fail("CheckstyleException is expected");
|
||||
}
|
||||
|
|
@ -234,9 +234,9 @@ public class TreeWalkerTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(RequiredTokenIsEmptyIntArray.class);
|
||||
final String pathToEmptyFile = temporaryFolder.newFile("file.java").getPath();
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
try {
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, pathToEmptyFile, expected);
|
||||
}
|
||||
catch (CheckstyleException ignored) {
|
||||
|
|
@ -275,14 +275,14 @@ public class TreeWalkerTest extends BaseCheckTestSupport {
|
|||
|
||||
@Override
|
||||
public int[] getAcceptableTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
}
|
||||
|
||||
private static class RequiredTokenIsEmptyIntArray extends AbstractCheck {
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -292,7 +292,7 @@ public class TreeWalkerTest extends BaseCheckTestSupport {
|
|||
|
||||
@Override
|
||||
public int[] getAcceptableTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,13 +33,13 @@ import java.nio.charset.StandardCharsets;
|
|||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.puppycrawl.tools.checkstyle.api.AuditEvent;
|
||||
import com.puppycrawl.tools.checkstyle.api.LocalizedMessage;
|
||||
import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* Enter a description of class XMLLoggerTest.java.
|
||||
|
|
@ -107,7 +107,7 @@ public class XMLLoggerTest {
|
|||
final XMLLogger logger = new XMLLogger(outStream, true);
|
||||
logger.auditStarted(null);
|
||||
logger.auditFinished(null);
|
||||
final String[] expectedLines = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expectedLines = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verifyLines(expectedLines);
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ public class XMLLoggerTest {
|
|||
logger.auditStarted(null);
|
||||
logger.auditFinished(null);
|
||||
outStream.close();
|
||||
final String[] expectedLines = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expectedLines = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verifyLines(expectedLines);
|
||||
}
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ public class XMLLoggerTest {
|
|||
final AuditEvent ev = new AuditEvent(this, "Test.java", message);
|
||||
logger.addError(ev);
|
||||
logger.auditFinished(null);
|
||||
final String[] expectedLines = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expectedLines = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verifyLines(expectedLines);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,10 +19,11 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.api;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class AbstractCheckTest {
|
||||
|
||||
@Test
|
||||
|
|
@ -30,12 +31,12 @@ public class AbstractCheckTest {
|
|||
final AbstractCheck check = new AbstractCheck() {
|
||||
@Override
|
||||
public int[] getDefaultTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
};
|
||||
// Eventually it will become clear abstract method
|
||||
Assert.assertArrayEquals(ArrayUtils.EMPTY_INT_ARRAY, check.getRequiredTokens());
|
||||
Assert.assertArrayEquals(CommonUtils.EMPTY_INT_ARRAY, check.getRequiredTokens());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -43,12 +44,12 @@ public class AbstractCheckTest {
|
|||
final AbstractCheck check = new AbstractCheck() {
|
||||
@Override
|
||||
public int[] getDefaultTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
};
|
||||
// Eventually it will become clear abstract method
|
||||
Assert.assertArrayEquals(ArrayUtils.EMPTY_INT_ARRAY, check.getAcceptableTokens());
|
||||
Assert.assertArrayEquals(CommonUtils.EMPTY_INT_ARRAY, check.getAcceptableTokens());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -56,17 +57,17 @@ public class AbstractCheckTest {
|
|||
final AbstractCheck check = new AbstractCheck() {
|
||||
@Override
|
||||
public int[] getDefaultTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAcceptableTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
};
|
||||
// Eventually it will become clear abstract method
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ import static org.junit.Assert.assertEquals;
|
|||
import java.lang.reflect.Method;
|
||||
import java.util.SortedSet;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* Tests to ensure that default message bundle is determined correctly.
|
||||
|
|
@ -122,17 +122,17 @@ public class AbstractViolationReporterTest extends BaseCheckTestSupport {
|
|||
private static class EmptyCheck extends AbstractCheck {
|
||||
@Override
|
||||
public int[] getDefaultTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAcceptableTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getRequiredTokens() {
|
||||
return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return CommonUtils.EMPTY_INT_ARRAY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,4 +49,23 @@ public class FileTextTest {
|
|||
+ "checkstyle/api/import-control_complete.xml"), charsetName);
|
||||
assertEquals(charsetName, o.getCharset().name());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineColumnBeforeCopyConstructor() throws IOException {
|
||||
final String charsetName = "ISO-8859-1";
|
||||
final FileText o = new FileText(new File("src/test/resources/com/puppycrawl/tools/"
|
||||
+ "checkstyle/api/import-control_complete.xml"), charsetName);
|
||||
final LineColumn lineColumn = o.lineColumn(100);
|
||||
final FileText copy = new FileText(o);
|
||||
assertEquals(lineColumn, copy.lineColumn(100));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineColumnAfterCopyConstructor() throws IOException {
|
||||
final String charsetName = "ISO-8859-1";
|
||||
final FileText o = new FileText(new File("src/test/resources/com/puppycrawl/tools/"
|
||||
+ "checkstyle/api/import-control_complete.xml"), charsetName);
|
||||
final FileText copy = new FileText(o);
|
||||
assertEquals(3, copy.lineColumn(100).getLine());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
package com.puppycrawl.tools.checkstyle.api;
|
||||
|
||||
import static org.apache.commons.lang3.ArrayUtils.EMPTY_BYTE_ARRAY;
|
||||
import static org.apache.commons.lang3.ArrayUtils.EMPTY_OBJECT_ARRAY;
|
||||
import static com.puppycrawl.tools.checkstyle.utils.CommonUtils.EMPTY_BYTE_ARRAY;
|
||||
import static com.puppycrawl.tools.checkstyle.utils.CommonUtils.EMPTY_OBJECT_ARRAY;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.powermock.api.mockito.PowerMockito.mock;
|
||||
import static org.powermock.api.mockito.PowerMockito.when;
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ import static com.puppycrawl.tools.checkstyle.checks.DescendantTokenCheck.MSG_KE
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class DescendantTokenCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
|
|
@ -44,7 +44,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
|
|||
throws Exception {
|
||||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(DescendantTokenCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig.addAttribute("limitedTokens", "LITERAL_DEFAULT");
|
||||
checkConfig.addAttribute("maximumNumber", "0");
|
||||
checkConfig.addAttribute("minimumDepth", "3");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig.addAttribute("limitedTokens", "LITERAL_DEFAULT");
|
||||
checkConfig.addAttribute("maximumNumber", "0");
|
||||
checkConfig.addAttribute("maximumDepth", "1");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig.addAttribute("maximumNumber", "1");
|
||||
checkConfig.addAttribute("maximumMessage", "What are you doing?");
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputReturnFromFinally.java"), expected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import java.io.IOException;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
|
|
@ -38,6 +37,7 @@ import com.puppycrawl.tools.checkstyle.TreeWalker;
|
|||
import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class FileSetCheckLifecycleTest
|
||||
extends BaseCheckTestSupport {
|
||||
|
|
@ -57,14 +57,14 @@ public class FileSetCheckLifecycleTest
|
|||
@Test
|
||||
public void testGetRequiredTokens() {
|
||||
final FileContentsHolder checkObj = new FileContentsHolder();
|
||||
assertArrayEquals(ArrayUtils.EMPTY_INT_ARRAY, checkObj.getRequiredTokens());
|
||||
assertArrayEquals(CommonUtils.EMPTY_INT_ARRAY, checkObj.getRequiredTokens());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTranslation() throws Exception {
|
||||
final Configuration checkConfig =
|
||||
createCheckConfig(TestFileSetCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
|
||||
|
||||
assertTrue("destroy() not called by Checker", TestFileSetCheck.isDestroyed());
|
||||
|
|
@ -90,7 +90,7 @@ public class FileSetCheckLifecycleTest
|
|||
|
||||
checker.addFileSetCheck(new TestFileSetCheck());
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checker, getPath("InputIllegalTokens.java"), expected);
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ import java.lang.reflect.Method;
|
|||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
|
@ -43,6 +42,7 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
|||
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.api.LocalizedMessage;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class NewlineAtEndOfFileCheckTest
|
||||
extends BaseCheckTestSupport {
|
||||
|
|
@ -64,7 +64,7 @@ public class NewlineAtEndOfFileCheckTest
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(NewlineAtEndOfFileCheck.class);
|
||||
checkConfig.addAttribute("lineSeparator", LineSeparatorOption.LF.toString());
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(
|
||||
createChecker(checkConfig),
|
||||
getPath("InputNewlineLfAtEndOfFile.java"),
|
||||
|
|
@ -76,7 +76,7 @@ public class NewlineAtEndOfFileCheckTest
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(NewlineAtEndOfFileCheck.class);
|
||||
checkConfig.addAttribute("lineSeparator", LineSeparatorOption.CRLF.toString());
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(
|
||||
createChecker(checkConfig),
|
||||
getPath("InputNewlineCrlfAtEndOfFile.java"),
|
||||
|
|
@ -88,7 +88,7 @@ public class NewlineAtEndOfFileCheckTest
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(NewlineAtEndOfFileCheck.class);
|
||||
checkConfig.addAttribute("lineSeparator", LineSeparatorOption.CR.toString());
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(
|
||||
createChecker(checkConfig),
|
||||
getPath("InputNewlineCrAtEndOfFile.java"),
|
||||
|
|
@ -100,7 +100,7 @@ public class NewlineAtEndOfFileCheckTest
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(NewlineAtEndOfFileCheck.class);
|
||||
checkConfig.addAttribute("lineSeparator", LineSeparatorOption.LF_CR_CRLF.toString());
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(
|
||||
createChecker(checkConfig),
|
||||
getPath("InputNewlineCrlfAtEndOfFile.java"),
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@ import static org.junit.Assert.assertArrayEquals;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class OuterTypeFilenameCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
|
|
@ -59,7 +59,7 @@ public class OuterTypeFilenameCheckTest extends BaseCheckTestSupport {
|
|||
public void testGood1() throws Exception {
|
||||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(OuterTypeFilenameCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ public class OuterTypeFilenameCheckTest extends BaseCheckTestSupport {
|
|||
public void testGood2() throws Exception {
|
||||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(OuterTypeFilenameCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("Input15Extensions.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -87,21 +87,21 @@ public class OuterTypeFilenameCheckTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testNestedClass() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(OuterTypeFilenameCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputOuterTypeFilename1.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFinePublic() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(OuterTypeFilenameCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputOuterTypeFilename2.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFineDefault() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(OuterTypeFilenameCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputOuterTypeFilename3.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ public class OuterTypeFilenameCheckTest extends BaseCheckTestSupport {
|
|||
public void testPackageAnnotation() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(OuterTypeFilenameCheck.class);
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getNonCompilablePath("package-info.java"), expected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.commons.beanutils.ConversionException;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.powermock.api.mockito.PowerMockito;
|
||||
|
|
@ -51,6 +50,7 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
|||
import com.puppycrawl.tools.checkstyle.api.LocalizedMessage;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
@RunWith(PowerMockRunner.class)
|
||||
@PrepareForTest({ SuppressWarningsHolder.class, SuppressWarningsHolderTest.class })
|
||||
|
|
@ -76,7 +76,7 @@ public class SuppressWarningsHolderTest extends BaseCheckTestSupport {
|
|||
public void testOnComplexAnnotations() throws Exception {
|
||||
final Configuration checkConfig = createCheckConfig(SuppressWarningsHolder.class);
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputSuppressWarningsHolder.java"), expected);
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ public class SuppressWarningsHolderTest extends BaseCheckTestSupport {
|
|||
public void testCustomAnnotation() throws Exception {
|
||||
final Configuration checkConfig = createCheckConfig(SuppressWarningsHolder.class);
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getNonCompilablePath("InputSuppressWarningsHolder.java"), expected);
|
||||
}
|
||||
|
|
@ -208,7 +208,7 @@ public class SuppressWarningsHolderTest extends BaseCheckTestSupport {
|
|||
public void testEmptyAnnotation() throws Exception {
|
||||
final Configuration checkConfig = createCheckConfig(SuppressWarningsHolder.class);
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputSuppressWarningsHolder3.java"), expected);
|
||||
}
|
||||
|
|
@ -315,7 +315,7 @@ public class SuppressWarningsHolderTest extends BaseCheckTestSupport {
|
|||
public void testAnnotationWithFullName() throws Exception {
|
||||
final Configuration checkConfig = createCheckConfig(SuppressWarningsHolder.class);
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputSuppressWarningsHolder4.java"), expected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
|
@ -34,6 +33,7 @@ import org.junit.Test;
|
|||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class TrailingCommentCheckTest extends BaseCheckTestSupport {
|
||||
private DefaultConfiguration checkConfig;
|
||||
|
|
@ -51,13 +51,13 @@ public class TrailingCommentCheckTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testGetRequiredTokens() {
|
||||
final TrailingCommentCheck checkObj = new TrailingCommentCheck();
|
||||
assertArrayEquals(ArrayUtils.EMPTY_INT_ARRAY, checkObj.getRequiredTokens());
|
||||
assertArrayEquals(CommonUtils.EMPTY_INT_ARRAY, checkObj.getRequiredTokens());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAcceptableTokens() {
|
||||
final TrailingCommentCheck checkObj = new TrailingCommentCheck();
|
||||
assertArrayEquals(ArrayUtils.EMPTY_INT_ARRAY, checkObj.getAcceptableTokens());
|
||||
assertArrayEquals(CommonUtils.EMPTY_INT_ARRAY, checkObj.getAcceptableTokens());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -25,13 +25,13 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.Checker;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class TranslationCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
|
|
@ -72,7 +72,7 @@ public class TranslationCheckTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testOnePropertyFileSet() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(TranslationCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
final File[] propertyFiles = {
|
||||
new File(getPath("app-dev.properties")),
|
||||
};
|
||||
|
|
@ -207,7 +207,7 @@ public class TranslationCheckTest extends BaseCheckTestSupport {
|
|||
new File(getPath("app-stage.properties")),
|
||||
};
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(
|
||||
createChecker(checkConfig),
|
||||
propertyFiles,
|
||||
|
|
@ -247,7 +247,7 @@ public class TranslationCheckTest extends BaseCheckTestSupport {
|
|||
new File(getPath("messages_home_fr_CA_UNIX.properties")),
|
||||
};
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(
|
||||
createChecker(checkConfig),
|
||||
propertyFiles,
|
||||
|
|
@ -380,7 +380,7 @@ public class TranslationCheckTest extends BaseCheckTestSupport {
|
|||
new File(getNonCompilablePath("MyLabelsI18_de.properties")),
|
||||
};
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(
|
||||
createChecker(checkConfig),
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
@ -35,6 +34,7 @@ import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
|||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class UncommentedMainCheckTest
|
||||
extends BaseCheckTestSupport {
|
||||
|
|
@ -83,21 +83,21 @@ public class UncommentedMainCheckTest
|
|||
@Test
|
||||
public void testDeepDepth() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(UncommentedMainCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputUncommentedMain2.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongName() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(UncommentedMainCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputUncommentedMain3.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongArrayType() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(UncommentedMainCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputUncommentedMain4.java"), expected);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,12 +26,12 @@ import static org.junit.Assert.assertArrayEquals;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class AnnotationLocationCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
|
|
@ -43,13 +43,13 @@ public class AnnotationLocationCheckTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testGetRequiredTokens() {
|
||||
final AnnotationLocationCheck checkObj = new AnnotationLocationCheck();
|
||||
assertArrayEquals(ArrayUtils.EMPTY_INT_ARRAY, checkObj.getRequiredTokens());
|
||||
assertArrayEquals(CommonUtils.EMPTY_INT_ARRAY, checkObj.getRequiredTokens());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCorrect() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(AnnotationLocationCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputCorrectAnnotationLocation.java"), expected);
|
||||
}
|
||||
|
|
@ -108,7 +108,7 @@ public class AnnotationLocationCheckTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testWithoutAnnotations() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(AnnotationLocationCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputAnnotationLocation1.java"), expected);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,13 +31,13 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.beanutils.ConversionException;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class AnnotationUseStyleCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
|
|
@ -196,7 +196,7 @@ public class AnnotationUseStyleCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig.addAttribute("closingParens", "ignore");
|
||||
checkConfig.addAttribute("elementStyle", "ignore");
|
||||
checkConfig.addAttribute("trailingArrayComma", "ALWAYS");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputAnnotationUseWithTrailingComma.java"), expected);
|
||||
}
|
||||
|
|
@ -227,7 +227,7 @@ public class AnnotationUseStyleCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig.addAttribute("closingParens", "ignore");
|
||||
checkConfig.addAttribute("elementStyle", "ignore");
|
||||
checkConfig.addAttribute("trailingArrayComma", "NEVER");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputAnnotationUseNoTrailingComma.java"), expected);
|
||||
}
|
||||
|
|
@ -238,7 +238,7 @@ public class AnnotationUseStyleCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig.addAttribute("closingParens", "ignore");
|
||||
checkConfig.addAttribute("elementStyle", "ignore");
|
||||
checkConfig.addAttribute("trailingArrayComma", "ignore");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputDifferentUseStyles.java"), expected);
|
||||
}
|
||||
|
|
@ -247,7 +247,7 @@ public class AnnotationUseStyleCheckTest extends BaseCheckTestSupport {
|
|||
public void testAnnotationsWithoutDefaultValues() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(AnnotationUseStyleCheck.class);
|
||||
checkConfig.addAttribute("closingParens", "NEVER");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputAnnotationsUseStyleParams.java"), expected);
|
||||
}
|
||||
|
|
@ -278,7 +278,7 @@ public class AnnotationUseStyleCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig.addAttribute("closingParens", "ignore");
|
||||
checkConfig.addAttribute("elementStyle", "COMPACT_NO_ARRAY");
|
||||
checkConfig.addAttribute("trailingArrayComma", "ignore");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputAnnotationUseStyle.java"), expected);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@ import static org.junit.Assert.assertArrayEquals;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class MissingDeprecatedCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
|
|
@ -138,7 +138,7 @@ public class MissingDeprecatedCheckTest extends BaseCheckTestSupport {
|
|||
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(MissingDeprecatedCheck.class);
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputGoodDeprecated.java"), expected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,13 +26,13 @@ import static org.junit.Assert.assertEquals;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
|
|
@ -108,7 +108,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
checkConfig.addAttribute("javaFiveCompatibility", "true");
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputBadOverrideFromOther.java"), expected);
|
||||
}
|
||||
|
|
@ -138,7 +138,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
public void testBadAnnotationOverrideJ5Compatible() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
checkConfig.addAttribute("javaFiveCompatibility", "true");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputBadAnnotationOverride.java"), expected);
|
||||
}
|
||||
|
|
@ -166,7 +166,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
checkConfig.addAttribute("javaFiveCompatibility", "false");
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputGoodOverrideFromObject.java"), expected);
|
||||
}
|
||||
|
|
@ -180,7 +180,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
checkConfig.addAttribute("javaFiveCompatibility", "true");
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputGoodOverrideFromObject.java"), expected);
|
||||
}
|
||||
|
|
@ -192,7 +192,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testGoodOverrideFromOther() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputGoodOverrideFromOther.java"), expected);
|
||||
}
|
||||
|
|
@ -206,7 +206,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
checkConfig.addAttribute("javaFiveCompatibility", "true");
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputGoodOverrideFromOther.java"), expected);
|
||||
}
|
||||
|
|
@ -218,7 +218,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testGoodAnnotationOverride() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputGoodAnnotationOverride.java"), expected);
|
||||
}
|
||||
|
|
@ -231,7 +231,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
public void testGoodAnnotationOverrideJ5Compatible() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
checkConfig.addAttribute("javaFiveCompatibility", "true");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputGoodAnnotationOverride.java"), expected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,13 +24,13 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.PackageAnnotatio
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class PackageAnnotationCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
|
|
@ -52,7 +52,7 @@ public class PackageAnnotationCheckTest extends BaseCheckTestSupport {
|
|||
public void testGoodPackageAnnotation() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(PackageAnnotationCheck.class);
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getNonCompilablePath("package-info.java"), expected);
|
||||
}
|
||||
|
|
@ -69,7 +69,7 @@ public class PackageAnnotationCheckTest extends BaseCheckTestSupport {
|
|||
public void testAnnotationNotInPackageInfo() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(PackageAnnotationCheck.class);
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputPackageAnnotation.java"), expected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarnings
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class SuppressWarningsCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
|
|
@ -796,7 +796,7 @@ public class SuppressWarningsCheckTest extends BaseCheckTestSupport {
|
|||
public void testUncheckedInConstant() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(SuppressWarningsCheck.class);
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputSuppressWarningsConstants.java"), expected);
|
||||
}
|
||||
|
|
@ -805,7 +805,7 @@ public class SuppressWarningsCheckTest extends BaseCheckTestSupport {
|
|||
public void testValuePairAnnotation() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(SuppressWarningsCheck.class);
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputSuppressWarningsValuePair.java"), expected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,12 +26,12 @@ import static org.junit.Assert.assertEquals;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class EmptyBlockCheckTest
|
||||
extends BaseCheckTestSupport {
|
||||
|
|
@ -142,7 +142,7 @@ public class EmptyBlockCheckTest
|
|||
public void testInvalidOption() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(EmptyBlockCheck.class);
|
||||
checkConfig.addAttribute("option", "invalid_option");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputSemantic.java"), expected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
@ -36,6 +35,7 @@ import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
|||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class LeftCurlyCheckTest extends BaseCheckTestSupport {
|
||||
private DefaultConfiguration checkConfig;
|
||||
|
|
@ -70,7 +70,7 @@ public class LeftCurlyCheckTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testGetRequiredTokens() {
|
||||
final LeftCurlyCheck checkObj = new LeftCurlyCheck();
|
||||
assertArrayEquals(ArrayUtils.EMPTY_INT_ARRAY, checkObj.getRequiredTokens());
|
||||
assertArrayEquals(CommonUtils.EMPTY_INT_ARRAY, checkObj.getRequiredTokens());
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -272,7 +272,7 @@ public class LeftCurlyCheckTest extends BaseCheckTestSupport {
|
|||
public void testIgnoreEnumsOptionTrue() throws Exception {
|
||||
checkConfig.addAttribute("option", LeftCurlyOption.EOL.toString());
|
||||
checkConfig.addAttribute("ignoreEnums", "true");
|
||||
final String[] expectedWhileTrue = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expectedWhileTrue = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputLeftCurlyEnums.java"), expectedWhileTrue);
|
||||
}
|
||||
|
||||
|
|
@ -340,7 +340,7 @@ public class LeftCurlyCheckTest extends BaseCheckTestSupport {
|
|||
public void testFirstLine() throws Exception {
|
||||
checkConfig.addAttribute("option", LeftCurlyOption.EOL.toString());
|
||||
checkConfig.addAttribute("maxLineLength", "100");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputLeftCurlyAllInOneLine.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -364,7 +364,7 @@ public class LeftCurlyCheckTest extends BaseCheckTestSupport {
|
|||
@Test(expected = CheckstyleException.class)
|
||||
public void testInvalidOption() throws Exception {
|
||||
checkConfig.addAttribute("option", "invalid_option");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputScopeInnerInterfaces.java"), expected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ import static com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck.MSG_
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class NeedBracesCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
|
|
@ -120,7 +120,7 @@ public class NeedBracesCheckTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig = createCheckConfig(NeedBracesCheck.class);
|
||||
checkConfig.addAttribute("tokens", "LITERAL_WHILE, LITERAL_DO, LITERAL_FOR");
|
||||
checkConfig.addAttribute("allowSingleLineStatement", "true");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputNeedBraces.java"), expected);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,13 +28,13 @@ import static org.junit.Assert.assertEquals;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class RightCurlyCheckTest extends BaseCheckTestSupport {
|
||||
private DefaultConfiguration checkConfig;
|
||||
|
|
@ -88,7 +88,7 @@ public class RightCurlyCheckTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testSameOmitOneLiners() throws Exception {
|
||||
checkConfig.addAttribute("option", RightCurlyOption.SAME.toString());
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputRightCurlyNameForOneLiners.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -151,7 +151,7 @@ public class RightCurlyCheckTest extends BaseCheckTestSupport {
|
|||
|
||||
@Test
|
||||
public void testForceLineBreakBefore2() throws Exception {
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputRightCurlyLineBreakBefore.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ public class RightCurlyCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig.addAttribute("option", RightCurlyOption.ALONE.toString());
|
||||
checkConfig.addAttribute("tokens", "CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, "
|
||||
+ "LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputRightCurlyEmptyAbstractMethod.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -278,7 +278,7 @@ public class RightCurlyCheckTest extends BaseCheckTestSupport {
|
|||
@Test(expected = CheckstyleException.class)
|
||||
public void testInvalidOption() throws Exception {
|
||||
checkConfig.addAttribute("option", "invalid_option");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputRightCurly.java"), expected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastChec
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class DefaultComesLastCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
|
|
@ -62,7 +62,7 @@ public class DefaultComesLastCheckTest extends BaseCheckTestSupport {
|
|||
throws Exception {
|
||||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(DefaultComesLastCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig,
|
||||
getNonCompilablePath("InputDefaultComesLast2.java"),
|
||||
expected);
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck.
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class EqualsHashCodeCheckTest
|
||||
extends BaseCheckTestSupport {
|
||||
|
|
@ -55,7 +55,7 @@ public class EqualsHashCodeCheckTest
|
|||
public void testBooleanMethods() throws Exception {
|
||||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(EqualsHashCodeCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputEqualsHashCode.java"), expected);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCh
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
@ -32,6 +31,7 @@ import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
|||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class FinalLocalVariableCheckTest
|
||||
extends BaseCheckTestSupport {
|
||||
|
|
@ -114,7 +114,7 @@ public class FinalLocalVariableCheckTest
|
|||
createCheckConfig(FinalLocalVariableCheck.class);
|
||||
checkConfig.addAttribute("tokens", "PARAMETER_DEF");
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputFinalLocalVariableNativeMethods.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ public class FinalLocalVariableCheckTest
|
|||
createCheckConfig(FinalLocalVariableCheck.class);
|
||||
checkConfig.addAttribute("tokens", "VARIABLE_DEF, PARAMETER_DEF");
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("InputFinalLocalVariableFalsePositive.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ public class FinalLocalVariableCheckTest
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(FinalLocalVariableCheck.class);
|
||||
checkConfig.addAttribute("tokens", "PARAMETER_DEF,VARIABLE_DEF");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputFinalLocalVariableNameLambda.java"),
|
||||
expected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalInstantiation
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
@ -35,6 +34,7 @@ import com.puppycrawl.tools.checkstyle.api.FileContents;
|
|||
import com.puppycrawl.tools.checkstyle.api.FileText;
|
||||
import com.puppycrawl.tools.checkstyle.api.LocalizedMessages;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class IllegalInstantiationCheckTest
|
||||
extends BaseCheckTestSupport {
|
||||
|
|
@ -76,7 +76,7 @@ public class IllegalInstantiationCheckTest
|
|||
public void testJava8() throws Exception {
|
||||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(IllegalInstantiationCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig,
|
||||
getNonCompilablePath("InputIllegalInstantiation2.java"),
|
||||
expected);
|
||||
|
|
@ -120,7 +120,7 @@ public class IllegalInstantiationCheckTest
|
|||
checkConfig.addAttribute(
|
||||
"classes",
|
||||
"jjva.lang.Boolean,java.lang*Boolean");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig,
|
||||
getNonCompilablePath("InputIllegalInstantiationLang.java"),
|
||||
expected);
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck.M
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class IllegalThrowsCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
|
|
@ -112,7 +112,7 @@ public class IllegalThrowsCheckTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig = createCheckConfig(IllegalThrowsCheck.class);
|
||||
checkConfig.addAttribute("ignoreOverriddenMethods", "true");
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputIllegalThrowsIgnoreOverriddenMethods.java"), expected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck.MSG
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
|
@ -33,6 +32,7 @@ import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
|||
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
||||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class IllegalTypeCheckTest extends BaseCheckTestSupport {
|
||||
private DefaultConfiguration checkConfig;
|
||||
|
|
@ -63,7 +63,7 @@ public class IllegalTypeCheckTest extends BaseCheckTestSupport {
|
|||
@Test
|
||||
public void testValidateAbstractClassNamesSetToFalse() throws Exception {
|
||||
checkConfig.addAttribute("validateAbstractClassNames", "false");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("InputIllegalTypeAbstractClassNames.java"), expected);
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue