本文整理汇总了Java中com.siyeh.ig.psiutils.LibraryUtil.isOverrideOfLibraryMethod方法的典型用法代码示例。如果您正苦于以下问题:Java LibraryUtil.isOverrideOfLibraryMethod方法的具体用法?Java LibraryUtil.isOverrideOfLibraryMethod怎么用?Java LibraryUtil.isOverrideOfLibraryMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.siyeh.ig.psiutils.LibraryUtil
的用法示例。
在下文中一共展示了LibraryUtil.isOverrideOfLibraryMethod方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(PsiMethod method) {
super.visitMethod(method);
if (!TestNGUtil.hasTest(method)) {
return;
}
final PsiIdentifier nameIdentifier = method.getNameIdentifier();
if (nameIdentifier == null) {
return;
}
final String name = method.getName();
if (isValid(name)) {
return;
}
if (!isOnTheFly() && MethodUtils.hasSuper(method)) {
return;
}
if (LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
registerMethodError(method, name);
}
示例2: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(PsiMethod method) {
super.visitMethod(method);
if (!TestUtils.isJUnit4TestMethod(method) || !TestUtils.isRunnable(method)) {
return;
}
final PsiIdentifier nameIdentifier = method.getNameIdentifier();
if (nameIdentifier == null) {
return;
}
final String name = method.getName();
if (isValid(name)) {
return;
}
if (!isOnTheFly() && MethodUtils.hasSuper(method)) {
return;
}
if (LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
registerMethodError(method, name);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:JUnit4MethodNamingConventionInspectionBase.java
示例3: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(PsiMethod method) {
super.visitMethod(method);
if (!TestUtils.isJUnit3TestMethod(method) || !TestUtils.isRunnable(method)) {
return;
}
final PsiIdentifier nameIdentifier = method.getNameIdentifier();
if (nameIdentifier == null) {
return;
}
final String name = method.getName();
if (isValid(name)) {
return;
}
if (!isOnTheFly() && MethodUtils.hasSuper(method)) {
return;
}
if (LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
registerMethodError(method, name);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:JUnit3MethodNamingConventionInspectionBase.java
示例4: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(@NotNull PsiMethod method) {
super.visitMethod(method);
if (method.isConstructor()) {
return;
}
if (!method.hasModifierProperty(PsiModifier.NATIVE)) {
return;
}
final PsiIdentifier nameIdentifier = method.getNameIdentifier();
if (nameIdentifier == null) {
return;
}
final String name = method.getName();
if (isValid(name)) {
return;
}
if (!isOnTheFly() && MethodUtils.hasSuper(method)) {
return;
}
if (LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
registerMethodError(method, name);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:NativeMethodNamingConventionInspectionBase.java
示例5: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(@NotNull PsiMethod method) {
super.visitMethod(method);
if (ignorePrivateMethodsAndFields &&
method.hasModifierProperty(PsiModifier.PRIVATE)) {
return;
}
if (isOnTheFly() && !isCheapEnoughToSearch(method)) {
return;
}
final PsiType type = method.getReturnType();
if (!CollectionUtils.isConcreteCollectionClass(type) || LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
checkToWeaken(type, method.getReturnTypeElement(), method);
}
示例6: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(PsiMethod method) {
super.visitMethod(method);
final PsiType returnType = method.getReturnType();
if (!isObsoleteCollectionType(returnType)) {
return;
}
if (LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
final PsiTypeElement typeElement = method.getReturnTypeElement();
if (typeElement == null) {
return;
}
if (ignoreRequiredObsoleteCollectionTypes &&
isUsedAsParameterForLibraryMethod(method)) {
return;
}
registerError(typeElement);
}
示例7: visitTypeElement
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitTypeElement(PsiTypeElement typeElement) {
if (!isNewDateTimeApiPresent(typeElement)) {
return;
}
super.visitTypeElement(typeElement);
final PsiType type = typeElement.getType();
if (!isObsoleteDateTimeType(type)) {
return;
}
final PsiElement parent = typeElement.getParent();
if (parent instanceof PsiMethod) {
final PsiMethod method = (PsiMethod)parent;
if (LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
}
else if (parent instanceof PsiParameter) {
final PsiParameter parameter = (PsiParameter)parent;
if (LibraryUtil.isOverrideOfLibraryMethodParameter(parameter)) {
return;
}
}
registerError(typeElement);
}
示例8: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(@NotNull PsiMethod method) {
super.visitMethod(method);
if (ignoreLibraryOverrides && LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
final PsiReferenceList throwsList = method.getThrowsList();
final PsiJavaCodeReferenceElement[] references = throwsList.getReferenceElements();
for (PsiJavaCodeReferenceElement reference : references) {
final PsiElement element = reference.resolve();
if (!(element instanceof PsiClass)) {
continue;
}
final PsiClass thrownClass = (PsiClass)element;
final String qualifiedName = thrownClass.getQualifiedName();
if (qualifiedName != null && exceptions.contains(qualifiedName)) {
registerError(reference, reference);
}
}
}
示例9: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(@NotNull PsiMethod method) {
// note: no call to super
if (method.getNameIdentifier() == null) {
return;
}
if (method.isConstructor()) {
return;
}
final PsiParameterList parameterList = method.getParameterList();
final int parametersCount = parameterList.getParametersCount();
if (parametersCount <= getLimit()) {
return;
}
if (LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
registerMethodError(method, Integer.valueOf(parametersCount));
}
示例10: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(@NotNull PsiMethod method) {
super.visitMethod(method);
if (method.isConstructor() || method.hasModifierProperty(PsiModifier.STATIC)) {
return;
}
final PsiIdentifier nameIdentifier = method.getNameIdentifier();
if (nameIdentifier == null) {
return;
}
final String name = method.getName();
if (isValid(name)) {
return;
}
if (!isOnTheFly()) {
if (MethodUtils.hasSuper(method)) {
return;
}
}
if (LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
registerMethodError(method, name);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:InstanceMethodNamingConventionInspection.java
示例11: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(@NotNull PsiMethod method)
{
super.visitMethod(method);
if(ignorePrivateMethodsAndFields && method.hasModifierProperty(PsiModifier.PRIVATE))
{
return;
}
if(isOnTheFly() && DeclarationSearchUtils.isTooExpensiveToSearch(method, false))
{
return;
}
final PsiType type = method.getReturnType();
if(!CollectionUtils.isConcreteCollectionClass(type) || LibraryUtil.isOverrideOfLibraryMethod(method))
{
return;
}
checkToWeaken(type, method.getReturnTypeElement(), method);
}
示例12: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(@NotNull PsiMethod method) {
final PsiType returnType = method.getReturnType();
if (returnType == null) {
return;
}
else if (!returnType.equals(PsiType.BOOLEAN)) {
if (ignoreBooleanMethods || !returnType.equalsToText(CommonClassNames.JAVA_LANG_BOOLEAN)) {
return;
}
}
if (ignoreInAnnotationInterface) {
final PsiClass containingClass = method.getContainingClass();
if (containingClass != null && containingClass.isAnnotationType()) {
return;
}
}
final String name = method.getName();
for (String question : questionList) {
if (name.startsWith(question)) {
return;
}
}
if (onlyWarnOnBaseMethods) {
if (MethodUtils.hasSuper(method)) {
return;
}
}
else if (LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
registerMethodError(method);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:BooleanMethodNameMustStartWithQuestionInspectionBase.java
示例13: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(@NotNull PsiMethod method) {
super.visitMethod(method);
final PsiType returnType = method.getReturnType();
if (returnType == null || returnType.equals(PsiType.BOOLEAN)) {
return;
}
if (ignoreBooleanMethods && returnType.equalsToText(CommonClassNames.JAVA_LANG_BOOLEAN)) {
return;
}
final String name = method.getName();
boolean startsWithQuestionWord = false;
for (String question : questionList) {
if (name.startsWith(question)) {
if (name.length() == question.length()) {
startsWithQuestionWord = true;
break;
}
final char nextChar = name.charAt(question.length());
if (Character.isUpperCase(nextChar) || nextChar == '_') {
startsWithQuestionWord = true;
break;
}
}
}
if (!startsWithQuestionWord) {
return;
}
if (onlyWarnOnBaseMethods) {
if (MethodUtils.hasSuper(method)) {
return;
}
}
else if (LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
registerMethodError(method);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:NonBooleanMethodNameMayNotStartWithQuestionInspectionBase.java
示例14: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(@NotNull PsiMethod method) {
super.visitMethod(method);
if (method.isConstructor() || method.hasModifierProperty(PsiModifier.STATIC)) {
return;
}
if (method.hasModifierProperty(PsiModifier.NATIVE) && isInspectionEnabled("NativeMethodNamingConvention", method)) {
return;
}
final PsiIdentifier nameIdentifier = method.getNameIdentifier();
if (nameIdentifier == null) {
return;
}
if (TestUtils.isRunnable(method)) {
if (TestUtils.isJUnit4TestMethod(method) && isInspectionEnabled("JUnit4MethodNamingConvention", method)) {
return;
}
if (TestUtils.isJUnit3TestMethod(method) && isInspectionEnabled("JUnit3MethodNamingConvention", method)) {
return;
}
}
if (isTestNGTestMethod(method) && isInspectionEnabled("TestNGMethodNamingConvention", method)) {
return;
}
final String name = method.getName();
if (isValid(name)) {
return;
}
if (!isOnTheFly() && MethodUtils.hasSuper(method)) {
return;
}
if (LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
registerMethodError(method, name);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:InstanceMethodNamingConventionInspectionBase.java
示例15: visitMethod
import com.siyeh.ig.psiutils.LibraryUtil; //导入方法依赖的package包/类
@Override
public void visitMethod(PsiMethod method) {
super.visitMethod(method);
if (!method.hasModifierProperty(PsiModifier.PUBLIC)) {
final PsiClass aClass = method.getContainingClass();
if (aClass == null || !aClass.isInterface()) {
return;
}
}
if (PropertyUtil.isSimpleSetter(method) || LibraryUtil.isOverrideOfLibraryMethod(method)) {
return;
}
final PsiParameterList parameterList = method.getParameterList();
final PsiParameter[] parameters = parameterList.getParameters();
int count = 0;
for (PsiParameter parameter : parameters) {
final PsiType type = parameter.getType();
if (!PsiPrimitiveType.BOOLEAN.equals(type)) {
continue;
}
count++;
if (count > 1) {
break;
}
}
if (count == 0 || onlyReportMultiple && count == 1) {
return;
}
registerMethodError(method, method, Integer.valueOf(count));
}