Skip to content

Commit f201471

Browse files
committed
Remove remaining use of Text
1 parent 349792d commit f201471

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/main/java/org/elasticsearch/common/network/InetAddresses.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import org.elasticsearch.core.SuppressForbidden;
2121
import org.elasticsearch.core.Tuple;
22-
import org.elasticsearch.xcontent.Text;
2322
import org.elasticsearch.xcontent.XContentString;
2423

2524
import java.net.Inet4Address;
@@ -434,7 +433,8 @@ private static String hextetsToIPv6String(int[] hextets) {
434433
* @throws IllegalArgumentException if the argument is not a valid IP string literal
435434
*/
436435
public static InetAddress forString(String ipString) {
437-
return forString(new Text(ipString).bytes());
436+
byte[] utf8Bytes = ipString.getBytes(StandardCharsets.UTF_8);
437+
return forString(utf8Bytes, 0, utf8Bytes.length);
438438
}
439439

440440
/**

0 commit comments

Comments
 (0)