hiddenstaticmethodtest.java

来自「Checkstyle 可寻找:·不能使用的或者多余的输入 ·空格更好的地方不使用」· Java 代码 · 共 23 行

JAVA
23
字号
package com.puppycrawl.tools.checkstyle.bcel.checks;

import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
import com.puppycrawl.tools.checkstyle.bcel.BcelCheckTestCase;

public class HiddenStaticMethodTest
    extends BcelCheckTestCase
{
    public void testIt()
            throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(HiddenStaticMethodCheck.class);

        final String[] expected = {
            "0: Static method 'public static int staticMethod()' hides method in class 'com.puppycrawl.tools.checkstyle.bcel.checks.SuperClass'.",
            "0: Static method 'public static int staticMethodSameParamName(int i)' hides method in class 'com.puppycrawl.tools.checkstyle.bcel.checks.SuperClass'.",
            "0: Static method 'public static int staticMethodSameParamType(int x)' hides method in class 'com.puppycrawl.tools.checkstyle.bcel.checks.SuperClass'.",
        };
        verify(checkConfig, getPath("com\\puppycrawl\\tools\\checkstyle\\bcel\\checks\\SubClass.class"), expected);
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?