Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-9828

Modify org.springframework.util.Assert.* methods so that they will return checked values

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.2
    • Fix Version/s: Waiting for Triage
    • Component/s: Core
    • Labels:
      None

      Description

      The proposed improvement is to modify signature for each org.springframework.util.Assert.* method so that it will return the checked value to let programmer to make check and assignment in "one turn".

      This would improve readability of the initializers that uses spring's Assert and minimize the code, e.g. instead of having to write

      notNull(foo, "Foo can't be null"); // static import omitted for clarity
      hasText(bar, "Bar can't be empty");
      this.foo = foo;
      this.bar = bar;

      someone can write

      this.foo = notNull(foo, "Foo can't be null");
      this.bar = hasText(bar, "Bar can't be empty");

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alex_sv Alexander Shabanov
              Last updater:
              Chris Beams
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                5 years, 35 weeks, 1 day ago