Tapestry 5
  1. Tapestry 5
  2. TAP5-1425

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.3, 5.2
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:
      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())

        Activity

        Hide
        Massimo Lusetti added a comment -

        What would be the case where localized wouldn't be null if the Resource isn't found?

        Show
        Massimo Lusetti added a comment - What would be the case where localized wouldn't be null if the Resource isn't found?
        Hide
        Hudson added a comment -

        Integrated in tapestry-trunk-freestyle #622 (See https://builds.apache.org/job/tapestry-trunk-freestyle/622/)
        TAP5-1425 Throw an exception if asset is found but does not actually exists

        mlusetti : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196608
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetSourceImpl.java
        Show
        Hudson added a comment - Integrated in tapestry-trunk-freestyle #622 (See https://builds.apache.org/job/tapestry-trunk-freestyle/622/ ) TAP5-1425 Throw an exception if asset is found but does not actually exists mlusetti : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196608 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetSourceImpl.java
        Hide
        Howard M. Lewis Ship added a comment -

        Discovered this fixed bug while reviewing 5.4 bugs; this was fixed somewhere in the 5.3 timeframe.

        Show
        Howard M. Lewis Ship added a comment - Discovered this fixed bug while reviewing 5.4 bugs; this was fixed somewhere in the 5.3 timeframe.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development