Implements the reverse process of the {@link #getUniqueInternalName(String)}.

@param internalName The name to be decoded.
@return The original, user-specified name for the state.
542769
public static String getOriginalNameFromInternal(String internalName) {
		Preconditions.checkNotNull(internalName);
		return internalName.split(STATE_NAME_DELIM)[0];
	}
1027773
def get_unique_name(name='', collection=()):
    '''
    
    '''
    if name not in collection:
        return name
    i = 1
    while True:
        i += 1
        name2 = '%s_%s' % (name, i)
        if name2 not in collection:
            return name2
831329
private String getUniqueTemplateName(String name, String ext) {
		if (this.getTreeModel().getTemplate(name) == null) {
			// Its unique
			return name;
		}
		// Its not unique, add a suitable index...
		String stub = name.substring(0, name.length() - ext.length() - 1);
		int index = 1;
		do {
			index++;
			name = stub + "(" + index + ")." + ext;
		}
		while (this.getTreeModel().getTemplate(name) != null);
		
		return name;
	}
993686
public String deduplicate(String name){
		long id = nextId(name);
		if (id == 0){	// the first one
			return name;
		}else{
			return String.format(renamePattern, name, id);
		}
	}
820328
def uniqueName(self, name):
        
        try:
            suffix = self.name_suffixes[name]
        except KeyError:
            self.name_suffixes[name] = 0
            return name

        suffix += 1
        self.name_suffixes[name] = suffix

        return "%s%i" % (name, suffix)
412096
@Pure
	public static String makeInternalId(UUID uid) {
		final StringBuilder buf = new StringBuilder("nowhere(?"); //$NON-NLS-1$
		buf.append(uid.toString());
		buf.append("?)"); //$NON-NLS-1$
		return Encryption.md5(buf.toString());
	}
1311194
@Override
    protected String toStringInternal(final boolean useSimpleNames) {
        final StringBuilder buf = new StringBuilder();
        buf.append(
                useSimpleNames ? elementTypeSignature.toStringWithSimpleNames() : elementTypeSignature.toString());
        for (int i = 0; i < numDims; i++) {
            buf.append("[]");
        }
        return buf.toString();
    }
773488
public static InternalQName getName(ValueData valueData) throws RepositoryException
   {
      if (valueData instanceof TransientValueData)
      {
         return getName(((TransientValueData)valueData).delegate);
      }
      
      try
      {
         return ((AbstractValueData)valueData).getName();
      }
      catch (IllegalNameException e)
      {
         throw new RepositoryException(e.getMessage(), e);
      }
   }
771049
public static String localName(String name) {
		int ix = name.lastIndexOf(Manager.HIERARCHY_DELIMITER);
		if (ix == -1) {
			return name;
		}
		return name.substring(ix + 1);
	}
1097937
private String getSecNameFromUniqueID(String uniqueId) throws WIMException {
        String METHODNAME = "getSecNameFromUniqueID";
        String secName = null;
        try {
            secName = getUserSecurityName(uniqueId);
        } catch (EntryNotFoundException e) {
            try {
                secName = getGroupSecurityName(uniqueId);
            } catch (com.ibm.ws.security.registry.EntryNotFoundException renf) {
                throw new EntityNotFoundException(WIMMessageKey.ENTITY_NOT_FOUND, Tr.formatMessage(tc, WIMMessageKey.ENTITY_NOT_FOUND,
                                                                                                   WIMMessageHelper.generateMsgParms(uniqueId)));
            } catch (RegistryException re) {
                throw new EntityNotFoundException(WIMMessageKey.ENTITY_NOT_FOUND, Tr.formatMessage(tc, WIMMessageKey.ENTITY_NOT_FOUND,
                                                                                                   WIMMessageHelper.generateMsgParms(uniqueId)));
            }
        } catch (RegistryException e) {
            throw new EntityNotFoundException(WIMMessageKey.ENTITY_NOT_FOUND, Tr.formatMessage(tc, WIMMessageKey.ENTITY_NOT_FOUND,
                                                                                               WIMMessageHelper.generateMsgParms(uniqueId)));
        }

        if (tc.isDebugEnabled()) {
            Tr.debug(tc, METHODNAME + " The Security Name for " + uniqueId + " is " + secName);
        }

        return secName;
    }
208471
private static Class<?> getClassFromInternalName(String internalName) {
    try {
      return Class.forName(internalName.replace('/', '.'));
    } catch (ClassNotFoundException e) {
      throw new RuntimeException(e);
    }
  }
83025
private String getCallerUniqueName() throws WIMApplicationException {
        String uniqueName = null;
        Subject subject = null;
        WSCredential cred = null;

        try {
            /* Get the subject */
            if ((subject = WSSubject.getRunAsSubject()) == null) {
                subject = WSSubject.getCallerSubject();
            }

            /* Get the credential */
            if (subject != null) {
                Iterator<WSCredential> iter = subject.getPublicCredentials(WSCredential.class).iterator();
                if (iter.hasNext()) {
                    cred = iter.next();
                }
                //check if credentials is null , then throw exception
                if (null == cred) {
                    throw new WIMApplicationException(WIMMessageKey.AUTH_SUBJECT_CRED_FAILURE, Tr.formatMessage(tc, WIMMessageKey.AUTH_SUBJECT_CRED_FAILURE));
                }
            }
            //throw exception when subject is null
            else {
                throw new WIMApplicationException(WIMMessageKey.AUTH_SUBJECT_FAILURE, Tr.formatMessage(tc, WIMMessageKey.AUTH_SUBJECT_FAILURE));
            }

            /* Get the unique name */
            uniqueName = cred.getUniqueSecurityName();
            if (null == uniqueName) {
                throw new WIMApplicationException(WIMMessageKey.AUTH_SUBJECT_CRED_FAILURE, Tr.formatMessage(tc, WIMMessageKey.AUTH_SUBJECT_CRED_FAILURE));
            }
        } //throw exception in case there is some issue while retrieving authentication details from subject
        catch (Exception excp) {
            //check if Auth subject failure OR auth credential failure to give relevant message in exception
            if (WIMMessageKey.AUTH_SUBJECT_FAILURE.equals(excp.getMessage())) {
                throw new WIMApplicationException(WIMMessageKey.AUTH_SUBJECT_FAILURE, Tr.formatMessage(tc, WIMMessageKey.AUTH_SUBJECT_FAILURE));
            } else {
                throw new WIMApplicationException(WIMMessageKey.AUTH_SUBJECT_CRED_FAILURE, Tr.formatMessage(tc, WIMMessageKey.AUTH_SUBJECT_CRED_FAILURE));
            }
        }

        //return unique name obtained from subject
        return uniqueName;
    }
922940
@FFDCIgnore({ EntityNotFoundException.class, Exception.class })
    private String getUniqueNameByUniqueId(String uniqueId, boolean isAllowOperationIfReposDown, Set<String> failureRepositoryIds) throws WIMException {
        final String METHODNAME = "getUniqueNameByUniqueId";
        String uniqueName = null;

        boolean found = false;
        int i = 0;
        Root temp = new Root();
        Entity entity = new Entity();
        IdentifierType id = new IdentifierType();
        id.setExternalId(uniqueId);
        entity.setIdentifier(id);
        temp.getEntities().add(entity);

        List<String> repositoryIds = repositoryManager.getRepoIds();
        while (i < repositoryIds.size() && !found) {
            try {
                Root returnedRoot = repositoryManager.getRepository(repositoryIds.get(i)).get(temp);
                if (returnedRoot != null) {
                    List<Entity> pes = returnedRoot.getEntities();
                    if (pes != null) {
                        Entity ent = pes.get(0);
                        if (ent != null) {
                            IdentifierType entityId = ent.getIdentifier();
                            if (entityId != null) {
                                uniqueName = entityId.getUniqueName();
                                found = true;
                            }
                        }
                    }
                }
            } catch (EntityNotFoundException e) {
                // Move on to the next repository
                i++;
            } catch (Exception e) {
                if (!isAllowOperationIfReposDown) {
                    if (e instanceof WIMException) {
                        throw (WIMException) e;
                    }
                    throw new WIMException(e);
                } else {
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, METHODNAME + " IGNORE: exception [" + e.getMessage()
                                     + "] on repository [" + repositoryIds.get(i) + "]");
                    failureRepositoryIds.add(repositoryIds.get(i));

                    // Move on to the next repository
                    i++;
                }
            }
        }
        return uniqueName;
    }
