streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sblack...@apache.org
Subject [25/50] [abbrv] incubator-streams git commit: protect no-arg constructor
Date Fri, 20 Mar 2015 00:53:51 GMT
protect no-arg constructor


Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/624d3e1f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/624d3e1f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/624d3e1f

Branch: refs/heads/asf-master
Commit: 624d3e1fe72a51302ee4f05cecf1a74eb9808555
Parents: f471d78
Author: sblackmon <sblackmon@apache.org>
Authored: Tue Feb 17 16:01:04 2015 -0600
Committer: sblackmon <sblackmon@apache.org>
Committed: Tue Feb 17 16:01:04 2015 -0600

----------------------------------------------------------------------
 .../org/apache/streams/jackson/StreamsJacksonMapper.java     | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/624d3e1f/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsJacksonMapper.java
----------------------------------------------------------------------
diff --git a/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsJacksonMapper.java
b/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsJacksonMapper.java
index f5eace1..30b5615 100644
--- a/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsJacksonMapper.java
+++ b/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsJacksonMapper.java
@@ -58,7 +58,13 @@ public class StreamsJacksonMapper extends ObjectMapper {
 
     }
 
-    public StreamsJacksonMapper() {
+    /*
+      Use getInstance to get a globally shared thread-safe ObjectMapper,
+      rather than call this constructor.  Reflection-based resolution of
+      date-time formats across all modules can be slow and should only happen
+      once per JVM.
+     */
+    protected StreamsJacksonMapper() {
         super();
         registerModule(new StreamsJacksonModule());
         configure();


Mime
View raw message