Velocity
  1. Velocity
  2. VELOCITY-458

InternalContextBase defines non-serializable non-transient fields

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5 beta1
    • Fix Version/s: 1.5
    • Component/s: Engine
    • Labels:
      None

      Description

      According to Findbugs, org.apache.velocity.context.InternalContextBase defines currentResource and eventCartridge as non-serializable, non-transient in a serializable class.

      Possible solutions:

      a) make Resource and EventCartridge serializable (might drag a large number of classes along)

      b) remove Serializable from InternalContextBase (does the Context get serialized somewhere? Is it needed for e.g. Web Applications?)

      c) make the fields transient, losing their contents after serialization / de-serialization.

        Activity

        Hide
        Will Glass-Husain added a comment -

        so what's the current behavior? If someone serializes a VelocityContext object does it throw an exception?

        Hard to see what's right here. Option c is terrible – it's a hidden change to the context state.

        My preference is

        (a) make Resource/Event Cartridge serializable (recognizing this is a pain)

        (b) remove Serializable (since it doesn't work anyway)

        Show
        Will Glass-Husain added a comment - so what's the current behavior? If someone serializes a VelocityContext object does it throw an exception? Hard to see what's right here. Option c is terrible – it's a hidden change to the context state. My preference is (a) make Resource/Event Cartridge serializable (recognizing this is a pain) (b) remove Serializable (since it doesn't work anyway)
        Hide
        Henning Schmiedehausen added a comment -

        Removed Serializable.

        Show
        Henning Schmiedehausen added a comment - Removed Serializable.
        Hide
        Henning Schmiedehausen added a comment -

        Close all resolved issues for Engine 1.5 release.

        Show
        Henning Schmiedehausen added a comment - Close all resolved issues for Engine 1.5 release.

          People

          • Assignee:
            Unassigned
            Reporter:
            Henning Schmiedehausen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development