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

Method toString

output/java_guava/1.4.19/HostAndPort.java:311–324  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

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