mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 19:28:23 +07:00
more java tests moved to community
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// "Create Method 'get'" "true"
|
||||
class W<T> {
|
||||
public T get(T s) {
|
||||
<selection>return null; //To change body of created methods use File | Settings | File Templates.</selection>
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
void foo () {
|
||||
W<String> w = new W<String>();
|
||||
String s = w.get("");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Create Method 'get'" "true"
|
||||
class Generic<T> {
|
||||
public T get() {
|
||||
<selection>return null; //To change body of created methods use File | Settings | File Templates.<caret></selection>
|
||||
}
|
||||
}
|
||||
|
||||
class WWW {
|
||||
<E> void foo (Generic<E> p) {
|
||||
E e = p.get();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Create Method 'foo'" "true"
|
||||
interface Int<T> {
|
||||
}
|
||||
|
||||
class A1<T> implements Int<T> {
|
||||
public void foo(Int<T> c) {
|
||||
<selection>//To change body of created methods use File | Settings | File Templates.</selection><caret>
|
||||
}
|
||||
}
|
||||
|
||||
class B1 {
|
||||
A1<String> a;
|
||||
void foo (Int<String> c) {
|
||||
a.foo(c);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// "Create Method 'foo'" "true"
|
||||
interface Comparable<T> {
|
||||
}
|
||||
|
||||
class R implements Comparable<R> {
|
||||
|
||||
}
|
||||
|
||||
class A1<T> {
|
||||
public T foo() {
|
||||
<selection>return null; //To change body of created methods use File | Settings | File Templates.<caret></selection>
|
||||
}
|
||||
}
|
||||
|
||||
class B1 {
|
||||
A1<R> a;
|
||||
void foo (Comparable<R> c) {
|
||||
c = a.foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Create Constructor" "true"
|
||||
public class Seq<T> {
|
||||
public Seq() {}
|
||||
|
||||
public Seq(T x, Seq<T> xs) {
|
||||
<selection>//To change body of created methods use File | Settings | File Templates.</selection>
|
||||
}
|
||||
|
||||
static <T> Seq<T> nil () {
|
||||
return new Seq<T> ();
|
||||
}
|
||||
|
||||
static <V> Seq<V> cons (V x, Seq<V> xs) {
|
||||
return new Seq<V> (x, xs);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Create Method 'get'" "true"
|
||||
class W<T> {
|
||||
}
|
||||
|
||||
class C {
|
||||
void foo () {
|
||||
W<String> w = new W<String>();
|
||||
String s = w.<caret>get("");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Create Method 'get'" "true"
|
||||
class Generic<T> {
|
||||
}
|
||||
|
||||
class WWW {
|
||||
<E> void foo (Generic<E> p) {
|
||||
E e = p.g<caret>et();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Create Method 'foo'" "true"
|
||||
interface Int<T> {
|
||||
}
|
||||
|
||||
class A1<T> implements Int<T> {
|
||||
}
|
||||
|
||||
class B1 {
|
||||
A1<String> a;
|
||||
void foo (Int<String> c) {
|
||||
a.<caret>foo(c);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Create Method 'foo'" "true"
|
||||
interface Comparable<T> {
|
||||
}
|
||||
|
||||
class R implements Comparable<R> {
|
||||
|
||||
}
|
||||
|
||||
class A1<T> {
|
||||
}
|
||||
|
||||
class B1 {
|
||||
A1<R> a;
|
||||
void foo (Comparable<R> c) {
|
||||
c = a.<caret>foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Create Constructor" "true"
|
||||
public class Seq<T> {
|
||||
public Seq() {}
|
||||
|
||||
static <T> Seq<T> nil () {
|
||||
return new Seq<T> ();
|
||||
}
|
||||
|
||||
static <V> Seq<V> cons (V x, Seq<V> xs) {
|
||||
return new Seq<V> (x, xs)<caret>;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user