aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Skeet <jonskeet@google.com>2016-02-04 07:05:49 +0000
committerJon Skeet <jonskeet@google.com>2016-02-04 07:05:49 +0000
commita3ea9d120389d535164e42e45c07b539a398c6e1 (patch)
tree7f89000a6e653ab8af6899e30f3c2c1b3f8de925
parenteb1d156d74fc4742175d6c143e5747772e44a4bb (diff)
downloadprotobuf-a3ea9d120389d535164e42e45c07b539a398c6e1.tar.gz
protobuf-a3ea9d120389d535164e42e45c07b539a398c6e1.tar.bz2
protobuf-a3ea9d120389d535164e42e45c07b539a398c6e1.zip
Rename GeneratedCodeInfo to GeneratedClrTypeInfo
Recently, descriptor.proto gained a GeneratedCodeInfo message, which means the generated code conflicts with our type. Unfortunately this affects codegen as well, although this is a part of the public API which is very unlikely to affect hand-written code. Generated code changes in next commit.
-rw-r--r--Makefile.am2
-rw-r--r--csharp/src/Google.Protobuf/Google.Protobuf.csproj2
-rw-r--r--csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs6
-rw-r--r--csharp/src/Google.Protobuf/Reflection/GeneratedClrTypeInfo.cs (renamed from csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs)14
-rw-r--r--csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs2
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_reflection_class.cc8
6 files changed, 17 insertions, 17 deletions
diff --git a/Makefile.am b/Makefile.am
index 188346fe..c7267e02 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -146,7 +146,7 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs \
csharp/src/Google.Protobuf/Reflection/FieldType.cs \
csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs \
- csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs \
+ csharp/src/Google.Protobuf/Reflection/GeneratedClrTypeInfo.cs \
csharp/src/Google.Protobuf/Reflection/IDescriptor.cs \
csharp/src/Google.Protobuf/Reflection/IFieldAccessor.cs \
csharp/src/Google.Protobuf/Reflection/MapFieldAccessor.cs \
diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj
index f95bae07..326b6d31 100644
--- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj
+++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj
@@ -109,7 +109,7 @@
<Compile Include="Reflection\FieldDescriptor.cs" />
<Compile Include="Reflection\FieldType.cs" />
<Compile Include="Reflection\FileDescriptor.cs" />
- <Compile Include="Reflection\GeneratedCodeInfo.cs" />
+ <Compile Include="Reflection\GeneratedClrTypeInfo.cs" />
<Compile Include="Reflection\IDescriptor.cs" />
<Compile Include="Reflection\IFieldAccessor.cs" />
<Compile Include="Reflection\MapFieldAccessor.cs" />
diff --git a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs
index 48ee5596..ab7cd922 100644
--- a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs
+++ b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs
@@ -43,7 +43,7 @@ namespace Google.Protobuf.Reflection
/// </summary>
public sealed class FileDescriptor : IDescriptor
{
- private FileDescriptor(ByteString descriptorData, FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool, bool allowUnknownDependencies, GeneratedCodeInfo generatedCodeInfo)
+ private FileDescriptor(ByteString descriptorData, FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool, bool allowUnknownDependencies, GeneratedClrTypeInfo generatedCodeInfo)
{
SerializedData = descriptorData;
DescriptorPool = pool;
@@ -223,7 +223,7 @@ namespace Google.Protobuf.Reflection
/// <exception cref="DescriptorValidationException">If <paramref name="proto"/> is not
/// a valid descriptor. This can occur for a number of reasons, such as a field
/// having an undefined type or because two messages were defined with the same name.</exception>
- private static FileDescriptor BuildFrom(ByteString descriptorData, FileDescriptorProto proto, FileDescriptor[] dependencies, bool allowUnknownDependencies, GeneratedCodeInfo generatedCodeInfo)
+ private static FileDescriptor BuildFrom(ByteString descriptorData, FileDescriptorProto proto, FileDescriptor[] dependencies, bool allowUnknownDependencies, GeneratedClrTypeInfo generatedCodeInfo)
{
// Building descriptors involves two steps: translating and linking.
// In the translation step (implemented by FileDescriptor's
@@ -291,7 +291,7 @@ namespace Google.Protobuf.Reflection
public static FileDescriptor FromGeneratedCode(
byte[] descriptorData,
FileDescriptor[] dependencies,
- GeneratedCodeInfo generatedCodeInfo)
+ GeneratedClrTypeInfo generatedCodeInfo)
{
FileDescriptorProto proto;
try
diff --git a/csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs b/csharp/src/Google.Protobuf/Reflection/GeneratedClrTypeInfo.cs
index e5fe9fb7..fe5db656 100644
--- a/csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs
+++ b/csharp/src/Google.Protobuf/Reflection/GeneratedClrTypeInfo.cs
@@ -38,10 +38,10 @@ namespace Google.Protobuf.Reflection
/// These are constructed as required, and are not long-lived. Hand-written code should
/// never need to use this type.
/// </summary>
- public sealed class GeneratedCodeInfo
+ public sealed class GeneratedClrTypeInfo
{
private static readonly string[] EmptyNames = new string[0];
- private static readonly GeneratedCodeInfo[] EmptyCodeInfo = new GeneratedCodeInfo[0];
+ private static readonly GeneratedClrTypeInfo[] EmptyCodeInfo = new GeneratedClrTypeInfo[0];
/// <summary>
/// Irrelevant for file descriptors; the CLR type for the message for message descriptors.
@@ -70,7 +70,7 @@ namespace Google.Protobuf.Reflection
/// The reflection information for types within this file/message descriptor. Elements may be null
/// if there is no corresponding generated type, e.g. for map entry types.
/// </summary>
- public GeneratedCodeInfo[] NestedTypes { get; }
+ public GeneratedClrTypeInfo[] NestedTypes { get; }
/// <summary>
/// The CLR types for enums within this file/message descriptor.
@@ -78,11 +78,11 @@ namespace Google.Protobuf.Reflection
public Type[] NestedEnums { get; }
/// <summary>
- /// Creates a GeneratedCodeInfo for a message descriptor, with nested types, nested enums, the CLR type, property names and oneof names.
+ /// Creates a GeneratedClrTypeInfo for a message descriptor, with nested types, nested enums, the CLR type, property names and oneof names.
/// Each array parameter may be null, to indicate a lack of values.
/// The parameter order is designed to make it feasible to format the generated code readably.
/// </summary>
- public GeneratedCodeInfo(Type clrType, MessageParser parser, string[] propertyNames, string[] oneofNames, Type[] nestedEnums, GeneratedCodeInfo[] nestedTypes)
+ public GeneratedClrTypeInfo(Type clrType, MessageParser parser, string[] propertyNames, string[] oneofNames, Type[] nestedEnums, GeneratedClrTypeInfo[] nestedTypes)
{
NestedTypes = nestedTypes ?? EmptyCodeInfo;
NestedEnums = nestedEnums ?? ReflectionUtil.EmptyTypes;
@@ -93,9 +93,9 @@ namespace Google.Protobuf.Reflection
}
/// <summary>
- /// Creates a GeneratedCodeInfo for a file descriptor, with only types and enums.
+ /// Creates a GeneratedClrTypeInfo for a file descriptor, with only types and enums.
/// </summary>
- public GeneratedCodeInfo(Type[] nestedEnums, GeneratedCodeInfo[] nestedTypes)
+ public GeneratedClrTypeInfo(Type[] nestedEnums, GeneratedClrTypeInfo[] nestedTypes)
: this(null, null, null, null, nestedEnums, nestedTypes)
{
}
diff --git a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
index f43803a6..f5798d1e 100644
--- a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
+++ b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
@@ -60,7 +60,7 @@ namespace Google.Protobuf.Reflection
private readonly IList<FieldDescriptor> fieldsInNumberOrder;
private readonly IDictionary<string, FieldDescriptor> jsonFieldMap;
- internal MessageDescriptor(DescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int typeIndex, GeneratedCodeInfo generatedCodeInfo)
+ internal MessageDescriptor(DescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int typeIndex, GeneratedClrTypeInfo generatedCodeInfo)
: base(file, file.ComputeFullName(parent, proto.Name), typeIndex)
{
Proto = proto;
diff --git a/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc b/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc
index 3862f001..22dae43b 100644
--- a/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc
@@ -182,7 +182,7 @@ void ReflectionClassGenerator::WriteDescriptor(io::Printer* printer) {
}
}
printer->Print("},\n"
- " new pbr::GeneratedCodeInfo(");
+ " new pbr::GeneratedClrTypeInfo(");
// Specify all the generated code information, recursively.
if (file_->enum_type_count() > 0) {
printer->Print("new[] {");
@@ -195,7 +195,7 @@ void ReflectionClassGenerator::WriteDescriptor(io::Printer* printer) {
printer->Print("null, ");
}
if (file_->message_type_count() > 0) {
- printer->Print("new pbr::GeneratedCodeInfo[] {\n");
+ printer->Print("new pbr::GeneratedClrTypeInfo[] {\n");
printer->Indent();
printer->Indent();
printer->Indent();
@@ -232,7 +232,7 @@ void ReflectionClassGenerator::WriteGeneratedCodeInfo(const Descriptor* descript
return;
}
// Generated message type
- printer->Print("new pbr::GeneratedCodeInfo(typeof($type_name$), $type_name$.Parser, ", "type_name", GetClassName(descriptor));
+ printer->Print("new pbr::GeneratedClrTypeInfo(typeof($type_name$), $type_name$.Parser, ", "type_name", GetClassName(descriptor));
// Fields
if (descriptor->field_count() > 0) {
@@ -273,7 +273,7 @@ void ReflectionClassGenerator::WriteGeneratedCodeInfo(const Descriptor* descript
// Nested types
if (descriptor->nested_type_count() > 0) {
// Need to specify array type explicitly here, as all elements may be null.
- printer->Print("new pbr::GeneratedCodeInfo[] { ");
+ printer->Print("new pbr::GeneratedClrTypeInfo[] { ");
for (int i = 0; i < descriptor->nested_type_count(); i++) {
WriteGeneratedCodeInfo(descriptor->nested_type(i), printer, i == descriptor->nested_type_count() - 1);
}