package pl.mkrystek.mkbot;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Main {

    private static final Logger LOGGER = LoggerFactory.getLogger(Main.class);

    public static void main(String[] args) throws Exception {
        try {
            BotApplication application = new BotApplication();
            application.init();
            application.startApplication();
            application.shutdown();
        } catch (RuntimeException e) {
            LOGGER.error("Error : ", e);
        }
    }
}

@@ -241,16 +241,59 @@
 ption %7B%0A
+        BotApplication application = null;%0A
         
@@ -306,39 +306,24 @@
             
-BotApplication 
 application 
@@ -426,44 +426,8 @@
 ();%0A
-            application.shutdown();%0A
     
@@ -461,16 +461,16 @@
 on e) %7B%0A
-
         
@@ -502,16 +502,97 @@
  %22, e);%0A
+        %7D finally %7B%0A            if (application != null) application.shutdown();%0A
         

Refactor vol.5