#3 Static Analysis Fixes - ChecksumUtils.cs

closed
None
5
2012-09-14
2009-03-04
Phill L
No

The first of many i'm sure ;)

1) Instances of types that define only static members do not need to be created. Adding an empty private constructor to prevent this.

2) Mark 'ChecksumUtils' as sealed. Static holder types do not provide functionality that derived instances can extend. Inheriting from such a type indicates a flawed design.

3) Correct the potential overflow in the operation 'len-1' in 'ChecksumUtils.OnesSum(byte[], int, int) [note: I know this is horribly unlikely, but it keeps the overflow gods happy.]

Discussion

  • Phill L

    Phill L - 2009-03-04

    Static Analysis Fixes for ChecksumUtils.cs Patch 1/1

     
  • Chris Morgan

    Chris Morgan - 2009-03-04

    What tool is generating these warnings? Patch looks good and are checked in.

    Chris

     


Anonymous

Cancel  Add attachments