isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject [2/5] isis git commit: ISIS-1465: tiny threadsafety fix for restful when generating representations (SimpleDateFormat is not thread-safe)
Date Tue, 15 Aug 2017 21:56:39 GMT
ISIS-1465: tiny threadsafety fix for restful when generating representations (SimpleDateFormat
is not thread-safe)


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/a4279f06
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/a4279f06
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/a4279f06

Branch: refs/heads/master
Commit: a4279f06a64f096d9fadee6652d24dba74791f54
Parents: ee57be7
Author: Dan Haywood <dan@haywood-associates.co.uk>
Authored: Tue Aug 15 21:36:18 2017 +0100
Committer: Dan Haywood <dan@haywood-associates.co.uk>
Committed: Tue Aug 15 21:36:18 2017 +0100

----------------------------------------------------------------------
 .../ContentNegotiationServiceForRestfulObjectsV1_0.java      | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/a4279f06/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conneg/ContentNegotiationServiceForRestfulObjectsV1_0.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conneg/ContentNegotiationServiceForRestfulObjectsV1_0.java
b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conneg/ContentNegotiationServiceForRestfulObjectsV1_0.java
index ac8692f..fb666a8 100644
--- a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conneg/ContentNegotiationServiceForRestfulObjectsV1_0.java
+++ b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conneg/ContentNegotiationServiceForRestfulObjectsV1_0.java
@@ -56,8 +56,6 @@ import org.apache.isis.viewer.restfulobjects.rendering.service.RepresentationSer
 )
 public class ContentNegotiationServiceForRestfulObjectsV1_0 implements ContentNegotiationService
{
 
-    private static final DateFormat ETAG_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
-
     private boolean strictAcceptChecking;
 
     @PostConstruct
@@ -110,11 +108,15 @@ public class ContentNegotiationServiceForRestfulObjectsV1_0 implements
ContentNe
 
         final Version version = objectAdapter.getVersion();
         if (version != null && version.getTime() != null) {
-            responseBuilder.tag(ETAG_FORMAT.format(version.getTime()));
+            responseBuilder.tag(etagFormat().format(version.getTime()));
         }
         return responseBuilder;
     }
 
+    private DateFormat etagFormat() {
+        return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
+    }
+
     @Override
     public ResponseBuilder buildResponse(
             final RepresentationService.Context2 rendererContext,


Mime
View raw message