From a37c58c745cc3805437919015a0dcdfb8c823ee4 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 12 Apr 2012 17:06:02 +0200 Subject: [PATCH] bad code is green (IDEA-84533) --- .../advHighlighting7/IDEA84533.java | 19 +++++++++++++++++++ .../daemon/LightAdvHighlightingJdk7Test.java | 3 +++ 2 files changed, 22 insertions(+) create mode 100644 java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/IDEA84533.java diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/IDEA84533.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/IDEA84533.java new file mode 100644 index 000000000000..23c27ee1b0ee --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/IDEA84533.java @@ -0,0 +1,19 @@ +public class Main { + static class A {} + static class B extends A {} + static class X { } + static class Y extends X { } + + private void test1(X x) { + Y y = (Y) x; + } + + private void test2(X x) { + Y y = (Y) x; + } + + private void test3(Y y1) { + @SuppressWarnings("unchecked") + Y y2 = (Y) y1; + } +} diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/LightAdvHighlightingJdk7Test.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/LightAdvHighlightingJdk7Test.java index 55a041c9e77c..b5c0c7d8ae7e 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/LightAdvHighlightingJdk7Test.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/LightAdvHighlightingJdk7Test.java @@ -302,4 +302,7 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase { public void testExtendsBound() throws Exception { doTest(false, false); } + + public void testIDEA84533() throws Exception { doTest(false, false); } } +