Remove duplicates in throws lists. #1555
Fixes `DuplicateThrows` inspection violations. Description: >This inspection reports duplicate exceptions in a method throws list.
This commit is contained in:
parent
d5129db907
commit
3d7dcc51c4
|
|
@ -22,7 +22,7 @@ public class OuterTypeFilenameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void outerTypeFilenameTest_1() throws IOException, Exception {
|
||||
public void outerTypeFilenameTest_1() throws Exception {
|
||||
|
||||
final String[] expected = {};
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ public class OuterTypeFilenameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void outerTypeFilenameTest_2() throws IOException, Exception {
|
||||
public void outerTypeFilenameTest_2() throws Exception {
|
||||
|
||||
final String[] expected = {};
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ public class OuterTypeFilenameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void outerTypeFilenameTest_3() throws IOException, Exception {
|
||||
public void outerTypeFilenameTest_3() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
"3: " + getCheckMessage(OuterTypeFilenameCheck.class, "type.file.mismatch"),
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class FileTabCharacterTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void fileTabTest() throws IOException, Exception {
|
||||
public void fileTabTest() throws Exception {
|
||||
|
||||
final DefaultConfiguration checkConfig = createConfig(true);
|
||||
final String[] expected = {
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@ public class IllegalTokenTextTest extends BaseCheckTestSupport{
|
|||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder()
|
||||
throws CheckstyleException, MalformedURLException, IOException {
|
||||
throws CheckstyleException, IOException {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void illegalTokensTest() throws IOException, Exception {
|
||||
public void illegalTokensTest() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
"17:27: Avoid using corresponding octal or Unicode escape.",
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends BaseCheckTestSupport
|
|||
}
|
||||
|
||||
@Test
|
||||
public void unicodeEscapesTest() throws IOException, Exception {
|
||||
public void unicodeEscapesTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(AvoidEscapedUnicodeCharactersCheck.class, "forbid.escaped.unicode.char");
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class NeedBracesTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void needBracesTest() throws IOException, Exception {
|
||||
public void needBracesTest() throws Exception {
|
||||
|
||||
Class<NeedBracesCheck> clazz = NeedBracesCheck.class;
|
||||
String messageKey = "needBraces";
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class EmptyBlockTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void emptyBlockTest() throws IOException, Exception {
|
||||
public void emptyBlockTest() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
"19:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"),
|
||||
|
|
@ -68,7 +68,7 @@ public class EmptyBlockTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void emptyBlockTestCatch() throws IOException, Exception {
|
||||
public void emptyBlockTestCatch() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
"29:17: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"),
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class EmptyCatchBlockTest extends BaseCheckTestSupport
|
|||
}
|
||||
|
||||
@Test
|
||||
public void emptyBlockTestCatch() throws IOException, Exception
|
||||
public void emptyBlockTestCatch() throws Exception
|
||||
{
|
||||
|
||||
final String[] expected = {
|
||||
|
|
@ -40,7 +40,7 @@ public class EmptyCatchBlockTest extends BaseCheckTestSupport
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testNoViolations() throws IOException, Exception
|
||||
public void testNoViolations() throws Exception
|
||||
{
|
||||
|
||||
final String[] expected = {
|
||||
|
|
@ -54,7 +54,7 @@ public class EmptyCatchBlockTest extends BaseCheckTestSupport
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testViolationsByComment() throws IOException, Exception
|
||||
public void testViolationsByComment() throws Exception
|
||||
{
|
||||
|
||||
final String[] expected = {
|
||||
|
|
@ -70,7 +70,7 @@ public class EmptyCatchBlockTest extends BaseCheckTestSupport
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testViolationsByVariableName() throws IOException, Exception
|
||||
public void testViolationsByVariableName() throws Exception
|
||||
{
|
||||
final String[] expected = {
|
||||
"19: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"),
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class LineLengthTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void lineLengthTest() throws IOException, Exception {
|
||||
public void lineLengthTest() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
"5: " + getCheckMessage(LineLengthCheck.class, "maxLineLen", 100, 112),
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class MethodParamPadTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void operatorWrapTest() throws IOException, Exception {
|
||||
public void operatorWrapTest() throws Exception {
|
||||
|
||||
Class<MethodParamPadCheck> clazz = MethodParamPadCheck.class;
|
||||
String messageKey = "line.previous";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class OperatorWrapTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void operatorWrapTest() throws IOException, Exception {
|
||||
public void operatorWrapTest() throws Exception {
|
||||
|
||||
Class<OperatorWrapCheck> clazz = OperatorWrapCheck.class;
|
||||
String messageKey = "line.new";
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class SeparatorWrapTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void separatorWrapTest() throws IOException, Exception {
|
||||
public void separatorWrapTest() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
"28:30: " + getCheckMessage(SeparatorWrapCheck.class, "line.new", "."),
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class VariableDeclarationUsageDistanceTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void arrayTypeStyleTest() throws IOException, Exception {
|
||||
public void arrayTypeStyleTest() throws Exception {
|
||||
|
||||
String msgExt = "variable.declaration.usage.distance.extend";
|
||||
Class<VariableDeclarationUsageDistanceCheck> clazz = VariableDeclarationUsageDistanceCheck.class;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class ArrayTypeStyleTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void arrayTypeStyleTest() throws IOException, Exception {
|
||||
public void arrayTypeStyleTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(ArrayTypeStyleCheck.class, "array.type.style");
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class IndentationTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void correctClassTest() throws IOException, Exception {
|
||||
public void correctClassTest() throws Exception {
|
||||
|
||||
final String[] expected = {};
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ public class IndentationTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void correctFieldTest() throws IOException, Exception {
|
||||
public void correctFieldTest() throws Exception {
|
||||
|
||||
final String[] expected = {};
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ public class IndentationTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void correctForTest() throws IOException, Exception {
|
||||
public void correctForTest() throws Exception {
|
||||
|
||||
final String[] expected = {};
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ public class IndentationTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void correctIfTest() throws IOException, Exception {
|
||||
public void correctIfTest() throws Exception {
|
||||
|
||||
final String[] expected = {};
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ public class IndentationTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void correctTest() throws IOException, Exception {
|
||||
public void correctTest() throws Exception {
|
||||
|
||||
final String[] expected = {};
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ public class IndentationTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void correctReturnTest() throws IOException, Exception {
|
||||
public void correctReturnTest() throws Exception {
|
||||
|
||||
final String[] expected = {};
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ public class IndentationTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void correctWhileTest() throws IOException, Exception {
|
||||
public void correctWhileTest() throws Exception {
|
||||
|
||||
final String[] expected = {};
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class FallThroughTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void fallThroughTest() throws IOException, Exception {
|
||||
public void fallThroughTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(FallThroughCheck.class, "fall.through");
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class AnnotationLocationTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void annotationTest() throws IOException, Exception {
|
||||
public void annotationTest() throws Exception {
|
||||
|
||||
Class<AnnotationLocationCheck> clazz = AnnotationLocationCheck.class;
|
||||
String msgLocation = "annotation.location";
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class ModifierOrderTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void modifierOrderTest() throws IOException, Exception {
|
||||
public void modifierOrderTest() throws Exception {
|
||||
|
||||
Class<ModifierOrderCheck> clazz = ModifierOrderCheck.class;
|
||||
String msgMod = "mod.order";
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public class UpperEllTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void upperEllTest() throws IOException, Exception {
|
||||
public void upperEllTest() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
"6:36: Should use uppercase 'L'.",
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class PackageNameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void goodPackageNameTest() throws IOException, Exception {
|
||||
public void goodPackageNameTest() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = {};
|
||||
|
|
@ -39,7 +39,7 @@ public class PackageNameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void badPackageNameTest() throws IOException, Exception {
|
||||
public void badPackageNameTest() throws Exception {
|
||||
|
||||
String packagePath =
|
||||
"com.google.checkstyle.test.chapter5naming.rule521packageNamesCamelCase";
|
||||
|
|
@ -56,7 +56,7 @@ public class PackageNameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void badPackageName2Test() throws IOException, Exception {
|
||||
public void badPackageName2Test() throws Exception {
|
||||
|
||||
|
||||
String packagePath = "com.google.checkstyle.test.chapter5naming.rule521_packagenames";
|
||||
|
|
@ -73,7 +73,7 @@ public class PackageNameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void badPackageName3Test() throws IOException, Exception {
|
||||
public void badPackageName3Test() throws Exception {
|
||||
|
||||
|
||||
String packagePath = "com.google.checkstyle.test.chapter5naming.rule521$packagenames";
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public class MethodNameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void methodNameTest() throws IOException, Exception {
|
||||
public void methodNameTest() throws Exception {
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("MethodName");
|
||||
String msgKey = "name.invalidPattern";
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class MemberNameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void memberNameTest() throws IOException, Exception {
|
||||
public void memberNameTest() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
"5:16: " + getCheckMessage(checkConfig.getMessages(), msgKey, "mPublic", format),
|
||||
|
|
@ -51,7 +51,7 @@ public class MemberNameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void simpleTest() throws IOException, Exception {
|
||||
public void simpleTest() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
"12:17: " + getCheckMessage(checkConfig.getMessages(), msgKey, "bad$Static", format),
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class ParameterNameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void parameterNameTest() throws IOException, Exception {
|
||||
public void parameterNameTest() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
"8:21: " + getCheckMessage(checkConfig.getMessages(), MSG_KEY, "$arg1", format),
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class LocalVariableNameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void localVariableNameTest() throws IOException, Exception {
|
||||
public void localVariableNameTest() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
"26:13: " + getCheckMessage(checkConfig.getMessages(), msgKey, "a", format),
|
||||
|
|
@ -49,7 +49,7 @@ public class LocalVariableNameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void oneCharTest() throws IOException, Exception {
|
||||
public void oneCharTest() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
"15:13: " + getCheckMessage(checkConfig.getMessages(), msgKey, "i", format),
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class ClassMethodTypeParameterNameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testClassDefault() throws IOException, Exception {
|
||||
public void testClassDefault() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
"5:31: " + getCheckMessage(checkConfig.getMessages(), msgKey, "t", format),
|
||||
|
|
@ -41,7 +41,7 @@ public class ClassMethodTypeParameterNameTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testMethodDefault() throws IOException, Exception {
|
||||
public void testMethodDefault() throws Exception {
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("MethodTypeParameterName");
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class SingleLineJavadocTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void singleLineJavadocTest() throws IOException, Exception {
|
||||
public void singleLineJavadocTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(SingleLineJavadocCheck.class, "singleline.javadoc");
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ public class SingleLineJavadocTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test(expected = Exception.class)
|
||||
public void customInlineTagTest() throws IOException, Exception{
|
||||
public void customInlineTagTest() throws Exception{
|
||||
String msg = getCheckMessage(SingleLineJavadocCheck.class, "singleline.javadoc");
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("SingleLineJavadocCheck");
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class JavadocParagraphTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void javadocParagraphCorrectTest() throws IOException, Exception {
|
||||
public void javadocParagraphCorrectTest() throws Exception {
|
||||
|
||||
final String[] expected = {
|
||||
};
|
||||
|
|
@ -35,7 +35,7 @@ public class JavadocParagraphTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void javadocParagraphIncorrectTest() throws IOException, Exception {
|
||||
public void javadocParagraphIncorrectTest() throws Exception {
|
||||
|
||||
String msgBefore = getCheckMessage(JavadocParagraphCheck.class, "javadoc.paragraph.line.before");
|
||||
String msgRed = getCheckMessage(JavadocParagraphCheck.class, "javadoc.paragraph.redundant.paragraph");
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class AtclauseOrderTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void noFinalizerBasicTest() throws IOException, Exception {
|
||||
public void noFinalizerBasicTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method");
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ public class AtclauseOrderTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void noFinalizerExtendedTest() throws IOException, Exception {
|
||||
public void noFinalizerExtendedTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method");
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class JavadocTagContinuationIndentationTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void noFinalizerBasicTest() throws IOException, Exception {
|
||||
public void noFinalizerBasicTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method");
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ public class JavadocTagContinuationIndentationTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void noFinalizerExtendedTest() throws IOException, Exception {
|
||||
public void noFinalizerExtendedTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method");
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class NonEmptyAtclauseDescriptionTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void noFinalizerBasicTest() throws IOException, Exception {
|
||||
public void noFinalizerBasicTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method");
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ public class NonEmptyAtclauseDescriptionTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void noFinalizerExtendedTest() throws IOException, Exception {
|
||||
public void noFinalizerExtendedTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method");
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class SummaryJavadocTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void noFinalizerBasicTest() throws IOException, Exception {
|
||||
public void noFinalizerBasicTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method");
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ public class SummaryJavadocTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void noFinalizerExtendedTest() throws IOException, Exception {
|
||||
public void noFinalizerExtendedTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method");
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class JavadocMethodTest extends BaseCheckTestSupport{
|
|||
}
|
||||
|
||||
@Test
|
||||
public void javadocMethodTest() throws IOException, Exception {
|
||||
public void javadocMethodTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(JavadocMethodCheck.class, "javadoc.missing");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue