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


Java DelegatingFix类代码示例

本文整理汇总了Java中com.siyeh.ig.DelegatingFix的典型用法代码示例。如果您正苦于以下问题:Java DelegatingFix类的具体用法?Java DelegatingFix怎么用?Java DelegatingFix使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DelegatingFix类属于com.siyeh.ig包,在下文中一共展示了DelegatingFix类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildFixes

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@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,代码行数:17,代码来源:SuppressionAnnotationInspection.java

示例2: buildFix

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
@Nullable
protected InspectionGadgetsFix buildFix(Object... infos) {
  final PsiElement elt = (PsiElement)infos[0];
  if (!AnnotationUtil.isAnnotatingApplicable(elt)) {
    return null;
  }

  if (PsiTreeUtil.getParentOfType(elt, PsiMethod.class, PsiLambdaExpression.class) instanceof PsiLambdaExpression) {
    return null;
  }

  final NullableNotNullManager manager = NullableNotNullManager.getInstance(elt.getProject());
  return new DelegatingFix(new AnnotateMethodFix(
    manager.getDefaultNullable(),
    ArrayUtil.toStringArray(manager.getNotNulls())){
    @Override
    public int shouldAnnotateBaseMethod(PsiMethod method, PsiMethod superMethod, Project project) {
      return ReturnNullInspectionBase.this.shouldAnnotateBaseMethod(method, superMethod);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ReturnNullInspectionBase.java

示例3: buildFix

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
@Nullable
protected InspectionGadgetsFix buildFix(Object... infos) {
  final PsiElement elt = (PsiElement)infos[0];
  if (!AnnotationUtil.isAnnotatingApplicable(elt)) {
    return null;
  }
  final NullableNotNullManager manager =
    NullableNotNullManager.getInstance(elt.getProject());
  return new DelegatingFix(new AnnotateMethodFix(
    manager.getDefaultNullable(),
    ArrayUtil.toStringArray(manager.getNotNulls())){
    @Override
    public int shouldAnnotateBaseMethod(PsiMethod method, PsiMethod superMethod, Project project) {
      return ReturnNullInspectionBase.this.shouldAnnotateBaseMethod(method, superMethod);
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:ReturnNullInspectionBase.java

示例4: buildFix

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
protected InspectionGadgetsFix buildFix(Object... infos) {
  final PsiMethod constructor = (PsiMethod)infos[1];
  if (constructor == null) {
    final PsiClass aClass = (PsiClass)infos[0];
    if (aClass instanceof PsiAnonymousClass) {
      // can't create constructor for anonymous class
      return null;
    }
    return new DelegatingFix(new AddDefaultConstructorFix(aClass, PsiModifier.PUBLIC));
  }
  else {
    return new MakeConstructorPublicFix();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ExternalizableWithoutPublicNoArgConstructorInspection.java

示例5: buildFix

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
protected InspectionGadgetsFix buildFix(Object... infos) {
  final Object info = infos[0];
  if (!(info instanceof PsiReferenceExpression)) {
    return null;
  }
  final PsiElement target = ((PsiReferenceExpression)info).resolve();
  if (!(target instanceof PsiVariable)) {
    return null;
  }
  final NullableNotNullManager manager = NullableNotNullManager.getInstance(target.getProject());
  return new DelegatingFix(new AddAnnotationPsiFix(manager.getDefaultNullable(), (PsiVariable)target,PsiNameValuePair.EMPTY_ARRAY));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AssignmentToNullInspection.java

示例6: buildFix

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Nullable
@Override
protected InspectionGadgetsFix buildFix(Object... infos) {
  return new DelegatingFix(new AnnotateMethodFix("org.junit.Test"){
    @Override
    public int shouldAnnotateBaseMethod(PsiMethod method, PsiMethod superMethod, Project project) {
      return 1;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JUnit3StyleTestMethodInJUnit4ClassInspection.java

示例7: build

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
public static List<InspectionGadgetsFix> build(final PsiModifierListOwner modifierListOwner,
                                               final List<String> configurationList,
                                               final List<InspectionGadgetsFix> fixes) {
  SpecialAnnotationsUtilBase.createAddToSpecialAnnotationFixes(modifierListOwner, new Processor<String>() {
    @Override
    public boolean process(String qualifiedName) {
      fixes.add(new DelegatingFix(SpecialAnnotationsUtilBase.createAddToSpecialAnnotationsListQuickFix(
        InspectionGadgetsBundle.message("add.0.to.ignore.if.annotated.by.list.quickfix", qualifiedName),
        QuickFixBundle.message("fix.add.special.annotation.family"),
        configurationList, qualifiedName, modifierListOwner)));
      return true;
    }
  });
  return fixes;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:AddToIgnoreIfAnnotatedByListQuickFix.java

示例8: buildFix

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
@Nullable
protected InspectionGadgetsFix buildFix(Object... infos) {
  final PsiReferenceExpression methodExpression =
    (PsiReferenceExpression)infos[0];
  final PsiModifierListOwner annotatableQualifier =
    NonNlsUtils.getAnnotatableQualifier(
      methodExpression);
  if (annotatableQualifier == null) {
    return null;
  }
  return new DelegatingFix(new AddAnnotationPsiFix(
    AnnotationUtil.NON_NLS, annotatableQualifier,PsiNameValuePair.EMPTY_ARRAY));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:StringToUpperWithoutLocaleInspection.java

示例9: buildFix

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
protected InspectionGadgetsFix buildFix(Object... infos) {
  final Object info = infos[0];
  if (!(info instanceof PsiReferenceExpression)) {
    return null;
  }
  final PsiElement target = ((PsiReferenceExpression)info).resolve();
  if (!(target instanceof PsiVariable)) {
    return null;
  }
  final NullableNotNullManager manager = NullableNotNullManager.getInstance(target.getProject());
  return new DelegatingFix(new AddAnnotationFix(manager.getDefaultNullable(), (PsiVariable)target));
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:14,代码来源:AssignmentToNullInspection.java

示例10: build

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
public static List<InspectionGadgetsFix> build(final PsiModifierListOwner modifierListOwner, final List<String> configurationList, final List<InspectionGadgetsFix> fixes)
{
	SpecialAnnotationsUtilBase.createAddToSpecialAnnotationFixes(modifierListOwner, new Processor<String>()
	{
		@Override
		public boolean process(String qualifiedName)
		{
			fixes.add(new DelegatingFix(SpecialAnnotationsUtilBase.createAddToSpecialAnnotationsListQuickFix(InspectionGadgetsBundle.message("add.0.to.ignore.if.annotated.by.list.quickfix",
					qualifiedName), JavaQuickFixBundle.message("fix.add.special.annotation.family"), configurationList, qualifiedName, modifierListOwner)));
			return true;
		}
	});
	return fixes;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:15,代码来源:AddToIgnoreIfAnnotatedByListQuickFix.java

示例11: buildFix

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
@Nullable
protected InspectionGadgetsFix buildFix(Object... infos) {
  final PsiElement elt = (PsiElement)infos[0];
  if (!AnnotationUtil.isAnnotatingApplicable(elt)) {
    return null;
  }
  final NullableNotNullManager manager =
    NullableNotNullManager.getInstance(elt.getProject());
  return new DelegatingFix(new AnnotateMethodFix(
    manager.getDefaultNullable(),
    ArrayUtil.toStringArray(manager.getNotNulls())));
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:14,代码来源:ReturnNullInspection.java

示例12: buildFix

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
@Nullable
protected InspectionGadgetsFix buildFix(Object... infos) {
  final PsiReferenceExpression methodExpression =
    (PsiReferenceExpression)infos[0];
  final PsiModifierListOwner annotatableQualifier =
    NonNlsUtils.getAnnotatableQualifier(
      methodExpression);
  if (annotatableQualifier == null) {
    return null;
  }
  return new DelegatingFix(new AddAnnotationFix(
    AnnotationUtil.NON_NLS, annotatableQualifier));
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:15,代码来源:StringToUpperWithoutLocaleInspection.java

示例13: buildFix

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Nullable
@Override
protected InspectionGadgetsFix buildFix(Object... infos) {
  final PsiClass aClass = (PsiClass)infos[0];
  return new DelegatingFix(new AddAnnotationPsiFix(CommonClassNames.JAVA_LANG_FUNCTIONAL_INTERFACE, aClass, PsiNameValuePair.EMPTY_ARRAY));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:InterfaceMayBeAnnotatedFunctionalInspection.java

示例14: createMakeSerializableFix

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
public static InspectionGadgetsFix createMakeSerializableFix(PsiClass aClass) {
  final PsiClassType type = TypeUtils.getType(CommonClassNames.JAVA_IO_SERIALIZABLE, aClass);
  return new DelegatingFix(QuickFixFactory.getInstance().createExtendsListFix(aClass, type, true));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:DelegatingFixFactory.java

示例15: createMakeCloneableFix

import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
public static InspectionGadgetsFix createMakeCloneableFix(PsiClass aClass) {
  final PsiClassType type = TypeUtils.getType(CommonClassNames.JAVA_LANG_CLONEABLE, aClass);
  return new DelegatingFix(QuickFixFactory.getInstance().createExtendsListFix(aClass, type, true));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:DelegatingFixFactory.java


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