Search in sources :

Example 1 with MethodParameterNames

use of meghanada.reflect.names.MethodParameterNames in project meghanada-server by mopemope.

the class MethodAnalyzeVisitor method tryGetParameterName.

private boolean tryGetParameterName(final String className, final String name) {
    // log.debug("search {}", name);
    final String path = ClassNameUtils.replace(className, ".", "/");
    try (final InputStream in = getClass().getResourceAsStream("/params/" + path + ".param")) {
        if (in == null) {
            return false;
        }
        final MethodParameterNames mn = Serializer.readObject(in, MethodParameterNames.class);
        final List<List<ParameterName>> pmsList = mn.names.get(name);
        if (pmsList == null) {
            return false;
        }
        final boolean result = this.searchParameterNames(pmsList);
        if (result) {
            return true;
        }
        // fallback
        return false;
    } catch (Exception e) {
        log.debug(e.getMessage());
    }
    return false;
}
Also used : MethodParameterNames(meghanada.reflect.names.MethodParameterNames) InputStream(java.io.InputStream) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 MethodParameterNames (meghanada.reflect.names.MethodParameterNames)1