mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 10:20:15 +07:00
Fixes after review: IDEA-249165
GitOrigin-RevId: 5f90b50bd298dbc73283a6b2e78267483211c111
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ccd13a4b2d
commit
d6ecf8f1f0
@@ -0,0 +1,30 @@
|
||||
// "Fix all 'Redundant String operation' problems in file" "true"
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
class Main {
|
||||
|
||||
private static ByteArrayOutputStream foo() {
|
||||
return new ByteArrayOutputStream();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Charset charset = Charset.defaultCharset();
|
||||
|
||||
ByteArrayOutputStream out1 = new ByteArrayOutputStream();
|
||||
String s1 = out1.toString(charset);
|
||||
|
||||
ByteArrayOutputStream out2 = new ByteArrayOutputStream();
|
||||
String s2 = out2.toString((charset));
|
||||
|
||||
ByteArrayOutputStream out3 = new ByteArrayOutputStream();
|
||||
String s3 = out3.toString(charset);
|
||||
|
||||
ByteArrayOutputStream out4 = new ByteArrayOutputStream();
|
||||
String s4 = out4.toString((charset));
|
||||
|
||||
String s5 = foo().toString(charset);
|
||||
String s6 = foo().toString((charset));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// "Fix all 'Redundant String operation' problems in file" "true"
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
class Main {
|
||||
|
||||
private static ByteArrayOutputStream foo() {
|
||||
return new ByteArrayOutputStream();
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws UnsupportedEncodingException {
|
||||
String csn = "ISO-8859-1";
|
||||
|
||||
ByteArrayOutputStream out1 = new ByteArrayOutputStream();
|
||||
String s1 = out1.toString(csn);
|
||||
|
||||
ByteArrayOutputStream out2 = new ByteArrayOutputStream();
|
||||
String s2 = out2.toString((csn));
|
||||
|
||||
ByteArrayOutputStream out3 = new ByteArrayOutputStream();
|
||||
String s3 = out3.toString(csn);
|
||||
|
||||
ByteArrayOutputStream out4 = new ByteArrayOutputStream();
|
||||
String s4 = out4.toString((csn));
|
||||
|
||||
String s5 = foo().toString(csn);
|
||||
String s6 = foo().toString((csn));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// "Fix all 'Redundant String operation' problems in file" "true"
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
class Main {
|
||||
|
||||
private static ByteArrayOutputStream foo() {
|
||||
return new ByteArrayOutputStream();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Charset charset = Charset.defaultCharset();
|
||||
|
||||
ByteArrayOutputStream out1 = new ByteArrayOutputStream();
|
||||
byte[] result1 = out1.toByteArray();
|
||||
String s1 = new String(result1, charset);
|
||||
|
||||
ByteArrayOutputStream out2 = new ByteArrayOutputStream();
|
||||
byte[] result2 = out2.toByteArray();
|
||||
String s2 = new String((result2), (charset));
|
||||
|
||||
ByteArrayOutputStream out3 = new ByteArrayOutputStream();
|
||||
String s3 = new String(out3.toByteArray(), charset);
|
||||
|
||||
ByteArrayOutputStream out4 = new ByteArrayOutputStream();
|
||||
String s4 = new String((out4.toByteArray()), (charset));
|
||||
|
||||
String s5 = new String(foo().toByteArray(), charset);
|
||||
String s6 = new String((foo().toByteArray()), (charset<caret>));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// "Fix all 'Redundant String operation' problems in file" "true"
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
class Main {
|
||||
|
||||
private static ByteArrayOutputStream foo() {
|
||||
return new ByteArrayOutputStream();
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws UnsupportedEncodingException {
|
||||
String csn = "ISO-8859-1";
|
||||
|
||||
ByteArrayOutputStream out1 = new ByteArrayOutputStream();
|
||||
byte[] result1 = out1.toByteArray();
|
||||
String s1 = new String(result1, csn);
|
||||
|
||||
ByteArrayOutputStream out2 = new ByteArrayOutputStream();
|
||||
byte[] result2 = out2.toByteArray();
|
||||
String s2 = new String((result2), (csn));
|
||||
|
||||
ByteArrayOutputStream out3 = new ByteArrayOutputStream();
|
||||
String s3 = new String(out3.toByteArray(), csn);
|
||||
|
||||
ByteArrayOutputStream out4 = new ByteArrayOutputStream();
|
||||
String s4 = new String((out4.toByteArray()), (csn));
|
||||
|
||||
String s5 = new String(foo().toByteArray(), csn);
|
||||
String s6 = new String((foo().toByteArray()), (csn<caret>));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user