diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/naming/BooleanMethodNameMustStartWithQuestionInspectionBase.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/naming/BooleanMethodNameMustStartWithQuestionInspectionBase.java index d0ce6de63884..6bd74419d834 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/naming/BooleanMethodNameMustStartWithQuestionInspectionBase.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/naming/BooleanMethodNameMustStartWithQuestionInspectionBase.java @@ -43,8 +43,9 @@ public class BooleanMethodNameMustStartWithQuestionInspectionBase extends BaseIn /** * @noinspection PublicField */ - @NonNls public String questionString = "is,can,has,should,could,will,shall,check,contains,equals,add,put,remove,startsWith,endsWith";List - questionList = new ArrayList(32); + @NonNls public String questionString = + "add,are,can,check,contains,could,endsWith,equals,has,is,matches,must,put,remove,shall,should,startsWith,was,were,will,would"; + List questionList = new ArrayList(32); public BooleanMethodNameMustStartWithQuestionInspectionBase() { parseString(questionString, questionList); diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/naming/NonBooleanMethodNameMayNotStartWithQuestionInspectionBase.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/naming/NonBooleanMethodNameMayNotStartWithQuestionInspectionBase.java index 80d9fbb7fc1f..2eefa678699d 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/naming/NonBooleanMethodNameMayNotStartWithQuestionInspectionBase.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/naming/NonBooleanMethodNameMayNotStartWithQuestionInspectionBase.java @@ -40,7 +40,8 @@ public class NonBooleanMethodNameMayNotStartWithQuestionInspectionBase extends B /** * @noinspection PublicField */ - @NonNls public String questionString = "is,can,has,should,could,will,shall,check,contains,equals,startsWith,endsWith"; + @NonNls public String questionString = + "add,are,can,check,contains,could,endsWith,equals,has,is,matches,must,put,remove,shall,should,startsWith,was,were,will,would"; @SuppressWarnings({"PublicField"}) public boolean ignoreBooleanMethods = false; @SuppressWarnings({"PublicField"}) diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/naming/boolean_method_name_must_start_with_question/BooleanMethodNameMustStartWithQuestion.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/naming/boolean_method_name_must_start_with_question/BooleanMethodNameMustStartWithQuestion.java new file mode 100644 index 000000000000..926c83379900 --- /dev/null +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/naming/boolean_method_name_must_start_with_question/BooleanMethodNameMustStartWithQuestion.java @@ -0,0 +1,10 @@ +class BooleanMethodNameMustStartWithQuestion { + + public boolean areYouAllRight() { + return true; + } + + public boolean setup() { + return false; + } +} \ No newline at end of file diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/naming/BooleanMethodNameMustStartWithQuestionInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/naming/BooleanMethodNameMustStartWithQuestionInspectionTest.java new file mode 100644 index 000000000000..42681485f68f --- /dev/null +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/naming/BooleanMethodNameMustStartWithQuestionInspectionTest.java @@ -0,0 +1,37 @@ +/* + * Copyright 2000-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.siyeh.ig.naming; + +import com.intellij.codeInspection.InspectionProfileEntry; +import com.siyeh.ig.LightInspectionTestCase; +import junit.framework.TestCase; +import org.jetbrains.annotations.Nullable; + +/** + * @author Bas Leijdekkers + */ +public class BooleanMethodNameMustStartWithQuestionInspectionTest extends LightInspectionTestCase { + + public void testBooleanMethodNameMustStartWithQuestion() { + doTest(); + } + + @Nullable + @Override + protected InspectionProfileEntry getInspection() { + return new BooleanMethodNameMustStartWithQuestionInspection(); + } +} \ No newline at end of file