cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r944311 - in /cxf/branches/2.2.x-fixes: ./ parent/pom.xml tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java
Date Fri, 14 May 2010 15:16:51 GMT
Author: dkulp
Date: Fri May 14 15:16:48 2010
New Revision: 944311

URL: http://svn.apache.org/viewvc?rev=944311&view=rev
Log:
Merged revisions 944307 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r944307 | dkulp | 2010-05-14 11:05:54 -0400 (Fri, 14 May 2010) | 2 lines
  
  Update to protect the velocity engine init from being hit by multiple
  threads.
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/parent/pom.xml
    cxf/branches/2.2.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/parent/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/parent/pom.xml?rev=944311&r1=944310&r2=944311&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/parent/pom.xml (original)
+++ cxf/branches/2.2.x-fixes/parent/pom.xml Fri May 14 15:16:48 2010
@@ -781,7 +781,7 @@
             <dependency>
                 <groupId>org.apache.velocity</groupId>
                 <artifactId>velocity</artifactId>
-                <version>1.6.2</version>
+                <version>1.6.4</version>
             </dependency>
             <dependency>
                 <groupId>wsdl4j</groupId>

Modified: cxf/branches/2.2.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java?rev=944311&r1=944310&r2=944311&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java
Fri May 14 15:16:48 2010
@@ -42,6 +42,8 @@ import org.apache.velocity.runtime.Runti
 
 public final class VelocityGenerator {
     private static final Logger LOG = LogUtils.getL7dLogger(VelocityGenerator.class);
+    private static boolean initialized;
+    
     private final Map<String, Object> attributes = new HashMap<String, Object>();
     private String baseDir;
     
@@ -52,7 +54,7 @@ public final class VelocityGenerator {
         initVelocity(log);
     }
 
-    private String getVelocityLogFile(String logfile) {
+    private static String getVelocityLogFile(String logfile) {
         String logdir = System.getProperty("user.home");
         if (logdir == null || logdir.length() == 0) {
             logdir = System.getProperty("user.dir");
@@ -60,7 +62,11 @@ public final class VelocityGenerator {
         return logdir + File.separator + logfile;
     }
 
-    private void initVelocity(boolean log) throws ToolException {
+    private static synchronized void initVelocity(boolean log) throws ToolException {
+        if (initialized) {
+            return;
+        }
+        initialized = true;
         try {
             Properties props = new Properties();
             String clzName = "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader";



Mime
View raw message