build the qname with the given, and make sure the namespace is ended with "/" if specified.

@param portNameSpace
@param portLocalName
@return
322947
public static QName buildQName(String namespace, String localName)
    {
        String namespaceURI = namespace;
        if (!isEmpty(namespace) && !namespace.trim().endsWith("/"))
        {
            namespaceURI += "/";
        }

        return new QName(namespaceURI, localName);
    }
875519
public static final String getQualifiedName(String localName, String pfx) {
		pfx = pfx == null ? "" : pfx;
		return pfx.length() == 0 ? localName
				: (pfx + Constants.COLON + localName);
	}
930796
public static synchronized String getLocalHostName(int timeoutMs) {
    if (sLocalHost != null) {
      return sLocalHost;
    }

    try {
      sLocalHost = InetAddress.getByName(getLocalIpAddress(timeoutMs)).getCanonicalHostName();
      return sLocalHost;
    } catch (UnknownHostException e) {
      throw new RuntimeException(e);
    }
  }
987109
public static String getClassName(QName qname) {
		try {
			StringBuilder className = new StringBuilder();

			// e.g., {http://www.w3.org/2001/XMLSchema}decimal
			StringTokenizer st1 = new StringTokenizer(qname.getNamespaceURI(),
					"/");
			// --> "http:" -> "www.w3.org" --> "2001" -> "XMLSchema"
			st1.nextToken(); // protocol, e.g. "http:"
			String domain = st1.nextToken(); // "www.w3.org"

			StringTokenizer st2 = new StringTokenizer(domain, ".");
			List<String> lDomain = new ArrayList<String>();
			while (st2.hasMoreTokens()) {
				lDomain.add(st2.nextToken());
			}
			assert (lDomain.size() >= 2);
			className.append(lDomain.get(lDomain.size() - 1)); // "org"
			className.append('.');
			className.append(lDomain.get(lDomain.size() - 2)); // "w3"

			while (st1.hasMoreTokens()) {
				className.append('.');
				className.append(st1.nextToken());
			}

			className.append('.');
			className.append(qname.getLocalPart());

			return className.toString();
		} catch (Exception e) {
			return null;
		}
	}
421947
public String first(String localName) {
		for (Element child : children()) {
			if (localName.equals(child.getLocalName()) && XCAL_NS.equals(child.getNamespaceURI())) {
				return child.getTextContent();
			}
		}
		return null;
	}
295615
public static String buildName(final QName pQName) {
        if (pQName == null) {
            throw new NullPointerException("mQName must not be null!");
        }
        String name;
        if (pQName.getPrefix().isEmpty()) {
            name = pQName.getLocalPart();
        } else {
            name = new StringBuilder(pQName.getPrefix()).append(":").append(pQName.getLocalPart()).toString();
        }
        return name;
    }
340792
public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
        setEndpointAddress(portName.getLocalPart(), address);
    }
665510
public Hashtable<String,List<Other>> attributesWithNamespace(String namespace) {


        Hashtable<String,List<Other>> result=namespaceIndex.get(namespace);
        if (result==null) {
            result=new Hashtable<String,List<Other>>();
            namespaceIndex.put(namespace,result);
        }

        for (Other attribute: attributes) {
            
            QualifiedName name=attribute.getElementName();
            if (namespace.equals(name.getNamespaceURI())) {
                List<Other> ll=result.get(name.getLocalPart());
                if (ll==null) {
                    List<Other> tmp=new LinkedList<Other>();
                    tmp.add(attribute);
                    result.put(name.getLocalPart(),tmp);
                } else {
                    ll.add(attribute);                        
                }
            }
        }
        return result;
    }
737195
public static String getLocalHostName() {
        String localHostName = NetUtils.getHostName();
        return SystemPropertiesUtils.getSystemProperty(
                NaviCommonConstant.SYSTEM_PROPERTY_SERVER_HOST_FROM_ENV_4JPAAS2, localHostName);
    }
368890
def _build_qname(self, uri=None, namespaces=None):
        
        if not uri:
            uri = self.uri
        if not namespaces:
            namespaces = self.namespaces
        return uri2niceString(uri, namespaces)
18625
public String getLocalNameOfNode(Node n)
  {

    String qname = n.getNodeName();
    int index = qname.indexOf(':');

    return (index < 0) ? qname : qname.substring(index + 1);
  }
371860
@NonNull
  public SelfT withKeyspace(@Nullable String keyspaceName) {
    return withKeyspace(keyspaceName == null ? null : CqlIdentifier.fromCql(keyspaceName));
  }
628852
public String getLocalizedName(Locale locale) {

        if (m_messageContainer != null) {
            return m_messageContainer.key(locale);
        }
        return m_key;
    }
230308
public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        if (portName == null) {
            return getPort(serviceEndpointInterface);
        }
        java.lang.String inputPortName = portName.getLocalPart();
        if ("NetworkServiceInterfacePort".equals(inputPortName)) {
            return getNetworkServiceInterfacePort();
        }
        else  {
            java.rmi.Remote _stub = getPort(serviceEndpointInterface);
            ((org.apache.axis.client.Stub) _stub).setPortName(portName);
            return _stub;
        }
    }
1105696
protected boolean isValidQName(
        String prefix,
        String local,
        boolean xml11Version) {

        // check that both prefix and local part match NCName
        if (local == null)
            return false;
        boolean validNCName = false;

        if (!xml11Version) {
            validNCName =
                (prefix == null || XMLChar.isValidNCName(prefix))
                    && XMLChar.isValidNCName(local);
        } else {
            validNCName =
                (prefix == null || XML11Char.isXML11ValidNCName(prefix))
                    && XML11Char.isXML11ValidNCName(local);
        }

        return validNCName;
    }
222971
@Override
    public void createNamespace() {
        KeyspaceMetadata ksMetadata = m_cluster.getMetadata().getKeyspace(m_keyspace);
        if (ksMetadata == null) {
            new CQLSchemaManager(this).createKeyspace();
        }
    }
610781
public @Nullable String build() {
    StringBuilder queryString = new StringBuilder();

    for (NameValuePair param : params) {
      if (queryString.length() > 0) {
        queryString.append(PARAM_SEPARATOR);
      }
      queryString.append(Escape.urlEncode(param.getName()));
      queryString.append(VALUE_SEPARATOR);
      queryString.append(Escape.urlEncode(param.getValue()));
    }

    if (queryString.length() > 0) {
      return queryString.toString();
    }
    else {
      return null;
    }
  }