IsPublicInstance in ReflectionsExtensions checks for non-public setter method

Issue #26 resolved
Stephan Arenswald created an issue

Hi folks,

in ReflectionsExtensions the method IsPublicInstance that was introduced with yesterdays update to support the latest SQLite-Net 2.4.1 version performs a wrong check I think.

return propertyInfo != null &&
    ((propertyInfo.GetMethod != null && !propertyInfo.GetMethod.IsStatic && propertyInfo.GetMethod.IsPublic) ||
    (propertyInfo.SetMethod != null && !propertyInfo.SetMethod.IsStatic && !propertyInfo.SetMethod.IsPublic));

It is checking for the setter method to be not public (third line, last check). Should be instead

return propertyInfo != null &&
    ((propertyInfo.GetMethod != null && !propertyInfo.GetMethod.IsStatic && propertyInfo.GetMethod.IsPublic) ||
    (propertyInfo.SetMethod != null && !propertyInfo.SetMethod.IsStatic && propertyInfo.SetMethod.IsPublic));

Comments (3)

  1. Log in to comment