private static String applyRFC2732(String hostname){
  if (hostname.indexOf(":") != -1) {
    return "[" + hostname + "]";
  }
  return hostname;
}

private static String applyRFC2732 ( String hostname ) { if ( hostname . indexOf ( ":" ) != - 1 ) { return "[" + hostname + "]" ; } return hostname ; }
process the string form of a hostname to make it comply with jmx url restrictions . namely wrap ipv6 literal address with " [ " , " ] "
