Methods should check arguments before internal state

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Affects Version/s: 1.5
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Methods that check arguments should do so before checking internal state, so that internal state doesn't mask invalid arguments.

      For example, classes that implement the freezable pattern should check for null arguments in property setters before checking whether the instance is frozen, so that attempting to set a property to null when the object is frozen should throw an ArgumentNullException instead of an InvalidOperationException.

            Assignee:
            Unassigned
            Reporter:
            Robert Stam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: