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

@Import leads to StringIndexOutOfBoundsException

    Details

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

      Description

      class org.apache.tapestry5.internal.services.ClasspathAssetAliasManagerImpl contains method extractAssetAlias with
      if (resourcePath.startsWith(pathPrefix))
      {
      // Prevent matching path prefix "foo" against "foobar" ... it must match against "foo/".
      if (resourcePath.charAt(pathPrefix.length()) != '/')

      { continue; }

      this code don't check when resourcePath.equals(pathPrefix) is true. In this case we get
      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 20

      To reproduce it just do next:

      @Import(library = InternalConstants.CORE_LIBRARY)
      public class Index {
      }

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: