Calendar

<<  août 2008  >>
lumamejevesadi
28293031123
45678910
111214151617
181920222324
25262728293031
1234567

View posts in large calendar
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

(juin 16, 2008 17:47)

Today, my colleague Thierry Thoua has shown me a bug in one of the .NET framework class. If you look in the Lutz Roeder's Reflector for the CompilerType.Equals method, you should see something like:

 public override bool Equals(object o)

 {

     CompilerType type = o as CompilerType;

     if (o == null)

     {

         return false;

     }

     return ((((this._codeDomProviderType == type._codeDomProviderType)

            && (this._compilParams.WarningLevel == type._compilParams.WarningLevel))

            && (this._compilParams.IncludeDebugInformation == type._compilParams.IncludeDebugInformation))

            && (this._compilParams.CompilerOptions == type._compilParams.CompilerOptions));

 }

what happens ? Of course as they do not check "type" for nullity, but for "o" instead, you may have a NullReferenceException. Apparently he has seen such a bug in some other classes in the .NET framework. Maybe some more information on his blog ?

Billets liés

Commentaires

juin 17. 2008 11:24

Check on the blog of Thierry some other related bugs:
blog.lelibre.eu/.../104-les-mysteres-de-equals

pe.dautreppe

Ajouter un commentaire


 

  Country flag





Live preview

août 28. 2008 17:10

Powered by BlogEngine.NET 1.2.0.0 | Theme by Pierre-Emmanuel Dautreppe