MCPcopy Index your code
hub / github.com/antlr/codebuff / toString

Method toString

output/java_guava/1.4.17/HostAndPort.java:308–321  ·  view source on GitHub ↗

Rebuild the host:port string, including brackets if necessary.

()

Source from the content-addressed store, hash-verified

306 /** Rebuild the host:port string, including brackets if necessary. */
307
308 @Override
309 public String toString() {
310 // "[]:12345" requires 8 extra bytes.
311 StringBuilder builder = new StringBuilder(host.length() + 8);
312 if (host.indexOf(':') >= 0) {
313 builder.append('[').append(host).append(']');
314 } else {
315 builder.append(host);
316 }
317 if (hasPort()) {
318 builder.append(':').append(port);
319 }
320 return builder.toString();
321 }
322
323 /** Return true for valid port numbers. */
324

Callers

nothing calls this directly

Calls 5

hasPortMethod · 0.95
toStringMethod · 0.65
lengthMethod · 0.45
indexOfMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected