mirror of
https://github.com/jlengrand/error-prone-support.git
synced 2026-03-10 08:11:25 +00:00
Add tests and more context in the StringRules file
This commit is contained in:
@@ -246,5 +246,9 @@ final class StringRules {
|
||||
}
|
||||
|
||||
// Rewrite `String#copyValueOf(char[])` to `new String(char[])`.
|
||||
// Example:
|
||||
// String.copyValueOf(new char[]);
|
||||
// -->
|
||||
// new String(new char[]);
|
||||
|
||||
}
|
||||
|
||||
@@ -96,4 +96,8 @@ final class StringRulesTest implements RefasterRuleCollectionTestCase {
|
||||
int testUtf8EncodedLength() {
|
||||
return "foo".getBytes(UTF_8).length;
|
||||
}
|
||||
|
||||
String testNewStringChar() {
|
||||
return String.copyValueOf(new char[] {'f', 'o', 'o'});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,4 +96,8 @@ final class StringRulesTest implements RefasterRuleCollectionTestCase {
|
||||
int testUtf8EncodedLength() {
|
||||
return Utf8.encodedLength("foo");
|
||||
}
|
||||
|
||||
String testNewStringChar() {
|
||||
return new String(new char[] {'f', 'o', 'o'});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user