redundant cast: do not raise if result in bad return type in lambda expression (IDEA-138927)

This commit is contained in:
Anna Kozlova
2015-04-08 21:14:33 +02:00
parent 149184c95e
commit 6047478cae
3 changed files with 15 additions and 2 deletions
@@ -0,0 +1,7 @@
import java.util.stream.Stream;
class Test {
public void filterByBoolean(Stream<Object[]> stream) {
stream.filter(it -> (Boolean) it[0]);
}
}
@@ -38,6 +38,8 @@ public class LambdaRedundantCastTest extends LightDaemonAnalyzerTestCase {
public void testSer() { doTest(); }
public void testLambdaReturnExpressions() { doTest(); }
public void testLambdaReturnExpressions1() { doTest(); }
public void testPreventBadReturnTypeInReturnExpression() { doTest(); }
private void doTest() {
doTest(BASE_PATH + "/" + getTestName(false) + ".java", true, false);
}