mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Java: Slightly increased the limit for size of subexpression that can be an extracted method's parameter (IDEA-181195)
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
class C {
|
||||
void foo(String x, int a, int b) {
|
||||
String s1 = <selection>sum(a, b).substring(2, Math.max(a, b))</selection>;
|
||||
String s2 = sum(a, 0).substring(2, Math.min(a, b) + 1);
|
||||
String s3 = x.substring(2, a - b);
|
||||
}
|
||||
|
||||
String sum(int a, int b) {
|
||||
return a + " " + b;
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class C {
|
||||
void foo(String x, int a, int b) {
|
||||
String s1 = newMethod(sum(a, b), Math.max(a, b));
|
||||
String s2 = newMethod(sum(a, 0), Math.min(a, b) + 1);
|
||||
String s3 = newMethod(x, a - b);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String newMethod(String sum, int max) {
|
||||
return sum.substring(2, max);
|
||||
}
|
||||
|
||||
String sum(int a, int b) {
|
||||
return a + " " + b;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user