From 6fc4ae2d4f85288769cdb13e9cd9ee39fba74143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20K=C3=BChne?= Date: Wed, 22 Sep 2004 18:52:23 +0000 Subject: [PATCH] converted DOS to Unix Linefeeds (bug #1032634) --- .../checks/RequiredRegexpCheck.java | 144 +++++++++--------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/RequiredRegexpCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/RequiredRegexpCheck.java index b45a0ef9a..a5ac4b9df 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/RequiredRegexpCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/RequiredRegexpCheck.java @@ -1,72 +1,72 @@ -//////////////////////////////////////////////////////////////////////////////// -// checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2004 Oliver Burn -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//////////////////////////////////////////////////////////////////////////////// -package com.puppycrawl.tools.checkstyle.checks; - -import com.puppycrawl.tools.checkstyle.api.DetailAST; -import org.apache.regexp.RE; - - -/** - *

- * A check that makes sure that a specified pattern exists in the code. - *

- *

- * An example of how to configure the check to make sure a copyright statement - * is included in the file (but without requirements on where in the file - * it should be): - *

- *
- * <module name="RequiredRegexp">
- *    <property name="format" value="This code is copyrighted"/>
- * </module>
- * 
- * @author Daniel Grenner - */ -public class RequiredRegexpCheck extends AbstractFormatCheck -{ - /** - * Instantiates an new GenericIllegalRegexpCheck. - */ - public RequiredRegexpCheck() - { - super("$^"); // the empty language - } - - /** @see com.puppycrawl.tools.checkstyle.api.Check */ - public int[] getDefaultTokens() - { - return new int[0]; - } - - /** @see com.puppycrawl.tools.checkstyle.api.Check */ - public void beginTree(DetailAST aRootAST) - { - final RE regexp = getRegexp(); - final String[] lines = getLines(); - for (int i = 0; i < lines.length; i++) { - - final String line = lines[i]; - if (regexp.match(line)) { - return; - } - } - log(0, "required.regexp", getFormat()); - } -} - +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2004 Oliver Burn +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//////////////////////////////////////////////////////////////////////////////// +package com.puppycrawl.tools.checkstyle.checks; + +import com.puppycrawl.tools.checkstyle.api.DetailAST; +import org.apache.regexp.RE; + + +/** + *

+ * A check that makes sure that a specified pattern exists in the code. + *

+ *

+ * An example of how to configure the check to make sure a copyright statement + * is included in the file (but without requirements on where in the file + * it should be): + *

+ *
+ * <module name="RequiredRegexp">
+ *    <property name="format" value="This code is copyrighted"/>
+ * </module>
+ * 
+ * @author Daniel Grenner + */ +public class RequiredRegexpCheck extends AbstractFormatCheck +{ + /** + * Instantiates an new GenericIllegalRegexpCheck. + */ + public RequiredRegexpCheck() + { + super("$^"); // the empty language + } + + /** @see com.puppycrawl.tools.checkstyle.api.Check */ + public int[] getDefaultTokens() + { + return new int[0]; + } + + /** @see com.puppycrawl.tools.checkstyle.api.Check */ + public void beginTree(DetailAST aRootAST) + { + final RE regexp = getRegexp(); + final String[] lines = getLines(); + for (int i = 0; i < lines.length; i++) { + + final String line = lines[i]; + if (regexp.match(line)) { + return; + } + } + log(0, "required.regexp", getFormat()); + } +} +