openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1822202 - /openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
Date Thu, 25 Jan 2018 13:39:45 GMT
Author: rmannibucau
Date: Thu Jan 25 13:39:45 2018
New Revision: 1822202

URL: http://svn.apache.org/viewvc?rev=1822202&view=rev
Log:
MEECROWAVE-94 ensure Cli works without calling twice close()

Modified:
    openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java

Modified: openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java?rev=1822202&r1=1822201&r2=1822202&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
Thu Jan 25 13:39:45 2018
@@ -835,7 +835,7 @@ public class Meecrowave implements AutoC
     }
 
     @Override
-    public void close() {
+    public synchronized void close() {
         if (tomcat == null) {
             return;
         }
@@ -860,6 +860,8 @@ public class Meecrowave implements AutoC
             } catch (final LifecycleException e) {
                 throw new IllegalStateException(e);
             } finally {
+                tomcat = null; // ensure we can call close() N times and not have side effects
+                contexts.clear();
                 if (clearCatalinaSystemProperties) {
                     Stream.of("catalina.base", "catalina.home").forEach(System::clearProperty);
                 }



Mime
View raw message