mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
more java tests moved to community
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.util.*;
|
||||
|
||||
@Target({ElementType.TYPE_USE/*, ElementType.TYPE*/})
|
||||
@interface TA {
|
||||
}
|
||||
|
||||
@<error descr="'@TA' not applicable to type">TA</error>
|
||||
class X0<@<error descr="'@TA' not applicable to type parameter">TA</error> T> {
|
||||
@TA
|
||||
protected
|
||||
void f() @<error descr="'@TA' not applicable to parameter">TA</error> {
|
||||
@TA String p=new @TA String();
|
||||
|
||||
if (this instanceof @TA Object) return;
|
||||
String o = p;
|
||||
List<@TA String> l;
|
||||
Class c = @TA String.class;
|
||||
}
|
||||
|
||||
@TA int @TA[] methodf() throws @TA Exception {
|
||||
boolean a = this instanceof @TA X0;
|
||||
X0<@<error descr="Duplicate annotation">TA</error> @<error descr="Duplicate annotation">TA</error> X0> c = new @TA X0<@TA X0>();
|
||||
Object o = (@TA Object) c;
|
||||
@TA X0.field = null;
|
||||
return null;
|
||||
}
|
||||
|
||||
@TA() int @TA[] p;
|
||||
static @TA Object field;
|
||||
@TA List<String> disambiguateBetweenBinaryExpr;
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
@interface Ann {
|
||||
int u () default 0;
|
||||
}
|
||||
|
||||
@Ann(<error descr="Cannot resolve method 'v'">v</error>=0) class D {
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
@interface Ann {
|
||||
}
|
||||
|
||||
@<error descr="Duplicate annotation">Ann</error> @<error descr="Duplicate annotation">Ann</error> class D {
|
||||
}
|
||||
|
||||
@SuppressWarnings({})
|
||||
@<error descr="Annotation type expected">java.lang</error>
|
||||
class PsiDa {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
@interface A {
|
||||
int value();
|
||||
}
|
||||
|
||||
@A(value = 0, <error descr="Duplicate attribute 'value'">value = 1</error>) class C {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.TYPE, <error descr="Repeated annotation target">ElementType.ANNOTATION_TYPE</error>})
|
||||
@interface A {}
|
||||
@@ -0,0 +1,8 @@
|
||||
import java.lang.annotation.*;
|
||||
|
||||
//OK
|
||||
@Target({ElementType.TYPE})
|
||||
@Expose @interface Expose {}
|
||||
|
||||
@Target({ElementType.FIELD})
|
||||
@<error descr="'@Expose1' not applicable to annotation type">Expose1</error>@interface Expose1 {}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
@interface Ann {
|
||||
int u () default 0;
|
||||
}
|
||||
|
||||
@Ann(u=<error descr="Incompatible types. Found: 'double', required: 'int'">0.0</error>) class D {
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
@interface Ann {
|
||||
int[] u () default 0;
|
||||
}
|
||||
|
||||
@Ann(u=0) class D {
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
@interface Ann {
|
||||
short[] u () default 0;
|
||||
}
|
||||
|
||||
@Ann(u={<error descr="Incompatible types. Found: 'int', required: 'short'">2222222</error>}) class D {
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
@interface Ann {
|
||||
Inner1 inner ();
|
||||
}
|
||||
|
||||
@interface Inner1 {
|
||||
int i ();
|
||||
}
|
||||
|
||||
@interface Inner2 {
|
||||
int i ();
|
||||
}
|
||||
|
||||
|
||||
@Ann(inner=<error descr="Incompatible types. Found: 'Inner2', required: 'Inner1'">@Inner2(i=0)</error>) class D {
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
@<error descr="'@SuppressWarnings' not applicable to package">SuppressWarnings</error>("all") package annotations.invalidPackageAnnotationTarget;
|
||||
@@ -0,0 +1,8 @@
|
||||
class Clazz {}
|
||||
|
||||
@interface Ann {
|
||||
<error descr="Invalid type for annotation member">Clazz</error> i ();
|
||||
<error descr="Cyclic annotation element type">Ann</error> j ();
|
||||
|
||||
<error descr="Invalid type for annotation member">void</error> f();
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
@interface Ann {
|
||||
int i ();
|
||||
}
|
||||
|
||||
@<error descr="'i' missing though required">Ann</error>() class D {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
@interface Ann {
|
||||
int i ();
|
||||
}
|
||||
|
||||
class D {
|
||||
int field;
|
||||
@Ann(i=<error descr="Attribute value must be constant">field</error>) void foo () {}
|
||||
}
|
||||
|
||||
@interface ManistaDouble
|
||||
{
|
||||
public abstract double defaultValue() default Double.NaN;
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
@interface Ann {
|
||||
int u () default 0;
|
||||
}
|
||||
|
||||
@Ann(<error descr="Cannot find method 'value'">0</error>) class D {
|
||||
}
|
||||
|
||||
@In(""<error descr="Annotation attribute must be of the form 'name=value'">,</error> create = "")
|
||||
class ZZZ {
|
||||
}
|
||||
@interface In {
|
||||
String value();
|
||||
String create();
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
<error descr="Package annotations should be in file package-info.java">@Deprecated</error> package annotations.packageAnnotationNotInPackageInfo;
|
||||
Reference in New Issue
Block a user