Read class entry.
431723
ClassSymbol readClassSymbol(int i) {
        Object obj = readPool(i);
        if (obj != null && !(obj instanceof ClassSymbol))
            throw badClassFile("bad.const.pool.entry",
                               currentClassFile.toString(),
                               "CONSTANT_Class_info", i);
        return (ClassSymbol)obj;
    }
879062
public void readObject (ObjectInputStream in)
        throws IOException, ClassNotFoundException
    {
        _size = in.readInt();
        // ensure our capacity is a power of 2 (for consistency)
        int capacity = INITIAL_CAPACITY;
        while (capacity < _size) {
            capacity <<= 1;
        }
        @SuppressWarnings("unchecked") E[] entries = (E[])new Entry[capacity];
        _entries = entries;
        for (int ii = 0; ii < _size; ii++) {
            @SuppressWarnings("unchecked") E entry = (E)in.readObject();
            _entries[ii] = entry;
        }
    }
187527
private ClassLoaderHandlerRegistryEntry getRegistryEntry(final ClassLoader classLoader) {
        ClassLoaderHandlerRegistryEntry entry = classLoaderToClassLoaderHandlerRegistryEntry.get(classLoader);
        if (entry == null) {
            // Find a ClassLoaderHandler that can handle the ClassLoader
            for (final ClassLoaderHandlerRegistryEntry handler : ClassLoaderHandlerRegistry.CLASS_LOADER_HANDLERS) {
                if (handler.canHandle(classLoader)) {
                    // This ClassLoaderHandler can handle the ClassLoader
                    entry = handler;
                    break;
                }
            }
            if (entry == null) {
                // Use fallback handler
                entry = ClassLoaderHandlerRegistry.FALLBACK_HANDLER;
            }
            classLoaderToClassLoaderHandlerRegistryEntry.put(classLoader, entry);
        }
        return entry;
    }
360812
def read(self, size=-1):
        """"""
        buf = self._fd.read(size)
        self._progress_cb(len(buf))
        return buf
617902
def classname(ob):
    """"""
    import inspect
    if inspect.isclass(ob):
        return '.'.join([ob.__module__, ob.__name__])
    else:
        return '.'.join([ob.__class__.__module__, ob.__class__.__name__])
