Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-937

Custom binding prefixes shorter than 2 characters fail without useful diagnostics

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.1
    • Fix Version/s: 4.1.2
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Java 1.5, OS X 10.4.6

      Description

      It should be possible to specify custom binding prefixes consisting of one character, or even of the empty string, e.g.:

      <contribution configuration-id="tapestry.bindings.BindingFactories">
      <binding prefix="" service-id="tapestry.bindings.OGNLBindingFactory"/>
      <binding prefix="C" service-id="tapestry.bindings.ComponentBindingFactory"/>
      </contribution>

      This configuration should cause "C:foo" to be equivalent to "component:foo", and ":bar" to be equivalent to "component:bar". However, Tapestry silently ignores prefixes shorter than two characters, treating "C:foo" as a literal even with the above configuration.

      Tapestry should do one of two things:

      (1) Hopefully this behavior is unintentional. If so, it is due to a dropped minus sign on line 63 of BindingSourceImpl:

      if (colonx > 1)

      ...should be:

      if (colonx > -1)

      (2) If this behavior is intentional, BindingSourceImpl should reject any invalid contributions up front instead of ignoring them.

        Attachments

          Activity

            People

            • Assignee:
              jkuhnert Jesse Kuhnert
              Reporter:
              melquiades Paul Cantrell
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: