I got such a report on #SNMP source code. 21. ProtectCallToEventDelegatesRule
Problem: The use of the event does not seems protected properly against NullReferenceException and/or race conditions. Details [Severity: High, Confidence: Normal] * Target: System.Void Lextm.SharpSnmpLib.Manager::TrapListener_InformRequestReceived (System.Object,Lextm.SharpSnmpLib.InformRequestReceivedEventArgs) * Variable 'handler' does not seems to be checked against null. Solution: Fix the event use to make sure it wont be null nor be susceptible to a race condition. More info available at: http://www.mono-project.com/Gendarme.Rules.Concurrency#ProtectCallToEventDelegatesRule But it is a false alarm in my opinion because I did check against null except I used if (null != handler). If I changed it back to if (handler != null) then this warning would disappear. Hope Gendarme can support (null != handler) some day as some books on C# use such a style. We don't want to puzzle some beginners by this rule, do we? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Gendarme" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/gendarme?hl=en -~----------~----~----~----~------~----~------~--~---

