Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package ch.nerdin.generators.testdata.framework.analyzer;
 
 
 import java.util.List;

Author(s):
edewit
    public Class<?>[] findClass(Method method) {
        Class<?>[] foundClass = null;
        Type type = method.getGenericReturnType();
        if (type instanceof ParameterizedType) {
            List<Typeresult = Arrays.asList(((ParameterizedTypetype).getActualTypeArguments());
            foundClass = result.toArray(new Class<?>[result.size()]);
        } else if (!((Class<?>) type).isInterface()) {
            foundClass = new Class<?>[] {(Class<?>) type };
        }
        return foundClass;
    }
New to GrepCode? Check out our FAQ X