本文整理汇总了Java中com.siyeh.ig.InspectionGadgetsFix.EMPTY_ARRAY属性的典型用法代码示例。如果您正苦于以下问题:Java InspectionGadgetsFix.EMPTY_ARRAY属性的具体用法?Java InspectionGadgetsFix.EMPTY_ARRAY怎么用?Java InspectionGadgetsFix.EMPTY_ARRAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.siyeh.ig.InspectionGadgetsFix
的用法示例。
在下文中一共展示了InspectionGadgetsFix.EMPTY_ARRAY属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildFixes
@Override
@NotNull
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
final PsiMethodCallExpression methodCallExpression = (PsiMethodCallExpression)infos[0];
final PsiClass callClass = ClassUtils.getContainingClass(methodCallExpression);
final PsiMethod method = methodCallExpression.resolveMethod();
if (method == null) {
return InspectionGadgetsFix.EMPTY_ARRAY;
}
final PsiClass containingClass = method.getContainingClass();
if (containingClass == null || !containingClass.equals(callClass) || MethodUtils.isOverridden(method)) {
return InspectionGadgetsFix.EMPTY_ARRAY;
}
final String methodName = method.getName();
return new InspectionGadgetsFix[]{
new MakeClassFinalFix(containingClass),
new MakeMethodFinalFix(methodName)
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:OverridableMethodCallDuringObjectConstructionInspection.java
示例2: buildFixes
@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
final boolean suppressionIdPresent = ((Boolean)infos[1]).booleanValue();
if (infos[0] instanceof PsiAnnotation) {
final PsiAnnotation annotation = (PsiAnnotation)infos[0];
return suppressionIdPresent
? new InspectionGadgetsFix[]{new DelegatingFix(new RemoveAnnotationQuickFix(annotation, null)), new AllowSuppressionsFix()}
: new InspectionGadgetsFix[]{new DelegatingFix(new RemoveAnnotationQuickFix(annotation, null))};
} else if (infos[0] instanceof PsiComment) {
return suppressionIdPresent
? new InspectionGadgetsFix[]{new RemoveSuppressCommentFix(), new AllowSuppressionsFix()}
: new InspectionGadgetsFix[]{new RemoveSuppressCommentFix()};
}
return InspectionGadgetsFix.EMPTY_ARRAY;
}
示例3: buildFixes
@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
final boolean namedIgnoreButUsed = ((Boolean)infos[0]).booleanValue();
final PsiElement context = (PsiElement)infos[1];
final InspectionGadgetsFix fix = SuppressForTestsScopeFix.build(this, context);
if (namedIgnoreButUsed) {
if (fix == null) {
return InspectionGadgetsFix.EMPTY_ARRAY;
}
return new InspectionGadgetsFix[] {fix};
}
final RenameFix renameFix = new RenameFix("ignored", false, false);
if (fix == null) {
return new InspectionGadgetsFix[] {renameFix};
}
return new InspectionGadgetsFix[] {renameFix, fix};
}
示例4: buildFixes
@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
final Object info = infos[0];
if (!(info instanceof PsiModifierListOwner)) {
return InspectionGadgetsFix.EMPTY_ARRAY;
}
return AddToIgnoreIfAnnotatedByListQuickFix.build((PsiModifierListOwner)info, ignorableAnnotations);
}
示例5: build
public static InspectionGadgetsFix[] build(PsiModifierListOwner modifierListOwner, List<String> configurationList) {
final List<InspectionGadgetsFix> fixes = build(modifierListOwner, configurationList, new ArrayList());
return fixes.isEmpty() ? InspectionGadgetsFix.EMPTY_ARRAY : fixes.toArray(new InspectionGadgetsFix[fixes.size()]);
}