mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 02:09:59 +07:00
IDEA-238645 Test fixes and some refactoring
GitOrigin-RevId: 5a3ac649c4639a0a2981608c1f503fbea72ce3be
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fcf688ffa3
commit
6100adc63f
@@ -0,0 +1,26 @@
|
||||
// "Fix all 'Redundant String operation' problems in file" "true"
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
||||
class Main {
|
||||
|
||||
private static ByteArrayOutputStream foo() {
|
||||
return new ByteArrayOutputStream();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
ByteArrayOutputStream out1 = new ByteArrayOutputStream();
|
||||
String s1 = out1.toString();
|
||||
|
||||
ByteArrayOutputStream out2 = new ByteArrayOutputStream();
|
||||
String s2 = out2.toString();
|
||||
|
||||
ByteArrayOutputStream out3 = new ByteArrayOutputStream();
|
||||
String s3 = out3.toString();
|
||||
|
||||
ByteArrayOutputStream out4 = new ByteArrayOutputStream();
|
||||
String s4 = out4.toString();
|
||||
|
||||
String s5 = foo().toString();
|
||||
String s6 = foo().toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// "Fix all 'Redundant String operation' problems in file" "true"
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
||||
class Main {
|
||||
|
||||
private static ByteArrayOutputStream foo() {
|
||||
return new ByteArrayOutputStream();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
ByteArrayOutputStream out1 = new ByteArrayOutputStream();
|
||||
byte[] result1 = out1.toByteArray();
|
||||
String s1 = new String(result1);
|
||||
|
||||
ByteArrayOutputStream out2 = new ByteArrayOutputStream();
|
||||
byte[] result2 = out2.toByteArray();
|
||||
String s2 = new String((result2));
|
||||
|
||||
ByteArrayOutputStream out3 = new ByteArrayOutputStream();
|
||||
String s3 = new String(out3.toByteArray());
|
||||
|
||||
ByteArrayOutputStream out4 = new ByteArrayOutputStream();
|
||||
String s4 = new String((out4.toByteArray()));
|
||||
|
||||
String s5 = new String(foo().toByteArray());
|
||||
String s6 = new String((foo().toByteArray()<caret>));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user