forked from phoedos/pmd
Fix checkstyle config and checkstyle issues
This commit is contained in:
parent
b1c40f1e33
commit
d88a3c50fe
@ -8,7 +8,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
|
@ -9,9 +9,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest;
|
||||
import net.sourceforge.pmd.lang.rule.RuleSet;
|
||||
import net.sourceforge.pmd.lang.rule.RuleSetLoader;
|
||||
import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest;
|
||||
|
||||
import com.github.stefanbirkner.systemlambda.SystemLambda;
|
||||
|
||||
|
@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.apex.cpd;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
|
||||
import net.sourceforge.pmd.lang.apex.ApexLanguageModule;
|
||||
import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
|
||||
|
||||
class ApexCpdLexerTest extends CpdTextComparisonTest {
|
||||
|
||||
|
@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.coco.cpd;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
|
||||
import net.sourceforge.pmd.lang.coco.CocoLanguageModule;
|
||||
import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
|
||||
|
||||
class CocoCpdLexerTest extends CpdTextComparisonTest {
|
||||
CocoCpdLexerTest() {
|
||||
|
@ -12,9 +12,9 @@ import org.junit.jupiter.api.Test;
|
||||
import net.sourceforge.pmd.cpd.CpdLanguageProperties;
|
||||
import net.sourceforge.pmd.cpd.CpdLexer;
|
||||
import net.sourceforge.pmd.cpd.Tokens;
|
||||
import net.sourceforge.pmd.lang.cpp.CppLanguageModule;
|
||||
import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
|
||||
import net.sourceforge.pmd.lang.test.cpd.LanguagePropertyConfig;
|
||||
import net.sourceforge.pmd.lang.cpp.CppLanguageModule;
|
||||
|
||||
class CppCpdLexerTest extends CpdTextComparisonTest {
|
||||
|
||||
|
@ -10,9 +10,9 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.cpd.CpdLanguageProperties;
|
||||
import net.sourceforge.pmd.lang.ast.LexException;
|
||||
import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
|
||||
import net.sourceforge.pmd.lang.test.cpd.LanguagePropertyConfig;
|
||||
import net.sourceforge.pmd.lang.ast.LexException;
|
||||
|
||||
class CsCpdLexerTest extends CpdTextComparisonTest {
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
package net.sourceforge.pmd.lang.html.ast;
|
||||
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
import net.sourceforge.pmd.lang.html.HtmlLanguageModule;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
|
||||
public final class HtmlParsingHelper extends BaseParsingHelper<HtmlParsingHelper, ASTHtmlDocument> {
|
||||
|
||||
|
@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.html.cpd;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
|
||||
import net.sourceforge.pmd.lang.html.HtmlLanguageModule;
|
||||
import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
|
||||
|
||||
class HtmlCpdLexerTest extends CpdTextComparisonTest {
|
||||
|
||||
|
@ -4,6 +4,9 @@
|
||||
|
||||
package net.sourceforge.pmd.lang.java.rule.bestpractices;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTBlock;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTMethodCall;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration;
|
||||
@ -13,10 +16,6 @@ import net.sourceforge.pmd.properties.NumericConstraints;
|
||||
import net.sourceforge.pmd.properties.PropertyDescriptor;
|
||||
import net.sourceforge.pmd.properties.PropertyFactory;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class JUnitTestContainsTooManyAssertsRule extends AbstractJavaRulechainRule {
|
||||
|
||||
private static final PropertyDescriptor<Integer> MAX_ASSERTS =
|
||||
|
@ -4,6 +4,9 @@
|
||||
|
||||
package net.sourceforge.pmd.lang.java.rule.bestpractices;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTBlock;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTMethodCall;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration;
|
||||
@ -12,9 +15,6 @@ import net.sourceforge.pmd.lang.java.rule.internal.TestFrameworksUtil;
|
||||
import net.sourceforge.pmd.properties.PropertyDescriptor;
|
||||
import net.sourceforge.pmd.properties.PropertyFactory;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class JUnitTestsShouldIncludeAssertRule extends AbstractJavaRulechainRule {
|
||||
|
||||
private static final PropertyDescriptor<Set<String>> EXTRA_ASSERT_METHOD_NAMES =
|
||||
|
@ -55,8 +55,8 @@ import net.sourceforge.pmd.lang.java.types.TypeOps;
|
||||
import net.sourceforge.pmd.lang.java.types.TypeTestUtil;
|
||||
import net.sourceforge.pmd.properties.PropertyDescriptor;
|
||||
import net.sourceforge.pmd.properties.PropertyFactory;
|
||||
import net.sourceforge.pmd.util.OptionalBool;
|
||||
import net.sourceforge.pmd.reporting.RuleContext;
|
||||
import net.sourceforge.pmd.util.OptionalBool;
|
||||
|
||||
/**
|
||||
* This rule can detect possible violations of the Law of Demeter. The Law of
|
||||
|
@ -11,13 +11,13 @@ import java.util.stream.Collectors;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.Node;
|
||||
import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTExpression;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTModifierList;
|
||||
import net.sourceforge.pmd.lang.java.ast.JModifier;
|
||||
import net.sourceforge.pmd.lang.java.ast.ModifierOwner;
|
||||
import net.sourceforge.pmd.lang.rule.xpath.Attribute;
|
||||
import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter;
|
||||
|
||||
/**
|
||||
* Special tweak to remove deprecated attributes of {@link ModifierOwner}
|
||||
|
@ -24,7 +24,6 @@ import net.sourceforge.pmd.lang.LanguageProcessor;
|
||||
import net.sourceforge.pmd.lang.ast.Node;
|
||||
import net.sourceforge.pmd.lang.ast.SemanticErrorReporter;
|
||||
import net.sourceforge.pmd.lang.ast.SemanticException;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit;
|
||||
import net.sourceforge.pmd.lang.java.ast.JavaParser;
|
||||
import net.sourceforge.pmd.lang.java.internal.JavaAstProcessor;
|
||||
@ -33,6 +32,7 @@ import net.sourceforge.pmd.lang.java.types.TypeSystem;
|
||||
import net.sourceforge.pmd.lang.java.types.internal.infer.TypeInferenceLogger;
|
||||
import net.sourceforge.pmd.lang.java.types.internal.infer.TypeInferenceLogger.SimpleLogger;
|
||||
import net.sourceforge.pmd.lang.java.types.internal.infer.TypeInferenceLogger.VerboseLogger;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
import net.sourceforge.pmd.util.log.PmdReporter;
|
||||
import net.sourceforge.pmd.util.log.internal.SimpleMessageReporter;
|
||||
|
||||
|
@ -10,8 +10,8 @@ import static net.sourceforge.pmd.test.AbstractLanguageVersionTest.TestDescripto
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.sourceforge.pmd.test.AbstractLanguageVersionTest;
|
||||
import net.sourceforge.pmd.lang.Language;
|
||||
import net.sourceforge.pmd.test.AbstractLanguageVersionTest;
|
||||
|
||||
class LanguageVersionTest extends AbstractLanguageVersionTest {
|
||||
|
||||
|
@ -9,9 +9,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest;
|
||||
import net.sourceforge.pmd.lang.rule.RuleSet;
|
||||
import net.sourceforge.pmd.lang.rule.RuleSetLoader;
|
||||
import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest;
|
||||
|
||||
import com.github.stefanbirkner.systemlambda.SystemLambda;
|
||||
|
||||
|
@ -16,9 +16,9 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.ParseException;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
|
||||
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
|
||||
class JDKVersionTest extends BaseJavaTreeDumpTest {
|
||||
|
||||
|
@ -11,9 +11,9 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.ParseException;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
|
||||
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
|
||||
/**
|
||||
* Tests new java14 standard features.
|
||||
|
@ -9,9 +9,9 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.ParseException;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
|
||||
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
|
||||
class Java15TreeDumpTest extends BaseJavaTreeDumpTest {
|
||||
private final JavaParsingHelper java15 =
|
||||
|
@ -18,11 +18,11 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.NodeStream;
|
||||
import net.sourceforge.pmd.lang.ast.ParseException;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
|
||||
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
|
||||
import net.sourceforge.pmd.lang.java.symbols.JElementSymbol;
|
||||
import net.sourceforge.pmd.lang.java.types.JPrimitiveType;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
|
||||
class Java16TreeDumpTest extends BaseJavaTreeDumpTest {
|
||||
private final JavaParsingHelper java16 =
|
||||
|
@ -10,9 +10,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.ParseException;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
|
||||
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
|
||||
class Java17TreeDumpTest extends BaseJavaTreeDumpTest {
|
||||
private final JavaParsingHelper java17 =
|
||||
|
@ -7,9 +7,9 @@ package net.sourceforge.pmd.lang.java.ast;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
|
||||
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
|
||||
class Java9TreeDumpTest extends BaseJavaTreeDumpTest {
|
||||
|
||||
|
@ -20,12 +20,12 @@ import org.junit.jupiter.api.Timeout;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.ParseException;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.MalformedSourceException;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
import net.sourceforge.pmd.lang.document.FileId;
|
||||
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
|
||||
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr;
|
||||
import net.sourceforge.pmd.lang.java.types.AstTestUtil;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
|
||||
class ParserCornersTest extends BaseJavaTreeDumpTest {
|
||||
private final JavaParsingHelper java = JavaParsingHelper.DEFAULT.withResourceContext(getClass());
|
||||
|
@ -12,12 +12,12 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.cpd.CpdLanguageProperties;
|
||||
import net.sourceforge.pmd.cpd.CpdLexer;
|
||||
import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
|
||||
import net.sourceforge.pmd.lang.test.cpd.LanguagePropertyConfig;
|
||||
import net.sourceforge.pmd.lang.ast.LexException;
|
||||
import net.sourceforge.pmd.lang.document.FileId;
|
||||
import net.sourceforge.pmd.lang.document.TextDocument;
|
||||
import net.sourceforge.pmd.lang.java.JavaLanguageModule;
|
||||
import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
|
||||
import net.sourceforge.pmd.lang.test.cpd.LanguagePropertyConfig;
|
||||
|
||||
class JavaCpdLexerTest extends CpdTextComparisonTest {
|
||||
|
||||
|
@ -17,6 +17,7 @@ class JUnit4TestShouldUseAfterAnnotationTest extends PmdRuleTst {
|
||||
public void setUp() {
|
||||
// A setup code
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
// A tear down code
|
||||
|
@ -17,6 +17,7 @@ class JUnit4TestShouldUseBeforeAnnotationTest extends PmdRuleTst {
|
||||
public void setUp() {
|
||||
// A setup code
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
// A tear down code
|
||||
|
@ -1,11 +1,16 @@
|
||||
/*
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.lang.java.rule.internal;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTMethodCall;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class TestFrameworksUtilTest {
|
||||
|
||||
|
@ -10,9 +10,6 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.Node;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest;
|
||||
import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter;
|
||||
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration;
|
||||
@ -20,6 +17,9 @@ import net.sourceforge.pmd.lang.java.ast.ASTVariableId;
|
||||
import net.sourceforge.pmd.lang.java.ast.InvocationNode;
|
||||
import net.sourceforge.pmd.lang.java.ast.TypeNode;
|
||||
import net.sourceforge.pmd.lang.rule.xpath.Attribute;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest;
|
||||
import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -8,7 +8,6 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.mozilla.javascript.CompilerEnvirons;
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
package net.sourceforge.pmd.lang.ecmascript.ast;
|
||||
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule;
|
||||
import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
|
||||
|
||||
public final class JsParsingHelper extends BaseParsingHelper<JsParsingHelper, ASTAstRoot> {
|
||||
|
||||
|
@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.ecmascript.cpd;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
|
||||
import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule;
|
||||
import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
|
||||
|
||||
/**
|
||||
*
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user