@Nullable public ClassDescriptor resolveClass(@NotNull KotlinJvmBinaryClass kotlinClass) { String[] data = readData(kotlinClass, CLASS); if (data != null) { return components .getClassDeserializer() .deserializeClass(kotlinClass.getClassId(), JvmProtoBufUtil.readClassDataFrom(data)); } return null; }
@Nullable public ClassDescriptor resolveClass(@NotNull KotlinJvmBinaryClass kotlinClass) { String[] data = readData(kotlinClass, CLASS); if (data != null) { ClassData classData = JvmProtoBufUtil.readClassDataFrom(data); KotlinJvmBinarySourceElement sourceElement = new KotlinJvmBinarySourceElement(kotlinClass); ClassDataProvider classDataProvider = new ClassDataProvider(classData, sourceElement); return components .getClassDeserializer() .deserializeClass(kotlinClass.getClassId(), classDataProvider); } return null; }
@Nullable public JetScope createKotlinPackageScope( @NotNull PackageFragmentDescriptor descriptor, @NotNull KotlinJvmBinaryClass kotlinClass) { String[] data = readData(kotlinClass, PACKAGE_FACADE); if (data != null) { // all classes are included in java scope PackageData packageData = JvmProtoBufUtil.readPackageDataFrom(data); return new DeserializedPackageMemberScope( descriptor, packageData.getPackageProto(), packageData.getNameResolver(), components, new Function0<Collection<Name>>() { @Override public Collection<Name> invoke() { return Collections.emptyList(); } }); } return null; }