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

AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 5.3, 5.2
    • 5.3
    • tapestry-core
    • None

    Description

      From the JavaDoc:

      /**

      • Find an asset but does not attempt to localize it. If the path has no prefix, it is assumed to
      • be on the classpath.
      • @since 5.2.0
      • @throws RuntimeException
      • if the asset can not be found
        */
        Asset getUnlocalizedAsset(String path);

      I discoverred that I can pass an invalid path name and it works.

      private Asset getLocalizedAssetFromResource(Resource unlocalized, Locale locale)

      { Resource localized = locale == null ? unlocalized : unlocalized.forLocale(locale); if (localized == null) throw new RuntimeException(ServicesMessages.assetDoesNotExist(unlocalized)); return getAssetForResource(localized); }

      That should be:

      if (localized == null || ! localized.exists())

      Attachments

        Activity

          People

            mlusetti Massimo Lusetti
            hlship Howard Lewis Ship
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: