Search in sources :

Example 1 with GuavaConversionSettings

use of com.intellij.refactoring.typeMigration.inspections.GuavaConversionSettings in project intellij-community by JetBrains.

the class GuavaConversionUtil method convertAnonymousClass.

public static PsiExpression convertAnonymousClass(@NotNull PsiNewExpression expression, @NotNull PsiAnonymousClass anonymousClass, @NotNull TypeEvaluator typeEvaluator) {
    final GuavaConversionSettings settings = typeEvaluator.getSettings(GuavaConversionSettings.class);
    final Set<String> ignoredAnnotations = settings != null ? settings.getIgnoredAnnotations() : Collections.emptySet();
    if (AnonymousCanBeLambdaInspection.canBeConvertedToLambda(anonymousClass, true, ignoredAnnotations)) {
        return AnonymousCanBeLambdaInspection.replacePsiElementWithLambda(expression, true, true);
    } else {
        return tryConvertClassAndSamNameToJava(expression);
    }
}
Also used : GuavaConversionSettings(com.intellij.refactoring.typeMigration.inspections.GuavaConversionSettings)

Aggregations

GuavaConversionSettings (com.intellij.refactoring.typeMigration.inspections.GuavaConversionSettings)1