Hi,
I was trying to figure out why one test failure breaks all others in my
test app <https://github.com/amanica/tomee-embedded-trial.git>
when I found this inverted null check:
===================================================================
--- src/main/java/org/apache/tomee/embedded/EmbeddedTomEEContainer.java
(revision
1597615)
+++ src/main/java/org/apache/tomee/embedded/EmbeddedTomEEContainer.java
(working
copy)
@@ -176,7 +176,7 @@
}
throw new TomEERuntimeException("initialization
exception", e);
} finally {
- if (tomEEContainer == null) {
+ if (tomEEContainer != null) {
try {
tomEEContainer.close();
} catch (final Exception e) {
BTW. I think in general doing a no-op when caching an exception isn't the
best idea, rather log to debug level? (Unless it impacts performance or
becomes very annoying but I'd think that would be the exception to the rule)
} catch (final Exception e) {
// no-op
}
--
regards
✝ Marius
Index: src/main/java/org/apache/tomee/embedded/EmbeddedTomEEContainer.java
===================================================================
--- src/main/java/org/apache/tomee/embedded/EmbeddedTomEEContainer.java
(revision 1597615)
+++ src/main/java/org/apache/tomee/embedded/EmbeddedTomEEContainer.java
(working copy)
@@ -176,7 +176,7 @@
}
throw new TomEERuntimeException("initialization exception", e);
} finally {
- if (tomEEContainer == null) {
+ if (tomEEContainer != null) {
try {
tomEEContainer.close();
} catch (final Exception e) {