java: include parentheses () in text when referring to methods

GitOrigin-RevId: 1cfc8afb26b5db175d865f6bbdc752356040d8bb
This commit is contained in:
Bas Leijdekkers
2022-08-19 11:30:20 +02:00
committed by intellij-monorepo-bot
parent 46bc714501
commit 9addc5eaf7
285 changed files with 368 additions and 359 deletions

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInsight.intention;
import com.intellij.codeInsight.AnnotationTargetUtil;
@@ -20,6 +20,7 @@ import com.intellij.psi.*;
import com.intellij.psi.codeStyle.JavaCodeStyleManager;
import com.intellij.psi.impl.light.LightElement;
import com.intellij.psi.util.JavaElementKind;
import com.intellij.psi.util.PsiFormatUtil;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtil;
import com.intellij.util.ArrayUtil;
@@ -90,7 +91,7 @@ public class AddAnnotationPsiFix extends LocalQuickFixOnPsiElement implements On
public static @IntentionName String calcText(PsiModifierListOwner modifierListOwner, @Nullable String annotation) {
final String shortName = annotation == null ? null : annotation.substring(annotation.lastIndexOf('.') + 1);
if (modifierListOwner instanceof PsiNamedElement) {
final String name = ((PsiNamedElement)modifierListOwner).getName();
final String name = PsiFormatUtil.formatSimple((PsiNamedElement)modifierListOwner);
if (name != null) {
JavaElementKind type = JavaElementKind.fromElement(modifierListOwner).lessDescriptive();
if (shortName == null) {

View File

@@ -22,6 +22,7 @@ import com.intellij.psi.javadoc.PsiDocTag;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.PsiSearchHelper;
import com.intellij.psi.search.searches.ReferencesSearch;
import com.intellij.psi.util.PsiFormatUtil;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiTypesUtil;
import com.intellij.psi.util.PsiUtil;
@@ -127,7 +128,7 @@ public final class RedundantThrowsDeclarationLocalInspection extends AbstractBas
final PsiClassType exceptionType = throwRefType.myType;
final String description = JavaErrorBundle.message("exception.is.never.thrown", JavaHighlightUtil.formatType(exceptionType));
final RedundantThrowsQuickFix fix = new RedundantThrowsQuickFix(exceptionType.getCanonicalText(), method.getName());
final RedundantThrowsQuickFix fix = new RedundantThrowsQuickFix(exceptionType.getCanonicalText(), PsiFormatUtil.formatSimple(method));
myHolder.registerProblem(reference, description, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, fix);
});
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.psi.util;
import com.intellij.core.JavaPsiBundle;
@@ -32,6 +32,19 @@ public class PsiFormatUtil extends PsiFormatUtilBase {
SHOW_EXTENDS_IMPLEMENTS, SHOW_REDUNDANT_MODIFIERS, JAVADOC_MODIFIERS_ONLY, SHOW_RAW_TYPE})
public @interface FormatClassOptions { }
public static String formatSimple(@NotNull PsiNamedElement element) {
if (element instanceof PsiMethod) {
return formatMethod((PsiMethod)element, PsiSubstitutor.EMPTY, SHOW_NAME, 0);
}
else if (element instanceof PsiVariable) {
return formatVariable((PsiVariable)element, SHOW_NAME, PsiSubstitutor.EMPTY);
}
else if (element instanceof PsiClass) {
return formatClass((PsiClass)element, SHOW_NAME);
}
return element.getName();
}
public static @NlsSafe String formatVariable(@NotNull PsiVariable variable, @FormatVariableOptions int options, PsiSubstitutor substitutor) {
StringBuilder buffer = new StringBuilder();
formatVariable(variable, options, substitutor, buffer);
@@ -162,8 +175,8 @@ public class PsiFormatUtil extends PsiFormatUtilBase {
buffer.append(method.getName());
}
}
buffer.append('(');
if (BitUtil.isSet(options, SHOW_PARAMETERS)) {
buffer.append('(');
PsiParameter[] params = method.getParameterList().getParameters();
for (int i = 0; i < Math.min(params.length, maxParametersToShow); i++) {
if (i > 0) buffer.append(", ");
@@ -172,8 +185,8 @@ public class PsiFormatUtil extends PsiFormatUtilBase {
if (params.length > maxParametersToShow) {
buffer.append(", ...");
}
buffer.append(')');
}
buffer.append(')');
if (BitUtil.isSet(options, SHOW_TYPE) && BitUtil.isSet(options, TYPE_AFTER)) {
PsiType type = method.getReturnType();
if (type != null) {

View File

@@ -20,14 +20,14 @@ class B extends A {
}
B(String s) {
super(<error descr="Cannot reference 'B.db' before supertype constructor has been called">db</error>(1) );
super(<error descr="Cannot reference 'B.db()' before supertype constructor has been called">db</error>(1) );
}
B(int i, int j) {
super(<error descr="Cannot reference 'A.f' before supertype constructor has been called">f</error>());
super(<error descr="Cannot reference 'A.f()' before supertype constructor has been called">f</error>());
}
B(int i, int j, int k) {
super(<error descr="Cannot reference 'A.f' before supertype constructor has been called">super.f</error>());
super(<error descr="Cannot reference 'A.f()' before supertype constructor has been called">super.f</error>());
}
B(String s, int i) {
@@ -146,7 +146,7 @@ class Outer {
return null;
}
UseIt(int x) {
<error descr="Cannot reference 'UseIt.geto' before supertype constructor has been called">geto</error>().super();
<error descr="Cannot reference 'UseIt.geto()' before supertype constructor has been called">geto</error>().super();
}
UseIt(Outer x) {
<error descr="Cannot reference 'this' before supertype constructor has been called">this</error>.super();

View File

@@ -1,4 +1,4 @@
// "Make 'a.f' not abstract" "true-preview"
// "Make 'a.f()' not abstract" "true-preview"
interface a {
default String f() {
return null;

View File

@@ -1,4 +1,4 @@
// "Make 'a.f' not abstract" "true-preview"
// "Make 'a.f()' not abstract" "true-preview"
interface a {
String f();
}

View File

@@ -1,4 +1,4 @@
// "Annotate method 'dontAnnotateBase' as '@NotNull'" "true-preview"
// "Annotate method 'dontAnnotateBase()' as '@NotNull'" "true-preview"
import org.jetbrains.annotations.NotNull;
class X {

View File

@@ -1,4 +1,4 @@
// "Annotate method 'dontAnnotateBase' as '@NotNull'" "true-preview"
// "Annotate method 'dontAnnotateBase()' as '@NotNull'" "true-preview"
import org.jetbrains.annotations.NotNull;
class X {

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'X.MyAnnotation3'" "true-preview"
// "Make 'value()' return 'X.MyAnnotation3'" "true-preview"
class X {
@interface MyAnnotation1 { }

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'X.MyAnnotation1'" "true-preview"
// "Make 'value()' return 'X.MyAnnotation1'" "true-preview"
class X {
@interface MyAnnotation1 { }

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'java.lang.String[]'" "true-preview"
// "Make 'value()' return 'java.lang.String[]'" "true-preview"
class X {
@interface MyAnnotation {
String[] value();

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'java.lang.String[]'" "true-preview"
// "Make 'value()' return 'java.lang.String[]'" "true-preview"
class X {
@interface MyAnnotation {
String[] value() default {};

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'int'" "true-preview"
// "Make 'value()' return 'int'" "true-preview"
class X {
@interface MyAnnotation {
/*1*/int/*2*/ /*3*/value(/*4*/)/*5*/;

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'int'" "true-preview"
// "Make 'value()' return 'int'" "true-preview"
class X {
@interface MyAnnotation {
/*1*/int/*2*/ /*3*/value(/*4*/)/*5*/ default /*6*/42<caret>/*7*/;

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'java.lang.String'" "true-preview"
// "Make 'value()' return 'java.lang.String'" "true-preview"
class X {
@interface MyAnnotation {
String value() default<caret>;

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'X.MyAnnotation3'" "true-preview"
// "Make 'value()' return 'X.MyAnnotation3'" "true-preview"
class X {
@interface MyAnnotation1 { }

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'X.MyAnnotation1'" "true-preview"
// "Make 'value()' return 'X.MyAnnotation1'" "true-preview"
class X {
@interface MyAnnotation1 { }

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'java.lang.String[]'" "true-preview"
// "Make 'value()' return 'java.lang.String[]'" "true-preview"
class X {
@interface MyAnnotation {
String value();

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'java.lang.String[]'" "true-preview"
// "Make 'value()' return 'java.lang.String[]'" "true-preview"
class X {
@interface MyAnnotation {
String value() default {}<caret>;

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'int'" "true-preview"
// "Make 'value()' return 'int'" "true-preview"
class X {
@interface MyAnnotation {
/*1*/String/*2*/ /*3*/value(/*4*/)/*5*/;

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'int'" "true-preview"
// "Make 'value()' return 'int'" "true-preview"
class X {
@interface MyAnnotation {
/*1*/String/*2*/ /*3*/value(/*4*/)/*5*/ default /*6*/42<caret>/*7*/;

View File

@@ -1,4 +1,4 @@
// "Make 'value' return 'java.lang.String'" "true-preview"
// "Make 'value()' return 'java.lang.String'" "true-preview"
class X {
@interface MyAnnotation {
int value() default 42;

View File

@@ -1,6 +1,6 @@
import org.jetbrains.annotations.NonNls;
// "Annotate method 'test' as '@NonNls'" "true-preview"
// "Annotate method 'test()' as '@NonNls'" "true-preview"
class Foo {
@NonNls
Foo test(String s) {

View File

@@ -1,6 +1,6 @@
import org.jetbrains.annotations.NonNls;
// "Annotate method 'doTest' as '@NonNls'" "true-preview"
// "Annotate method 'doTest()' as '@NonNls'" "true-preview"
class Foo {
@NonNls
public String doTest() {

View File

@@ -1,4 +1,4 @@
// "Annotate method 'test' as '@NonNls'" "true-preview"
// "Annotate method 'test()' as '@NonNls'" "true-preview"
class Foo {
Foo test(String s) {
return this;

View File

@@ -1,4 +1,4 @@
// "Annotate method 'doTest' as '@NonNls'" "true-preview"
// "Annotate method 'doTest()' as '@NonNls'" "true-preview"
class Foo {
public String doTest() {
return "t<caret>ext";

View File

@@ -1,4 +1,4 @@
// "Make 'PrivateMethodRef.filter' package-private" "true"
// "Make 'PrivateMethodRef.filter()' package-private" "true"
import java.util.function.Predicate;
class PrivateMethodRef {

View File

@@ -1,4 +1,4 @@
// "Make 'PrivateMethodRef.filter' package-private" "true"
// "Make 'PrivateMethodRef.filter()' package-private" "true"
import java.util.function.Predicate;
class PrivateMethodRef {

View File

@@ -1,4 +1,4 @@
// "Make 'f' return 'int'" "true-preview"
// "Make 'f()' return 'int'" "true-preview"
class a {
int f() {
return <caret>1;

View File

@@ -1,4 +1,4 @@
// "Make 'call' return 'Callable<java.lang.Integer>'" "true"
// "Make 'call()' return 'Callable<java.lang.Integer>'" "true"
public class a extends Callable<Integer> {
public Callable<Integer> call() {
return new Callable<Integer>();

View File

@@ -1,4 +1,4 @@
// "Make 'call' return 'Callable<java.lang.Integer>'" "true"
// "Make 'call()' return 'Callable<java.lang.Integer>'" "true"
public class a extends CallableEx<Integer> {
public Callable<Integer> call() {
return new Callable<Integer>();

View File

@@ -1,4 +1,4 @@
// "Make 'f' return 'long'" "true-preview"
// "Make 'f()' return 'long'" "true-preview"
class a {
long f() {
return <caret>1L;

View File

@@ -1,4 +1,4 @@
// "Make 'f' return 'java.lang.String'" "true-preview"
// "Make 'f()' return 'java.lang.String'" "true-preview"
class a {
String f() {
return <caret>"";

View File

@@ -1,4 +1,4 @@
// "Make 'f' return 'void'" "true-preview"
// "Make 'f()' return 'void'" "true-preview"
class a {
void f() {
return <caret>;

View File

@@ -1,4 +1,4 @@
// "Make 'call' return 'java.lang.Integer'" "true"
// "Make 'call()' return 'java.lang.Integer'" "true"
public class a {
String f() {
return new Callable<Integer>() {

View File

@@ -1,4 +1,4 @@
// "Make 'call' return 'java.lang.Integer'" "true"
// "Make 'call()' return 'java.lang.Integer'" "true"
public class a implements Callable<Integer> {
public Integer call() {
return new Integer(0);

View File

@@ -1,4 +1,4 @@
// "Make 'call' return 'int'" "true"
// "Make 'call()' return 'int'" "true"
public class a implements Callable<Integer> {
public Integer call() {
return 42;

View File

@@ -1,4 +1,4 @@
// "Make 'getTT' return 'int'" "true-preview"
// "Make 'getTT()' return 'int'" "true-preview"
public class a {
<TT> int getTT() {
return 42;

View File

@@ -1,4 +1,4 @@
// "Make 'bar' return 'java.lang.String'" "true-preview"
// "Make 'bar()' return 'java.lang.String'" "true-preview"
public class Foo {
void foo() {
String s;

View File

@@ -1,4 +1,4 @@
// "Make 'getDrawerAppsList' return 'java.util.ArrayList<ResolveInfo>'" "true-preview"
// "Make 'getDrawerAppsList()' return 'java.util.ArrayList<ResolveInfo>'" "true-preview"
import java.util.*;
class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'doin' return 'int'" "true"
// "Make 'doin()' return 'int'" "true"
abstract class AsyncTask<A, B, C> {
abstract C doin(A... a);
}

View File

@@ -1,4 +1,4 @@
// "Make 'method' return 'java.util.List<T>'" "true-preview"
// "Make 'method()' return 'java.util.List<T>'" "true-preview"
import java.util.*;
public class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'get' return 'Callable<java.lang.Integer>'" "true-preview"
// "Make 'get()' return 'Callable<java.lang.Integer>'" "true-preview"
interface Gettable<T> {
Callable<Integer> get();
}

View File

@@ -1,4 +1,4 @@
// "Make 'm' return 'java.lang.Integer' or predecessor" "true-preview"
// "Make 'm()' return 'java.lang.Integer' or predecessor" "true-preview"
class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'm' return 'int'" "true-preview"
// "Make 'm()' return 'int'" "true-preview"
class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'm' return 'void'" "true-preview"
// "Make 'm()' return 'void'" "true-preview"
class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'getNumber' return 'java.lang.String'" "true-preview"
// "Make 'getNumber()' return 'java.lang.String'" "true-preview"
public class Test {
int number;

View File

@@ -1,4 +1,4 @@
// "Make 'getNumber' return 'double'" "true-preview"
// "Make 'getNumber()' return 'double'" "true-preview"
public class Test {
int number;

View File

@@ -1,4 +1,4 @@
// "Make 'bar' return 'java.lang.String'" "true-preview"
// "Make 'bar()' return 'java.lang.String'" "true-preview"
import java.util.List;
public class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'condition' return 'Test.Base' or predecessor" "true-preview"
// "Make 'condition()' return 'Test.Base' or predecessor" "true-preview"
abstract class Test {
private Base condition(boolean flag) {
return flag ? foo() : bar();

View File

@@ -1,4 +1,4 @@
// "Make 'condition' return 'Test.Child2' or predecessor" "true-preview"
// "Make 'condition()' return 'Test.Child2' or predecessor" "true-preview"
abstract class Test {
private Child2 condition(boolean flag) {
return flag ? foo() : bar();

View File

@@ -1,4 +1,4 @@
// "Make 'm' return 'double'" "true-preview"
// "Make 'm()' return 'double'" "true-preview"
class Test {
double m(boolean b) {

View File

@@ -1,4 +1,4 @@
// "Make 'foo' return 'int'" "true-preview"
// "Make 'foo()' return 'int'" "true-preview"
abstract class A {
private int condition(boolean flag) {
return flag ? foo() : bar();

View File

@@ -1,4 +1,4 @@
// "Make 'foo' return 'java.lang.Object'" "true-preview"
// "Make 'foo()' return 'java.lang.Object'" "true-preview"
class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'bar' return 'java.lang.String'" "true-preview"
// "Make 'bar()' return 'java.lang.String'" "true-preview"
public class Foo {
String foo() {
return bar();

View File

@@ -1,4 +1,4 @@
// "Make 'bar' return 'java.util.Iterator'" "true-preview"
// "Make 'bar()' return 'java.util.Iterator'" "true-preview"
import java.util.ArrayList;
import java.util.Iterator;

View File

@@ -1,4 +1,4 @@
// "Make 'test' return 'int'" "true-preview"
// "Make 'test()' return 'int'" "true-preview"
class Test {
int test(int val) {

View File

@@ -1,4 +1,4 @@
// "Make 'f' return 'int'" "true"
// "Make 'f()' return 'int'" "true"
interface SomeInterface<T> {
int f(T t);
}

View File

@@ -1,4 +1,4 @@
// "Make 'b' return 'java.lang.Integer'" "true"
// "Make 'b()' return 'java.lang.Integer'" "true"
class MyClass {
interface BaseInterface {

View File

@@ -1,4 +1,4 @@
// "Make 'bar' return 'java.lang.String'" "true-preview"
// "Make 'bar()' return 'java.lang.String'" "true-preview"
public class Foo {
void foo() {
String s = bar();

View File

@@ -1,4 +1,4 @@
// "Make 'f' return 'int'" "true-preview"
// "Make 'f()' return 'int'" "true-preview"
class a {
void f() {
return <caret>1;

View File

@@ -1,4 +1,4 @@
// "Make 'call' return 'Callable<java.lang.Integer>'" "true"
// "Make 'call()' return 'Callable<java.lang.Integer>'" "true"
public class a extends Callable<String> {
public Callable<String> call() {
return new Callable<Inte<caret>ger>();

View File

@@ -1,4 +1,4 @@
// "Make 'call' return 'Callable<java.lang.Integer>'" "true"
// "Make 'call()' return 'Callable<java.lang.Integer>'" "true"
public class a extends CallableEx<String> {
public Callable<String> call() {
return new Callable<Inte<caret>ger>();

View File

@@ -1,4 +1,4 @@
// "Make 'f' return 'long'" "true-preview"
// "Make 'f()' return 'long'" "true-preview"
class a {
int f() {
return <caret>1L;

View File

@@ -1,4 +1,4 @@
// "Make 'f' return 'java.lang.String'" "true-preview"
// "Make 'f()' return 'java.lang.String'" "true-preview"
class a {
int f() {
return <caret>"";

View File

@@ -1,4 +1,4 @@
// "Make 'f' return 'void'" "true-preview"
// "Make 'f()' return 'void'" "true-preview"
class a {
int f() {
return <caret>;

View File

@@ -1,4 +1,4 @@
// "Make 'f' return 'null'" "false"
// "Make 'f()' return 'null'" "false"
class a {
int f() {
return <caret>null;

View File

@@ -1,4 +1,4 @@
// "Make 'call' return 'java.lang.Integer'" "true"
// "Make 'call()' return 'java.lang.Integer'" "true"
public class a {
String f() {
return new Callable<String>() {

View File

@@ -1,4 +1,4 @@
// "Make 'call' return 'java.lang.Integer'" "true"
// "Make 'call()' return 'java.lang.Integer'" "true"
public class a implements Callable<String> {
public String call() {
return new Int<caret>eger(0);

View File

@@ -1,4 +1,4 @@
// "Make 'call' return 'int'" "true"
// "Make 'call()' return 'int'" "true"
public class a implements Callable<String> {
public String call() {
return 4<caret>2;

View File

@@ -1,4 +1,4 @@
// "Make 'getTT' return 'int'" "true-preview"
// "Make 'getTT()' return 'int'" "true-preview"
public class a {
<TT> TT getTT() {
return 4<caret>2;

View File

@@ -1,4 +1,4 @@
// "Make 'bar' return 'java.lang.String'" "true-preview"
// "Make 'bar()' return 'java.lang.String'" "true-preview"
public class Foo {
void foo() {
String s;

View File

@@ -1,4 +1,4 @@
// "Make 'getDrawerAppsList' return 'java.util.ArrayList<ResolveInfo>'" "true-preview"
// "Make 'getDrawerAppsList()' return 'java.util.ArrayList<ResolveInfo>'" "true-preview"
import java.util.*;
class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'doin' return 'int'" "true"
// "Make 'doin()' return 'int'" "true"
abstract class AsyncTask<A, B, C> {
abstract C doin(A... a);
}

View File

@@ -1,4 +1,4 @@
// "Make 'method' return 'java.util.List<T>'" "true-preview"
// "Make 'method()' return 'java.util.List<T>'" "true-preview"
import java.util.*;
public class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'method' return 'java.util.List<T>'" "false"
// "Make 'method()' return 'java.util.List<T>'" "false"
import java.util.*;
public class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'method' return 'java.util.List<T>'" "false"
// "Make 'method()' return 'java.util.List<T>'" "false"
import java.util.*;
public class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'get' return 'Callable<java.lang.Integer>'" "true-preview"
// "Make 'get()' return 'Callable<java.lang.Integer>'" "true-preview"
interface Gettable<T> {
Callable<Integer> get();
}

View File

@@ -1,4 +1,4 @@
// "Make 'm' return 'java.lang.Integer' or predecessor" "true-preview"
// "Make 'm()' return 'java.lang.Integer' or predecessor" "true-preview"
class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'm' return 'int'" "true-preview"
// "Make 'm()' return 'int'" "true-preview"
class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'm' return 'void'" "true-preview"
// "Make 'm()' return 'void'" "true-preview"
class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'getNumber' return 'java.lang.String'" "true-preview"
// "Make 'getNumber()' return 'java.lang.String'" "true-preview"
public class Test {
int number;

View File

@@ -1,4 +1,4 @@
// "Make 'getNumber' return 'double'" "true-preview"
// "Make 'getNumber()' return 'double'" "true-preview"
public class Test {
int number;

View File

@@ -1,4 +1,4 @@
// "Make 'getNumber' return 'java.lang.String'" "false"
// "Make 'getNumber()' return 'java.lang.String'" "false"
public class Test {
int number;

View File

@@ -1,4 +1,4 @@
// "Make 'bar' return 'java.lang.String'" "true-preview"
// "Make 'bar()' return 'java.lang.String'" "true-preview"
import java.util.List;
public class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'condition' return 'Test.Base' or predecessor" "true-preview"
// "Make 'condition()' return 'Test.Base' or predecessor" "true-preview"
abstract class Test {
private void condition(boolean flag) {
return flag ? foo()<caret> : bar();

View File

@@ -1,4 +1,4 @@
// "Make 'condition' return 'Test.Child2' or predecessor" "true-preview"
// "Make 'condition()' return 'Test.Child2' or predecessor" "true-preview"
abstract class Test {
private void condition(boolean flag) {
return flag ? foo() : b<caret>ar();

View File

@@ -1,4 +1,4 @@
// "Make 'condition' return 'java.lang.Object'" "false"
// "Make 'condition()' return 'java.lang.Object'" "false"
abstract class Test {
private Child2 condition(boolean flag) {
return flag ? foo<caret>() : bar();

View File

@@ -1,4 +1,4 @@
// "Make 'm' return 'double'" "true-preview"
// "Make 'm()' return 'double'" "true-preview"
class Test {
<caret>m(boolean b) {

View File

@@ -1,4 +1,4 @@
// "Make 'foo' return 'int'" "true-preview"
// "Make 'foo()' return 'int'" "true-preview"
abstract class A {
private int condition(boolean flag) {
return flag ? foo()<caret> : bar();

View File

@@ -1,4 +1,4 @@
// "Make 'foo' return 'java.lang.Object'" "true-preview"
// "Make 'foo()' return 'java.lang.Object'" "true-preview"
class Test {

View File

@@ -1,4 +1,4 @@
// "Make 'bar' return 'java.lang.String'" "true-preview"
// "Make 'bar()' return 'java.lang.String'" "true-preview"
public class Foo {
String foo() {
return <caret>bar();

View File

@@ -1,4 +1,4 @@
// "Make 'bar' return 'java.util.Iterator'" "true-preview"
// "Make 'bar()' return 'java.util.Iterator'" "true-preview"
import java.util.ArrayList;
public class Foo {
void bar() {

View File

@@ -1,4 +1,4 @@
// "Make 'test' return 'int'" "true-preview"
// "Make 'test()' return 'int'" "true-preview"
class Test {
void test(int val) {

View File

@@ -1,4 +1,4 @@
// "Make 'test' return 'java.lang.String'" "false"
// "Make 'test()' return 'java.lang.String'" "false"
import java.util.stream.Stream;

View File

@@ -1,4 +1,4 @@
// "Make 'f' return 'int'" "true"
// "Make 'f()' return 'int'" "true"
interface SomeInterface<T> {
void f(T t);
}

View File

@@ -1,4 +1,4 @@
// "Make 'b' return 'java.lang.Integer'" "true"
// "Make 'b()' return 'java.lang.Integer'" "true"
class MyClass {
interface BaseInterface {

View File

@@ -1,4 +1,4 @@
// "Make 'bar' return 'java.lang.String'" "true-preview"
// "Make 'bar()' return 'java.lang.String'" "true-preview"
public class Foo {
void foo() {
String <caret>s = bar();

View File

@@ -1,4 +1,4 @@
// "Make 'b' return 'void'" "false"
// "Make 'b()' return 'void'" "false"
class Test {
static void a() {}

View File

@@ -1,4 +1,4 @@
// "Make 'foo' return 'void'" "false"
// "Make 'foo()' return 'void'" "false"
abstract class A {
private void condition(boolean flag) {
return flag ? foo()<caret> : bar();

Some files were not shown because too many files have changed in this diff Show More