You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Luke Niesink (JIRA)" <ji...@apache.org> on 2012/08/21 16:19:37 UTC

[jira] [Created] (WICKET-4721) ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference

Luke Niesink created WICKET-4721:
------------------------------------

             Summary: ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference
                 Key: WICKET-4721
                 URL: https://issues.apache.org/jira/browse/WICKET-4721
             Project: Wicket
          Issue Type: Improvement
    Affects Versions: 6.0.0-beta3
            Reporter: Luke Niesink
            Priority: Minor


ConcatBundleResource (and ConcatResourceBundleReference) are currently limited to concatenating resources of the type PackageResource.

The only methods of the specified PackageResource's used by ConcatBundleResource are PackageResource#getCacheKey() and PackageResource#getResourceStream().

The implementation of PackageResource#getResourceStream() is (nearly) identical to PackageResource#getCacheableResourceStream().

The methods PackageResource#getCacheKey() and PackageResource#getCacheableResourceStream() are both implemented as part of the interface IStaticCacheableResource.

ConcatBundleResource (and ConcatResourceBundleReference) should, in my vision, therefor be able to concatenate all resources that implement IStaticCacheableResource.


--
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] (WICKET-4721) ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference

Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13438941#comment-13438941 ] 

Emond Papegaaij commented on WICKET-4721:
-----------------------------------------

I've come up with 2 solutions, a simple one and a type-safe generic one. I like the idea that this can be solved type-safe, but as you can see from the patch size, it rather large for such a small benefit, and it only includes the fixes in wicket-core.
                
> ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference
> -----------------------------------------------------------------------------------
>
>                 Key: WICKET-4721
>                 URL: https://issues.apache.org/jira/browse/WICKET-4721
>             Project: Wicket
>          Issue Type: Improvement
>    Affects Versions: 6.0.0-beta3
>            Reporter: Luke Niesink
>            Assignee: Emond Papegaaij
>            Priority: Minor
>         Attachments: WICKET-4721-generics.patch, WICKET-4721-simple.patch
>
>
> ConcatBundleResource (and ConcatResourceBundleReference) are currently limited to concatenating resources of the type PackageResource.
> The only methods of the specified PackageResource's used by ConcatBundleResource are PackageResource#getCacheKey() and PackageResource#getResourceStream().
> The implementation of PackageResource#getResourceStream() is (nearly) identical to PackageResource#getCacheableResourceStream().
> The methods PackageResource#getCacheKey() and PackageResource#getCacheableResourceStream() are both implemented as part of the interface IStaticCacheableResource.
> ConcatBundleResource (and ConcatResourceBundleReference) should, in my vision, therefor be able to concatenate all resources that implement IStaticCacheableResource.

--
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] [Assigned] (WICKET-4721) ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference

Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4721?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emond Papegaaij reassigned WICKET-4721:
---------------------------------------

    Assignee: Emond Papegaaij
    
> ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference
> -----------------------------------------------------------------------------------
>
>                 Key: WICKET-4721
>                 URL: https://issues.apache.org/jira/browse/WICKET-4721
>             Project: Wicket
>          Issue Type: Improvement
>    Affects Versions: 6.0.0-beta3
>            Reporter: Luke Niesink
>            Assignee: Emond Papegaaij
>            Priority: Minor
>
> ConcatBundleResource (and ConcatResourceBundleReference) are currently limited to concatenating resources of the type PackageResource.
> The only methods of the specified PackageResource's used by ConcatBundleResource are PackageResource#getCacheKey() and PackageResource#getResourceStream().
> The implementation of PackageResource#getResourceStream() is (nearly) identical to PackageResource#getCacheableResourceStream().
> The methods PackageResource#getCacheKey() and PackageResource#getCacheableResourceStream() are both implemented as part of the interface IStaticCacheableResource.
> ConcatBundleResource (and ConcatResourceBundleReference) should, in my vision, therefor be able to concatenate all resources that implement IStaticCacheableResource.

--
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] (WICKET-4721) ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference

Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4721?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emond Papegaaij updated WICKET-4721:
------------------------------------

    Attachment: WICKET-4721-simple.patch
    
> ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference
> -----------------------------------------------------------------------------------
>
>                 Key: WICKET-4721
>                 URL: https://issues.apache.org/jira/browse/WICKET-4721
>             Project: Wicket
>          Issue Type: Improvement
>    Affects Versions: 6.0.0-beta3
>            Reporter: Luke Niesink
>            Assignee: Emond Papegaaij
>            Priority: Minor
>         Attachments: WICKET-4721-generics.patch, WICKET-4721-simple.patch
>
>
> ConcatBundleResource (and ConcatResourceBundleReference) are currently limited to concatenating resources of the type PackageResource.
> The only methods of the specified PackageResource's used by ConcatBundleResource are PackageResource#getCacheKey() and PackageResource#getResourceStream().
> The implementation of PackageResource#getResourceStream() is (nearly) identical to PackageResource#getCacheableResourceStream().
> The methods PackageResource#getCacheKey() and PackageResource#getCacheableResourceStream() are both implemented as part of the interface IStaticCacheableResource.
> ConcatBundleResource (and ConcatResourceBundleReference) should, in my vision, therefor be able to concatenate all resources that implement IStaticCacheableResource.

--
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] [Comment Edited] (WICKET-4721) ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439333#comment-13439333 ] 

Martin Grigorov edited comment on WICKET-4721 at 8/22/12 6:29 PM:
------------------------------------------------------------------

>From the two suggested patches I prefer the simple one.
The one with the generics is too intrusive and requires too much typing. It can be improved though : no need to pass the type for JavaScriptResourceReference or JavaScriptReferenceHeaderItem. The type should be part of the ResRef/HeaderItem declaration. E.g. JavaScriptResRef is tied with JavaScriptPackageResource:

class PackageResourceReference<T extends PackageResource> extends ResourceReference<T> { ... }
class JavaScriptResourceRefeference extends PackageResourceReference<JavaScriptPackageResource> { ... }.


I think about of a third solution: ConcatResourceBundleReference is a ResRef but it works with IReferenceHeaderItems instead of with IResource (IStaticCacheableResource (ISCR) in this case) like any other ResRef. The problem with making it work with ISCR is that the user will have to manage the dependencies himself.
                
      was (Author: mgrigorov):
    From the two suggested patches I prefer the simple one.
The one with the generics is too intrusive and requires too much typing. It can be improved though : no need to pass the type for JavaScriptResourceReference or JavaScriptReferenceHeaderItem. The type should be part of the ResRef/HeaderItem declaration. E.g. JavaScriptResRef is tied with JavaScriptPackageResource:

class PackageResourceReference<T extends PackageResource> extends ResourceReference<T> { ... }
class JavaScriptResourceRefeference extends PackageResourceReference<JavaScriptPackageResource> { ... }.


I think about of a third solution: ConcatResourceBundleReference is a ResRef but it works with IReferenceHeaderItems instead of with IStaticCacheableResource (ISCR) like any other ResRef. The problem with making with work with ISCR is that the user will have to manage the dependencies himself.
                  
> ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference
> -----------------------------------------------------------------------------------
>
>                 Key: WICKET-4721
>                 URL: https://issues.apache.org/jira/browse/WICKET-4721
>             Project: Wicket
>          Issue Type: Improvement
>    Affects Versions: 6.0.0-beta3
>            Reporter: Luke Niesink
>            Assignee: Emond Papegaaij
>            Priority: Minor
>         Attachments: WICKET-4721-generics.patch, WICKET-4721-simple.patch
>
>
> ConcatBundleResource (and ConcatResourceBundleReference) are currently limited to concatenating resources of the type PackageResource.
> The only methods of the specified PackageResource's used by ConcatBundleResource are PackageResource#getCacheKey() and PackageResource#getResourceStream().
> The implementation of PackageResource#getResourceStream() is (nearly) identical to PackageResource#getCacheableResourceStream().
> The methods PackageResource#getCacheKey() and PackageResource#getCacheableResourceStream() are both implemented as part of the interface IStaticCacheableResource.
> ConcatBundleResource (and ConcatResourceBundleReference) should, in my vision, therefor be able to concatenate all resources that implement IStaticCacheableResource.

--
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] [Resolved] (WICKET-4721) ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference

Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4721?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emond Papegaaij resolved WICKET-4721.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.0.0

The simple patch is applied.
                
> ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference
> -----------------------------------------------------------------------------------
>
>                 Key: WICKET-4721
>                 URL: https://issues.apache.org/jira/browse/WICKET-4721
>             Project: Wicket
>          Issue Type: Improvement
>    Affects Versions: 6.0.0-beta3
>            Reporter: Luke Niesink
>            Assignee: Emond Papegaaij
>            Priority: Minor
>             Fix For: 6.0.0
>
>         Attachments: WICKET-4721-generics.patch, WICKET-4721-simple.patch
>
>
> ConcatBundleResource (and ConcatResourceBundleReference) are currently limited to concatenating resources of the type PackageResource.
> The only methods of the specified PackageResource's used by ConcatBundleResource are PackageResource#getCacheKey() and PackageResource#getResourceStream().
> The implementation of PackageResource#getResourceStream() is (nearly) identical to PackageResource#getCacheableResourceStream().
> The methods PackageResource#getCacheKey() and PackageResource#getCacheableResourceStream() are both implemented as part of the interface IStaticCacheableResource.
> ConcatBundleResource (and ConcatResourceBundleReference) should, in my vision, therefor be able to concatenate all resources that implement IStaticCacheableResource.

--
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] (WICKET-4721) ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference

Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4721?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emond Papegaaij updated WICKET-4721:
------------------------------------

    Attachment: WICKET-4721-generics.patch
    
> ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference
> -----------------------------------------------------------------------------------
>
>                 Key: WICKET-4721
>                 URL: https://issues.apache.org/jira/browse/WICKET-4721
>             Project: Wicket
>          Issue Type: Improvement
>    Affects Versions: 6.0.0-beta3
>            Reporter: Luke Niesink
>            Assignee: Emond Papegaaij
>            Priority: Minor
>         Attachments: WICKET-4721-generics.patch, WICKET-4721-simple.patch
>
>
> ConcatBundleResource (and ConcatResourceBundleReference) are currently limited to concatenating resources of the type PackageResource.
> The only methods of the specified PackageResource's used by ConcatBundleResource are PackageResource#getCacheKey() and PackageResource#getResourceStream().
> The implementation of PackageResource#getResourceStream() is (nearly) identical to PackageResource#getCacheableResourceStream().
> The methods PackageResource#getCacheKey() and PackageResource#getCacheableResourceStream() are both implemented as part of the interface IStaticCacheableResource.
> ConcatBundleResource (and ConcatResourceBundleReference) should, in my vision, therefor be able to concatenate all resources that implement IStaticCacheableResource.

--
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] (WICKET-4721) ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439333#comment-13439333 ] 

Martin Grigorov commented on WICKET-4721:
-----------------------------------------

>From the two suggested patches I prefer the simple one.
The one with the generics is too intrusive and requires too much typing. It can be improved though : no need to pass the type for JavaScriptResourceReference or JavaScriptReferenceHeaderItem. The type should be part of the ResRef/HeaderItem declaration. E.g. JavaScriptResRef is tied with JavaScriptPackageResource:

class PackageResourceReference<T extends PackageResource> extends ResourceReference<T> { ... }
class JavaScriptResourceRefeference extends PackageResourceReference<JavaScriptPackageResource> { ... }.


I think about of a third solution: ConcatResourceBundleReference is a ResRef but it works with IReferenceHeaderItems instead of with IStaticCacheableResource (ISCR) like any other ResRef. The problem with making with work with ISCR is that the user will have to manage the dependencies himself.
                
> ConcatBundleResource is unnecessarily limited to accepting PackageResourceReference
> -----------------------------------------------------------------------------------
>
>                 Key: WICKET-4721
>                 URL: https://issues.apache.org/jira/browse/WICKET-4721
>             Project: Wicket
>          Issue Type: Improvement
>    Affects Versions: 6.0.0-beta3
>            Reporter: Luke Niesink
>            Assignee: Emond Papegaaij
>            Priority: Minor
>         Attachments: WICKET-4721-generics.patch, WICKET-4721-simple.patch
>
>
> ConcatBundleResource (and ConcatResourceBundleReference) are currently limited to concatenating resources of the type PackageResource.
> The only methods of the specified PackageResource's used by ConcatBundleResource are PackageResource#getCacheKey() and PackageResource#getResourceStream().
> The implementation of PackageResource#getResourceStream() is (nearly) identical to PackageResource#getCacheableResourceStream().
> The methods PackageResource#getCacheKey() and PackageResource#getCacheableResourceStream() are both implemented as part of the interface IStaticCacheableResource.
> ConcatBundleResource (and ConcatResourceBundleReference) should, in my vision, therefor be able to concatenate all resources that implement IStaticCacheableResource.

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