mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
IDEA-312818 [java-inspections] "Replace concatenation" naming is too long
GitOrigin-RevId: 732e1b24a1ce6c3f3791ad18483865eada50f529
This commit is contained in:
committed by
intellij-monorepo-bot
parent
09a1e4c5e8
commit
4390e0ec86
@@ -1,4 +1,4 @@
|
||||
// "Replace '0x7fffffffffffffffL == 0x7ffffffffffffffeL' with constant value 'false'" "true-preview"
|
||||
// "Compute constant value of '0x7fffffffffffffffL == 0x7ffffffffffffffeL'" "true-preview"
|
||||
class Test {
|
||||
boolean result = false;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Compute constant value of '"The quick brown fox jumps " + 100000 + " times" + " over the lazy dog"'" "true-preview"
|
||||
// "Replace with constant value" "true-preview"
|
||||
class Test {
|
||||
void test() {
|
||||
// Do not display the result in action name
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Replace '"a" + "b"' with constant value '"ab"'" "true-preview"
|
||||
// "Compute constant value of '"a" + "b"'" "true-preview"
|
||||
class Test {
|
||||
String x = ("ab");
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Replace '2 * 2' with constant value '4'" "true-preview"
|
||||
// "Compute constant value of '2 * 2'" "true-preview"
|
||||
class Test {
|
||||
int x = 4;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Replace '~2' with constant value '-3'" "true-preview"
|
||||
// "Compute constant value of '~2'" "true-preview"
|
||||
class Test {
|
||||
int x = -3;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Replace '0x7fffffffffffffffL == 0x7ffffffffffffffeL' with constant value 'false'" "true-preview"
|
||||
// "Compute constant value of '0x7fffffffffffffffL == 0x7ffffffffffffffeL'" "true-preview"
|
||||
class Test {
|
||||
boolean result = 0x7fffffffffffffffL<caret> == 0x7ffffffffffffffeL;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Compute constant value of '"The quick brown fox jumps " + 100000 + " times" + " over the lazy dog"'" "true-preview"
|
||||
// "Replace with constant value" "true-preview"
|
||||
class Test {
|
||||
void test() {
|
||||
// Do not display the result in action name
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Replace '"a" + "b"' with constant value '"ab"'" "true-preview"
|
||||
// "Compute constant value of '"a" + "b"'" "true-preview"
|
||||
class Test {
|
||||
String x = ("a" + <caret>"b");
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Replace '2 * 2' with constant value '4'" "true-preview"
|
||||
// "Compute constant value of '2 * 2'" "true-preview"
|
||||
class Test {
|
||||
int x = 2*<caret>2;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Replace '~2' with constant value '-3'" "true-preview"
|
||||
// "Compute constant value of '~2'" "true-preview"
|
||||
class Test {
|
||||
int x = ~<caret>2;
|
||||
}
|
||||
@@ -2262,6 +2262,7 @@ fix.add.argument.name=Add ''{0}'' argument
|
||||
inspection.constant.expression.display.name=Constant expression can be evaluated
|
||||
inspection.constant.expression.message=Constant expression can be evaluated to ''{0}''
|
||||
inspection.constant.expression.fix.name=Compute constant value of ''{0}''
|
||||
inspection.constant.expression.fix.name.short=Replace with constant value
|
||||
inspection.constant.expression.fix.name.with.value=Replace ''{0}'' with constant value ''{1}''
|
||||
inspection.constant.expression.fix.family.name=Compute constant value
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ConstantExpressionInspection extends AbstractBaseJavaLocalInspectionTool {
|
||||
private static final int MAX_RESULT_LENGTH_TO_DISPLAY = 50;
|
||||
private static final int MAX_RESULT_LENGTH_TO_DISPLAY = 40;
|
||||
private static final int MAX_EXPRESSION_LENGTH = 200;
|
||||
|
||||
@NotNull
|
||||
@@ -77,10 +77,10 @@ public class ConstantExpressionInspection extends AbstractBaseJavaLocalInspectio
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
if (myValueText.length() > MAX_RESULT_LENGTH_TO_DISPLAY) {
|
||||
if (myValueText.length() < MAX_RESULT_LENGTH_TO_DISPLAY) {
|
||||
return InspectionGadgetsBundle.message("inspection.constant.expression.fix.name", myText);
|
||||
}
|
||||
return InspectionGadgetsBundle.message("inspection.constant.expression.fix.name.with.value", myText, myValueText);
|
||||
return InspectionGadgetsBundle.message("inspection.constant.expression.fix.name.short");
|
||||
}
|
||||
|
||||
@Nls
|
||||
|
||||
Reference in New Issue
Block a user