#3 Static Analysis Fixes - ChecksumUtils.cs

closed
Chris Morgan
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

  • 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