@SuppressWarnings("unchecked") private static Class<SmackDebugger> getOneOfDefaultDebuggerClasses() { for (String debugger : DEFAULT_DEBUGGERS) { if (SmackConfiguration.isDisabledSmackClass(debugger)) { continue; } try { return (Class<SmackDebugger>) Class.forName(debugger); } catch (ClassNotFoundException cnfe) { LOGGER.fine("Did not find debugger class '" + debugger + "'"); } catch (ClassCastException ex) { LOGGER.warning("Found debugger class that does not appears to implement SmackDebugger interface"); } catch (Exception ex) { LOGGER.warning("Unable to instantiate either Smack debugger class"); } } // did not found any of default debuggers - give up return null; } }
private static void parseClassesToLoad(XmlPullParser parser, boolean optional, Collection<Exception> exceptions, ClassLoader classLoader) throws Exception { final String startName = parser.getName(); int eventType; String name; outerloop: do { eventType = parser.next(); name = parser.getName(); if (eventType == XmlPullParser.START_TAG && "className".equals(name)) { String classToLoad = parser.nextText(); if (SmackConfiguration.isDisabledSmackClass(classToLoad)) { continue outerloop; } try { loadSmackClass(classToLoad, optional, classLoader); } catch (Exception e) { // Don't throw the exception if an exceptions collection is given, instead // record it there. This is used for unit testing purposes. if (exceptions != null) { exceptions.add(e); } else { throw e; } } } } while (!(eventType == XmlPullParser.END_TAG && startName.equals(name))); }
@SuppressWarnings("unchecked") private static Class<SmackDebugger> getOneOfDefaultDebuggerClasses() { for (String debugger : DEFAULT_DEBUGGERS) { if (SmackConfiguration.isDisabledSmackClass(debugger)) { continue; } try { return (Class<SmackDebugger>) Class.forName(debugger); } catch (ClassNotFoundException cnfe) { LOGGER.fine("Did not find debugger class '" + debugger + "'"); } catch (ClassCastException ex) { LOGGER.warning("Found debugger class that does not appears to implement SmackDebugger interface"); } catch (Exception ex) { LOGGER.warning("Unable to instantiate either Smack debugger class"); } } // did not found any of default debuggers - give up return null; } }
private static void parseClassesToLoad(XmlPullParser parser, boolean optional, Collection<Exception> exceptions, ClassLoader classLoader) throws Exception { final String startName = parser.getName(); int eventType; String name; outerloop: do { eventType = parser.next(); name = parser.getName(); if (eventType == XmlPullParser.START_TAG && "className".equals(name)) { String classToLoad = parser.nextText(); if (SmackConfiguration.isDisabledSmackClass(classToLoad)) { continue outerloop; } try { loadSmackClass(classToLoad, optional, classLoader); } catch (Exception e) { // Don't throw the exception if an exceptions collection is given, instead // record it there. This is used for unit testing purposes. if (exceptions != null) { exceptions.add(e); } else { throw e; } } } } while (!(eventType == XmlPullParser.END_TAG && startName.equals(name))); }