[
https://issues.apache.org/jira/browse/WICKET-6611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16678123#comment-16678123
]
Tobias Soloschenko edited comment on WICKET-6611 at 11/7/18 12:07 PM:
----------------------------------------------------------------------
Hi [~mgrigorov],
just saw your answer. :)
{quote}
I think it is an oversight.
Please send a Pull Request. Preferably with tests. Thank you!
{quote}
I am just wondering on how to fix the circumstances I just mentioned or maybe I
am just making it to difficult. ;)
kind regards
Tobias
was (Author: klopfdreh):
Hi [~mgrigorov],
just saw your answer. :)
I am just wondering on how to fix the circumstances I just mentioned or maybe I
am just making it to difficult. ;)
kind regards
Tobias
> Missing check for IScopeAwareTextResourceProcessor when concatenating
> resources
> -------------------------------------------------------------------------------
>
> Key: WICKET-6611
> URL: https://issues.apache.org/jira/browse/WICKET-6611
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 8.1.0
> Reporter: Thomas Heigl
> Priority: Major
>
> Resource concatenation cannot be used with text compressors relying on scope
> information.
> I tried to use {{CssUrlReplacer}} in my application and it failed on startup
> with an {{UnsupportedOperationException}} in the {{compress}} method.
> In {{CssPackageResource}} we have the following code:
> {code:java}
> ICssCompressor compressor = getCompressor();
> if (compressor != null && getCompress())
> {
> try
> {
> String charsetName = "UTF-8";
> String nonCompressed = new String(processedResponse, charsetName);
> String output;
> if (compressor instanceof IScopeAwareTextResourceProcessor)
> {
> IScopeAwareTextResourceProcessor scopeAwareProcessor =
> (IScopeAwareTextResourceProcessor) compressor;
> output = scopeAwareProcessor.process(nonCompressed, getScope(),
> name);
> }
> else
> {
> output = compressor.compress(nonCompressed);
> }
> return output.getBytes(charsetName);
> }
> catch (Exception e)
> {
> log.error("Error while filtering content", e);
> return processedResponse;
> }
> }{code}
> In {{ConcatBundleResource}} this {{instanceof}} is missing and {{compress}}
> is called directly.
> {code:java}
> if (getCompressor() != null)
> {
> String nonCompressed = new String(bytes, "UTF-8");
> bytes = getCompressor().compress(nonCompressed).getBytes("UTF-8");
> }{code}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)