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
ee750f16
Commit
ee750f16
authored
8 years ago
by
Anna.Kozlova
1
Browse files
Options
Download
Email Patches
Plain Diff
ensure array is not accepted as functional interface (IDEA-172048)
parent
f9641720
Branches unavailable
Tags unavailable
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
java/java-psi-api/src/com/intellij/psi/LambdaUtil.java
+1
-1
java/java-psi-api/src/com/intellij/psi/LambdaUtil.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/ArrayNotAFunctionalInterface.java
+10
-0
...alyzer/lambda/newLambda/ArrayNotAFunctionalInterface.java
java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java
+1
-0
.../codeInsight/daemon/lambda/NewLambdaHighlightingTest.java
with
12 additions
and
1 deletion
+12
-1
java/java-psi-api/src/com/intellij/psi/LambdaUtil.java
+
1
-
1
View file @
ee750f16
...
...
@@ -112,7 +112,7 @@ public class LambdaUtil {
if
(
type
instanceof
PsiIntersectionType
)
{
return
extractFunctionalConjunct
((
PsiIntersectionType
)
type
)
!=
null
;
}
return
isFunctionalClass
(
PsiUtil
.
resolve
GenericsClassInType
(
type
).
getElement
(
));
return
isFunctionalClass
(
PsiUtil
.
resolve
ClassInClassTypeOnly
(
type
));
}
@Contract
(
"null -> false"
)
...
...
This diff is collapsed.
Click to expand it.
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/ArrayNotAFunctionalInterface.java
0 → 100644
+
10
-
0
View file @
ee750f16
import
java.util.concurrent.Callable
;
class
Test
{
public
static
<
T
>
void
execute
(
Callable
<
T
>[]
cmds
)
{
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
execute
(<
error
descr
=
"Callable<T>[] is not a functional interface"
>()
->
null
</
error
>);
}
}
This diff is collapsed.
Click to expand it.
java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java
+
1
-
0
View file @
ee750f16
...
...
@@ -156,6 +156,7 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
public
void
testNestedLambdasWithInferenceOfReturnTypeInTheLatestLambda
()
{
doTest
();
}
public
void
testCapturedWildcardNotOpenedDuringInference
()
{
doTest
();
}
public
void
testIgnoreStandaloneExpressionsInLambdaReturnForNestedCalls
()
{
doTest
();
}
public
void
testArrayNotAFunctionalInterface
()
{
doTest
();
}
private
void
doTest
()
{
IdeaTestUtil
.
setTestVersion
(
JavaSdkVersion
.
JDK_1_8
,
getModule
(),
getTestRootDisposable
());
...
...
This diff is collapsed.
Click to expand it.
小 白蛋
@baidan
mentioned in commit
ac5ccb1c
·
2 years ago
mentioned in commit
ac5ccb1c
mentioned in commit ac5ccb1c197157809f07a637e8ecd57a6b6c48b4
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