Rename in descriptors.proto: class_object_name -> default_object_name
This commit is contained in:
@@ -180,7 +180,7 @@ message Class {
|
||||
required int32 fq_name = 3;
|
||||
|
||||
// If this field is present, it contains the name of default object.
|
||||
optional int32 class_object_name = 4;
|
||||
optional int32 default_object_name = 4;
|
||||
|
||||
repeated TypeParameter type_parameter = 5;
|
||||
repeated Type supertype = 6;
|
||||
|
||||
@@ -32,7 +32,6 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.kotlin.resolve.DescriptorUtils.isEnumEntry;
|
||||
import static org.jetbrains.kotlin.resolve.DescriptorUtils.isObject;
|
||||
|
||||
public class DescriptorSerializer {
|
||||
|
||||
@@ -133,7 +132,7 @@ public class DescriptorSerializer {
|
||||
|
||||
ClassDescriptor defaultObjectDescriptor = classDescriptor.getDefaultObjectDescriptor();
|
||||
if (defaultObjectDescriptor != null) {
|
||||
builder.setClassObjectName(stringTable.getSimpleNameIndex(defaultObjectDescriptor.getName()));
|
||||
builder.setDefaultObjectName(stringTable.getSimpleNameIndex(defaultObjectDescriptor.getName()));
|
||||
}
|
||||
|
||||
extension.serializeClass(classDescriptor, builder, stringTable);
|
||||
|
||||
@@ -7310,23 +7310,23 @@ public final class ProtoBuf {
|
||||
*/
|
||||
int getFqName();
|
||||
|
||||
// optional int32 class_object_name = 4;
|
||||
// optional int32 default_object_name = 4;
|
||||
/**
|
||||
* <code>optional int32 class_object_name = 4;</code>
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* </pre>
|
||||
*/
|
||||
boolean hasClassObjectName();
|
||||
boolean hasDefaultObjectName();
|
||||
/**
|
||||
* <code>optional int32 class_object_name = 4;</code>
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* </pre>
|
||||
*/
|
||||
int getClassObjectName();
|
||||
int getDefaultObjectName();
|
||||
|
||||
// repeated .org.jetbrains.kotlin.serialization.TypeParameter type_parameter = 5;
|
||||
/**
|
||||
@@ -7489,7 +7489,7 @@ public final class ProtoBuf {
|
||||
}
|
||||
case 32: {
|
||||
bitField0_ |= 0x00000004;
|
||||
classObjectName_ = input.readInt32();
|
||||
defaultObjectName_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 42: {
|
||||
@@ -8203,28 +8203,28 @@ public final class ProtoBuf {
|
||||
return fqName_;
|
||||
}
|
||||
|
||||
// optional int32 class_object_name = 4;
|
||||
public static final int CLASS_OBJECT_NAME_FIELD_NUMBER = 4;
|
||||
private int classObjectName_;
|
||||
// optional int32 default_object_name = 4;
|
||||
public static final int DEFAULT_OBJECT_NAME_FIELD_NUMBER = 4;
|
||||
private int defaultObjectName_;
|
||||
/**
|
||||
* <code>optional int32 class_object_name = 4;</code>
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasClassObjectName() {
|
||||
public boolean hasDefaultObjectName() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 class_object_name = 4;</code>
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* </pre>
|
||||
*/
|
||||
public int getClassObjectName() {
|
||||
return classObjectName_;
|
||||
public int getDefaultObjectName() {
|
||||
return defaultObjectName_;
|
||||
}
|
||||
|
||||
// repeated .org.jetbrains.kotlin.serialization.TypeParameter type_parameter = 5;
|
||||
@@ -8423,7 +8423,7 @@ public final class ProtoBuf {
|
||||
private void initFields() {
|
||||
flags_ = 0;
|
||||
fqName_ = 0;
|
||||
classObjectName_ = 0;
|
||||
defaultObjectName_ = 0;
|
||||
typeParameter_ = java.util.Collections.emptyList();
|
||||
supertype_ = java.util.Collections.emptyList();
|
||||
nestedClassName_ = java.util.Collections.emptyList();
|
||||
@@ -8485,7 +8485,7 @@ public final class ProtoBuf {
|
||||
output.writeInt32(3, fqName_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
output.writeInt32(4, classObjectName_);
|
||||
output.writeInt32(4, defaultObjectName_);
|
||||
}
|
||||
for (int i = 0; i < typeParameter_.size(); i++) {
|
||||
output.writeMessage(5, typeParameter_.get(i));
|
||||
@@ -8524,7 +8524,7 @@ public final class ProtoBuf {
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeInt32Size(4, classObjectName_);
|
||||
.computeInt32Size(4, defaultObjectName_);
|
||||
}
|
||||
for (int i = 0; i < typeParameter_.size(); i++) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
@@ -8655,7 +8655,7 @@ public final class ProtoBuf {
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
fqName_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
classObjectName_ = 0;
|
||||
defaultObjectName_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
typeParameter_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
@@ -8703,7 +8703,7 @@ public final class ProtoBuf {
|
||||
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
to_bitField0_ |= 0x00000004;
|
||||
}
|
||||
result.classObjectName_ = classObjectName_;
|
||||
result.defaultObjectName_ = defaultObjectName_;
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_);
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
@@ -8745,8 +8745,8 @@ public final class ProtoBuf {
|
||||
if (other.hasFqName()) {
|
||||
setFqName(other.getFqName());
|
||||
}
|
||||
if (other.hasClassObjectName()) {
|
||||
setClassObjectName(other.getClassObjectName());
|
||||
if (other.hasDefaultObjectName()) {
|
||||
setDefaultObjectName(other.getDefaultObjectName());
|
||||
}
|
||||
if (!other.typeParameter_.isEmpty()) {
|
||||
if (typeParameter_.isEmpty()) {
|
||||
@@ -8962,51 +8962,51 @@ public final class ProtoBuf {
|
||||
return this;
|
||||
}
|
||||
|
||||
// optional int32 class_object_name = 4;
|
||||
private int classObjectName_ ;
|
||||
// optional int32 default_object_name = 4;
|
||||
private int defaultObjectName_ ;
|
||||
/**
|
||||
* <code>optional int32 class_object_name = 4;</code>
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasClassObjectName() {
|
||||
public boolean hasDefaultObjectName() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 class_object_name = 4;</code>
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* </pre>
|
||||
*/
|
||||
public int getClassObjectName() {
|
||||
return classObjectName_;
|
||||
public int getDefaultObjectName() {
|
||||
return defaultObjectName_;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 class_object_name = 4;</code>
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* </pre>
|
||||
*/
|
||||
public Builder setClassObjectName(int value) {
|
||||
public Builder setDefaultObjectName(int value) {
|
||||
bitField0_ |= 0x00000004;
|
||||
classObjectName_ = value;
|
||||
defaultObjectName_ = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 class_object_name = 4;</code>
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* </pre>
|
||||
*/
|
||||
public Builder clearClassObjectName() {
|
||||
public Builder clearDefaultObjectName() {
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
classObjectName_ = 0;
|
||||
defaultObjectName_ = 0;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
+2
-2
@@ -110,9 +110,9 @@ public class DeserializedClassDescriptor(
|
||||
}
|
||||
|
||||
private fun computeDefaultObjectDescriptor(): ClassDescriptor? {
|
||||
if (!classProto.hasClassObjectName()) return null
|
||||
if (!classProto.hasDefaultObjectName()) return null
|
||||
|
||||
val defaultObjectName = c.nameResolver.getName(classProto.getClassObjectName())
|
||||
val defaultObjectName = c.nameResolver.getName(classProto.getDefaultObjectName())
|
||||
return memberScope.getClassifier(defaultObjectName) as? ClassDescriptor
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user