show setting with generate annotations right on extract method dialog

This commit is contained in:
Anna Kozlova
2014-11-28 15:22:31 +01:00
parent 1d6f2590bf
commit f0a876431a
18 changed files with 73 additions and 25 deletions
@@ -1,3 +1,5 @@
import org.jetbrains.annotations.NotNull;
class Test {
void foo(Object x) {
@@ -5,6 +7,7 @@ class Test {
if (x instanceof String) x = newMethod((String) x);
}
@NotNull
private String newMethod(String x) {
return x.substring(1);
}
@@ -1,9 +1,12 @@
import org.jetbrains.annotations.NotNull;
class Test {
void foo() {
bar(newMethod());
baz(newMethod());
}
@NotNull
private String newMethod() {
return String.valueOf(1);
}
@@ -1,3 +1,5 @@
import org.jetbrains.annotations.NotNull;
import java.util.*;
class C {
@@ -11,6 +13,7 @@ class C {
System.out.println("l1 = " + l1 + ", l2 = " + l2);
}
@NotNull
private List newMethod(Object[] array) {
List l1 = null;
l1 = new ArrayList(Arrays.asList(array));
@@ -1,3 +1,5 @@
import org.jetbrains.annotations.NotNull;
import java.util.*;
class C {
@@ -11,6 +13,7 @@ class C {
System.out.println("l1 = " + l1 + ", l2 = " + l2);
}
@NotNull
private List newMethod(Object[] array) {
return new ArrayList(Arrays.asList(array));
}
@@ -1,9 +1,12 @@
import org.jetbrains.annotations.NotNull;
class C {
String method(Object o) {
System.out.println(o);
return newMethod(o);
}
@NotNull
private String newMethod(Object o) {
Integer i = new Integer(o.hashCode());
return i.toString();
@@ -1,9 +1,12 @@
import org.jetbrains.annotations.NotNull;
class C {
String method(Object o) {
System.out.println(o);
return newMethod(o);
}
@NotNull
private String newMethod(Object o) {
Integer i = new Integer(o.hashCode());
return i.toString();
@@ -1,3 +1,5 @@
import org.jetbrains.annotations.NotNull;
import java.util.*;
class C {
@@ -8,6 +10,7 @@ class C {
List l1 = newMethod(new Object[0]);
}
@NotNull
private ArrayList newMethod(Object[] o) {
return new ArrayList(Arrays.asList(o));
}
@@ -1,3 +1,5 @@
import org.jetbrains.annotations.NotNull;
public class S {
{
String s;
@@ -8,6 +10,7 @@ public class S {
System.out.print(s);
}
@NotNull
private String newMethod() {
String s;
s = "";
@@ -1,3 +1,5 @@
import org.jetbrains.annotations.NotNull;
class Test {
interface I {
String foo();
@@ -8,6 +10,7 @@ class Test {
};
}
@NotNull
private String newMethod() {
return "42";
}
@@ -1,3 +1,5 @@
import org.jetbrains.annotations.NotNull;
class Test {
void foo() {
final String str = newMethod();
@@ -9,6 +11,7 @@ class Test {
}
}
@NotNull
private String newMethod() {
final String str = "";
if (str == "") {
@@ -1,3 +1,5 @@
import org.jetbrains.annotations.NotNull;
class A {
public String method() {
try {
@@ -9,6 +11,7 @@ class A {
return "";
}
@NotNull
private String newMethod() {
try {
return "";
@@ -1,3 +1,5 @@
import org.jetbrains.annotations.NotNull;
public class Foo {
static Foo
f1 = new Foo(){
@@ -6,6 +8,7 @@ public class Foo {
}
};
@NotNull
private static String newMethod() {
return "a" + "b";
}
@@ -1,3 +1,5 @@
import org.jetbrains.annotations.NotNull;
public class A {
A(String s) {
}
@@ -6,6 +8,7 @@ public class A {
this(newMethod());
}
@NotNull
private static String newMethod() {
return "a";
}
@@ -1,3 +1,5 @@
import org.jetbrains.annotations.NotNull;
class BasicLazyResolveTest {
@@ -9,6 +11,7 @@ class BasicLazyResolveTest {
}
@NotNull
private Object newMethod() {
return new Object() {