199544
private void readConstantPoolEntries() throws IOException {
        // Only record class dependency info if inter-class dependencies are enabled
        List<Integer> classNameCpIdxs = null;
        List<Integer> typeSignatureIdxs = null;
        if (scanSpec.enableInterClassDependencies) {
            classNameCpIdxs = new ArrayList<Integer>();
            typeSignatureIdxs = new ArrayList<Integer>();
        }

        // Read size of constant pool
        cpCount = inputStreamOrByteBuffer.readUnsignedShort();

        // Allocate storage for constant pool
        entryOffset = new int[cpCount];
        entryTag = new int[cpCount];
        indirectStringRefs = new int[cpCount];
        Arrays.fill(indirectStringRefs, 0, cpCount, -1);

        // Read constant pool entries
        for (int i = 1, skipSlot = 0; i < cpCount; i++) {
            if (skipSlot == 1) {
                // Skip a slot (keeps Scrutinizer happy -- it doesn't like i++ in case 6)
                skipSlot = 0;
                continue;
            }
            entryTag[i] = inputStreamOrByteBuffer.readUnsignedByte();
            entryOffset[i] = inputStreamOrByteBuffer.curr;
            switch (entryTag[i]) {
            case 0: // Impossible, probably buffer underflow
                throw new ClassfileFormatException("Unknown constant pool tag 0 in classfile " + relativePath
                        + " (possible buffer underflow issue). Please report this at "
                        + "https://github.com/classgraph/classgraph/issues");
            case 1: // Modified UTF8
                final int strLen = inputStreamOrByteBuffer.readUnsignedShort();
                inputStreamOrByteBuffer.skip(strLen);
                break;
            case 3: // int, short, char, byte, boolean are all represented by Constant_INTEGER
            case 4: // float
                inputStreamOrByteBuffer.skip(4);
                break;
            case 5: // long
            case 6: // double
                inputStreamOrByteBuffer.skip(8);
                skipSlot = 1; // double slot
                break;
            case 7: // Class reference (format is e.g. "java/lang/String")
                // Forward or backward indirect reference to a modified UTF8 entry
                indirectStringRefs[i] = inputStreamOrByteBuffer.readUnsignedShort();
                if (scanSpec.enableInterClassDependencies) {
                    // If this is a class ref, and inter-class dependencies are enabled, record the dependency
                    classNameCpIdxs.add(indirectStringRefs[i]);
                }
                break;
            case 8: // String
                // Forward or backward indirect reference to a modified UTF8 entry
                indirectStringRefs[i] = inputStreamOrByteBuffer.readUnsignedShort();
                break;
            case 9: // field ref
                // Refers to a class ref (case 7) and then a name and type (case 12)
                inputStreamOrByteBuffer.skip(4);
                break;
            case 10: // method ref
                // Refers to a class ref (case 7) and then a name and type (case 12)
                inputStreamOrByteBuffer.skip(4);
                break;
            case 11: // interface method ref
                // Refers to a class ref (case 7) and then a name and type (case 12)
                inputStreamOrByteBuffer.skip(4);
                break;
            case 12: // name and type
                final int nameRef = inputStreamOrByteBuffer.readUnsignedShort();
                final int typeRef = inputStreamOrByteBuffer.readUnsignedShort();
                if (scanSpec.enableInterClassDependencies) {
                    typeSignatureIdxs.add(typeRef);
                }
                indirectStringRefs[i] = (nameRef << 16) | typeRef;
                break;
            case 15: // method handle
                inputStreamOrByteBuffer.skip(3);
                break;
            case 16: // method type
                inputStreamOrByteBuffer.skip(2);
                break;
            case 18: // invoke dynamic
                inputStreamOrByteBuffer.skip(4);
                break;
            case 19: // module (for module-info.class in JDK9+)
                // see https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.4
                indirectStringRefs[i] = inputStreamOrByteBuffer.readUnsignedShort();
                break;
            case 20: // package (for module-info.class in JDK9+)
                // see https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.4
                inputStreamOrByteBuffer.skip(2);
                break;
            default:
                throw new ClassfileFormatException("Unknown constant pool tag " + entryTag[i]
                        + " (element size unknown, cannot continue reading class). Please report this at "
                        + "https://github.com/classgraph/classgraph/issues");
            }
        }

        // Find classes referenced in the constant pool (note that there are some class refs that will not be
        // found this way, e.g. enum classes and class refs in annotation parameter values, since they are
        // referenced as strings (tag 1) rather than classes (tag 7) or type signatures (part of tag 12)).
        if (scanSpec.enableInterClassDependencies) {
            refdClassNames = new HashSet<>();
            // Get class names from direct class references in constant pool
            for (final int cpIdx : classNameCpIdxs) {
                final String refdClassName = getConstantPoolString(cpIdx, /* replaceSlashWithDot = */ true,
                        /* stripLSemicolon = */ false);
                if (refdClassName != null) {
                    if (refdClassName.startsWith("[")) {
                        // Parse array type signature, e.g. "[Ljava.lang.String;" -- uses '.' rather than '/'
                        try {
                            final TypeSignature typeSig = TypeSignature.parse(refdClassName.replace('.', '/'),
                                    /* definingClass = */ null);
                            typeSig.findReferencedClassNames(refdClassNames);
                        } catch (final ParseException e) {
                            // Should not happen
                            throw new ClassfileFormatException("Could not parse class name: " + refdClassName, e);
                        }
                    } else {
                        refdClassNames.add(refdClassName);
                    }
                }
            }
            // Get class names from type signatures in "name and type" entries in constant pool
            for (final int cpIdx : typeSignatureIdxs) {
                final String typeSigStr = getConstantPoolString(cpIdx);
                if (typeSigStr != null) {
                    try {
                        if (typeSigStr.indexOf('(') >= 0 || "<init>".equals(typeSigStr)) {
                            // Parse the type signature
                            final MethodTypeSignature typeSig = MethodTypeSignature.parse(typeSigStr,
                                    /* definingClassName = */ null);
                            // Extract class names from type signature
                            typeSig.findReferencedClassNames(refdClassNames);
                        } else {
                            // Parse the type signature
                            final TypeSignature typeSig = TypeSignature.parse(typeSigStr,
                                    /* definingClassName = */ null);
                            // Extract class names from type signature
                            typeSig.findReferencedClassNames(refdClassNames);
                        }
                    } catch (final ParseException e) {
                        throw new ClassfileFormatException("Could not parse type signature: " + typeSigStr, e);
                    }
                }
            }
        }
    }
858459
@Override
  protected ClassEntry getClassEntry(String name, String pathName)
    throws ClassNotFoundException
  {
    PathImpl path = _pathMap.get(name);

    if (path != null && path.canRead() && path.length() > 0) {
      ClassEntry entry = new ClassEntry(getClassLoader(), name, path,
                                        path, getCodeSource(path));

      /*
      int p = name.lastIndexOf('.');
      String pkg;
      if (p > 0)
        pkg = name.substring(0, p);
      else
        pkg = "";

      ClassPackage classPackage = jarEntry.getPackage(pkg);

      entry.setClassPackage(classPackage);
      */

      return entry;
    }

    return null;
  }
