You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by pe...@apache.org on 2024/11/03 01:01:27 UTC
(wicket) branch master updated: WICKET-7024 javadoc + code cleanup
This is an automated email from the ASF dual-hosted git repository.
pedro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git
The following commit(s) were added to refs/heads/master by this push:
new 985fb6be8a WICKET-7024 javadoc + code cleanup
985fb6be8a is described below
commit 985fb6be8ab5ae41e54892492ff241deb5585446
Author: Pedro Santos <pe...@apache.org>
AuthorDate: Sat Nov 2 22:01:20 2024 -0300
WICKET-7024 javadoc + code cleanup
---
.../wicket/request/resource/PackageResource.java | 25 ++++++----------------
1 file changed, 6 insertions(+), 19 deletions(-)
diff --git a/wicket-core/src/main/java/org/apache/wicket/request/resource/PackageResource.java b/wicket-core/src/main/java/org/apache/wicket/request/resource/PackageResource.java
index c1897f5d02..58d5bc3534 100644
--- a/wicket-core/src/main/java/org/apache/wicket/request/resource/PackageResource.java
+++ b/wicket-core/src/main/java/org/apache/wicket/request/resource/PackageResource.java
@@ -869,24 +869,19 @@ public class PackageResource extends AbstractResource implements IStaticCacheabl
return this;
}
+ /**
+ * @return UrlAttributes with an existent locale/style/variation if a resource is bound to the
+ * scope+name
+ */
public static ResourceReference.UrlAttributes sanitize(
ResourceReference.UrlAttributes urlAttributes, Class<?> scope, String name)
{
IResourceStream filesystemMatch = getResourceStream(scope, name, urlAttributes.getLocale(),
urlAttributes.getStyle(), urlAttributes.getVariation(), false);
-
if (filesystemMatch == null)
{
return urlAttributes;
}
-
- ResourceReference.Key urlKey = new ResourceReference.Key(scope.getName(), name,
- urlAttributes.getLocale(), urlAttributes.getStyle(), urlAttributes.getVariation());
-
- ResourceReference.Key filesystemKey = new ResourceReference.Key(scope.getName(), name,
- filesystemMatch.getLocale(), filesystemMatch.getStyle(),
- filesystemMatch.getVariation());
-
try
{
filesystemMatch.close();
@@ -895,16 +890,8 @@ public class PackageResource extends AbstractResource implements IStaticCacheabl
{
log.error("failed to close", e);
}
-
- if (!urlKey.equals(filesystemKey))
- {
- return new ResourceReference.UrlAttributes(filesystemKey.getLocale(),
- filesystemKey.getStyle(), filesystemKey.getVariation());
- }
- else
- {
- return urlAttributes;
- }
+ return new ResourceReference.UrlAttributes(filesystemMatch.getLocale(),
+ filesystemMatch.getStyle(), filesystemMatch.getVariation());
}
}