shell/console/src/main/java/org/apache/karaf/shell/compat/ArgumentCompleter.java [206:255]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private Map<Integer, Object> getCompleterValues(CommandWithAction function) {
        final Map<Integer, Object> values = new HashMap<>();
        Action action = null;
        try {
            for (Class<?> type = function.getActionClass(); type != null; type = type.getSuperclass()) {
                for (Method method : type.getDeclaredMethods()) {
                    CompleterValues completerMethod = method.getAnnotation(CompleterValues.class);
                    if (completerMethod != null) {
                        int index = completerMethod.index();
                        Integer key = index;
                        if (index >= arguments.size() || index < 0) {
                            LOGGER.warn("Index out of range on @CompleterValues on class " + type.getName() + " for index: " + key + " see: " + method);
                        } else if (values.containsKey(key)) {
                            LOGGER.warn("Duplicate @CompleterMethod annotations on class " + type.getName() + " for index: " + key + " see: " + method);
                        } else {
                            try {
                                Object value;
                                if (Modifier.isStatic(method.getModifiers())) {
                                    value = method.invoke(null);
                                } else {
                                    if (action == null) {
                                        action = function.createNewAction();
                                    }
                                    value = method.invoke(action);
                                }
                                values.put(key, value);
                            } catch (IllegalAccessException e) {
                                LOGGER.warn("Could not invoke @CompleterMethod on " + function + ". " + e, e);
                            } catch (InvocationTargetException e) {
                                Throwable target = e.getTargetException();
                                if (target == null) {
                                    target = e;
                                }
                                LOGGER.warn("Could not invoke @CompleterMethod on " + function + ". " + target, target);
                            }
                        }
                    }
                }
            }
        } finally {
            if (action != null) {
                try {
                    function.releaseAction(action);
                } catch (Exception e) {
                    LOGGER.warn("Failed to release action: " + action + ". " + e, e);
                }
            }
        }
        return values;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



shell/console/src/main/java/org/apache/karaf/shell/console/completer/ArgumentCompleter.java [201:250]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private Map<Integer, Object> getCompleterValues(CommandWithAction function) {
        final Map<Integer, Object> values = new HashMap<>();
        Action action = null;
        try {
            for (Class<?> type = function.getActionClass(); type != null; type = type.getSuperclass()) {
                for (Method method : type.getDeclaredMethods()) {
                    CompleterValues completerMethod = method.getAnnotation(CompleterValues.class);
                    if (completerMethod != null) {
                        int index = completerMethod.index();
                        Integer key = index;
                        if (index >= arguments.size() || index < 0) {
                            LOGGER.warn("Index out of range on @CompleterValues on class " + type.getName() + " for index: " + key + " see: " + method);
                        } else if (values.containsKey(key)) {
                            LOGGER.warn("Duplicate @CompleterMethod annotations on class " + type.getName() + " for index: " + key + " see: " + method);
                        } else {
                            try {
                                Object value;
                                if (Modifier.isStatic(method.getModifiers())) {
                                    value = method.invoke(null);
                                } else {
                                    if (action == null) {
                                        action = function.createNewAction();
                                    }
                                    value = method.invoke(action);
                                }
                                values.put(key, value);
                            } catch (IllegalAccessException e) {
                                LOGGER.warn("Could not invoke @CompleterMethod on " + function + ". " + e, e);
                            } catch (InvocationTargetException e) {
                                Throwable target = e.getTargetException();
                                if (target == null) {
                                    target = e;
                                }
                                LOGGER.warn("Could not invoke @CompleterMethod on " + function + ". " + target, target);
                            }
                        }
                    }
                }
            }
        } finally {
            if (action != null) {
                try {
                    function.releaseAction(action);
                } catch (Exception e) {
                    LOGGER.warn("Failed to release action: " + action + ". " + e, e);
                }
            }
        }
        return values;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



