cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject cxf git commit: [CXF-6286] Create transformer factory only once
Date Tue, 24 Mar 2015 10:45:25 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 60e4f8401 -> 6400b3cd1


[CXF-6286] Create transformer factory only once


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

Branch: refs/heads/master
Commit: 6400b3cd1d87e52723fac2641b34a5f0289b908c
Parents: 60e4f84
Author: Christian Schneider <chris@die-schneider.net>
Authored: Tue Mar 24 11:45:21 2015 +0100
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Tue Mar 24 11:45:21 2015 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/6400b3cd/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java
b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java
index 719c162..71742d8 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java
@@ -31,10 +31,12 @@ import javax.xml.transform.stream.StreamSource;
 public class PrettyLoggingFilter implements LogEventSender {
     private LogEventSender next;
     private boolean prettyLogging;
+    private TransformerFactory transformerFactory;
 
     public PrettyLoggingFilter(LogEventSender next) {
         this.next = next;
         this.prettyLogging = false;
+        transformerFactory = TransformerFactory.newInstance();
     }
 
     @Override
@@ -54,7 +56,7 @@ public class PrettyLoggingFilter implements LogEventSender {
 
     public String getPrettyMessage(String message) {
         try {
-            Transformer serializer = TransformerFactory.newInstance().newTransformer();
+            Transformer serializer = transformerFactory.newTransformer();
             serializer.setOutputProperty(OutputKeys.INDENT, "yes");
             serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
 


Mime
View raw message