You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org> on 2011/01/25 20:29:47 UTC

[jira] Created: (TAP5-1425) AssetSource.getUnlocalizedAsset() should throw an exception if asset not found but does not

AssetSource.getUnlocalizedAsset() should throw an exception if asset not found but does not
-------------------------------------------------------------------------------------------

                 Key: TAP5-1425
                 URL: https://issues.apache.org/jira/browse/TAP5-1425
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.3.0, 5.2
            Reporter: Howard M. Lewis Ship
            Priority: Minor


>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())


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] [Updated] (TAP5-1425) AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist

Posted by "Howard M. Lewis Ship (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-1425:
---------------------------------------

    Summary: AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist  (was: AssetSource.getUnlocalizedAsset() should throw an exception if asset not found but does not actually exist)
    
> AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1425
>                 URL: https://issues.apache.org/jira/browse/TAP5-1425
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3, 5.2
>            Reporter: Howard M. Lewis Ship
>            Priority: Minor
>
> 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())

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1425) AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist

Posted by "Massimo Lusetti (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142161#comment-13142161 ] 

Massimo Lusetti commented on TAP5-1425:
---------------------------------------

What would be the case where localized wouldn't be null if the Resource isn't found?
                
> AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1425
>                 URL: https://issues.apache.org/jira/browse/TAP5-1425
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3, 5.2
>            Reporter: Howard M. Lewis Ship
>            Priority: Minor
>
> 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())

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1425) AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist

Posted by "Massimo Lusetti (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142161#comment-13142161 ] 

Massimo Lusetti commented on TAP5-1425:
---------------------------------------

What would be the case where localized wouldn't be null if the Resource isn't found?
                
> AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1425
>                 URL: https://issues.apache.org/jira/browse/TAP5-1425
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3, 5.2
>            Reporter: Howard M. Lewis Ship
>            Priority: Minor
>
> 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())

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TAP5-1425) AssetSource.getUnlocalizedAsset() should throw an exception if asset not found but does not actually exist

Posted by "Howard M. Lewis Ship (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-1425:
---------------------------------------

    Summary: AssetSource.getUnlocalizedAsset() should throw an exception if asset not found but does not actually exist  (was: AssetSource.getUnlocalizedAsset() should throw an exception if asset not found but does not)
    
> AssetSource.getUnlocalizedAsset() should throw an exception if asset not found but does not actually exist
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1425
>                 URL: https://issues.apache.org/jira/browse/TAP5-1425
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3, 5.2
>            Reporter: Howard M. Lewis Ship
>            Priority: Minor
>
> 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())

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1425) AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142279#comment-13142279 ] 

Hudson commented on TAP5-1425:
------------------------------

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

                
> AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1425
>                 URL: https://issues.apache.org/jira/browse/TAP5-1425
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3, 5.2
>            Reporter: Howard M. Lewis Ship
>            Priority: Minor
>
> 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())

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1425) AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142279#comment-13142279 ] 

Hudson commented on TAP5-1425:
------------------------------

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

                
> AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1425
>                 URL: https://issues.apache.org/jira/browse/TAP5-1425
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3, 5.2
>            Reporter: Howard M. Lewis Ship
>            Priority: Minor
>
> 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())

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TAP5-1425) AssetSource.getUnlocalizedAsset() should throw an exception if asset not found but does not actually exist

Posted by "Howard M. Lewis Ship (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-1425:
---------------------------------------

    Summary: AssetSource.getUnlocalizedAsset() should throw an exception if asset not found but does not actually exist  (was: AssetSource.getUnlocalizedAsset() should throw an exception if asset not found but does not)
    
> AssetSource.getUnlocalizedAsset() should throw an exception if asset not found but does not actually exist
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1425
>                 URL: https://issues.apache.org/jira/browse/TAP5-1425
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3, 5.2
>            Reporter: Howard M. Lewis Ship
>            Priority: Minor
>
> 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())

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TAP5-1425) AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist

Posted by "Howard M. Lewis Ship (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-1425:
---------------------------------------

    Summary: AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist  (was: AssetSource.getUnlocalizedAsset() should throw an exception if asset not found but does not actually exist)
    
> AssetSource.getUnlocalizedAsset() should throw an exception if asset is found but does not actually exist
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1425
>                 URL: https://issues.apache.org/jira/browse/TAP5-1425
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3, 5.2
>            Reporter: Howard M. Lewis Ship
>            Priority: Minor
>
> 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())

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira