diff options
author | rnveach <rveach02@gmail.com> | 2015-11-12 10:48:43 -0500 |
---|---|---|
committer | Roman Ivanov <ivanov-jr@mail.ru> | 2015-11-12 19:08:40 -0800 |
commit | 63668c23e4fc6803b3161430f1d52fed67741c0f (patch) | |
tree | 6babc1508623baa9280e293fe4fe6f7edcd72e64 /src/it | |
parent | c29af9d03619dfbf64f68185f8b1f1720f2f9676 (diff) | |
download | checkstyle-63668c23e4fc6803b3161430f1d52fed67741c0f.tar.gz |
Issue #2589: Removed unneeded warning comments in IT.
Diffstat (limited to 'src/it')
7 files changed, 89 insertions, 14 deletions
diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java index ee175bb8d..8c25633d6 100644 --- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java +++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java @@ -92,7 +92,7 @@ public class EmptyBlockTest extends BaseCheckTestSupport { }; final Configuration checkConfig = getCheckConfig("EmptyBlock"); - final String filePath = getPath("InputEmptyBlockCatch.java"); + final String filePath = getPath("InputEmptyBlock.java"); final Integer[] warnList = getLinesWithWarn(filePath); verify(checkConfig, filePath, expected, warnList); diff --git a/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/InputEmptyBlock.java b/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/InputEmptyBlock.java new file mode 100644 index 000000000..624be9f0e --- /dev/null +++ b/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/InputEmptyBlock.java @@ -0,0 +1,75 @@ +//////////////////////////////////////////////////////////////////////////////// +// Test case file for checkstyle. +// Created: 2001 +//////////////////////////////////////////////////////////////////////////////// +package com.google.checkstyle.test.chapter4formatting.rule413emptyblocks; + +import java.io.*; +import java.awt.Dimension; +import java.awt.Color; + +class Block { + boolean flag; + void doSm() {} + void foo() { + try { + if (!flag) { + doSm(); + } + } catch (Exception e) { /* ignore */ } //ok + finally {/* ignore */} //ok + } + + void foo2() { + try { + if (!flag) { + doSm(); + } + } catch (Exception e) {} + finally {} //warn + } + + class Inner { + boolean flag; + void doSm() {} + void foo() { + try { + if (!flag) { + doSm(); + } + } catch (Exception e) { /* ignore */ } //ok + finally {/* ignore */} //ok + } + + void foo2() { + try { + if (!flag) { + doSm(); + } + } catch (Exception e) {} + finally {} //warn + } + } + + Inner anon = new Inner(){ + boolean flag; + void doSm() {} + void foo() { + try { + if (!flag) { + doSm(); + } + } catch (Exception e) { /* ignore */ } //ok + finally {/* ignore */} //ok + } + + void foo2() { + try { + if (!flag) { + doSm(); + } + } catch (Exception e) {} + finally {} //warn + } + }; +} diff --git a/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/InputEmptyBlockCatch.java b/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/InputEmptyBlockCatch.java index 259bef7e5..c4c27aca8 100644 --- a/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/InputEmptyBlockCatch.java +++ b/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/InputEmptyBlockCatch.java @@ -26,7 +26,7 @@ class Catch { doSm(); } } catch (Exception e) {} //warn - finally {} //warn + finally {} } class Inner { @@ -47,7 +47,7 @@ class Catch { doSm(); } } catch (Exception e) {} //warn - finally {} //warn + finally {} } } @@ -69,7 +69,7 @@ class Catch { doSm(); } } catch (Exception e) {} //warn - finally {} //warn + finally {} } }; } diff --git a/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule485annotations/InputAnnotationLocation.java b/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule485annotations/InputAnnotationLocation.java index 4d97799e8..78cfb8241 100644 --- a/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule485annotations/InputAnnotationLocation.java +++ b/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule485annotations/InputAnnotationLocation.java @@ -21,7 +21,7 @@ class InputCorrectAnnotationIndentation public InputCorrectAnnotationIndentation() {} @MyAnnotationWithParam("foo") - @MyAnnotation2 void foo1() {} //warn + @MyAnnotation2 void foo1() {} @MyAnnotation1 @MyAnnotation2 //warn @@ -33,7 +33,7 @@ class InputCorrectAnnotationIndentation @MyAnnotation4 //warn class InnerClass { - @MyAnnotation2 @MyAnnotation1 //warn + @MyAnnotation2 @MyAnnotation1 public int a; @MyAnnotation1 public int b; @@ -60,7 +60,7 @@ class InputCorrectAnnotationIndentation } @MyAnnotation1 - @MyAnnotation2 //warn + @MyAnnotation2 InnerClass anon = new InnerClass() { @MyAnnotation2 @MyAnnotation1 public int a; diff --git a/src/it/resources/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/InputEmptyBlockCatch.java b/src/it/resources/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/InputEmptyBlockCatch.java index 00569a325..f5efc09f9 100644 --- a/src/it/resources/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/InputEmptyBlockCatch.java +++ b/src/it/resources/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/InputEmptyBlockCatch.java @@ -25,7 +25,7 @@ class Catch { if (!flag) { doSm(); } - } catch (Exception e) {} //warn + } catch (Exception e) {} finally {} //warn } @@ -46,7 +46,7 @@ class Catch { if (!flag) { doSm(); } - } catch (Exception e) {} //warn + } catch (Exception e) {} finally {} //warn } } @@ -68,7 +68,7 @@ class Catch { if (!flag) { doSm(); } - } catch (Exception e) {} //warn + } catch (Exception e) {} finally {} //warn } }; diff --git a/src/it/resources/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/InputIncorrectAtClauseOrderCheck.java b/src/it/resources/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/InputIncorrectAtClauseOrderCheck.java index 83d4bae7c..9ca960da2 100644 --- a/src/it/resources/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/InputIncorrectAtClauseOrderCheck.java +++ b/src/it/resources/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/InputIncorrectAtClauseOrderCheck.java @@ -6,10 +6,10 @@ import java.io.Serializable; * Some javadoc. * * @since Some javadoc. - * @version 1.0 //warn //warn + * @version 1.0 * @deprecated Some javadoc. - * @see Some javadoc. //warn - * @author max //warn + * @see Some javadoc. + * @author max */ class WithAnnotations12 implements Serializable { diff --git a/src/it/resources/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/InputJavaDocTagContinuationIndentation.java b/src/it/resources/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/InputJavaDocTagContinuationIndentation.java index e1b1ecb61..281f11c25 100644 --- a/src/it/resources/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/InputJavaDocTagContinuationIndentation.java +++ b/src/it/resources/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/InputJavaDocTagContinuationIndentation.java @@ -280,7 +280,7 @@ class JavaDocTagContinuationIndentation implements Serializable /** * Some text. - * Some javadoc. // warn + * Some javadoc. * @param aString Some text. * Some javadoc. // warn * @return Some text. |