method getResolver(getSchema(), getExpected()) is final so instead we override read()
483052
@Override
  @SuppressWarnings("unchecked")
  public D read(D reuse, Decoder in) throws IOException {    
    resolver.configure(in);
    D result = (D) read(reuse, getExpected(), resolver);
    resolver.drain();
    return result;
  }
164310
function getSchema(connection) {
  return runQuery(SCHEMA_SQL_V1, connection)
    .then(queryResult => formatSchemaQueryResults(queryResult))
    .catch(() =>
      runQuery(SCHEMA_SQL_V0, connection).then(queryResult =>
        formatSchemaQueryResults(queryResult)
      )
    );
}
258516
private MessageType getPartialReadSchema(InitContext context)
  {
    MessageType fullSchema = context.getFileSchema();

    String name = fullSchema.getName();

    HadoopDruidIndexerConfig config = HadoopDruidIndexerConfig.fromConfiguration(context.getConfiguration());
    ParseSpec parseSpec = config.getParser().getParseSpec();

    // this is kind of lame, maybe we can still trim what we read if we
    // parse the flatten spec and determine it isn't auto discovering props?
    if (parseSpec instanceof ParquetParseSpec) {
      if (((ParquetParseSpec) parseSpec).getFlattenSpec() != null) {
        return fullSchema;
      }
    }

    String tsField = parseSpec.getTimestampSpec().getTimestampColumn();

    List<DimensionSchema> dimensionSchema = parseSpec.getDimensionsSpec().getDimensions();
    Set<String> dimensions = new HashSet<>();
    for (DimensionSchema dim : dimensionSchema) {
      dimensions.add(dim.getName());
    }

    Set<String> metricsFields = new HashSet<>();
    for (AggregatorFactory agg : config.getSchema().getDataSchema().getAggregators()) {
      metricsFields.addAll(agg.requiredFields());
    }

    List<Type> partialFields = new ArrayList<>();

    for (Type type : fullSchema.getFields()) {
      if (tsField.equals(type.getName())
          || metricsFields.contains(type.getName())
          || dimensions.size() > 0 && dimensions.contains(type.getName())
          || dimensions.size() == 0) {
        partialFields.add(type);
      }
    }

    return new MessageType(name, partialFields);
  }
228755
function resolveSchemaRefs(val, validator, _root) {

    _root = _root || val;
    resolve(val, '', val);
    return val;

    /*
     * @param {mixed} val
     * @param {String|Int} key
     * @param {Object|Array} object
     */
    function resolve(val, key, object) {
        if (_.isPlainObject(val)) {
            if (   val.hasOwnProperty('$ref')
                && typeof val.$ref === 'string'
            ) {

                var resolved;

                if (val.$ref.indexOf('#') === 0) {
                    let path = _.compact(val.$ref.slice(1).split('/'));
                    if (_.has(_root, path)) {
                        resolved = _.cloneDeep(_.get(_root, path));
                        _.set(object, key, resolved);

                    }
                } else if ((resolved = validator.getSchema(val.$ref))) {
                    resolved = _.cloneDeep(resolved.schema);
                    _.set(object, key, resolved);
                }

                do {
                    resolve(resolved, key, object);
                }
                while (   _.isPlainObject(object[key])
                         && object[key].hasOwnProperty('$ref')
                );
            } else {
                _.forOwn(val, resolve);
            }
        } else if (val instanceof Array) {
            val.forEach(resolve);
        }
        //can not return anything because of the lodash.forOwn
    }
}
209711
function getSchema(connection) {
  const schemaSql = getPrestoSchemaSql(
    connection.prestoCatalog,
    connection.prestoSchema
  );
  return runQuery(schemaSql, connection).then(queryResult =>
    formatSchemaQueryResults(queryResult)
  );
}
372459
function getSchema(connection) {
  const schemaSql = getSchemaSql(connection.database);
  return runQuery(schemaSql, connection).then(queryResult =>
    formatSchemaQueryResults(queryResult)
  );
}
560081
private Object readResolve() {
        Chronology base = getBase();
        return base == null ?
                getInstance(DateTimeZone.UTC, getMinimumDaysInFirstWeek()) :
                    getInstance(base.getZone(), getMinimumDaysInFirstWeek());
    }
