Create a globally unique identifier for naming instances

@return New globally unique identifier
7546
public static String makeGUID() {
        String uuid = "";
        String chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
        int rnd = 0;
        int r;

        for (int i = 0; i < GUID_STRING_LENGTH; i += 1) {
            if (i == 8 || i == 13 ||  i == 18 || i == 23) {
                uuid = uuid + "-";
            } else if (i == 14) {
                uuid = uuid + "4";
            } else {
                if (rnd <= 0x02) {
                    rnd = (int) (0x2000000 + Math.round(java.lang.Math.random() * 0x1000000));
                }
                r = rnd & 0xf;
                rnd = rnd >> 4;

                if (i == 19) {
                    uuid = uuid + chars.charAt((r & 0x3) | 0x8);
                } else {
                    uuid = uuid + chars.charAt(r);
                }
            }
        }
        return uuid;
    }
966105
function identifierFactory (ast, reserved) {
  reserved = reserved || new Set

  ast.find(j.Identifier).forEach(path => {
    reserved.add(path.node.name)
  })

  ast.find(j.FunctionDeclaration).forEach(path => {
    reserved.add(path.node.id.name)
  })

  function identifier (name, suffix) {
    return j.identifier(identifier.string(name, suffix))
  }

  identifier.string = function (name, suffix) {
    let sfx = suffix == null ? '' : suffix
      , unique = name + sfx
      , n = 0

    while (reserved.has(unique)) {
      unique = name + (n++) + sfx
    }

    return unique
  }

  return identifier
}
145126
function createIdentifierNode(name) {
  return (scope, opts) => {
    const property = get(opts.properties, name);

    return property ? property(scope) : get(scope, name);
  };
}
547064
private String createNewIdentifier(ParseTreeNode productionPart, String suffix)
	    throws TreeException {
	String identifier = "";
	if (productionPart.hasChild("IDENTIFIER")) {
	    identifier = productionPart.getChild("IDENTIFIER").getText();
	} else if (productionPart.hasChild("STRING_LITERAL")) {
	    identifier = productionPart.getChild("STRING_LITERAL").getText();
	}
	return createIdentifierName(identifier, suffix);
    }
1324232
public UniqueModel unique() {
		checkReadOnly();
		UniqueModel unique = new UniqueModel();
		unique.setTableModel(this);
		getUniqueConsts().add(unique);
		return unique;
	}
845891
private static String generateUniqueId(Set<String> ids, String idBase) {
		String id = idBase;
		int counter = 1;
		while (ids.contains(id)) {
			id = idBase + String.valueOf(counter++);
		}
		
		// put the newly generated one into the set
		ids.add(id);
		return id;
	}
808116
def create_id(self, prefix="guid"):
        
        if self.method == IDGenerator.METHOD_UUID:
            id_ = str(uuid.uuid4())
        elif self.method == IDGenerator.METHOD_INT:
            id_ = self.next_int
            self.next_int += 1
        else:
            raise InvalidMethodError(self.method)

        return "%s:%s-%s" % (self.namespace.prefix, prefix, id_)
228315
public GSSName createName(String nameStr,
			      Oid nameType,
			      Oid mech)
	throws GSSException {
	throw new GSSException(GSSException.UNAVAILABLE);
    }
1128627
protected StrongCounter getCounterOrCreateIt(String counterName, int initialValue) {
		CounterManager counterManager = EmbeddedCounterManagerFactory.asCounterManager( cacheManager );
		if ( !counterManager.isDefined( counterName ) ) {
			LOG.tracef( "Counter %s is not defined, creating it", counterName );

			// global configuration is mandatory in order to define
			// a new clustered counter with persistent storage
			validateGlobalConfiguration();

			counterManager.defineCounter( counterName,
				CounterConfiguration.builder(
					CounterType.UNBOUNDED_STRONG )
						.initialValue( initialValue )
						.storage( Storage.PERSISTENT )
						.build() );
		}

		StrongCounter strongCounter = counterManager.getStrongCounter( counterName );
		return strongCounter;
	}
781373
public static Command newGetGlobal(String identifier,
                                       String outIdentifier) {
        return getCommandFactoryProvider().newGetGlobal( identifier,
                                                         outIdentifier );
    }
914015
@Override
    public StringColumn unique() {
        List<String> strings = new ArrayList<>(lookupTable.asSet());
        return StringColumn.create(name() + " Unique values", strings);
    }
219727
private NamedAdminObjectServiceInfo createNamedAdminObjectServiceInfo(String id) {
        NamedAdminObjectServiceInfo aosInfo = adminObjectServices.get(id);
        if (aosInfo == null) {
            aosInfo = new NamedAdminObjectServiceInfo(id,
                            new ConcurrentServiceReferenceSet<AdminObjectService>(REFERENCE_ADMIN_OBJECT_SERVICES),
                            new ConcurrentServiceReferenceSet<AdminObjectService>(REFERENCE_ADMIN_OBJECT_SERVICES));
            adminObjectServices.put(id, aosInfo);
        }
        return aosInfo;
    }
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;
	}
815579
@Override
    public TZID getID() {

        if (this.id == null) {
            String zoneID = java.util.TimeZone.getDefault().getID();
            return new NamedID(zoneID);
        } else {
            return this.id;
        }

    }
828775
public String getInstanceId() {
        String rc = toString();
        int i = rc.indexOf("@");
        if (i > 0) {
            rc = rc.substring(i + 1);
        }
        return rc;
    }
1363818
public String createUniqueName(String name) {
		if (!isDuplicateName(name)) {
			return name;
		}
		if (name.matches(".*\\(\\d*\\)")) { //$NON-NLS-1$
			final int start = name.lastIndexOf('(');
			final int end = name.lastIndexOf(')');
			final String stringInt = name.substring(start + 1, end);
			final int numericValue = Integer.parseInt(stringInt);
			final String newName = name.substring(0, start + 1) + (numericValue + 1) + ")"; //$NON-NLS-1$
			return createUniqueName(newName);
		}
		return createUniqueName(name + " (1)"); //$NON-NLS-1$
	}
246570
public Object createInstanceQuietly() {
      try {
         return clazz.newInstance();
      } catch (InstantiationException e) {
         log.finest(e);
         return null;
      } catch (IllegalAccessException e) {
         log.finest(e);
         return null;
      }
   }