aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace
diff options
context:
space:
mode:
authorkazachka <kazachka@mail.ua>2016-11-12 21:32:39 +0300
committerRoman Ivanov <romani@users.noreply.github.com>2016-12-12 06:04:12 -0800
commit65fe91df6a9712f3ec7af2ed963867a50303b0e9 (patch)
treee3f9e20a58ea0611c5faf4b9727bed3f7190fbf8 /src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace
parentc2bbc9753b161924166715cd73f3d9839b8a5637 (diff)
downloadcheckstyle-65fe91df6a9712f3ec7af2ed963867a50303b0e9.tar.gz
Issue #3426: remove warning on PACKAGE_DEF preceded by javadoc not separated by line
Diffstat (limited to 'src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace')
-rw-r--r--src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparator.java15
-rw-r--r--src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test1/package-info.java5
-rw-r--r--src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test2/package-info.java6
-rw-r--r--src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test3/package-info.java7
-rw-r--r--src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test4/package-info.java7
5 files changed, 37 insertions, 3 deletions
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparator.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparator.java
index 679fb6587..52157b887 100644
--- a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparator.java
+++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparator.java
@@ -17,18 +17,21 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
////////////////////////////////////////////////////////////////////////////////
-package com.puppycrawl.tools.checkstyle.checks.whitespace;
+package com.puppycrawl.tools.checkstyle.checks.whitespace; //no violation: trainling comment
import java.io.Serializable;
-import java.util.ArrayList;
+import java.util.ArrayList; /*no violation: trailing comment*/
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.Collections;
+/* no violation: block comment after token*/
import com.oracle.net.Sdp;
+//no violation: single line comment after token
-import javax.swing.AbstractAction;
+import javax.swing.AbstractAction; /* no violation: no trailing comment
+*/
import org.apache.commons.beanutils.locale.converters.ByteLocaleConverter;
import org.apache.commons.beanutils.BasicDynaBean;
@@ -125,6 +128,12 @@ class InputEmptyLineSeparator
//empty
}
}
+
+
+ class SecondInnerClass {
+
+ private int intVariable;
+ }
}
class Class2{
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test1/package-info.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test1/package-info.java
new file mode 100644
index 000000000..717e51a82
--- /dev/null
+++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test1/package-info.java
@@ -0,0 +1,5 @@
+/*OK: for test allowing to place annotation before PACKAGE_DEF.*/
+@Deprecated
+package com.puppycrawl.tools.checkstyle.checks.whitespace.packageinfo.test1;
+
+import java.lang.Deprecated;
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test2/package-info.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test2/package-info.java
new file mode 100644
index 000000000..bb11990ea
--- /dev/null
+++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test2/package-info.java
@@ -0,0 +1,6 @@
+/**OK: for test allowing to place javadoc before PACKAGE_DEF.*/
+package com.puppycrawl.tools.checkstyle.checks.whitespace.packageinfo.test2;
+
+//that import is for doing check of PACKAGE_DEF,
+//because EmptyLineSeparatorCheck doesn't check last token
+import java.lang.System;
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test3/package-info.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test3/package-info.java
new file mode 100644
index 000000000..9551c295f
--- /dev/null
+++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test3/package-info.java
@@ -0,0 +1,7 @@
+/*violation: for test that there's warning when block comment isn't
+ separated from PACKAGE_DEF by line.*/
+package com.puppycrawl.tools.checkstyle.checks.whitespace.packageinfo.test3;
+
+//that import is for doing check of PACKAGE_DEF,
+//because EmptyLineSeparatorCheck doesn't check last token
+import java.lang.System;
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test4/package-info.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test4/package-info.java
new file mode 100644
index 000000000..0f4d20f38
--- /dev/null
+++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info/test4/package-info.java
@@ -0,0 +1,7 @@
+//for test there's warning when single line comment isn't separated from PACKAGE_DEF by line
+//violation is expected after this line
+package com.puppycrawl.tools.checkstyle.checks.whitespace.packageinfo.test4;
+
+//that import is for doing check of PACKAGE_DEF,
+//because EmptyLineSeparatorCheck doesn't check last token
+import java.lang.System;