1355407
private Object readResolve() throws java.io.ObjectStreamException {
        return Nd4j.create(data, arrayShape, Nd4j.getStrides(arrayShape, arrayOrdering), 0, arrayOrdering);
    }
607443
@SuppressWarnings("unused")
    private Object readResolve() {
        if (StringUtils.isNotEmpty(oldTopic)) {
            oldTopicObject = new Topic(oldTopic);
            oldTopic = null;
        }

        if (oldTopicObject != null && StringUtils.isEmpty(oldTopicObject.getName())) {
            oldTopicObject = null;
        }

        return this;
    }
448887
Object readResolve() throws ObjectStreamException {
        Bean<?> bean = Container.instance(contextId).services().get(ContextualStore.class).<Bean<Object>, Object>getContextual(beanId);
        if (bean == null) {
            throw BeanLogger.LOG.proxyDeserializationFailure(beanId);
        }
        return Container.instance(contextId).deploymentManager().getClientProxyProvider().getClientProxy(bean);
    }
1309228
Object[] getVersionAndReader(Object input) throws IOException {
        // need to determine version of sld from actual content
        BufferedReader reader = null;

        if (input instanceof InputStream) {
            reader = RequestUtils.getBufferedXMLReader((InputStream) input, XML_LOOKAHEAD);
        } else {
            reader = RequestUtils.getBufferedXMLReader(toReader(input), XML_LOOKAHEAD);
        }

        String version;
        try {
            // create stream parser
            XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
            factory.setNamespaceAware(true);
            factory.setValidating(false);

            // parse root element
            XmlPullParser parser = factory.newPullParser();
            parser.setInput(reader);
            parser.nextTag();

            version = null;
            for (int i = 0; i < parser.getAttributeCount(); i++) {
                if ("version".equals(parser.getAttributeName(i))) {
                    version = parser.getAttributeValue(i);
                }
            }

            parser.setInput(null);
        } catch (XmlPullParserException e) {
            throw (IOException) new IOException("Error parsing content").initCause(e);
        }

        // reset input stream
        reader.reset();

        if (version == null) {
            LOGGER.warning("Could not determine SLD version from content. Assuming 1.0.0");
            version = "1.0.0";
        }

        return new Object[] {new Version(version), reader};
    }
1359378
@SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE",
            justification = "Null checks in readResolve are valid since we deserialize and upgrade objects")
    protected Object readResolve() {
        if (allowEmptyArchive == null) {
            this.allowEmptyArchive = SystemProperties.getBoolean(ArtifactArchiver.class.getName()+".warnOnEmpty");
        }
        if (defaultExcludes == null){
            defaultExcludes = true;
        }
        if (caseSensitive == null) {
            caseSensitive = true;
        }
        return this;
    }
331701
private TypeResolver getTypeResolver() {
        TypeResolver typeResolver = scannerContext.peek(TypeResolver.class);
        if (typeResolver == null) {
            throw new IllegalStateException("Cannot find Java type resolver.");
        }
        return typeResolver;
    }
1075707
@Override
  public S getSchema()
      throws IOException {
    try {
      if (_schemaRegistry.isPresent()) {
        return _schemaRegistry.get().getLatestSchemaByTopic(this._partition.topic());
      }
    } catch (SchemaRegistryException e) {
      throw new RuntimeException(e);
    }
    return ((S) this._partition.topic());
  }
531482
private Object readResolve() {
        Chronology base = getBase();
        return base == null ? getInstanceUTC() : getInstance(base.getZone());
    }
7826
public static <E> Schema getReaderSchema(Class<E> type, Schema schema) {
    Schema readerSchema = schema;
    GenericData dataModel = getDataModelForType(type);

    if (dataModel instanceof SpecificData) {
      readerSchema = ((SpecificData)dataModel).getSchema(type);
    }

    return readerSchema;
  }
117877
public static String getSchemaFromType(final Type type, Map<String, Schema> schemaMap, IRestDocGeneratorExtension ext) {
		String schema = SchemaResolver.getSchemaFromTypeOrNull(type, schemaMap, ext);
		if (schema != null) {
			return schema;
		}
		final String s = String.format("SchemaType %s is not annotated with RestDocSchema.", type);
		throw new RestDocException(s);
	}