mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 21:41:24 +07:00
IDEA-120784 "Class is public should be declared in a file named <Classname>.java" for inner interface
This commit is contained in:
@@ -229,9 +229,6 @@ public class HighlightClassUtil {
|
||||
|
||||
@Nullable
|
||||
static HighlightInfo checkPublicClassInRightFile(PsiClass aClass) {
|
||||
// most test case classes are located in wrong files
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) return null;
|
||||
|
||||
PsiFile containingFile = aClass.getContainingFile();
|
||||
if (aClass.getParent() != containingFile || !aClass.hasModifierProperty(PsiModifier.PUBLIC) || !(containingFile instanceof PsiJavaFile)) return null;
|
||||
PsiJavaFile file = (PsiJavaFile)containingFile;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class MyChild {
|
||||
public class IDEA118733 {
|
||||
public void evaluate(Child child) {
|
||||
Parent<String>.InnerBase i = child.foo();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class MyChild extends Child<String> {
|
||||
public class IDEA97887 extends Child<String> {
|
||||
@Override
|
||||
public void evaluate(InnerImpl impl) {
|
||||
String s = impl.t;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// abstract methods
|
||||
public class a {
|
||||
class a {
|
||||
<error descr="Missing method body, or declare abstract">void f();</error>
|
||||
|
||||
}
|
||||
@@ -57,7 +57,7 @@ abstract class c8 {
|
||||
|
||||
|
||||
//------- if only Bottom were in other package, it should have been abstract --------------------------
|
||||
public abstract class AbstractTest {
|
||||
abstract class AbstractTest {
|
||||
|
||||
abstract String getName();
|
||||
|
||||
|
||||
@@ -53,3 +53,6 @@ class Class2 {
|
||||
}
|
||||
}
|
||||
}
|
||||
class Ax {
|
||||
public interface B {}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class QQQ {
|
||||
class QQQ {
|
||||
{
|
||||
new Outer(){
|
||||
void foo(){
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// call to super must be first
|
||||
public class a {
|
||||
class a {
|
||||
a() {}
|
||||
a(int i) {}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import static <error descr="Cannot resolve symbol 'MyConstants'">MyConstants</error>.*;
|
||||
import <error descr="Cannot resolve symbol 'MyConstants'">MyConstants</error>;
|
||||
|
||||
public class MyClient
|
||||
class MyClient
|
||||
{
|
||||
private int field = MyConstants.CONSTANT;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class inner_holder {
|
||||
class inner {}
|
||||
}
|
||||
|
||||
public class C1_57 extends inner_holder {
|
||||
class C1_57 extends inner_holder {
|
||||
// inner instance available through inheritance
|
||||
protected class c extends inner {
|
||||
private class iii extends inner {}
|
||||
@@ -88,7 +88,7 @@ class ABIllegal extends <error descr="No enclosing instance of type 'A' is in sc
|
||||
}
|
||||
|
||||
|
||||
public class A42 {
|
||||
class A42 {
|
||||
class B {}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ class b1 extends a1 {
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
public class FooThrow
|
||||
class FooThrow
|
||||
{
|
||||
final Foo foo = new Foo(); // Can throw FooException
|
||||
FooThrow() throws Foo {
|
||||
|
||||
@@ -3,7 +3,7 @@ import java.io.*;
|
||||
import java.net.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
public class a {
|
||||
class a {
|
||||
/**
|
||||
* javadoc should not be highlighted
|
||||
*/
|
||||
@@ -177,7 +177,7 @@ class a20Exotic {
|
||||
int n2 = k==0 ? (k2=9) : (k2=0);
|
||||
}
|
||||
|
||||
public class cX {
|
||||
class cX {
|
||||
final int i;
|
||||
cX() {
|
||||
this(1);
|
||||
@@ -208,7 +208,7 @@ class correct {
|
||||
}
|
||||
}
|
||||
|
||||
public class X {
|
||||
class X {
|
||||
final int i;
|
||||
X() {
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
public class X extends Y {}
|
||||
public class Y {
|
||||
class X extends Y {}
|
||||
class Y {
|
||||
|
||||
private static int x = 0;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ abstract class CompileErrorTest implements ICompileErrorTest {
|
||||
}
|
||||
}
|
||||
|
||||
public class CompileErrorTestExtended extends CompileErrorTest {
|
||||
class CompileErrorTestExtended extends CompileErrorTest {
|
||||
public void foo() throws Exception {
|
||||
try {
|
||||
super.foo();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.io.*;
|
||||
|
||||
public class Main {
|
||||
class Main {
|
||||
static interface A
|
||||
{
|
||||
interface B { }
|
||||
|
||||
@@ -4,6 +4,6 @@ import java.io.IOException;
|
||||
<warning descr="Unused import statement">import java.io.IOException;</warning>
|
||||
|
||||
|
||||
public class c {
|
||||
class c {
|
||||
public IOException m;
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@ import java.io.IOException;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
public class c {}
|
||||
class c {}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
|
||||
public class a extends a1 {
|
||||
class a extends a1 {
|
||||
<error descr="Static method 'f()' in 'a' cannot override instance method 'f()' in 'a1'">public static void f()</error> { }
|
||||
<error descr="Instance method 'f1()' in 'a' cannot override static method 'f1()' in 'a1'">public void f1()</error> { }
|
||||
}
|
||||
@@ -75,13 +75,13 @@ class MyInterfaceImpl implements MyInterface
|
||||
|
||||
|
||||
// Sun-style inheritance
|
||||
public class Sunc {
|
||||
class Sunc {
|
||||
protected void f() {}
|
||||
}
|
||||
public class Suncc extends Sunc {
|
||||
class Suncc extends Sunc {
|
||||
public void f() {}
|
||||
}
|
||||
public interface Suni {
|
||||
interface Suni {
|
||||
public void f();
|
||||
}
|
||||
class Sunccc extends Suncc implements Suni {
|
||||
@@ -103,7 +103,7 @@ class StB extends StA {
|
||||
class Foo {
|
||||
protected static void foo(String s) {}
|
||||
}
|
||||
public class Bar extends Foo{
|
||||
class Bar extends Foo{
|
||||
<error descr="'foo(String)' in 'Bar' clashes with 'foo(String)' in 'Foo'; attempting to assign weaker access privileges ('private'); was 'protected'">private</error> static void foo(String s) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// unhandled exceptions from superclases/etc
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
public class a {
|
||||
class a {
|
||||
a(int i) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class a extends Exception {
|
||||
class a extends Exception {
|
||||
private <warning descr="Private constructor 'a(java.lang.String)' is never used">a</warning>(String s) {
|
||||
super(s);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class <warning descr="Class 'XXX' is never used">XXX</warning> {
|
||||
class <warning descr="Class 'XXX' is never used">XXX</warning> {
|
||||
void <warning descr="Method 'fffff()' is never used">fffff</warning>(){}
|
||||
public void <warning descr="Method 'asdfaffffff()' is never used">asdfaffffff</warning>(){}
|
||||
protected void <warning descr="Method 'dasklfjhsad()' is never used">dasklfjhsad</warning>(){}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class WithMain {
|
||||
class WithMain {
|
||||
|
||||
public static void main(String[] args){
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
public class <warning descr="Class 'XXX' is never used">XXX</warning> {
|
||||
class <warning descr="Class 'XXX' is never used">XXX</warning> {
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import java.io.*;
|
||||
|
||||
public class x {
|
||||
class x {
|
||||
static {int i;}
|
||||
}
|
||||
@@ -134,7 +134,7 @@ import <error descr="Cannot resolve symbol 'sun'">sun</error>.security.action.Ge
|
||||
* @see java.lang.ClassLoader#resolveClass(java.lang.Class)
|
||||
* @since JDK1.0
|
||||
*/
|
||||
public abstract class ClassLoader {
|
||||
abstract class ClassLoader {
|
||||
|
||||
private static native void registerNatives();
|
||||
static {
|
||||
|
||||
@@ -35,7 +35,7 @@ import java.util.*;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class Thinlet extends Container //java
|
||||
class Thinlet extends Container //java
|
||||
implements Runnable, Serializable { //java
|
||||
//midp public class Thinlet extends Canvas implements CommandListener {
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
package x;
|
||||
public class X {
|
||||
public interface B {}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
package x;
|
||||
<error descr="Class 'DD' is public, should be declared in a file named 'DD.java'">public class DD</error> {}
|
||||
@@ -5,7 +5,7 @@ import x.n.X2;
|
||||
import x.n.X3;
|
||||
|
||||
@Deprecated
|
||||
public class Y {
|
||||
class Y {
|
||||
X1 x1;
|
||||
x.n.Class s;
|
||||
X2 x2;
|
||||
|
||||
@@ -5,7 +5,7 @@ import x.n.*;
|
||||
import java.lang.Class;
|
||||
|
||||
@Deprecated
|
||||
public class Y {
|
||||
class Y {
|
||||
X1 x1;
|
||||
x.n.Class s;
|
||||
X2 x2;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class Foo {
|
||||
class Foo {
|
||||
public static void main(String[] args) {
|
||||
final boolean b = false;
|
||||
final Integer i = (<warning descr="Casting '3' to 'Integer' is redundant">Integer</warning>)3;
|
||||
|
||||
@@ -7,4 +7,4 @@ enum SomeEnumeration {
|
||||
}
|
||||
|
||||
|
||||
public class IllegalArgumentException extends Exception {}
|
||||
class IllegalArgumentException extends Exception {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class Pos01<X> {
|
||||
class Pos01<X> {
|
||||
|
||||
Pos01(X x) {}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class Pos02 {
|
||||
class Pos02 {
|
||||
|
||||
static class Foo<X> {
|
||||
Foo(X x) {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class Pos03<U> {
|
||||
class Pos03<U> {
|
||||
|
||||
class Foo<V> {
|
||||
Foo(V x) {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class Pos4<U> {
|
||||
class Pos4<U> {
|
||||
|
||||
void test() {
|
||||
class Foo<V> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class Pos05 {
|
||||
class Pos05 {
|
||||
|
||||
static class Foo<X> {
|
||||
Foo(X x) {}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
public class <warning descr="Class 'WithMain' is never used">WithMain</warning> {
|
||||
class <warning descr="Class 'WithMain' is never used">WithMain</warning> {
|
||||
@MyAnno
|
||||
public void <warning descr="Method 'myTestMethod()' is never used">myTestMethod</warning>(){}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.lang.Character;
|
||||
import java.util.List;
|
||||
|
||||
public class Test {
|
||||
class Test {
|
||||
public static void test() {
|
||||
Character c1 = '1';
|
||||
Character c2 = '2';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.util.*;
|
||||
|
||||
public class Test {
|
||||
class Test {
|
||||
static <E extends Exception, T> void foo(List<T> l, Class<E> ec) throws E {
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
import java.lang.Override;
|
||||
import java.util.List;
|
||||
public class Test
|
||||
class Test
|
||||
{
|
||||
public interface MyList<N extends Number> extends List<N>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.util.*;
|
||||
|
||||
public class Test {
|
||||
class Test {
|
||||
static <T> List<T> asList(T... tt) {
|
||||
System.out.println(tt);
|
||||
return null;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class MissingWarning {
|
||||
class MissingWarning {
|
||||
|
||||
static final Map<String, String> VALID_VALUES_BY_KEY = <warning descr="Unchecked generics array creation for varargs parameter">newExceptionOnNullHashMap</warning>(
|
||||
"Invalid key",
|
||||
|
||||
@@ -13,7 +13,7 @@ class D extends A {
|
||||
}
|
||||
|
||||
|
||||
public class Main {
|
||||
class Main {
|
||||
public static void test(Collection<? extends A> <warning descr="Parameter 'c' is never used">c</warning>) {}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -13,7 +13,7 @@ class D {
|
||||
static <T> String foo(List<List<T>> x) { return null; }
|
||||
}
|
||||
|
||||
public class Main {
|
||||
class Main {
|
||||
public static void main(String[] args){
|
||||
List<List<String>> x = null;
|
||||
foo(x).toLowerCase();
|
||||
|
||||
@@ -13,7 +13,7 @@ class D {
|
||||
static <T> String foo(List<T[]> x) { return null; }
|
||||
}
|
||||
|
||||
public class Main {
|
||||
class Main {
|
||||
public static void main(String[] args){
|
||||
List<String[]> x = null;
|
||||
foo(x).toLowerCase();
|
||||
|
||||
@@ -2,7 +2,7 @@ package pck;
|
||||
import static pck.D.foo;
|
||||
import static pck.C.foo;
|
||||
|
||||
public class C {
|
||||
class C {
|
||||
public static <T extends Comparable<S>, S> void foo(T x){}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package pck;
|
||||
import static pck.D.foo;
|
||||
import static pck.C.foo;
|
||||
|
||||
public class C {
|
||||
class C {
|
||||
public static <T> String foo(Comparable<? extends Comparable<T>> x){
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package pck;
|
||||
import static pck.D.foo;
|
||||
import static pck.C.foo;
|
||||
|
||||
public class C {
|
||||
class C {
|
||||
public static <T> void foo(Comparable<? extends Comparable<T>> x){}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.List;
|
||||
import static pck.D.foo;
|
||||
import static pck.C.foo;
|
||||
|
||||
public class C {
|
||||
class C {
|
||||
static <T extends Collection<S>, S> void foo(T x) { }
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class D {
|
||||
static <T extends List<?>, S> String foo1(List<T> x) { return null; }
|
||||
}
|
||||
|
||||
public class Main {
|
||||
class Main {
|
||||
public static void main(String[] args){
|
||||
List<List<String>> x = null;
|
||||
foo(x).toCharArray();
|
||||
|
||||
@@ -17,7 +17,7 @@ package pck;
|
||||
|
||||
class Key<K>{}
|
||||
|
||||
public class C {
|
||||
class C {
|
||||
public <T> void putCopyableUserData(Key<T> key, T value) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class D {
|
||||
static <T extends List<?>> String foo(List<T> x) { return null; }
|
||||
}
|
||||
|
||||
public class Main {
|
||||
class Main {
|
||||
public static void main(String[] args){
|
||||
List<List<String>> x = null;
|
||||
foo(x).toCharArray();
|
||||
|
||||
@@ -2,7 +2,7 @@ package pck;
|
||||
import static pck.C.foo;
|
||||
import static pck.D.foo;
|
||||
|
||||
public class C {
|
||||
class C {
|
||||
public static void foo(){}
|
||||
}
|
||||
class D {
|
||||
|
||||
@@ -2,7 +2,7 @@ package pck;
|
||||
import static pck.D.foo;
|
||||
import static pck.C.foo;
|
||||
|
||||
public class C {
|
||||
class C {
|
||||
public static <T> void foo(Comparable<T> x){}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
public class CssPropertyValueImpl extends CssTableValueBase<CssPropertyValue, Object> implements CssPropertyValue {
|
||||
class CssPropertyValueImpl extends CssTableValueBase<CssPropertyValue, Object> implements CssPropertyValue {
|
||||
public CssPropertyValueImpl(final Type type) {
|
||||
super(type);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class CssTableValueBase<V extends CssTableValue, T> implements CssTableValue<V, T> {
|
||||
abstract class CssTableValueBase<V extends CssTableValue, T> implements CssTableValue<V, T> {
|
||||
|
||||
protected CssTableValueBase(final Type type) {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@Deprecated @SuppressWarnings("")
|
||||
<error descr="Class 'Foo' must either be declared abstract or implement abstract method 'run()' in 'Runnable'">public class Foo implements Runnable</error> {
|
||||
<error descr="Class 'Foo' must either be declared abstract or implement abstract method 'run()' in 'Runnable'">class Foo implements Runnable</error> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class Autoboxing {
|
||||
class Autoboxing {
|
||||
public boolean compare(short s, Integer i) {
|
||||
return i == s; //OK, i is unboxed
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class Test {
|
||||
class Test {
|
||||
|
||||
public Test(Object a) {
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class Autoboxing {
|
||||
class Autoboxing {
|
||||
void method(int i) {
|
||||
System.out.println("i = " + i);
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class Autoboxing {
|
||||
m2(new Integer(10));
|
||||
}
|
||||
}
|
||||
public class Autoboxing1 {
|
||||
class Autoboxing1 {
|
||||
void method(String s, int i) {
|
||||
System.out.println("i = " + i);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class Main {
|
||||
class Main {
|
||||
public <T> T getAttribute() {return null;}
|
||||
public <T> T getAttribute(T def) {return null;}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Test {
|
||||
class Test {
|
||||
public static void bar() {
|
||||
<error descr="Incompatible types. Found: 'java.lang.Class<capture<? extends java.util.Iterator>>', required: 'java.lang.Class<? extends java.util.Iterator<?>>'">Class<? extends Iterator<?>> c = foo();</error>
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ abstract class CCC2<T> extends DT<T> implements I<T> {
|
||||
}
|
||||
|
||||
class a extends b<d, c> implements c<d, c<c,c>>, d<b<c<c,c>,d>> {}
|
||||
public class b<K,V> implements c<K, c<V,V>> { }
|
||||
class b<K,V> implements c<K, c<V,V>> { }
|
||||
interface c<K,V> extends d<b<V,K>> {}
|
||||
interface d<K> {}
|
||||
|
||||
@@ -28,7 +28,7 @@ class GenericExtendItself<T, U extends T>
|
||||
|
||||
|
||||
////////////////////
|
||||
public abstract class ZZZZ<E> {
|
||||
abstract class ZZZZ<E> {
|
||||
public abstract E getElement();
|
||||
}
|
||||
abstract class Z<E> extends ZZZZ<E> {}
|
||||
|
||||
@@ -5,7 +5,7 @@ interface YO<<warning descr="Type parameter 'T' is never used">T</warning>> {}
|
||||
interface YO1 extends YO<String> {}
|
||||
interface YO2 extends YO<Integer> {}
|
||||
|
||||
public class ConvertibleTest {
|
||||
class ConvertibleTest {
|
||||
|
||||
YO2 bar (YO1 s) {
|
||||
return <error descr="Inconvertible types; cannot cast 'YO1' to 'YO2'">(YO2) s</error>;
|
||||
@@ -19,7 +19,7 @@ interface Interface2 {}
|
||||
|
||||
class Implementation implements Interface1 {}
|
||||
|
||||
public class InconvertibleTypesTest <E extends Interface2>
|
||||
class InconvertibleTypesTest <E extends Interface2>
|
||||
{
|
||||
E thing;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.util.List;
|
||||
|
||||
public class Test {
|
||||
class Test {
|
||||
|
||||
interface P {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.util.Comparator;
|
||||
|
||||
public class Main2 {
|
||||
class Main2 {
|
||||
static class OfRef<T> {
|
||||
public OfRef() {
|
||||
this((Comparator<? super T>) naturalOrder());
|
||||
|
||||
@@ -5,7 +5,7 @@ interface EntityId<E extends BusinessEntity> {
|
||||
E getEntity();
|
||||
}
|
||||
|
||||
public class MyTest {
|
||||
class MyTest {
|
||||
<T extends BusinessEntity<T>> T getEntity(EntityId<T> defaultValue) {
|
||||
return getEntityID(defaultValue).getEntity();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.util.*;
|
||||
public class MyList extends ArrayList {}
|
||||
class MyList extends ArrayList {}
|
||||
|
||||
public class Test {
|
||||
class Test {
|
||||
public void test() {
|
||||
List<? super List> list = new ArrayList<List>();
|
||||
list.add(new MyList());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class TestGenericMap<A extends Comparable<A>, B extends Comparable<B>>
|
||||
class TestGenericMap<A extends Comparable<A>, B extends Comparable<B>>
|
||||
{
|
||||
public TestGenericMap<B, A> inverse()
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ interface Bar {
|
||||
<T extends FooObject, I extends FooId<? extends T>> Collection<T> get(Collection<I> keys);
|
||||
}
|
||||
|
||||
public class Target {
|
||||
class Target {
|
||||
void foo(Bar bar) {
|
||||
final Set<FooId<?>> keys = null;
|
||||
final Collection<FooObject> values = bar.get(keys);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.util.Map;
|
||||
|
||||
public class Test {
|
||||
class Test {
|
||||
void bar(Prop p) {
|
||||
Map<? extends String, ? extends String> map = <error descr="Inconvertible types; cannot cast 'Prop' to 'java.util.Map<? extends java.lang.String,? extends java.lang.String>'">(Map<? extends String, ? extends String>)p</error>;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.io.Serializable;
|
||||
|
||||
public abstract class Test {
|
||||
abstract class Test {
|
||||
|
||||
abstract <T> T test(Class<T> cls);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class Test {
|
||||
class Test {
|
||||
{
|
||||
final <error descr="Incompatible types. Found: 'java.lang.Object', required: 'MyResult'">MyResult hello = parseXML(new Parser());</error>
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
public class Test<Y> {
|
||||
class Test<Y> {
|
||||
|
||||
public static <K> Test<K> doTest(K k){
|
||||
return null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.util.Collection;
|
||||
|
||||
public class IncorrectError extends NarrowClass {
|
||||
class IncorrectError extends NarrowClass {
|
||||
public Collection<String> bar() {
|
||||
return super.doStuff();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Test {
|
||||
class Test {
|
||||
public <T extends Serializable> void foo(byte[] data) {
|
||||
T foo = (T) data;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.util.List;
|
||||
|
||||
public class MyTest {
|
||||
class MyTest {
|
||||
|
||||
static void m(List<? extends List> c) {
|
||||
List<? extends List<?>> d = <warning descr="Unchecked cast: 'java.util.List<capture<? extends java.util.List>>' to 'java.util.List<? extends java.util.List<?>>'">(List<? extends List<?>>)c</warning>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
public class IdeaBugTest {
|
||||
class IdeaBugTest {
|
||||
public void foo(List<Base> base) {
|
||||
MyCollection.fun<error descr="'fun(java.util.List<? extends Base>, java.util.Comparator<? super Base>)' in 'MyCollection' cannot be applied to '(java.util.List<Base>, SubComparator)'">(base, new SubComparator())</error>;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class Testsss {
|
||||
class Testsss {
|
||||
|
||||
public <TA, CA extends Iterable<TA>> void that(Iterable<TA> target) {}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public interface I<K> {
|
||||
interface I<K> {
|
||||
}
|
||||
|
||||
abstract class SpringHighlightingTestCase<T extends I>{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public abstract class BiFunction<A,B> {
|
||||
abstract class BiFunction<A,B> {
|
||||
public abstract B apply(A a);
|
||||
public abstract A unapply(B b);
|
||||
public BiFunction<B,A> flip() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class GoodCodeIsRed {
|
||||
class GoodCodeIsRed {
|
||||
|
||||
public void test() {
|
||||
FileIF file = new FileImpl();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
public class IDEABug {
|
||||
class IDEABug {
|
||||
|
||||
static class ClassA {
|
||||
static <T> void sayHello(Collection<? extends T> msg) {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
public class IDEABug {
|
||||
class IDEABug {
|
||||
|
||||
static class ClassA {
|
||||
static <T> void sayHello(Collection<? extends T> msg) {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.util.List;
|
||||
|
||||
public class SubClass extends BaseClass<String> {
|
||||
class SubClass extends BaseClass<String> {
|
||||
public static void main(String[] args) {
|
||||
new SubClass().method(null);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class IdeaBugTest {
|
||||
class IdeaBugTest {
|
||||
interface A<T> {
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import java.util.*;
|
||||
public class IdeaGenericsTest {
|
||||
class IdeaGenericsTest {
|
||||
interface Animal<T extends Animal<T>> {
|
||||
List<T> getFriends();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.util.Comparator;
|
||||
import java.util.Set;
|
||||
|
||||
public class CastError {
|
||||
class CastError {
|
||||
public void foo(Comparator<? super byte[]> comparator) throws Exception {
|
||||
MyComparator comparator1 = (MyComparator) comparator;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ class B<T> {
|
||||
B(List<A<?>> list) {}
|
||||
}
|
||||
|
||||
public class Bug {
|
||||
class Bug {
|
||||
|
||||
private static B case1(A<?> a) {
|
||||
return new B(Collections.singletonList(a));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class C1<T extends C1<T>>{
|
||||
class C1<T extends C1<T>>{
|
||||
public static class C2<K extends C1<K>> extends C1<K>{}
|
||||
public static class C3<Z> extends C2<<error descr="No wildcard expected">? extends C3<Z></error>>{}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.util.*;
|
||||
|
||||
public class Test<T>
|
||||
class Test<T>
|
||||
{
|
||||
List<Collection<T>> getList ()
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
public class IDEA74899 {
|
||||
class IDEA74899 {
|
||||
void foo() {
|
||||
Map<String, String> m = Collections.emptyMap();
|
||||
if (<error descr="Operator '==' cannot be applied to 'java.util.Map<java.lang.String,java.lang.String>', 'java.util.Map<java.lang.Object,java.lang.Object>'">m == Collections.emptyMap()</error>) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import java.util.*;
|
||||
public class IDEA76283 {
|
||||
class IDEA76283 {
|
||||
}
|
||||
|
||||
interface Parametrized<T extends Number> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.util.List;
|
||||
|
||||
public class IDEA80386 {
|
||||
class IDEA80386 {
|
||||
void foo(Class<List> listClass) {
|
||||
<error descr="Incompatible types. Found: 'java.lang.Class<java.util.List>', required: 'java.lang.Class<? extends java.util.List<?>>'">Class<? extends List<?>> cls = listClass;</error>
|
||||
Class < ?extends List > cls1 = listClass;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.util.Iterator;
|
||||
|
||||
public class WildcardGenericAndPrivateField {
|
||||
class WildcardGenericAndPrivateField {
|
||||
|
||||
private Object field;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/** @noinspection UnusedDeclaration*/
|
||||
public class GenericsTest98 {
|
||||
class GenericsTest98 {
|
||||
public static void main(String[] args) throws Exception{
|
||||
List<Movable<? extends Serializable>> list = new ArrayList<Movable<? extends Serializable>> ();
|
||||
Factory factory = Factory.newInstance();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class ZZZ {
|
||||
class ZZZ {
|
||||
|
||||
List<Class<?>> f(Class<?>[] exceptionTypes) {
|
||||
List<Class<?>> nd = Arrays.asList(exceptionTypes);
|
||||
|
||||
@@ -38,7 +38,7 @@ class BreakpointTree<TP> {
|
||||
class Node {}
|
||||
class XBreakpoint<SR>{}
|
||||
|
||||
public class GenericInnerClass<E> {
|
||||
class GenericInnerClass<E> {
|
||||
private void problem( Base base ) {
|
||||
if ( base instanceof First) {}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
public @interface Foo {
|
||||
@interface Foo {
|
||||
String id();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ class CLS {
|
||||
}
|
||||
}
|
||||
//////////////////////////////
|
||||
public abstract class ZZZ<K> {
|
||||
abstract class ZZZ<K> {
|
||||
public abstract <T extends String> ZZZ<T> get();
|
||||
}
|
||||
class Z2<K> extends ZZZ<K> {
|
||||
@@ -44,7 +44,7 @@ interface Callable<V> {
|
||||
class B extends A {}
|
||||
}
|
||||
//////////////////////////
|
||||
public class BadCodeGreen<T, C extends Collection<? extends T>> {
|
||||
class BadCodeGreen<T, C extends Collection<? extends T>> {
|
||||
public BadCodeGreen(C c, T t) {
|
||||
c.add<error descr="'add(capture<? extends T>)' in 'java.util.Collection' cannot be applied to '(T)'">(t)</error>;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class ExampleProblem {
|
||||
class ExampleProblem {
|
||||
<T> void asserting(T t, Simple<T> l){
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user