Merge remote-tracking branch 'origin/master'

This commit is contained in:
Roman Shevchenko
2016-07-12 12:13:23 +02:00
188 changed files with 4459 additions and 1997 deletions
@@ -0,0 +1,9 @@
package a;
import static a.A.foo;
interface B extends A {
static void bar() {
foo("");
}
}
@@ -0,0 +1,9 @@
class Test {
static {
@javax.annotation.Generated
String noRedundantCastForGeneratedCode = (String) "";
}
}
@@ -0,0 +1,16 @@
// "Make 'foo' return 'java.util.List<java.lang.Integer>'" "true"
import java.util.List;
interface Main<A, B> {
List<A> foo();
}
class MainImpl implements Main<Integer,String> {
@Override
public List<Integer> foo() {
return bar();
}
private List<Integer> bar() {
return null;
}
}
@@ -0,0 +1,16 @@
// "Make 'foo' return 'java.util.List<java.lang.Integer>'" "true"
import java.util.List;
interface Main<A, B> {
List<A> foo();
}
class MainImpl implements Main<String, String> {
@Override
public List<String> foo() {
return b<caret>ar();
}
private List<Integer> bar() {
return null;
}
}
@@ -1,7 +1,7 @@
import bar.A;
import static bar.A.foo;
class Usage {
void bar() {
A.foo();
foo();
}
}
@@ -16,6 +16,7 @@
package com.intellij.codeInsight.daemon;
import com.intellij.JavaTestUtil;
import com.intellij.codeInspection.redundantCast.RedundantCastInspection;
import com.intellij.psi.PsiClass;
import com.intellij.psi.search.searches.ReferencesSearch;
import com.intellij.testFramework.LightProjectDescriptor;
@@ -55,6 +56,27 @@ public class LightAdvHighlightingFixtureTest extends LightCodeInsightFixtureTest
myFixture.checkHighlighting();
}
public void testStaticImportCompoundWithInheritance() throws Exception {
myFixture.addClass("package a; public interface A { static void foo(Object o){} static void foo(String str) {}}");
myFixture.configureByFile(getTestName(false) + ".java");
myFixture.checkHighlighting();
}
public void testSuppressedInGenerated() throws Exception {
myFixture.addClass("package javax.annotation; public @interface Generated {}");
final RedundantCastInspection inspection = new RedundantCastInspection();
try {
myFixture.enableInspections(inspection);
myFixture.configureByFile(getTestName(false) + ".java");
myFixture.checkHighlighting();
}
finally {
myFixture.disableInspections(inspection);
}
}
@Override
protected String getBasePath() {
return JavaTestUtil.getRelativeJavaTestDataPath() + "/codeInsight/daemonCodeAnalyzer/advFixture";