Repository: reef
Updated Branches:
  refs/heads/master 42aa9462b -> 1ae16d9b2


[REEF-1499] Fix CoreCLR incompatibility for isDefined function in Tang 
Reflection Utilities

  Attribute.IsDefined() calls are not supported in .Net Core
  So replacing with CustomAttributeExtensions.IsDefined()

JIRA:
  [REEF-1499](https://issues.apache.org/jira/browse/REEF-1499)

Pull Request:
  Closes #1081


Project: http://git-wip-us.apache.org/repos/asf/reef/repo
Commit: http://git-wip-us.apache.org/repos/asf/reef/commit/1ae16d9b
Tree: http://git-wip-us.apache.org/repos/asf/reef/tree/1ae16d9b
Diff: http://git-wip-us.apache.org/repos/asf/reef/diff/1ae16d9b

Branch: refs/heads/master
Commit: 1ae16d9b25c2fd39bdd8b080426396cc5355fbcc
Parents: 42aa946
Author: Shiv Sundram <[email protected]>
Authored: Thu Jul 28 11:53:09 2016 -0700
Committer: Shravan M Narayanamurthy <[email protected]>
Committed: Thu Aug 4 13:29:33 2016 -0700

----------------------------------------------------------------------
 lang/cs/Org.Apache.REEF.Tang/Util/ReflectionUtilities.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/reef/blob/1ae16d9b/lang/cs/Org.Apache.REEF.Tang/Util/ReflectionUtilities.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang/Util/ReflectionUtilities.cs 
b/lang/cs/Org.Apache.REEF.Tang/Util/ReflectionUtilities.cs
index abdd093..31b06d4 100644
--- a/lang/cs/Org.Apache.REEF.Tang/Util/ReflectionUtilities.cs
+++ b/lang/cs/Org.Apache.REEF.Tang/Util/ReflectionUtilities.cs
@@ -513,7 +513,7 @@ namespace Org.Apache.REEF.Tang.Util
             if (type != null)
             {
                 // HACK: The only way to detect anonymous types right now.
-                return Attribute.IsDefined(type, 
typeof(CompilerGeneratedAttribute), false)
+                return CustomAttributeExtensions.IsDefined(type, 
typeof(CompilerGeneratedAttribute), false)
                        && type.IsGenericType && 
type.Name.Contains("AnonymousType")
                        && (type.Name.StartsWith("<>", true, 
CultureInfo.CurrentCulture) || type.Name.StartsWith("VB$", true, 
CultureInfo.CurrentCulture))
                        && (type.Attributes & TypeAttributes.NotPublic) == 
TypeAttributes.NotPublic;

Reply via email to