mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
moving tests
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
class A {
|
||||
String s;
|
||||
boolean foo() {
|
||||
boolean bar = false;
|
||||
if (s == null) {
|
||||
ba<caret>r = true;
|
||||
}
|
||||
return bar;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class A {
|
||||
String s;
|
||||
boolean foo() {
|
||||
boolean b<caret>ar = false;
|
||||
if (s == null) {
|
||||
bar = true;
|
||||
}
|
||||
return bar;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class AugmentedAssignment {
|
||||
public static String x() {
|
||||
String te<caret>xt = "";
|
||||
text += "something";
|
||||
return text;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class AugmentedAssignment {
|
||||
public static String x() {
|
||||
String te<caret>xt = "";
|
||||
text += "something";
|
||||
return text;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class IDEADEV10376 {
|
||||
private static int f(int p) {
|
||||
int i = 0;
|
||||
i = 9;
|
||||
i = f(<caret>i);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class IDEADEV10376 {
|
||||
private static int f(int p) {
|
||||
int i = 0;
|
||||
i = f(9);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import java.util.*;
|
||||
|
||||
class IDEADEV12244 {
|
||||
{
|
||||
TreeMap<String, Set<Integer>> map = new TreeMap<String, Set<Integer>>();
|
||||
Set<Integer> set = Collections.emptySet();
|
||||
map.put("foo", <caret>set);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import java.util.*;
|
||||
|
||||
class IDEADEV12244 {
|
||||
{
|
||||
TreeMap<String, Set<Integer>> map = new TreeMap<String, Set<Integer>>();
|
||||
map.put("foo", Collections.<Integer>emptySet());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Tester {
|
||||
void method(String x, String... y) {
|
||||
}
|
||||
|
||||
void method1(String x, String[] y) {
|
||||
}
|
||||
|
||||
void caller() {
|
||||
String[] thing = {"a", "b"};
|
||||
method("", <caret>thing);
|
||||
method1("", thing);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class Tester {
|
||||
void method(String x, String... y) {
|
||||
}
|
||||
|
||||
void method1(String x, String[] y) {
|
||||
}
|
||||
|
||||
void caller() {
|
||||
method("", "a", "b");
|
||||
method1("", new String[]{"a", "b"});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
public class IDEADEV950 {
|
||||
void foo () {
|
||||
int door_1 = 0;
|
||||
float doorP = door_1 ;
|
||||
//Cast should be inserted when inlining, otherwise semantics changes
|
||||
float d1 = (<caret>doorP / NOF_LOOPS);
|
||||
}
|
||||
|
||||
private static final int NOF_LOOPS = 2;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
public class IDEADEV950 {
|
||||
void foo () {
|
||||
int door_1 = 0;
|
||||
//Cast should be inserted when inlining, otherwise semantics changes
|
||||
float d1 = ((float) door_1 / NOF_LOOPS);
|
||||
}
|
||||
|
||||
private static final int NOF_LOOPS = 2;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import javax.swing.*;
|
||||
|
||||
class Test {
|
||||
public static JComponent getFoo() {
|
||||
JComponent c = new JPanel();
|
||||
return <caret>c;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import javax.swing.*;
|
||||
|
||||
class Test {
|
||||
public static JComponent getFoo() {
|
||||
return new JPanel();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class Inference {
|
||||
public <T> T getX() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void foo (String s) {}
|
||||
|
||||
{
|
||||
String v2 = new Inference().getX();
|
||||
foo(<caret>v2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Inference {
|
||||
public <T> T getX() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void foo (String s) {}
|
||||
|
||||
{
|
||||
foo(new Inference().<String>getX());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class YoYo {
|
||||
void bar () {}
|
||||
void f () {
|
||||
YoYo yoYoYo = foo();
|
||||
<caret>yoYoYo.bar();
|
||||
}
|
||||
|
||||
private YoYoYo foo() {
|
||||
|
||||
}
|
||||
class YoYoYo extends YoYo {}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class YoYo {
|
||||
void bar () {}
|
||||
void f () {
|
||||
foo().bar();
|
||||
}
|
||||
|
||||
private YoYoYo foo() {
|
||||
|
||||
}
|
||||
class YoYoYo extends YoYo {}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class Outer {
|
||||
String getValue() { return "";}
|
||||
void doSomething (String x) { }
|
||||
void foo() {
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
final String <caret>value = getValue();
|
||||
doSomething(value);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Outer {
|
||||
String getValue() { return "";}
|
||||
void doSomething (String x) { }
|
||||
void foo() {
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
doSomething(getValue());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Example {
|
||||
private class X<T> {}
|
||||
private <T> X<T> foo() { return new X<T>(); }
|
||||
private <T> X<T> boo(X<T> x) {return x;}
|
||||
private void goo() {
|
||||
X<Integer> f = foo();
|
||||
X<Integer> x = boo(<caret>f);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Example {
|
||||
private class X<T> {}
|
||||
private <T> X<T> foo() { return new X<T>(); }
|
||||
private <T> X<T> boo(X<T> x) {return x;}
|
||||
private void goo() {
|
||||
X<Integer> x = boo(this.<Integer>foo());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Example {
|
||||
private static class X<T> {}
|
||||
private static <T> X<T> foo() { return new X<T>(); }
|
||||
private static <T> X<T> boo(X<T> x) {return x;}
|
||||
private static void goo() {
|
||||
X<Integer> f = foo();
|
||||
X<Integer> x = boo(<caret>f);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Example {
|
||||
private static class X<T> {}
|
||||
private static <T> X<T> foo() { return new X<T>(); }
|
||||
private static <T> X<T> boo(X<T> x) {return x;}
|
||||
private static void goo() {
|
||||
X<Integer> x = boo(Example.<Integer>foo());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class A {
|
||||
void foo(final MyObject obj) {
|
||||
final MyObject _obj = obj;
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
System.out.println(<caret>_obj);
|
||||
}
|
||||
}.run();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
void foo(final MyObject obj) {
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
System.out.println(obj);
|
||||
}
|
||||
}.run();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class A {
|
||||
void foo(final MyObject obj) {
|
||||
final MyObject _obj;
|
||||
_obj = obj;
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
System.out.println(<caret>_obj);
|
||||
}
|
||||
}.run();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
void foo(final MyObject obj) {
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
System.out.println(obj);
|
||||
}
|
||||
}.run();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
public class IDEA17606 {
|
||||
|
||||
public void foo() {
|
||||
final Preferences preferences = Preferences.getInstance();
|
||||
// try to inline 'preferences'
|
||||
final Bar bar = new Bar(<caret>preferences.getComponent());
|
||||
bar.toString();
|
||||
|
||||
ThreadUtils.run(new Runnable() {
|
||||
public void run() {
|
||||
final Foo foo = new Foo();
|
||||
foo.setSize(preferences.getDimension().getSize());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
class Preferences {
|
||||
public static Preferences getInstance() {
|
||||
return new Preferences();
|
||||
}
|
||||
|
||||
public JComponent getComponent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Dimension getDimension() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
public Bar(JComponent component) {
|
||||
}
|
||||
}
|
||||
|
||||
class ThreadUtils {
|
||||
public static void run(Runnable runnable) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
public class IDEA17606 {
|
||||
|
||||
public void foo() {
|
||||
// try to inline 'preferences'
|
||||
final Bar bar = new Bar(Preferences.getInstance().getComponent());
|
||||
bar.toString();
|
||||
|
||||
ThreadUtils.run(new Runnable() {
|
||||
public void run() {
|
||||
final Foo foo = new Foo();
|
||||
foo.setSize(Preferences.getInstance().getDimension().getSize());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
class Preferences {
|
||||
public static Preferences getInstance() {
|
||||
return new Preferences();
|
||||
}
|
||||
|
||||
public JComponent getComponent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Dimension getDimension() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
public Bar(JComponent component) {
|
||||
}
|
||||
}
|
||||
|
||||
class ThreadUtils {
|
||||
public static void run(Runnable runnable) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
public class IDEA17606 {
|
||||
|
||||
public void foo() {
|
||||
final Preferences preferences = Preferences.getInstance();
|
||||
// try to inline 'preferences'
|
||||
final Bar bar = new Bar(preferences.getComponent());
|
||||
bar.toString();
|
||||
|
||||
ThreadUtils.run(new Runnable() {
|
||||
public void run() {
|
||||
final Foo foo = new Foo();
|
||||
foo.setSize(<caret>preferences.getDimension().getSize());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
class Preferences {
|
||||
public static Preferences getInstance() {
|
||||
return new Preferences();
|
||||
}
|
||||
|
||||
public JComponent getComponent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Dimension getDimension() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
public Bar(JComponent component) {
|
||||
}
|
||||
}
|
||||
|
||||
class ThreadUtils {
|
||||
public static void run(Runnable runnable) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
public class IDEA17606 {
|
||||
|
||||
public void foo() {
|
||||
// try to inline 'preferences'
|
||||
final Bar bar = new Bar(Preferences.getInstance().getComponent());
|
||||
bar.toString();
|
||||
|
||||
ThreadUtils.run(new Runnable() {
|
||||
public void run() {
|
||||
final Foo foo = new Foo();
|
||||
foo.setSize(Preferences.getInstance().getDimension().getSize());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
class Preferences {
|
||||
public static Preferences getInstance() {
|
||||
return new Preferences();
|
||||
}
|
||||
|
||||
public JComponent getComponent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Dimension getDimension() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
public Bar(JComponent component) {
|
||||
}
|
||||
}
|
||||
|
||||
class ThreadUtils {
|
||||
public static void run(Runnable runnable) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user