public class AnonymousCanBeLambdaInspection extends AbstractBaseJavaLocalInspectionTool
Modifier and Type | Field and Description |
---|---|
static Logger |
LOG |
boolean |
reportNotAnnotatedInterfaces |
EMPTY_ARRAY, VALID_ID_PATTERN
myNameProvider
Constructor and Description |
---|
AnonymousCanBeLambdaInspection() |
Modifier and Type | Method and Description |
---|---|
PsiElementVisitor |
buildVisitor(ProblemsHolder holder,
boolean isOnTheFly)
Override the method to provide your own inspection visitor.
|
static boolean |
canBeConvertedToLambda(PsiAnonymousClass aClass,
boolean acceptParameterizedFunctionTypes,
boolean reportNotAnnotatedInterfaces,
java.util.Set<java.lang.String> ignoredRuntimeAnnotations) |
static boolean |
canBeConvertedToLambda(PsiAnonymousClass aClass,
boolean acceptParameterizedFunctionTypes,
java.util.Set<java.lang.String> ignoredRuntimeAnnotations) |
javax.swing.JComponent |
createOptionsPanel()
This method is called each time UI is shown.
|
static boolean |
functionalInterfaceMethodReferenced(PsiMethod psiMethod,
PsiAnonymousClass anonymClass,
PsiCallExpression callExpression) |
java.lang.String |
getGroupDisplayName() |
java.lang.String |
getShortName()
DO NOT OVERRIDE this method.
|
static boolean |
hasForbiddenRefsInsideBody(PsiMethod method,
PsiAnonymousClass aClass) |
static boolean |
hasRuntimeAnnotations(PsiModifierListOwner listOwner,
java.util.Set<java.lang.String> runtimeAnnotationsToIgnore) |
boolean |
isEnabledByDefault()
DO NOT OVERRIDE this method.
|
static boolean |
isLambdaForm(PsiAnonymousClass aClass,
boolean acceptParameterizedFunctionTypes,
boolean reportNotAnnotatedInterfaces,
java.util.Set<java.lang.String> ignoredRuntimeAnnotations) |
static boolean |
isLambdaForm(PsiAnonymousClass aClass,
boolean acceptParameterizedFunctionTypes,
java.util.Set<java.lang.String> ignoredRuntimeAnnotations) |
static boolean |
isLambdaForm(PsiAnonymousClass aClass,
java.util.Set<java.lang.String> ignoredRuntimeAnnotations) |
static PsiExpression |
replaceAnonymousWithLambda(PsiElement anonymousClass,
PsiType expectedType) |
static PsiExpression |
replacePsiElementWithLambda(PsiElement element,
boolean ignoreEqualsMethod,
boolean forceIgnoreTypeCast) |
static void |
restoreComments(java.util.Collection<? extends PsiComment> comments,
PsiElement lambda) |
checkClass, checkField, checkMethod
buildVisitor, checkFile, getAlternativeID, getID, getProblemElement, getSuppressId, inspectionFinished, inspectionFinished, inspectionStarted, isValidID, processFile, runForWholeFile
cleanup, getBatchSuppressActions, getBlackList, getDefaultLevel, getDescriptionContextClass, getDescriptionFileName, getDisplayName, getGeneralGroupName, getGroupKey, getGroupPath, getMainToolId, getSerializationFilter, getShortName, getStaticDescription, getSuppressors, initialize, isInitialized, isSuppressedFor, loadDescription, readSettings, showDefaultConfigurationOptions, writeSettings
public static final Logger LOG
public boolean reportNotAnnotatedInterfaces
public java.lang.String getGroupDisplayName()
getGroupDisplayName
in class InspectionProfileEntry
InspectionEP.groupDisplayName
,
InspectionEP.groupKey
,
InspectionEP.groupBundle
public boolean isEnabledByDefault()
InspectionProfileEntry
isEnabledByDefault
in class InspectionProfileEntry
InspectionEP.enabledByDefault
public java.lang.String getShortName()
InspectionProfileEntry
getShortName
in class InspectionProfileEntry
InspectionEP.shortName
public javax.swing.JComponent createOptionsPanel()
InspectionProfileEntry
createOptionsPanel
in class InspectionProfileEntry
null
if no UI options required.public PsiElementVisitor buildVisitor(ProblemsHolder holder, boolean isOnTheFly)
LocalInspectionTool
PsiRecursiveElementVisitor
)
since it will be fed with every element in the file anyway.
Visitor created must be thread-safe since it might be called on several elements concurrently.buildVisitor
in class AbstractBaseJavaLocalInspectionTool
holder
- where visitor will register problems found.isOnTheFly
- true if inspection was run in non-batch modePsiRecursiveVisitor
public static boolean hasRuntimeAnnotations(PsiModifierListOwner listOwner, java.util.Set<java.lang.String> runtimeAnnotationsToIgnore)
public static boolean hasForbiddenRefsInsideBody(PsiMethod method, PsiAnonymousClass aClass)
public static boolean canBeConvertedToLambda(PsiAnonymousClass aClass, boolean acceptParameterizedFunctionTypes, java.util.Set<java.lang.String> ignoredRuntimeAnnotations)
public static boolean isLambdaForm(PsiAnonymousClass aClass, java.util.Set<java.lang.String> ignoredRuntimeAnnotations)
public static boolean canBeConvertedToLambda(PsiAnonymousClass aClass, boolean acceptParameterizedFunctionTypes, boolean reportNotAnnotatedInterfaces, java.util.Set<java.lang.String> ignoredRuntimeAnnotations)
public static boolean isLambdaForm(PsiAnonymousClass aClass, boolean acceptParameterizedFunctionTypes, java.util.Set<java.lang.String> ignoredRuntimeAnnotations)
public static boolean isLambdaForm(PsiAnonymousClass aClass, boolean acceptParameterizedFunctionTypes, boolean reportNotAnnotatedInterfaces, java.util.Set<java.lang.String> ignoredRuntimeAnnotations)
public static PsiExpression replaceAnonymousWithLambda(PsiElement anonymousClass, PsiType expectedType)
public static PsiExpression replacePsiElementWithLambda(PsiElement element, boolean ignoreEqualsMethod, boolean forceIgnoreTypeCast)
public static boolean functionalInterfaceMethodReferenced(PsiMethod psiMethod, PsiAnonymousClass anonymClass, PsiCallExpression callExpression)
public static void restoreComments(java.util.Collection<? extends PsiComment> comments, PsiElement lambda)