Skip to content

Commit

Permalink
Rm check on dependency in the C# reflection API (protocolbuffers#2051)
Browse files Browse the repository at this point in the history
This check adds a few constraints on the way to build a project when we have
a proto file which imports another one. In particular, on projects which
build both C# and Java, it's easy to end up with exceptions like

    Expected: included.proto but was src/main/protobuf/included.proto

A user may work around this issue, but it may add unnecessary constraints
on the layout of the project.

According to protocolbuffers@f3504cf#diff-ecb0b909ed572381a1c8d1994f09a948R309
it has already been considered to get rid of this check, for
similar considerations, and because it doesn't exist in the Java code
  • Loading branch information
gturri authored and jskeet committed Sep 5, 2016
1 parent 96a9d97 commit 9b8da10
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,6 @@ private static FileDescriptor BuildFrom(ByteString descriptorData, FileDescripto
"Dependencies passed to FileDescriptor.BuildFrom() don't match " +
"those listed in the FileDescriptorProto.");
}
for (int i = 0; i < proto.Dependency.Count; i++)
{
if (dependencies[i].Name != proto.Dependency[i])
{
throw new DescriptorValidationException(
result,
"Dependencies passed to FileDescriptor.BuildFrom() don't match " +
"those listed in the FileDescriptorProto. Expected: " +
proto.Dependency[i] + " but was: " + dependencies[i].Name);
}
}

result.CrossLink();
return result;
Expand Down Expand Up @@ -341,4 +330,4 @@ public override string ToString()
/// </value>
public static FileDescriptor DescriptorProtoFileDescriptor { get { return DescriptorReflection.Descriptor; } }
}
}
}

0 comments on commit 9b8da10

Please sign in to comment.