mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 02:38:59 +07:00
[java-intentions] Improve create method preview
GitOrigin-RevId: 9121bbda07694cdacab3508a83a08ba10e465d28
This commit is contained in:
committed by
intellij-monorepo-bot
parent
772791c821
commit
e5fd0db64d
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test() {
|
||||
test();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test() {
|
||||
test();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test() {
|
||||
test();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test() {
|
||||
test();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
static void test(int i) {}
|
||||
public Test() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create abstract method 'foo'" "true"
|
||||
// "Create abstract method 'foo'" "true-preview"
|
||||
class Usage {
|
||||
void usage(Target t) {
|
||||
t.foo();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create abstract method 'foo'" "true"
|
||||
// "Create abstract method 'foo'" "true-preview"
|
||||
class Usage {
|
||||
void usage(Target t) {
|
||||
t.foo();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create abstract method 'foo' in 'A'" "true"
|
||||
// "Create abstract method 'foo' in 'A'" "true-preview"
|
||||
abstract class A {
|
||||
void usage() {
|
||||
foo();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test() {
|
||||
byte[] bytes = new byte[0];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
{
|
||||
assert false: f();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'makeOp'" "true"
|
||||
// "Create method 'makeOp'" "true-preview"
|
||||
class Base<T> {
|
||||
Base(Factory<T> factory, Operator<T> operator) {
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'getPreloadKeys'" "true"
|
||||
// "Create method 'getPreloadKeys'" "true-preview"
|
||||
import java.util.*;
|
||||
|
||||
class X {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'getPreloadKeys'" "true"
|
||||
// "Create method 'getPreloadKeys'" "true-preview"
|
||||
import java.util.*;
|
||||
|
||||
class Foo<T>{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'bar'" "true"
|
||||
// "Create method 'bar'" "true-preview"
|
||||
public class Test {
|
||||
<T extends String> void foo (T t1, T t2) {
|
||||
bar (t1, t2);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test() {
|
||||
assert test();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'toMulti'" "true"
|
||||
// "Create method 'toMulti'" "true-preview"
|
||||
import java.util.Map;
|
||||
|
||||
class BrokenCreateMethod {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
void test(boolean b, Object obj) {
|
||||
if (b || test() == obj) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'doSomething' in 'Test'" "true"
|
||||
// "Create method 'doSomething' in 'Test'" "true-preview"
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
blaat(new Runnable() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public interface Test {
|
||||
|
||||
void test();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
{
|
||||
f(() -> {});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
{
|
||||
f(A::foo);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'foo'" "true"
|
||||
// "Create method 'foo'" "true-preview"
|
||||
class Test {
|
||||
<R, D> R foo(T<R, D> t, D data) {
|
||||
return t.foo(this, data);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
<T> T foo(){
|
||||
B<T> x = f();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
public class CreateMethodTest {
|
||||
public <T> T aMethod(T t) {
|
||||
T result = f(t);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f' in 'Nested" "true"
|
||||
// "Create method 'f' in 'Nested" "true-preview"
|
||||
public class CreateMethodTest {
|
||||
public <T> void aMethod(final T t) {
|
||||
class Nested {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'bar'" "true"
|
||||
// "Create method 'bar'" "true-preview"
|
||||
class A {
|
||||
public void foo() {
|
||||
Object x = bar();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'run'" "true"
|
||||
// "Create method 'run'" "true-preview"
|
||||
class Bug {
|
||||
|
||||
interface Foo<X> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'foo'" "true"
|
||||
// "Create method 'foo'" "true-preview"
|
||||
class A {
|
||||
private List<? extends CharSequence> sequences = null;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test2'" "true"
|
||||
// "Create method 'test2'" "true-preview"
|
||||
class Foo {
|
||||
static String FOO_BAR = "Bar";
|
||||
void test1() { test2(FOO_BAR); }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class Test {
|
||||
{
|
||||
long l = f(1) + f(2);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
{
|
||||
double d = -f();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
{
|
||||
-f();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'someMethod'" "true"
|
||||
// "Create method 'someMethod'" "true-preview"
|
||||
public class Test {
|
||||
|
||||
public Object get() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
{
|
||||
new Runnable() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test(Impl impl) {
|
||||
impl.test(test());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
interface X {
|
||||
public static void m() {
|
||||
f();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
interface I {}
|
||||
class A implements I {
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
public class A {
|
||||
public A() {
|
||||
this(f());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
import java.util.List;
|
||||
public class Test {
|
||||
<T> void f(List<? extends T> l) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
{
|
||||
int i = (Integer)test();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test() {
|
||||
te<caret>st();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test() {
|
||||
test(<caret>);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test() {
|
||||
test()<caret>;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test() {
|
||||
test();<caret>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
static void test(int i) {}
|
||||
public Test() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create abstract method 'foo'" "true"
|
||||
// "Create abstract method 'foo'" "true-preview"
|
||||
class Usage {
|
||||
void usage(Target t) {
|
||||
t.<caret>foo();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create abstract method 'foo'" "true"
|
||||
// "Create abstract method 'foo'" "true-preview"
|
||||
class Usage {
|
||||
void usage(Target t) {
|
||||
t.<caret>foo();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create abstract method 'foo' in 'A'" "true"
|
||||
// "Create abstract method 'foo' in 'A'" "true-preview"
|
||||
abstract class A {
|
||||
void usage() {
|
||||
<caret>foo();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test() {
|
||||
byte[] bytes = new byte[0];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
{
|
||||
assert false: f<caret>();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'makeOp'" "true"
|
||||
// "Create method 'makeOp'" "true-preview"
|
||||
class Base<T> {
|
||||
Base(Factory<T> factory, Operator<T> operator) {
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'getPreloadKeys'" "true"
|
||||
// "Create method 'getPreloadKeys'" "true-preview"
|
||||
import java.util.*;
|
||||
|
||||
class X {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'getPreloadKeys'" "true"
|
||||
// "Create method 'getPreloadKeys'" "true-preview"
|
||||
import java.util.*;
|
||||
|
||||
class Foo<T>{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'bar'" "true"
|
||||
// "Create method 'bar'" "true-preview"
|
||||
public class Test {
|
||||
<T extends String> void foo (T t1, T t2) {
|
||||
<caret>bar (t1, t2);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test() {
|
||||
assert <caret>test();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'toMulti'" "true"
|
||||
// "Create method 'toMulti'" "true-preview"
|
||||
import java.util.Map;
|
||||
|
||||
class BrokenCreateMethod {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
void test(boolean b, Object obj) {
|
||||
if (b || te<caret>st() == obj) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'doSomething' in 'Test'" "true"
|
||||
// "Create method 'doSomething' in 'Test'" "true-preview"
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
blaat(new Runnable() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public interface Test {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
{
|
||||
f<caret>(() -> {});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
{
|
||||
f<caret>(A::foo);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'foo'" "true"
|
||||
// "Create method 'foo'" "true-preview"
|
||||
class Test {
|
||||
<R, D> R foo(T<R, D> t, D data) {
|
||||
return t.f<caret>oo(this, data);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
<T> T foo(){
|
||||
B<T> x = f<caret>();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
public class CreateMethodTest {
|
||||
public <T> T aMethod(T t) {
|
||||
T result = f<caret>(t);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f' in 'Nested" "true"
|
||||
// "Create method 'f' in 'Nested" "true-preview"
|
||||
public class CreateMethodTest {
|
||||
public <T> void aMethod(final T t) {
|
||||
class Nested {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'bar'" "true"
|
||||
// "Create method 'bar'" "true-preview"
|
||||
class A {
|
||||
public void foo() {
|
||||
Object x = <caret>bar();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'run'" "true"
|
||||
// "Create method 'run'" "true-preview"
|
||||
class Bug {
|
||||
|
||||
interface Foo<X> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'foo'" "true"
|
||||
// "Create method 'foo'" "true-preview"
|
||||
class A {
|
||||
private List<? extends CharSequence> sequences = null;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test2'" "true"
|
||||
// "Create method 'test2'" "true-preview"
|
||||
class Foo {
|
||||
static String FOO_BAR = "Bar";
|
||||
void test1() { tes<caret>t2(FOO_BAR); }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class Test {
|
||||
{
|
||||
long l = f(1) + <caret>f(2);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
{
|
||||
double d = -f<caret>();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
{
|
||||
-f<caret>();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'someMethod'" "true"
|
||||
// "Create method 'someMethod'" "true-preview"
|
||||
public class Test {
|
||||
|
||||
public Object get() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
class A {
|
||||
{
|
||||
new Runnable() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public Test(Impl impl) {
|
||||
impl.test(te<caret>st());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
interface X {
|
||||
public static void m() {
|
||||
f<caret>();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
interface I {}
|
||||
class A implements I {
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'f'" "true"
|
||||
// "Create method 'f'" "true-preview"
|
||||
public class A {
|
||||
public A() {
|
||||
this(<caret>f());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
import java.util.List;
|
||||
public class Test {
|
||||
<T> void f(List<? extends T> l) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create method 'test'" "true"
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
{
|
||||
int i = (Integer)te<caret>st();
|
||||
|
||||
Reference in New Issue
Block a user