Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2120

StringIndexOutOfBoundsException computing relative paths for certain Resources

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.3, 5.4
    • Fix Version/s: 5.4
    • Component/s: tapestry-core, tapestry-ioc
    • Labels:
      None

      Description

      Discoverred as part of CSS URL rewriting.

      With a base resource of "context:css/style.css"
      a relative URL of "../images/icon.gif"
      will fail with StringIndexOutOfBounds exception.

      java.lang.AbstractStringBuilder.setLength(AbstractStringBuilder.java:173)
      java.lang.StringBuilder.setLength(StringBuilder.java:72)
      org.apache.tapestry5.ioc.internal.util.AbstractResource.forFile(AbstractResource.java:104)
      org.apache.tapestry5.internal.services.AssetSourceImpl.findResource(AssetSourceImpl.java:241)
      org.apache.tapestry5.internal.services.AssetSourceImpl.getAssetInLocale(AssetSourceImpl.java:222)
      org.apache.tapestry5.internal.services.AssetSourceImpl.getAsset(AssetSourceImpl.java:104)
      org.apache.tapestry5.internal.services.assets.CSSURLRewriter.replaceURLs(CSSURLRewriter.java:145)
      

      Basically, it can't handle the fact that context: URLs don't have to start with a leading slash. Maybe they should, but that would break backwards compatibility.

        Attachments

          Activity

            People

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              hlship Howard M. Lewis Ship
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: