Method called when a reference to id is encountered. If so, need
to check if specified id entry (ref or definiton) exists; and if not,
to add a reference marker.
422406
public ElementId addReferenced(char[] buffer, int start, int len, int hash,
                                   Location loc, PrefixedName elemName, PrefixedName attrName)
    {
        int index = (hash & mIndexMask);
        ElementId id = mTable[index];

        while (id != null) {
            if (id.idMatches(buffer, start, len)) { // found existing one
                return id;
            }
            id = id.nextColliding();
        }

        // Not found, need to create a placeholder...

        // But first, do we need more room?
        if (mSize >= mSizeThreshold) {
            rehash();
            // Index changes, for the new entr:
            index = (hash & mIndexMask);
        }
        ++mSize;

        // Ok, then, let's create the entry
        String idStr = new String(buffer, start, len);
        id = new ElementId(idStr, loc, false, elemName, attrName);

        // First, let's link it to Map; all ids have to be connected
        id.setNextColliding(mTable[index]);
        mTable[index] = id;

        // And then add the undefined entry at the end of list
        if (mHead == null) {
            mHead = mTail = id;
        } else {
            mTail.linkUndefined(id);
            mTail = id;
        }
        return id;
    }
865136
public void setId(Object id) {
	  if (lock == SET) {
		 throw new IllegalStateException("EntryInfo is locked");
	  }
	  /*if (idFlag == SET) {
		 if (tc.isDebugEnabled()) Tr.debug(tc, "Illegal State: tried to set id to "+id+
											   ", but id was already set to "+this.id  );
		  throw new IllegalStateException("id was already set");
	  } */
	  idFlag = SET;
	  this.id = id;
	  if (tc.isDebugEnabled())
		 Tr.debug(tc, "set id=" + id);
   }
742551
static void checkId(String id) {
    if (!ID.matcher(id).matches()) {
      throw new IllegalArgumentException(String.format("not a valid js identifier: %s", id));
    }
  }
267983
def set_id(self, identifier):
        
        self._id = identifier
        refobj = self.get_refobj()
        if refobj:
            self.get_refobjinter().set_id(refobj, identifier)
1236948
@Override
	public String isValidID(String id) {
		Data data;
		try {
			data = identities.find(id, identities.reuse());
		} catch (IOException e) {
			return getName() + " could not lookup " + id + ": " + e.getLocalizedMessage();
		}
		return data==null?id + "is not an Identity in " + getName():null;
	}
908716
public void setId(String id)
	{
		if (id == null || id.length() == 0)
			throw new IllegalArgumentException(
			"id required in setId");

		this.setId(Integer.valueOf(id));
	}
156907
def add_external_reference(self,markable_id, external_ref):
        
        if markable_id in self.idx:
            markable_obj = Cterm(self.idx[markable_id],self.type)
            markable_obj.add_external_reference(external_ref)
        else:
            print('{markable_id} not in self.idx'.format(**locals()))
1228369
public boolean isExistingID() {
        try {
            String userId= getPost().getString(Defines.Jsonkey.Identity.getKey());
            return (userId != null && userId.equals(prefHelper_.getIdentity()));
        } catch (JSONException e) {
            e.printStackTrace();
            return false;
        }

    }
31924
function checkReference(references) {
            astUtils.getModifyingReferences(references).forEach(reference => {
                context.report({ node: reference.identifier, message: "'{{name}}' is a function.", data: { name: reference.identifier.name } });
            });
        }
877602
function isForInRef(ref) {
            let target = ref.identifier.parent;


            // "for (var ...) { return; }"
            if (target.type === "VariableDeclarator") {
                target = target.parent.parent;
            }

            if (target.type !== "ForInStatement") {
                return false;
            }

            // "for (...) { return; }"
            if (target.body.type === "BlockStatement") {
                target = target.body.body[0];

            // "for (...) return;"
            } else {
                target = target.body;
            }

            // For empty loop body
            if (!target) {
                return false;
            }

            return target.type === "ReturnStatement";
        }
182510
def getReference(self, id_):
        
        if id_ not in self._referenceIdMap:
            raise exceptions.ReferenceNotFoundException(id_)
        return self._referenceIdMap[id_]
805731
function replaceReferencedId(value, idFrom, idTo) {
  var re = new RegExp('url\\([\'"]?#' + idFrom + '[\'"]?\\)', 'g');
  return value.replace(re, "url(#" + idTo + ")");

}
370614
def _hook_id(self, info):
        
        if isinstance(info, dict) and 'id' in info.keys():
            self.id = info['id']
540899
public void addReference(String referenceSource, String referenceName, String referenceUrl) {
        final Reference ref = new Reference();
        ref.setSource(referenceSource);
        ref.setName(referenceName);
        ref.setUrl(referenceUrl);
        this.references.add(ref);
    }
1359562
def add_reference(self, source, target, **kwargs):
        
        # Tweak keyword arguments for addReference
        addRef_kw = kwargs.copy()
        addRef_kw.setdefault("referenceClass", self.referenceClass)
        if "schema" in addRef_kw:
            del addRef_kw["schema"]
        uid = api.get_uid(target)
        rc = api.get_tool("reference_catalog")
        # throws IndexError if uid is invalid
        rc.addReference(source, uid, self.relationship, **addRef_kw)
        # link the version of the reference
        self.link_version(source, target)
522408
private void ensureId(final Element element) {
        final String id = element.getId();
        if (id == null || id.isEmpty()) {
            element.setId(Document.get().createUniqueId());
        }
    }
737909
protected boolean check(String id, List<String> includes) {
		if (null != includes) {
			for (String check : includes) {
				if (check(id, check)) {
					return true;
				}
			}
		}
		return false;
	}