diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/AvoidStarImport.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/AvoidStarImport.java index 2b0fc93f1..9e846a2a9 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/AvoidStarImport.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/AvoidStarImport.java @@ -1,17 +1,37 @@ -/* - * Created by IntelliJ IDEA. - * User: oliver.burn - * Date: 13/09/2002 - * Time: 22:23:58 - * To change template for new class use - * Code Style | Class Templates options (Tools | IDE Options). +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2002 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.JavaTokenTypes; +import com.puppycrawl.tools.checkstyle.api.DetailAST; + +/** + * Check that finds import statement that use the * notation. + *
+ * Rationale: Importing all classes from a package leads to tight coupling between + * packages and might lead to problems when a new version of a library introduces + * name clashes. + * + * @author Oliver Burn + * @version $Id: AvoidStarImport.java,v 1.2 2002-09-15 16:55:59 lkuehne Exp $ */ -package visitor.checks; - -import visitor.checks.ImportCheck; -import visitor.JavaTokenTypes; -import visitor.DetailAST; - public class AvoidStarImport extends ImportCheck { public int[] getDefaultTokens() @@ -19,7 +39,7 @@ public class AvoidStarImport extends ImportCheck return new int[] {JavaTokenTypes.IMPORT}; } - public void visitToken(DetailAST aAST) + public void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST aAST) { final String name = getImportText(aAST); if ((name != null) && name.endsWith(".*")) { diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/EmptyBlockCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/EmptyBlockCheck.java index c1d877b5f..af45a0cd5 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/EmptyBlockCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/EmptyBlockCheck.java @@ -1,19 +1,30 @@ -/* - * Created by IntelliJ IDEA. - * User: lk - * Date: Sep 15, 2002 - * Time: 8:32:39 AM - * To change template for new class use - * Code Style | Class Templates options (Tools | IDE Options). - */ -package visitor.checks; +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2002 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 java.util.Set; import java.util.HashSet; -import visitor.api.Check; -import visitor.DetailAST; -import visitor.JavaTokenTypes; +import com.puppycrawl.tools.checkstyle.api.Check; +import com.puppycrawl.tools.checkstyle.api.DetailAST; +import com.puppycrawl.tools.checkstyle.JavaTokenTypes; public class EmptyBlockCheck extends Check { diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ImportCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ImportCheck.java index 98b0b0e95..86c04b935 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ImportCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ImportCheck.java @@ -1,17 +1,31 @@ -/* - * Created by IntelliJ IDEA. - * User: oliver.burn - * Date: 13/09/2002 - * Time: 20:26:30 - * To change template for new class use - * Code Style | Class Templates options (Tools | IDE Options). +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2002 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.Check; +import com.puppycrawl.tools.checkstyle.api.DetailAST; +import com.puppycrawl.tools.checkstyle.JavaTokenTypes; + +/** + * Abstract */ -package visitor.checks; - -import visitor.api.Check; -import visitor.DetailAST; -import visitor.JavaTokenTypes; - public abstract class ImportCheck extends Check { diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ModifierCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ModifierCheck.java index 325dd814f..8fc1dfa79 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ModifierCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ModifierCheck.java @@ -1,23 +1,33 @@ -/* - * Created by IntelliJ IDEA. - * User: oliver.burn - * Date: 14/09/2002 - * Time: 09:51:28 - * To change template for new class use - * Code Style | Class Templates options (Tools | IDE Options). - */ -package visitor.checks; +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2002 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 antlr.collections.AST; -import java.util.Map; import java.util.List; import java.util.ArrayList; import java.util.Iterator; -import visitor.api.Check; -import visitor.JavaTokenTypes; -import visitor.DetailAST; +import com.puppycrawl.tools.checkstyle.api.Check; +import com.puppycrawl.tools.checkstyle.JavaTokenTypes; +import com.puppycrawl.tools.checkstyle.api.DetailAST; public class ModifierCheck extends Check { diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/SimplifyBooleanReturnCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/SimplifyBooleanReturnCheck.java index f14e18aad..c23433f17 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/SimplifyBooleanReturnCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/SimplifyBooleanReturnCheck.java @@ -1,18 +1,33 @@ -/* - * Created by IntelliJ IDEA. - * User: lk - * Date: Sep 14, 2002 - * Time: 3:13:55 PM - * To change template for new class use - * Code Style | Class Templates options (Tools | IDE Options). - */ -package visitor.checks; +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2002 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 antlr.collections.AST; -import visitor.api.Check; -import visitor.JavaTokenTypes; -import visitor.DetailAST; +import com.puppycrawl.tools.checkstyle.api.Check; +import com.puppycrawl.tools.checkstyle.JavaTokenTypes; +import com.puppycrawl.tools.checkstyle.api.DetailAST; + +/** + * Checks for overly complicated return + */ public class SimplifyBooleanReturnCheck extends Check { public int[] getDefaultTokens() diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/UnusedImportsCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/UnusedImportsCheck.java index ba793edb1..e27f81d51 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/UnusedImportsCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/UnusedImportsCheck.java @@ -1,16 +1,27 @@ -/* - * Created by IntelliJ IDEA. - * User: oliver.burn - * Date: 13/09/2002 - * Time: 23:04:45 - * To change template for new class use - * Code Style | Class Templates options (Tools | IDE Options). - */ -package visitor.checks; +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2002 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 +//////////////////////////////////////////////////////////////////////////////// -import visitor.checks.ImportCheck; -import visitor.JavaTokenTypes; -import visitor.DetailAST; +package com.puppycrawl.tools.checkstyle.checks; + +import com.puppycrawl.tools.checkstyle.checks.ImportCheck; +import com.puppycrawl.tools.checkstyle.JavaTokenTypes; +import com.puppycrawl.tools.checkstyle.api.DetailAST; import java.util.HashSet; import java.util.Set; diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/WhitespaceAroundCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/WhitespaceAroundCheck.java index 6dc8c91a3..a5c662924 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/WhitespaceAroundCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/WhitespaceAroundCheck.java @@ -1,18 +1,27 @@ -/* - * Created by IntelliJ IDEA. - * User: oliver.burn - * Date: 14/09/2002 - * Time: 11:55:01 - * To change template for new class use - * Code Style | Class Templates options (Tools | IDE Options). - */ -package visitor.checks; +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2002 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 +//////////////////////////////////////////////////////////////////////////////// -import visitor.api.Check; -import visitor.JavaTokenTypes; -import visitor.DetailAST; +package com.puppycrawl.tools.checkstyle.checks; -import java.util.Map; +import com.puppycrawl.tools.checkstyle.api.Check; +import com.puppycrawl.tools.checkstyle.JavaTokenTypes; +import com.puppycrawl.tools.checkstyle.api.DetailAST; public class WhitespaceAroundCheck extends Check {