Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
23cc5b9c
Commit
23cc5b9c
authored
8 years ago
by
Anna Kozlova
1
Browse files
Options
Download
Email Patches
Plain Diff
extract functional: better accessibility check
parent
36036f64
Branches unavailable
Tags unavailable
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/java-impl/src/com/intellij/codeInsight/FunctionalInterfaceSuggester.java
+1
-5
...om/intellij/codeInsight/FunctionalInterfaceSuggester.java
with
1 addition
and
5 deletions
+1
-5
java/java-impl/src/com/intellij/codeInsight/FunctionalInterfaceSuggester.java
+
1
-
5
View file @
23cc5b9c
...
...
@@ -18,7 +18,6 @@ package com.intellij.codeInsight;
import
com.intellij.codeInspection.java15api.Java15APIUsageInspectionBase
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.psi.*
;
import
com.intellij.psi.impl.source.resolve.JavaResolveUtil
;
import
com.intellij.psi.search.GlobalSearchScope
;
import
com.intellij.psi.search.searches.AnnotatedMembersSearch
;
import
com.intellij.psi.util.PsiTreeUtil
;
...
...
@@ -76,9 +75,6 @@ public class FunctionalInterfaceSuggester {
}
return
suggestFunctionalInterfaces
(
method
,
aClass
->
{
if
(!
JavaPsiFacade
.
getInstance
(
method
.
getProject
()).
getResolveHelper
().
isAccessible
(
aClass
,
method
,
null
))
{
return
null
;
}
final
PsiMethod
interfaceMethod
=
LambdaUtil
.
getFunctionalInterfaceMethod
(
aClass
);
if
(
interfaceMethod
!=
null
)
{
final
PsiParameter
[]
parameters
=
method
.
getParameterList
().
getParameters
();
...
...
@@ -151,7 +147,7 @@ public class FunctionalInterfaceSuggester {
final
Set
<
PsiType
>
types
=
new
HashSet
<>();
final
Processor
<
PsiMember
>
consumer
=
member
->
{
if
(
member
instanceof
PsiClass
&&
Java15APIUsageInspectionBase
.
getLastIncompatibleLanguageLevel
(
member
,
PsiUtil
.
getLanguageLevel
(
element
))
==
null
)
{
if
(!
Java
ResolveUtil
.
isAccessible
(
member
,
null
,
member
.
getModifierList
()
,
element
,
null
,
null
))
{
if
(!
Java
PsiFacade
.
getInstance
(
project
).
getResolveHelper
().
isAccessible
(
member
,
element
,
null
))
{
return
true
;
}
ContainerUtil
.
addIfNotNull
(
types
,
acceptanceChecker
.
fun
((
PsiClass
)
member
));
...
...
This diff is collapsed.
Click to expand it.
小 白蛋
@baidan
mentioned in commit
0a06cc38
·
2 years ago
mentioned in commit
0a06cc38
mentioned in commit 0a06cc388e180b10b926d598c332d1ac55a90797
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help