aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs
diff options
context:
space:
mode:
authorJan Tattermusch <jtattermusch@users.noreply.github.com>2015-07-22 10:36:06 -0700
committerJan Tattermusch <jtattermusch@users.noreply.github.com>2015-07-22 10:36:06 -0700
commit7b5c3967991b6534f439cb31b0d247501f4a0ef8 (patch)
treee161b4bfaa308ca173ee9a8b2ff858c5b76b618b /csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs
parent2ee4b5665520fe3245eb5e15df8bd35e0c539a07 (diff)
parent43d64b4f54c8cf9521aded37fc695faba28793ee (diff)
downloadprotobuf-7b5c3967991b6534f439cb31b0d247501f4a0ef8.tar.gz
protobuf-7b5c3967991b6534f439cb31b0d247501f4a0ef8.tar.bz2
protobuf-7b5c3967991b6534f439cb31b0d247501f4a0ef8.zip
Merge pull request #625 from jskeet/reflection-refactor
Reflection refactor
Diffstat (limited to 'csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs')
-rw-r--r--csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs7
1 files changed, 1 insertions, 6 deletions
diff --git a/csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs b/csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs
index 39a63b47..0893dc3d 100644
--- a/csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs
+++ b/csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs
@@ -43,13 +43,8 @@ namespace Google.Protobuf.Reflection
private readonly Func<object, object> getValueDelegate;
private readonly FieldDescriptor descriptor;
- internal FieldAccessorBase(Type type, string propertyName, FieldDescriptor descriptor)
+ internal FieldAccessorBase(PropertyInfo property, FieldDescriptor descriptor)
{
- PropertyInfo property = type.GetProperty(propertyName);
- if (property == null || !property.CanRead)
- {
- throw new ArgumentException("Not all required properties/methods available");
- }
this.descriptor = descriptor;
getValueDelegate = ReflectionUtil.CreateFuncObjectObject(property.GetGetMethod());
}