cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1526690 - in /cxf/branches/2.6.x-fixes/maven-plugins: codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/ java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/ wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/common/
Date Thu, 26 Sep 2013 21:10:39 GMT
Author: dkulp
Date: Thu Sep 26 21:10:38 2013
New Revision: 1526690

URL: http://svn.apache.org/r1526690
Log:
Merged revisions 1526682 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

........
  r1526682 | dkulp | 2013-09-26 17:06:03 -0400 (Thu, 26 Sep 2013) | 11 lines

  Merged revisions 1526679 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/trunk

  ........
    r1526679 | dkulp | 2013-09-26 17:00:36 -0400 (Thu, 26 Sep 2013) | 3 lines

    [CXF-5287] Fix for possible NPE in maven plugins
    Patch from Nickolay Martinov applied in multiple places

  ........

........

Modified:
    cxf/branches/2.6.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/ClassLoaderSwitcher.java
    cxf/branches/2.6.x-fixes/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/ClassLoaderSwitcher.java
    cxf/branches/2.6.x-fixes/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/common/ClassLoaderSwitcher.java

Modified: cxf/branches/2.6.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/ClassLoaderSwitcher.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/ClassLoaderSwitcher.java?rev=1526690&r1=1526689&r2=1526690&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/ClassLoaderSwitcher.java
(original)
+++ cxf/branches/2.6.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/ClassLoaderSwitcher.java
Thu Sep 26 21:10:38 2013
@@ -118,18 +118,22 @@ public class ClassLoaderSwitcher {
      * Restore the old classloader
      */
     public void restoreClassLoader() {
-        Thread.currentThread().setContextClassLoader(origContextClassloader);
+        if (origContextClassloader != null) {
+            Thread.currentThread().setContextClassLoader(origContextClassloader);
+            origContextClassloader = null; // don't hold a reference.
+        }
         if (origClassPath != null) {
             System.setProperty("java.class.path", origClassPath);
         }
 
-        Map<Object, Object> newProps = new HashMap<Object, Object>(System.getProperties());
-        for (Object o : newProps.keySet()) {
-            if (!origProps.containsKey(o)) {
-                System.clearProperty(o.toString());
+        if (origProps != null) {
+            Map<Object, Object> newProps = new HashMap<Object, Object>(System.getProperties());
+            for (Object o : newProps.keySet()) {
+                if (!origProps.containsKey(o)) {
+                    System.clearProperty(o.toString());
+                }
             }
+            System.getProperties().putAll(origProps);
         }
-        System.getProperties().putAll(origProps);
-        origContextClassloader = null; // don't hold a reference.
     }
 }

Modified: cxf/branches/2.6.x-fixes/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/ClassLoaderSwitcher.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/ClassLoaderSwitcher.java?rev=1526690&r1=1526689&r2=1526690&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/ClassLoaderSwitcher.java
(original)
+++ cxf/branches/2.6.x-fixes/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/ClassLoaderSwitcher.java
Thu Sep 26 21:10:38 2013
@@ -111,18 +111,22 @@ public class ClassLoaderSwitcher {
      * Restore the old classloader
      */
     public void restoreClassLoader() {
-        Thread.currentThread().setContextClassLoader(origContextClassloader);
+        if (origContextClassloader != null) {
+            Thread.currentThread().setContextClassLoader(origContextClassloader);
+            origContextClassloader = null; // don't hold a reference.
+        }
         if (origClassPath != null) {
             System.setProperty("java.class.path", origClassPath);
         }
 
-        Map<Object, Object> newProps = new HashMap<Object, Object>(System.getProperties());
-        for (Object o : newProps.keySet()) {
-            if (!origProps.containsKey(o)) {
-                System.clearProperty(o.toString());
+        if (origProps != null) {
+            Map<Object, Object> newProps = new HashMap<Object, Object>(System.getProperties());
+            for (Object o : newProps.keySet()) {
+                if (!origProps.containsKey(o)) {
+                    System.clearProperty(o.toString());
+                }
             }
+            System.getProperties().putAll(origProps);
         }
-        System.getProperties().putAll(origProps);
-        origContextClassloader = null; // don't hold a reference.
     }
 }

Modified: cxf/branches/2.6.x-fixes/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/common/ClassLoaderSwitcher.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/common/ClassLoaderSwitcher.java?rev=1526690&r1=1526689&r2=1526690&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/common/ClassLoaderSwitcher.java
(original)
+++ cxf/branches/2.6.x-fixes/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/common/ClassLoaderSwitcher.java
Thu Sep 26 21:10:38 2013
@@ -120,18 +120,22 @@ public class ClassLoaderSwitcher {
      * Restore the old classloader
      */
     public void restoreClassLoader() {
-        Thread.currentThread().setContextClassLoader(origContextClassloader);
+        if (origContextClassloader != null) {
+            Thread.currentThread().setContextClassLoader(origContextClassloader);
+            origContextClassloader = null; // don't hold a reference.
+        }
         if (origClassPath != null) {
             System.setProperty("java.class.path", origClassPath);
         }
 
-        Map<Object, Object> newProps = new HashMap<Object, Object>(System.getProperties());
-        for (Object o : newProps.keySet()) {
-            if (!origProps.containsKey(o)) {
-                System.clearProperty(o.toString());
+        if (origProps != null) {
+            Map<Object, Object> newProps = new HashMap<Object, Object>(System.getProperties());
+            for (Object o : newProps.keySet()) {
+                if (!origProps.containsKey(o)) {
+                    System.clearProperty(o.toString());
+                }
             }
+            System.getProperties().putAll(origProps);
         }
-        System.getProperties().putAll(origProps);
-        origContextClassloader = null; // don't hold a reference.
     }
 }



Mime
View raw message