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

@Import leads to StringIndexOutOfBoundsException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 5.4
    • 5.4
    • tapestry-core
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: