Tapestry 5
  1. Tapestry 5
  2. TAP5-323

Fields marked with @Persist should not allow default values

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.16
    • Fix Version/s: 5.0.16
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      An error should be raised when a persistent field comes with inline mutable object initialization, cause the result is very surprised: the field is not in session boundary, instead visible by all requests. The bad thing is this kind of code can pass unit tests and integration tests without any warnings.

      A document is good for this issue, but it's not enough; it's hard to guarantee every developer have read that piece of ducument carefully.

        Issue Links

          Activity

          Hide
          Howard M. Lewis Ship added a comment -

          This is very hard to detect, as is differentiating mutable types from immutable types.

          Show
          Howard M. Lewis Ship added a comment - This is very hard to detect, as is differentiating mutable types from immutable types.

            People

            • Assignee:
              Howard M. Lewis Ship
              Reporter:
              Yunhua Sang
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development