Search in sources :

Example 1 with AddTypeCastFix

use of com.intellij.codeInsight.daemon.impl.quickfix.AddTypeCastFix in project intellij-community by JetBrains.

the class NullArgumentToVariableArgMethodInspection method buildFixes.

@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
    final PsiExpression argument = (PsiExpression) infos[0];
    final PsiType type1 = (PsiType) infos[1];
    final PsiType type2 = (PsiType) infos[2];
    return new InspectionGadgetsFix[] { new DelegatingFix(new AddTypeCastFix(type1, argument)), new DelegatingFix(new AddTypeCastFix(type2, argument)) };
}
Also used : DelegatingFix(com.siyeh.ig.DelegatingFix) AddTypeCastFix(com.intellij.codeInsight.daemon.impl.quickfix.AddTypeCastFix) InspectionGadgetsFix(com.siyeh.ig.InspectionGadgetsFix) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with AddTypeCastFix

use of com.intellij.codeInsight.daemon.impl.quickfix.AddTypeCastFix in project intellij-community by JetBrains.

the class PrimitiveArrayArgumentToVariableArgMethodInspection method buildFix.

@Nullable
@Override
protected InspectionGadgetsFix buildFix(Object... infos) {
    final PsiExpression argument = (PsiExpression) infos[0];
    final PsiType type = (PsiType) infos[1];
    return new DelegatingFix(new AddTypeCastFix(type, argument));
}
Also used : DelegatingFix(com.siyeh.ig.DelegatingFix) AddTypeCastFix(com.intellij.codeInsight.daemon.impl.quickfix.AddTypeCastFix) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

AddTypeCastFix (com.intellij.codeInsight.daemon.impl.quickfix.AddTypeCastFix)2 DelegatingFix (com.siyeh.ig.DelegatingFix)2 InspectionGadgetsFix (com.siyeh.ig.InspectionGadgetsFix)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1