mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
more java tests moved to community
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
<orderEntry type="module" module-name="execution-impl" scope="RUNTIME" />
|
||||
<orderEntry type="module" module-name="platform-api" />
|
||||
<orderEntry type="library" name="Velocity" level="project" />
|
||||
<orderEntry type="module" module-name="java-i18n" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
public class Subclass<E extends Runnable, Q extends Runnable> extends Superclass<E, Q> {
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
class Superclass<E extends Runnable, Q extends Runnable> {
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
class Superclass<E extends Runnable, Q extends Runnable> {
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
@interface Ann {
|
||||
int u () default 0;
|
||||
}
|
||||
|
||||
@Ann(<error descr="Cannot resolve method 'v'">v</error>=0) class D {
|
||||
}
|
||||
@@ -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 {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
@interface A {
|
||||
int value();
|
||||
}
|
||||
|
||||
@A(value = 0, <error descr="Duplicate attribute 'value'">value = 1</error>) class C {}
|
||||
@@ -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 {}
|
||||
@@ -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 {
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
@interface Ann {
|
||||
int[] u () default 0;
|
||||
}
|
||||
|
||||
@Ann(u=0) class D {
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
@interface Ann {
|
||||
short[] u () default 0;
|
||||
}
|
||||
|
||||
@Ann(u={<error descr="Incompatible types. Found: 'int', required: 'short'">2222222</error>}) class D {
|
||||
}
|
||||
@@ -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 {
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
@interface Ann {
|
||||
int i ();
|
||||
}
|
||||
|
||||
@<error descr="'i' missing though required">Ann</error>() class D {
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<error descr="Package annotations should be in file package-info.java">@Deprecated</error> package annotations.packageAnnotationNotInPackageInfo;
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml encoding="<caret><selection>utf-8</selection>" ?>
|
||||
<xml>
|
||||
<warning descr="Unsupported characters for the charset 'US-ASCII'">абвг</warning> 132726435127
|
||||
<warning descr="Unsupported characters for the charset 'US-ASCII'">фигня</warning>
|
||||
</xml>
|
||||
@@ -0,0 +1,14 @@
|
||||
# works with IDEA 9.0
|
||||
foo=bar \"{0}\"
|
||||
longline=abc def ghiabc def ghiabc def ghiabc def ghiabc def ghiabc \
|
||||
def ghiabc def ghiabc def ghi\
|
||||
abc def ghi
|
||||
|
||||
# Warnings "Unsupported characters for charset 'US-ASCII' in IDEA 9.0
|
||||
# with escaped and transparently converted non-ASCII characters:
|
||||
|
||||
# key with non-ASCII characters (yes, not beautiful :)
|
||||
\u00e4\u00f6\u00fc=asc
|
||||
|
||||
# value with non-ASCII characters
|
||||
bar=\u00e4\u00f6\u00fc
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="<selection>UTF-8</selection><caret>"?>
|
||||
<x>
|
||||
хихи
|
||||
</x>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
abcd
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Access static 'AClass.fff' via class 'AClass' reference" "true"
|
||||
|
||||
class AClass
|
||||
{
|
||||
AClass getA() {
|
||||
return null;
|
||||
}
|
||||
static int fff;
|
||||
}
|
||||
|
||||
class acc {
|
||||
int f() {
|
||||
AClass a = null;
|
||||
return <caret>AClass.fff;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Access static 'AClass.fff' via class 'AClass' reference" "true"
|
||||
|
||||
class AClass
|
||||
{
|
||||
AClass getA() {
|
||||
int i = <caret>fff;
|
||||
return null;
|
||||
|
||||
}
|
||||
static int fff;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Access static 'AClass.getA()' via class 'AClass' reference" "true"
|
||||
|
||||
class AClass
|
||||
{
|
||||
static AClass getA() {
|
||||
return null;
|
||||
}
|
||||
static int fff;
|
||||
}
|
||||
|
||||
class acc {
|
||||
int f() {
|
||||
AClass a = null;
|
||||
<caret>AClass.getA();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Access static 'AClass.stat' via class 'AClass' reference" "true"
|
||||
|
||||
class AClass {
|
||||
static boolean stat;
|
||||
void foo (boolean stat) {
|
||||
AClass.stat<caret> = stat;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Access static 'AClass.R.rr' via class 'R' reference" "true"
|
||||
|
||||
class AClass
|
||||
{
|
||||
public static class R {
|
||||
static int rr = 0;
|
||||
}
|
||||
public R getR() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
class ss {
|
||||
void f(AClass d){
|
||||
int i = <caret>AClass.R.rr;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Access static 'AClass.fff' via class 'AClass' reference" "true"
|
||||
|
||||
class AClass
|
||||
{
|
||||
AClass getA() {
|
||||
return null;
|
||||
}
|
||||
static int fff;
|
||||
}
|
||||
|
||||
class acc {
|
||||
int f() {
|
||||
AClass a = null;
|
||||
return <caret>a.getA().fff;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Access static 'AClass.fff' via class 'AClass' reference" "true"
|
||||
|
||||
class AClass
|
||||
{
|
||||
AClass getA() {
|
||||
int i = <caret>this.fff;
|
||||
return null;
|
||||
|
||||
}
|
||||
static int fff;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Access static 'AClass.getA()' via class 'AClass' reference" "true"
|
||||
|
||||
class AClass
|
||||
{
|
||||
static AClass getA() {
|
||||
return null;
|
||||
}
|
||||
static int fff;
|
||||
}
|
||||
|
||||
class acc {
|
||||
int f() {
|
||||
AClass a = null;
|
||||
<caret>a.getA();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// "Access static 'AClass.R.rr' via class 'AClass.R' reference" "false"
|
||||
|
||||
class AClass
|
||||
{
|
||||
private static class R {
|
||||
static int rr = 0;
|
||||
}
|
||||
public R getR() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// AClass.R is not accessible there
|
||||
class ss {
|
||||
void f(AClass d){
|
||||
int i = <caret>d.getR().rr;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Access static 'AClass.stat' via class 'AClass' reference" "true"
|
||||
|
||||
class AClass {
|
||||
static boolean stat;
|
||||
void foo (boolean stat) {
|
||||
this.stat<caret> = stat;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Access static 'AClass.R.rr' via class 'R' reference" "true"
|
||||
|
||||
class AClass
|
||||
{
|
||||
public static class R {
|
||||
static int rr = 0;
|
||||
}
|
||||
public R getR() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
class ss {
|
||||
void f(AClass d){
|
||||
int i = <caret>d.getR().rr;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Add Catch Clause(s)" "true"
|
||||
class a {
|
||||
void g() throws Exception {
|
||||
}
|
||||
void f() {
|
||||
try {
|
||||
g();
|
||||
} catch (Error e) {
|
||||
} catch (Exception e) {
|
||||
<caret><selection>e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.</selection>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Add Catch Clause(s)" "true"
|
||||
class a {
|
||||
void g() throws Exception {
|
||||
}
|
||||
|
||||
// initializer
|
||||
{
|
||||
try {
|
||||
// comment before
|
||||
g();
|
||||
// comment after
|
||||
} catch (Exception e) {
|
||||
<caret><selection>e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.</selection>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Add Catch Clause(s)" "true"
|
||||
class MyException1 extends Exception {}
|
||||
class MyException2 extends Exception {}
|
||||
|
||||
class Test {
|
||||
void foo () throws MyException1, MyException2 {}
|
||||
|
||||
void bar () {
|
||||
try {
|
||||
foo();
|
||||
} catch (MyException1 e) {
|
||||
} catch (MyException2 myException2) {
|
||||
<caret><selection>myException2.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.</selection>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// "Add Catch Clause(s)" "true"
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
||||
class CatchExceptions {
|
||||
|
||||
void foo() throws java.io.IOException, java.io.FileNotFoundException {
|
||||
|
||||
}
|
||||
|
||||
void bar() {
|
||||
try {
|
||||
foo();
|
||||
} catch (FileNotFoundException e) {
|
||||
<selection>e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.</selection>
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Add Catch Clause(s)" "true"
|
||||
class a {
|
||||
void g() throws Exception {
|
||||
}
|
||||
void f() {
|
||||
try {
|
||||
<caret>g();
|
||||
} catch (Error e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// "Add Catch Clause(s)" "false"
|
||||
// should not try to add catch clauses across method boundaries
|
||||
class s {
|
||||
int f() throws Exception {
|
||||
Runnable runnable = new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
Runnable runnable = new Runnable() {
|
||||
public void run() {
|
||||
<caret>int i = f();//
|
||||
}
|
||||
};
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
};
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Add Catch Clause(s)" "true"
|
||||
class a {
|
||||
void g() throws Exception {
|
||||
}
|
||||
|
||||
// initializer
|
||||
{
|
||||
try {
|
||||
// comment before
|
||||
<caret>g();
|
||||
// comment after
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Add Catch Clause(s)" "true"
|
||||
class MyException1 extends Exception {}
|
||||
class MyException2 extends Exception {}
|
||||
|
||||
class Test {
|
||||
void foo () throws MyException1, MyException2 {}
|
||||
|
||||
void bar () {
|
||||
try {
|
||||
<caret>foo();
|
||||
} catch (MyException1 e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Add Catch Clause(s)" "true"
|
||||
class CatchExceptions {
|
||||
|
||||
void foo() throws java.io.IOException, java.io.FileNotFoundException {
|
||||
|
||||
}
|
||||
|
||||
void bar() {
|
||||
try {
|
||||
foo();<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add Method Body" "true"
|
||||
class a {
|
||||
void f() {
|
||||
<selection>//To change body of created methods use File | Settings | File Templates.</selection><caret>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add Method Body" "true"
|
||||
class a {
|
||||
String f() {
|
||||
<selection>return null; //To change body of created methods use File | Settings | File Templates.</selection><caret>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add Method Body" "true"
|
||||
class a {
|
||||
a() {
|
||||
<selection>//To change body of created methods use File | Settings | File Templates.</selection><caret>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add Method Body" "true"
|
||||
class a {
|
||||
String f() {
|
||||
<selection>return null; //To change body of created methods use File | Settings | File Templates.</selection><caret>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Add Method Body" "true"
|
||||
class a {
|
||||
<caret>void f();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Add Method Body" "true"
|
||||
class a {
|
||||
<caret>String f();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Add Method Body" "true"
|
||||
class a {
|
||||
<caret>a();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Add Method Body" "true"
|
||||
class a {
|
||||
<caret>abstract String f();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Add Method Body" "false"
|
||||
interface a {
|
||||
<caret>String f();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add 'new int[]'" "true"
|
||||
class c {
|
||||
void f() {
|
||||
int[] a;
|
||||
a = <caret>new int[]{1, 2};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add 'new int[]'" "true"
|
||||
class c {
|
||||
void f() {
|
||||
int[] a;
|
||||
a = <caret>{1, 2};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Add on demand static import for 'test.Bar'" "true"
|
||||
package test;
|
||||
|
||||
import static test.Bar.*;
|
||||
|
||||
class Bar {
|
||||
public static final void f() {}
|
||||
}
|
||||
public class Foo {
|
||||
public static final void f(int i) {}
|
||||
|
||||
{
|
||||
<caret>Bar.f(); // invoke 'add on demand static import' for Bar class here. The call is now done to other method.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
// "Add on demand static import for 'test.Bar'" "true"
|
||||
package test;
|
||||
|
||||
import static test.Bar.*;
|
||||
|
||||
class Bar {
|
||||
public static final void f() {
|
||||
}
|
||||
}
|
||||
|
||||
public class Foo {
|
||||
{
|
||||
f(); // invoke 'add on demand static import' for Bar class here. The call is now done to other method.
|
||||
}
|
||||
|
||||
static class D {
|
||||
public static final void f(int i) {
|
||||
}
|
||||
|
||||
{
|
||||
Bar.f(); // invoke 'add on demand static import' for Bar class here. The call is now done to other method.
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
f(); // invoke 'add on demand static import' for Bar class here. The call is now done to other method.
|
||||
}
|
||||
|
||||
{
|
||||
f(); // invoke 'add on demand static import' for Bar class here. The call is now done to other method.
|
||||
}
|
||||
|
||||
{
|
||||
f(); // invoke 'add on demand static import' for Bar class here. The call is now done to other method.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Add on demand static import for 'test.Bar'" "false"
|
||||
package test;
|
||||
import static test.Bar.*;
|
||||
|
||||
class Bar {
|
||||
public static final void f() {}
|
||||
}
|
||||
public class Foo {
|
||||
public static final void f(int i) {}
|
||||
|
||||
{
|
||||
<caret>Bar.f(); // invoke 'add on demand static import' for Bar class here. The call is now done to other method.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Add on demand static import for 'test.Bar'" "true"
|
||||
package test;
|
||||
|
||||
class Bar {
|
||||
public static final void f() {}
|
||||
}
|
||||
public class Foo {
|
||||
public static final void f(int i) {}
|
||||
|
||||
{
|
||||
<caret>Bar.f(); // invoke 'add on demand static import' for Bar class here. The call is now done to other method.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// "Add on demand static import for 'test.Bar'" "true"
|
||||
package test;
|
||||
|
||||
class Bar {
|
||||
public static final void f() {
|
||||
}
|
||||
}
|
||||
|
||||
public class Foo {
|
||||
{
|
||||
Bar.f(); // invoke 'add on demand static import' for Bar class here. The call is now done to other method.
|
||||
}
|
||||
|
||||
static class D {
|
||||
public static final void f(int i) {
|
||||
}
|
||||
|
||||
{
|
||||
Bar.f(); // invoke 'add on demand static import' for Bar class here. The call is now done to other method.
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
Bar.f(); // invoke 'add on demand static import' for Bar class here. The call is now done to other method.
|
||||
}
|
||||
|
||||
{
|
||||
Bar.f(); // invoke 'add on demand static import' for Bar class here. The call is now done to other method.
|
||||
}
|
||||
|
||||
{
|
||||
<caret>Bar.f(); // invoke 'add on demand static import' for Bar class here. The call is now done to other method.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add Return Statement" "true"
|
||||
class a {
|
||||
int f() {
|
||||
return <caret><selection>0</selection>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add Return Statement" "true"
|
||||
class a {
|
||||
String f() {
|
||||
return <caret><selection>null</selection>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Add Return Statement" "true"
|
||||
class a {
|
||||
int f() {
|
||||
int i = 0;
|
||||
return <caret><selection>i</selection>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add Return Statement" "true"
|
||||
class a {
|
||||
int f(int p) {
|
||||
return <caret><selection>p</selection>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Add Return Statement" "true"
|
||||
class a {
|
||||
int f() {
|
||||
short i = 0;
|
||||
return <caret><selection>0</selection>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Add Return Statement" "true"
|
||||
class a {
|
||||
int f() {
|
||||
<caret>}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Add Return Statement" "true"
|
||||
class a {
|
||||
String f() {
|
||||
<caret>}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add Return Statement" "true"
|
||||
class a {
|
||||
int f() {
|
||||
int i = 0;
|
||||
<caret>}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Add Return Statement" "true"
|
||||
class a {
|
||||
int f(int p) {
|
||||
<caret>}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add Return Statement" "true"
|
||||
class a {
|
||||
int f() {
|
||||
short i = 0;
|
||||
<caret>}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add Method Body" "false"
|
||||
class a {
|
||||
String f() {
|
||||
return null;
|
||||
<caret>}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add Runtime Exception(s) to Method Signature" "true"
|
||||
class a {
|
||||
int f() throws RuntimeException {
|
||||
throw new RuntimeException()<caret>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add Runtime Exception(s) to Method Signature" "true"
|
||||
class a {
|
||||
int f() {
|
||||
throw new RuntimeException()<caret>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add Runtime Exception(s) to Method Signature" "false"
|
||||
class a {
|
||||
int f() throws RuntimeException{
|
||||
throw new RuntimeException()<caret>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
|
||||
class Example {
|
||||
void f(List<String> list) {}
|
||||
|
||||
void g() {
|
||||
f(<caret>Collections.<String>emptyList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
class Example {
|
||||
void f(Collection<String> list) {}
|
||||
|
||||
void g() {
|
||||
f(<caret>Collections.<String>emptyList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
|
||||
class Example {
|
||||
Example(List<String> list) {}
|
||||
|
||||
void g() {
|
||||
new Example(<caret>Collections.<String>emptyList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
|
||||
class Example {
|
||||
void f(List<String> list) {}
|
||||
|
||||
void g() {
|
||||
f(<caret>Collections.emptyList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
class Example {
|
||||
void f(Collection<String> list) {}
|
||||
|
||||
void g() {
|
||||
f(<caret>Collections.emptyList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
|
||||
class Example {
|
||||
Example(List<String> list) {}
|
||||
|
||||
void g() {
|
||||
new Example(<caret>Collections.emptyList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Cast to 'char'" "true"
|
||||
class a {
|
||||
void f(int i) {
|
||||
<caret>char c = (char) i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Cast to 'A.Iterator<java.lang.String>'" "true"
|
||||
class A {
|
||||
interface Iterator<T> {
|
||||
}
|
||||
|
||||
class List<T> {
|
||||
Iterator<T> iterator() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
void method() {
|
||||
List l = new List();
|
||||
<caret>Iterator<String> it = (Iterator<String>) l.iterator();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Cast to 'b'" "true"
|
||||
class a {
|
||||
void f(a a) {
|
||||
<caret>b b = (b) a;
|
||||
}
|
||||
}
|
||||
class b extends a {}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Cast to 'int'" "true"
|
||||
class a {
|
||||
void f() {
|
||||
int[] ii = {<caret>(int) 1.3};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Cast to 'int'" "true"
|
||||
class a {
|
||||
void f() {
|
||||
int i;
|
||||
<caret>i = (int) 3.4f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Cast to 'float'" "true"
|
||||
class a {
|
||||
float f() {
|
||||
double d = 4;
|
||||
return <caret>(float) d;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Cast to 'int'" "true"
|
||||
class a {
|
||||
void f() {
|
||||
double d = 4;
|
||||
switch (<caret>(int) d) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Cast to 'char'" "true"
|
||||
class a {
|
||||
void f() {
|
||||
double d = 4;
|
||||
switch ('c') {
|
||||
case <caret>(char) 3.3:
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Cast to 'java.lang.String'" "true"
|
||||
class a {
|
||||
void f() {
|
||||
Object y = null;
|
||||
String s = <caret>(String) y;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Cast to 'B'" "true"
|
||||
class A {
|
||||
void f(B b) {
|
||||
B s = <caret>b == null ? (B) this : b;
|
||||
}
|
||||
}
|
||||
class B extends A {}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Cast to 'B'" "true"
|
||||
class A {
|
||||
void f(B b) {
|
||||
B s = <caret>b == null ? null : (B) this;
|
||||
}
|
||||
}
|
||||
class B extends A {}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Cast to 'B'" "true"
|
||||
class A {
|
||||
void f(B b) {
|
||||
B s = <caret>(B) (b == null ? this : this);
|
||||
}
|
||||
}
|
||||
class B extends A {}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Cast to 'char'" "true"
|
||||
class a {
|
||||
void f(int i) {
|
||||
<caret>char c = i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Cast to 'A.Iterator<java.lang.String>'" "true"
|
||||
class A {
|
||||
interface Iterator<T> {
|
||||
}
|
||||
|
||||
class List<T> {
|
||||
Iterator<T> iterator() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
void method() {
|
||||
List l = new List();
|
||||
<caret>Iterator<String> it = (Iterator<Object>)l.iterator();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Cast to 'b'" "true"
|
||||
class a {
|
||||
void f(a a) {
|
||||
<caret>b b = a;
|
||||
}
|
||||
}
|
||||
class b extends a {}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Cast to 'int'" "true"
|
||||
class a {
|
||||
void f() {
|
||||
int[] ii = { <caret>1.3 };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Cast to 'int'" "true"
|
||||
class a {
|
||||
void f() {
|
||||
int i;
|
||||
<caret>i = 3.4f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Cast to 'float'" "true"
|
||||
class a {
|
||||
float f() {
|
||||
double d = 4;
|
||||
return <caret>d;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Cast to 'int'" "true"
|
||||
class a {
|
||||
void f() {
|
||||
double d = 4;
|
||||
switch (<caret>d) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Cast to 'char'" "true"
|
||||
class a {
|
||||
void f() {
|
||||
double d = 4;
|
||||
switch ('c') {
|
||||
case <caret>3.3:
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user