private void init() { if (formatter == null) { try { Class<?> clazz = AbstractLogConfigParser.class.getClassLoader().loadClass(c.getLogNameFormatter()); formatter = (LogNameFormatter) clazz.newInstance(); } catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) { e.printStackTrace(); formatter = new DefaultLogNameFormatter(); } } } });