Checks all crossreferences found in the bibliography. If one can not
        be resolved from *this* Bibliography instance, a BrokenCrossReferences
        exception is raised.
324852
def check_crossrefs(self):
        
        broken = []
        for value in self.values():
            crossref = value.get('crossref')
            if crossref is not None:
                if crossref not in self:
                    broken.append(value)
        if len(broken):
            raise exceptions.BrokenCrossReferences('One or more cross reference could not'
                    ' be resolved', broken)
843846
private static boolean hasReferences(Bean target, BeanId reference) {
        for (String name : target.getReferenceNames()) {
            for (BeanId ref : target.getReference(name)) {
                if (ref.equals(reference)) {
                    return true;
                }
            }
        }
        return false;
    }
778369
public void check(ModelDef modelDef, String checkLevel) throws ConstraintException
    {
        ensureReferencedKeys(modelDef, checkLevel);
        checkReferenceForeignkeys(modelDef, checkLevel);
        checkCollectionForeignkeys(modelDef, checkLevel);
        checkKeyModifications(modelDef, checkLevel);
    }
993219
private void checkReferenceForeignkeys(ModelDef modelDef, String checkLevel) throws ConstraintException
    {
        if (CHECKLEVEL_NONE.equals(checkLevel))
        {
            return;
        }

        ClassDescriptorDef     classDef;
        ReferenceDescriptorDef refDef;

        for (Iterator it = modelDef.getClasses(); it.hasNext();)
        {
            classDef = (ClassDescriptorDef)it.next();
            for (Iterator refIt = classDef.getReferences(); refIt.hasNext();)
            {
                refDef = (ReferenceDescriptorDef)refIt.next();
                if (!refDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_IGNORE, false))
                {
                    checkReferenceForeignkeys(modelDef, refDef);
                }
            }
        }
    }
261404
function resolveReferences() {

    var elementsById = context.elementsById;
    var references = context.references;

    var i, r;

    for (i = 0; (r = references[i]); i++) {
      var element = r.element;
      var reference = elementsById[r.id];
      var property = getModdleDescriptor(element).propertiesByName[r.property];

      if (!reference) {
        context.addWarning({
          message: 'unresolved reference <' + r.id + '>',
          element: r.element,
          property: r.property,
          value: r.id
        });
      }

      if (property.isMany) {
        var collection = element.get(property.name),
            idx = collection.indexOf(r);

        // we replace an existing place holder (idx != -1) or
        // append to the collection instead
        if (idx === -1) {
          idx = collection.length;
        }

        if (!reference) {
          // remove unresolvable reference
          collection.splice(idx, 1);
        } else {
          // add or update reference in collection
          collection[idx] = reference;
        }
      } else {
        element.set(property.name, reference);
      }
    }
  }
728291
@Override
    void findReferencedClassNames(final Set<String> referencedClassNames) {
        if (enumValue != null) {
            enumValue.findReferencedClassNames(referencedClassNames);
        } else if (classRef != null) {
            referencedClassNames.add(classRef.getClassName());
        } else if (annotationInfo != null) {
            annotationInfo.findReferencedClassNames(referencedClassNames);
        } else if (objectArrayValue != null) {
            for (final ObjectTypedValueWrapper item : objectArrayValue) {
                item.findReferencedClassNames(referencedClassNames);
            }
        }
    }
454703
@Override
    protected void findReferencedClassNames(final Set<String> referencedClassNames) {
        if (this.referencedClassNames != null) {
            referencedClassNames.addAll(this.referencedClassNames);
        }
        getMethodInfo().findReferencedClassNames(referencedClassNames);
        getFieldInfo().findReferencedClassNames(referencedClassNames);
        getAnnotationInfo().findReferencedClassNames(referencedClassNames);
        if (annotationDefaultParamValues != null) {
            annotationDefaultParamValues.findReferencedClassNames(referencedClassNames);
        }
        final ClassTypeSignature classSig = getTypeSignature();
        if (classSig != null) {
            classSig.findReferencedClassNames(referencedClassNames);
        }
        // Remove any self-references
        referencedClassNames.remove(name);
    }
928963
void checkReferencedRows(Session session, Table table, int[] rowColArray) {

        Index           mainIndex = getMainIndex();
        PersistentStore store     = session.sessionData.getRowStore(table);
        RowIterator     it        = table.rowIterator(session);

        while (true) {
            Row row = it.getNextRow();

            if (row == null) {
                break;
            }

            Object[] rowData = row.getData();

            if (ArrayUtil.hasNull(rowData, rowColArray)) {
                if (core.matchType == OpTypes.MATCH_SIMPLE) {
                    continue;
                }
            } else if (mainIndex.exists(session, store, rowData,
                                        rowColArray)) {
                continue;
            }

            if (ArrayUtil.hasAllNull(rowData, rowColArray)) {
                continue;
            }

            String colValues = "";

            for (int i = 0; i < rowColArray.length; i++) {
                Object o = rowData[rowColArray[i]];

                colValues += table.getColumnTypes()[i].convertToString(o);
                colValues += ",";
            }

            String[] info = new String[] {
                getName().name, getMain().getName().name
            };

            throw Error.error(ErrorCode.X_23502, ErrorCode.CONSTRAINT, info);
        }
    }
