#vulnerable code 
                                protected List<Parameter> getParameters(Type type, List<Annotation> annotations) {
        // look for path, query
        Iterator<SwaggerExtension> chain = SwaggerExtensions.chain();
        List<Parameter> parameters = null;

        LOG.info("getParameters for " + type.getClass().getName());
        Set<Type> typesToSkip = new HashSet<Type>();
        if (chain.hasNext()) {
            SwaggerExtension extension = chain.next();
            LOG.info("trying extension " + extension);
            parameters = extension.extractParameters(annotations, type, typesToSkip, chain);
        }

        if (parameters.size() > 0) {
            for (Parameter parameter : parameters) {

                ParameterProcessor.applyAnnotations(swagger, parameter, type, annotations);
            }
        } else {
            LOG.info("no parameter found, looking at body params");
            if (typesToSkip.contains(type) == false) {
                Parameter param = null;
                param = ParameterProcessor.applyAnnotations(swagger, null, type, annotations);
                if (param != null) {
                    for (Annotation annotation : annotations) {
                        if (annotation instanceof ApiParam) {
                            ApiParam apiParam = (ApiParam) annotation;
                            param.setRequired(apiParam.required());
                            break;
                        }
                    }
                    parameters.add(param);
                }


            }
        }
        return parameters;
    } 
                            #location 14 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                protected List<Parameter> getParameters(Type type, List<Annotation> annotations) {
        Iterator<SwaggerExtension> chain = SwaggerExtensions.chain();
        List<Parameter> parameters = new ArrayList<Parameter>();

        LOG.info("Looking for path/query/header/form/cookie params in" + type.getClass().getName());
        Set<Type> typesToSkip = new HashSet<Type>();
        if (chain.hasNext()) {
            SwaggerExtension extension = chain.next();
            LOG.info("trying extension " + extension);
            parameters = extension.extractParameters(annotations, type, typesToSkip, chain);
        }

        if (parameters.size() > 0) {
            for (Parameter parameter : parameters) {
                ParameterProcessor.applyAnnotations(swagger, parameter, type, annotations);
            }
        } else {
            // look for body parameters
            LOG.info("Looking for body params in" + type.getClass().getName());
            if (typesToSkip.contains(type) == false) {
                Parameter param = ParameterProcessor.applyAnnotations(swagger, null, type, annotations);
                if (param != null) {
                    parameters.add(param);
                }
            }
        }
        return parameters;
    }