Skip to content

Running versions > 0.3.2 with JDK 1.7 #87

@wbauern

Description

@wbauern

In the code below from the AnnotationUtils.getAnnotatedParameters() method the Parameter class is used. This is a jdk1.8 specific class so this version will not work with apps running under jdk1.7. Since we currently don't have the option to run 1.8 we are stuck using v0.3.2 of your project which doesn't have that change in it. Do you have plans on making your library jdk1.7 compatible moving forward or will jdk1.8 be a hard requirement? We can make the fix ourselves to specifically work with 1.7 for now but want to make sure we don't have the same issue with future releases.

Thanks in Advance,
Bill


    //Attempt to use Paranamer to look up the parameter names for those not using Java 8+.
    //This will fail if trying to evaluate a class using Lambdas, in which case fall back and look up using
    //standard java reflections.  This will provide the paramter name if using the -parameters javac argument.
    try {
        parameterNames = paranamer.lookupParameterNames(method);
    } catch(Exception e) {
        Parameter[] parameters = method.getParameters();
        parameterNames = new String[parameters.length];
        for (int i = 0; i < parameters.length; i++) {
            Parameter parameter = parameters[i];
            parameterNames[i] = parameter.getName();
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions