/** * Reinvoke the createDescriptions of the sub-commanders as they will otherwise not have their * descriptions taken from the bundle. * * @param jc * @param bundle */ protected static void fixResourceBundleBug(final JCommander jc, final ResourceBundle bundle) { for (final Entry<String, JCommander> entry : jc.getCommands().entrySet()) { final JCommander subJc = entry.getValue(); subJc.setDescriptionsBundle(bundle); subJc.setAcceptUnknownOptions(false); subJc.setColumnSize(jc.getColumnSize()); try { final Method method = subJc.getClass().getDeclaredMethod("createDescriptions"); method.setAccessible(true); method.invoke(subJc); } catch (final NoSuchMethodException e) { } catch (final SecurityException e) { } catch (final IllegalAccessException e) { } catch (final IllegalArgumentException e) { } catch (final InvocationTargetException e) { } } }