当前位置: 首页>>代码示例>>Java>>正文


Java InspectionGadgetsFix.EMPTY_ARRAY属性代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:SuppressionAnnotationInspection.java

示例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};
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:UnusedCatchParameterInspection.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:EmptyClassInspectionBase.java

示例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()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:AddToIgnoreIfAnnotatedByListQuickFix.java


注:本文中的com.siyeh.ig.InspectionGadgetsFix.EMPTY_ARRAY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。