177814
public static UUID nameUUIDFromBytes(byte[] name) {
		MessageDigest md;
		try {
			md = MessageDigest.getInstance("MD5");
		} catch (NoSuchAlgorithmException nsae) {
			throw new InternalError("MD5 not supported");
		}
		byte[] md5Bytes = md.digest(name);
		md5Bytes[6] &= 0x0f; /* clear version */
		md5Bytes[6] |= 0x30; /* set to version 3 */
		md5Bytes[8] &= 0x3f; /* clear variant */
		md5Bytes[8] |= 0x80; /* set to IETF variant */
		return new UUID(md5Bytes);
	}
1216397
public static InternalQName parse(String qName) throws IllegalNameException
   {

      if (!qName.startsWith("["))
         throw new IllegalNameException("Invalid Internal QName '" + qName + "' Should start of '['");
      int uriStart = 0;
      int uriFinish = qName.indexOf("]", uriStart);
      if (uriFinish == -1)
         throw new IllegalNameException("Invalid Internal QName '" + qName + "' No closed ']'");
      String uri = qName.substring(uriStart + 1, uriFinish);
      String localName = qName.substring(uriFinish + 1, qName.length());
      return new InternalQName(uri, localName);
   }
368839
@Override
	public String getUniqueId() {
		final String sourceMethod = "getUniqueId"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(AggregatorExtension.class.getName(), sourceMethod);
			log.exiting(AggregatorExtension.class.getName(), sourceMethod, uniqueId);
		}
		return uniqueId;
	}
1356447
public function getUniqueName($name)
    {
        if (!isset($this->registry[$name])) {
            $this->registry[$name] = 0;

            return $name;
        }

        ++$this->registry[$name];

        return sprintf('%s_%s', $name, $this->registry[$name]);
    }