394099
def _parse_entry_record(self, lines):
        """"""
        dn = None
        entry = OrderedDict()

        for line in lines:
            attr_type, attr_value = self._parse_attr(line)

            if attr_type == 'dn':
                self._check_dn(dn, attr_value)
                dn = attr_value
            elif attr_type == 'version' and dn is None:
                pass  # version = 1
            else:
                if dn is None:
                    self._error('First line of record does not start '
                        'with "dn:": %s' % attr_type)
                if attr_value is not None and \
                         attr_type.lower() not in self._ignored_attr_types:
                    if attr_type in entry:
                        entry[attr_type].append(attr_value)
                    else:
                        entry[attr_type] = [attr_value]

        return dn, entry
203583
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        if ( null == this.object )
            return;
        Class<?> cls = this.object.getClass();
        if ( this.object instanceof Class )
            cls = (Class<?>) this.object;
        this.field = BshClassManager.memberCache.get(cls).findField(varName);
    }
923474
private Type enterClass(String s) {
        return reader.enterClass(names.fromString(s)).type;
    }
91020
private void readClassBuffer(ClassSymbol c) throws IOException {
        int magic = nextInt();
        if (magic != JAVA_MAGIC)
            throw badClassFile("illegal.start.of.class.file");

        minorVersion = nextChar();
        majorVersion = nextChar();
        int maxMajor = 53; // Version.MAX().major;  //******* TEMPORARY *******
        int maxMinor = Version.MAX().minor;
        if (majorVersion > maxMajor ||
            majorVersion * 1000 + minorVersion <
            Version.MIN().major * 1000 + Version.MIN().minor) {
            if (majorVersion == (maxMajor + 1))
                log.warning("big.major.version",
                            currentClassFile,
                            majorVersion,
                            maxMajor);
            else
                throw badClassFile("wrong.version",
                                   Integer.toString(majorVersion),
                                   Integer.toString(minorVersion),
                                   Integer.toString(maxMajor),
                                   Integer.toString(maxMinor));
        }

        indexPool();
        if (signatureBuffer.length < bp) {
            int ns = Integer.highestOneBit(bp) << 1;
            signatureBuffer = new byte[ns];
        }
        readClass(c);
    }
364258
def readline(self):
        """"""
        self.lineno += 1
        if self._buffer:
            return self._buffer.pop()
        else:
            return self.input.readline()
803684
def read(self):
        """"""
        self.build()
        if not hasattr(self, 'built_value'):
            self.built_value = self.value
        return self.built_value
81296
def read(self):
        """"""

        line_method = self._header_line
        section = None
        while 1:
            token = self.tok.get(True, True)
            if token.is_eol_or_eof():
                break
            if token.is_comment():
                u = token.value.upper()
                if u == 'HEADER':
                    line_method = self._header_line
                elif u == 'QUESTION' or u == 'ZONE':
                    line_method = self._question_line
                    section = self.message.question
                elif u == 'ANSWER' or u == 'PREREQ':
                    line_method = self._rr_line
                    section = self.message.answer
                elif u == 'AUTHORITY' or u == 'UPDATE':
                    line_method = self._rr_line
                    section = self.message.authority
                elif u == 'ADDITIONAL':
                    line_method = self._rr_line
                    section = self.message.additional
                self.tok.get_eol()
                continue
            self.tok.unget(token)
            line_method(section)
686379
public TransactionChangesLog read(ObjectReader in) throws UnknownClassIdException, IOException
   {

      // read id
      int key;
      if ((key = in.readInt()) != SerializationConstants.TRANSACTION_CHANGES_LOG)
      {
         throw new UnknownClassIdException("There is unexpected class [" + key + "]");
      }

      TransactionChangesLog log = new TransactionChangesLog();
      if (in.readByte() == SerializationConstants.NOT_NULL_DATA)
      {
         log.setSystemId(in.readString());
      }

      while (in.readByte() == SerializationConstants.NOT_NULL_DATA)
      {
         PlainChangesLogReader rdr = new PlainChangesLogReader(holder, spoolConfig);
         PlainChangesLog pl = rdr.read(in);
         log.addLog(pl);
      }

      return log;
   }
380995
def read(klass)
      size = Delimited.read_uvarint(io)
      klass.decode io.read(size) unless size.zero?
    end
992970
public Registration readClass (Input input) {
		if (input == null) throw new IllegalArgumentException("input cannot be null.");
		try {
			return classResolver.readClass(input);
		} finally {
			if (depth == 0 && autoReset) reset();
		}
	}