this code should be dropped otherwise the container start/stop and you
can't keep your app up (+ this is not the correct close)

I'll fix it now



Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-05-26 19:53 GMT+02:00 Marius Kruger <[email protected]>:

> 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
>

Reply via email to