mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
more java tests moved to community
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// "Create Field 'field'" "true"
|
||||
class Main {
|
||||
static void foo() {
|
||||
new Object() {
|
||||
public int field<caret>;
|
||||
|
||||
void bar() {
|
||||
this.field = 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Create Field 'panel'" "true"
|
||||
import javax.swing.*;
|
||||
|
||||
class Test {
|
||||
private JPanel panel;
|
||||
|
||||
void foo(JPanel container) {
|
||||
if (panel == null) {
|
||||
panel = new JPanel();
|
||||
panel.setOpaque(true);
|
||||
container.add(panel);
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create Field 'FIELD'" "true"
|
||||
class C {
|
||||
public void foo() {
|
||||
int i = ITest.FIELD;
|
||||
}
|
||||
|
||||
public static interface ITest {
|
||||
int FIELD<caret>;
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Create Field 'fld'" "true"
|
||||
class A {
|
||||
private String fld<caret>;
|
||||
|
||||
public void foo() {
|
||||
Object x = fld;
|
||||
fld = "";
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Create Field 'fld'" "true"
|
||||
class A {
|
||||
private String fld<caret>;
|
||||
|
||||
public void foo() {
|
||||
Object x = fld;
|
||||
String s = fld;
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Create Field 'array'" "true"
|
||||
class Smth<T> {
|
||||
}
|
||||
|
||||
class Converter {
|
||||
static <T> Smth<T> asSmth (T[] t) {}
|
||||
}
|
||||
|
||||
class Test {
|
||||
private String[] array<caret>;
|
||||
|
||||
void bar () {
|
||||
Smth<String> l = Converter.asSmth(array);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Create Field 'field'" "true"
|
||||
class A{
|
||||
private Outer.Inner field<caret>;
|
||||
|
||||
{
|
||||
Outer.f(field);
|
||||
}
|
||||
}
|
||||
|
||||
class Outer{
|
||||
static class Inner{}
|
||||
|
||||
static void f(Inner inner){}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create Field 'field'" "true"
|
||||
class Main {
|
||||
static void foo() {
|
||||
new Object() {
|
||||
void bar() {
|
||||
this.<caret>field = 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Create Field 'panel'" "true"
|
||||
import javax.swing.*;
|
||||
|
||||
class Test {
|
||||
void foo(JPanel container) {
|
||||
if (p<caret>anel == null) {
|
||||
panel = new JPanel();
|
||||
panel.setOpaque(true);
|
||||
container.add(panel);
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Create Field 'FIELD'" "true"
|
||||
class C {
|
||||
public void foo() {
|
||||
int i = ITest.FIELD<caret>;
|
||||
}
|
||||
|
||||
public static interface ITest {
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Create Field 'fld'" "true"
|
||||
class A {
|
||||
public void foo() {
|
||||
Object x = <caret>fld;
|
||||
fld = "";
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Create Field 'fld'" "true"
|
||||
class A {
|
||||
public void foo() {
|
||||
Object x = <caret>fld;
|
||||
String s = fld;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Field not created" "false"
|
||||
class C {
|
||||
void foo() {
|
||||
te<caret>st();
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Create Field 'array'" "true"
|
||||
class Smth<T> {
|
||||
}
|
||||
|
||||
class Converter {
|
||||
static <T> Smth<T> asSmth (T[] t) {}
|
||||
}
|
||||
|
||||
class Test {
|
||||
void bar () {
|
||||
Smth<String> l = Converter.asSmth(a<caret>rray);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Create Field 'field'" "true"
|
||||
class A{
|
||||
{
|
||||
Outer.f(field<caret>);
|
||||
}
|
||||
}
|
||||
|
||||
class Outer{
|
||||
static class Inner{}
|
||||
|
||||
static void f(Inner inner){}
|
||||
}
|
||||
Reference in New Issue
Block a user