1144945
static void filterUnwantedReferences(List<JpaRef> result, Collection<BeanId> query) {
        ListIterator<JpaRef> it = result.listIterator();
        while (it.hasNext()) {
            // remove reference from result that was not part of the query
            BeanId found = it.next().getSource();
            if (!query.contains(found)) {
                it.remove();
            }
        }
    }
894603
public void check(CollectionDescriptorDef collDef, String checkLevel) throws ConstraintException
    {
        ensureElementClassRef(collDef, checkLevel);
        checkInheritedForeignkey(collDef, checkLevel);
        ensureCollectionClass(collDef, checkLevel);
        checkProxyPrefetchingLimit(collDef, checkLevel);
        checkOrderby(collDef, checkLevel);
        checkQueryCustomizer(collDef, checkLevel);
    }
678605
def is_erroneous(self, field, sources):
        """"""
        if self._KEYS.ERRORS in self:
            my_errors = self[self._KEYS.ERRORS]
            for alias in sources.split(','):
                source = self.get_source_by_alias(alias)
                bib_err_values = [
                    err[ERROR.VALUE] for err in my_errors
                    if err[ERROR.KIND] == SOURCE.BIBCODE and
                    err[ERROR.EXTRA] == field
                ]
                if (SOURCE.BIBCODE in source and
                        source[SOURCE.BIBCODE] in bib_err_values):
                    return True

                name_err_values = [
                    err[ERROR.VALUE] for err in my_errors
                    if err[ERROR.KIND] == SOURCE.NAME and err[ERROR.EXTRA] ==
                    field
                ]
                if (SOURCE.NAME in source and
                        source[SOURCE.NAME] in name_err_values):
                    return True

        return False
1294386
protected function findStartXref()
    {
        $reader = $this->parser->getStreamReader();
        $reader->reset(-self::$trailerSearchLength, self::$trailerSearchLength);

        $buffer = $reader->getBuffer(false);
        $pos = \strrpos($buffer, 'startxref');
        $addOffset = 9;
        if ($pos === false) {
            // Some corrupted documents uses startref, instead of startxref
            $pos = \strrpos($buffer, 'startref');
            if ($pos === false) {
                throw new CrossReferenceException(
                    'Unable to find pointer to xref table',
                    CrossReferenceException::NO_STARTXREF_FOUND
                );
            }
            $addOffset = 8;
        }

        $reader->setOffset($pos + $addOffset);

        try {
            $value = $this->parser->readValue(null, PdfNumeric::class);
        } catch (PdfTypeException $e) {
            throw new CrossReferenceException(
                'Invalid data after startxref keyword.',
                CrossReferenceException::INVALID_DATA,
                $e
            );
        }

        return $value->value;
    }
447644
public final void ruleCrossReference() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXtext.g:1008:2: ( ( ( rule__CrossReference__Group__0 ) ) )
            // InternalXtext.g:1009:2: ( ( rule__CrossReference__Group__0 ) )
            {
            // InternalXtext.g:1009:2: ( ( rule__CrossReference__Group__0 ) )
            // InternalXtext.g:1010:3: ( rule__CrossReference__Group__0 )
            {
             before(grammarAccess.getCrossReferenceAccess().getGroup()); 
            // InternalXtext.g:1011:3: ( rule__CrossReference__Group__0 )
            // InternalXtext.g:1011:4: rule__CrossReference__Group__0
            {
            pushFollow(FollowSets000.FOLLOW_2);
            rule__CrossReference__Group__0();

            state._fsp--;


            }

             after(grammarAccess.getCrossReferenceAccess().getGroup()); 

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
485491
def _is_reference(bpe):
    """"""
    if isinstance(bpe, _bp('ProteinReference')) or \
        isinstance(bpe, _bpimpl('ProteinReference')) or \
        isinstance(bpe, _bp('SmallMoleculeReference')) or \
        isinstance(bpe, _bpimpl('SmallMoleculeReference')) or \
        isinstance(bpe, _bp('RnaReference')) or \
        isinstance(bpe, _bpimpl('RnaReference')) or \
        isinstance(bpe, _bp('EntityReference')) or \
        isinstance(bpe, _bpimpl('EntityReference')):
        return True
    else:
        return False
868648
private void checkCircularReference(final BeanId... references) {
        for (BeanId beanId : references) {
            if (getId().equals(beanId)) {
                throw CFG310_CIRCULAR_REF(getId(), getId());
            }
        }
    }
815353
private int getSkipCorrectedReference(List<Integer> tokenPositions, int refNumber) {
    int correctedRef = 0;
    int i = 0;
    for (int tokenPosition : tokenPositions) {
      if (i++ >= refNumber) {
        break;
      }
      correctedRef += tokenPosition;
    }
    return correctedRef - 1;
  }
1174306
def validate_internal_deps(self):
        """"""
        for node in self.node:
            if ('target_obj' not in self.node[node]
                    and node not in self.crossrefs):
                raise error.BrokenGraph('Missing target: %s referenced from %s'
                                        ' but not defined there.' %
                                        (node, self.name))