Author: remy.maucherat(a)jboss.com
Date: 2008-09-03 14:48:04 -0400 (Wed, 03 Sep 2008)
New Revision: 768
Modified:
trunk/java/org/apache/naming/resources/ResourceAttributes.java
trunk/webapps/docs/changelog.xml
Log:
- Refactor getETag.
Modified: trunk/java/org/apache/naming/resources/ResourceAttributes.java
===================================================================
--- trunk/java/org/apache/naming/resources/ResourceAttributes.java 2008-09-03 17:51:03 UTC
(rev 767)
+++ trunk/java/org/apache/naming/resources/ResourceAttributes.java 2008-09-03 18:48:04 UTC
(rev 768)
@@ -718,29 +718,29 @@
* @return ETag
*/
public String getETag(boolean strong) {
- String result = null;
- if (attributes != null) {
- Attribute attribute = attributes.get(ETAG);
- if (attribute != null) {
- try {
- result = attribute.get().toString();
- } catch (NamingException e) {
- ; // No value for the attribute
+ if (strong) {
+ // The strong ETag must always be calculated by the resources
+ if (strongETag != null)
+ return strongETag;
+ if (attributes != null) {
+ Attribute attribute = attributes.get(ETAG);
+ if (attribute != null) {
+ try {
+ strongETag = attribute.get().toString();
+ } catch (NamingException e) {
+ ; // No value for the attribute
+ }
}
}
- }
- if (strong) {
- // The strong ETag must always be calculated by the resources
- result = strongETag;
+ return strongETag;
} else {
// The weakETag is contentLenght + lastModified
if (weakETag == null) {
weakETag = "W/\"" + getContentLength() + "-"
+ getLastModified() + "\"";
}
- result = weakETag;
+ return weakETag;
}
- return result;
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-09-03 17:51:03 UTC (rev 767)
+++ trunk/webapps/docs/changelog.xml 2008-09-03 18:48:04 UTC (rev 768)
@@ -24,8 +24,11 @@
and harmonize lifecycle checks of StandardPipeline with the other components.
(remm)
</fix>
<fix>
- <bug>45628</bug>: JARs without deps should always be fulfilled.
(markt)
+ <bug>45628</bug>: JARs without dependencies should always be
fulfilled. (markt)
</fix>
+ <fix>
+ <bug>45735</bug>: More consistent getETag. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
Show replies by date