[Mono-bugs] [Bug 79979][Wis] New - [PATCH] IsDefined() is mis implemented.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Nov 19 04:28:07 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by redforks at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=79979

--- shadow/79979	2006-11-19 04:28:06.000000000 -0500
+++ shadow/79979.tmp.9804	2006-11-19 04:28:06.000000000 -0500
@@ -0,0 +1,43 @@
+Bug#: 79979
+Product: Mono: Class Libraries
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: redforks at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [PATCH] IsDefined() is mis implemented.
+
+IsDefined() is mis implemented.
+
+In MonoCustomAttrs.cs:
+
+			MethodInfo baseMethod = method.GetBaseDefinition ();
+
+GetBaseDefinition() not return its direct super method, but the virtual
+method where its first declared. And there is no standrad way do this. I
+hacked it:
+
++			return t.GetMethod(method.Name, BindingFlags.FlattenHierarchy |
+BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.NonPublic
+| BindingFlags.Public, null, GetMethodParameterTypes(method), null);
+
+			BindingFlags.FlattenHierarchy will search Method up and find the first
+virtual method.
+
+There is another problem, Attribute itself can determinate whether inheriting. 
+
+
++			if (inherit && GetUsage(attributeType).Inherited && ((btype = GetBase
+(obj)) != null))
+
+
+Maybe GetCustomAttributes also contains such problems.


More information about the mono-bugs mailing list