diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA20244.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA20244.java new file mode 100644 index 000000000000..ee5235ad87fe --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA20244.java @@ -0,0 +1,23 @@ +import java.util.Collection; +class Test { + public static final UnaryFunction unaryFunction = new UnaryFunction() { + public Object execute(Object o) throws RuntimeException { + return null; + } + }; + + public static void someMethod() { + transformCollection(null, unaryFunction, null); + } + + public static void transformCollection(Collection input, UnaryFunction transform, Collection output) throws X { + for (A a : input) { + B b = transform.execute(a); + output.add(b); + } + } +} + +interface UnaryFunction { + public B execute(A a) throws X; +} diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java index 6d9f498ed1a4..de9a8363ca8e 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java @@ -229,6 +229,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase { public void testIDEA21597() throws Exception { doTest5(false);} public void testIDEA20573() throws Exception { doTest5(false);} + public void testIDEA20244() throws Exception { doTest5(false);} public void testIDEA27185(){ doTest(LanguageLevel.JDK_1_6, JavaSdkVersion.JDK_1_6, false); } public void testIDEA67571(){ doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }