dependency-check-core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java
/**
     * Takes a CPE and parses out the version number. If no version is
     * identified then a '-' is returned.
     *
     * @param cpe a cpe object
     * @return a dependency version
     */
Takes a CPE and parses out the version number. If no version is
identified then a '-' is returned.

@param cpe a cpe object
@return a dependency version
Takes a CPE and parses out the version number . If no version is identified then a ' - ' is returned . @param cpe a cpe object @return a dependency version
private DependencyVersion parseDependencyVersion(VulnerableSoftware cpe) {
        final DependencyVersion cpeVersion;
        if (cpe.getVersion() != null && !cpe.getVersion().isEmpty()) {
            final String versionText;
            if (cpe.getUpdate() != null && !cpe.getUpdate().isEmpty()) {
                versionText = String.format("%s.%s", cpe.getVersion(), cpe.getUpdate());
            } else {
                versionText = cpe.getVersion();
            }
            cpeVersion = DependencyVersionUtil.parseVersion(versionText);
        } else {
            cpeVersion = new DependencyVersion("-");
        }
        return cpeVersion;
    }
private DependencyVersion parseDependencyVersion ( VulnerableSoftware cpe ) { final DependencyVersion cpeVersion ; if ( cpe . getVersion ( ) != null && ! cpe . getVersion ( ) . isEmpty ( ) ) { final String versionText ; if ( cpe . getUpdate ( ) != null && ! cpe . getUpdate ( ) . isEmpty ( ) ) { versionText = String . format ( "%s.%s" , cpe . getVersion ( ) , cpe . getUpdate ( ) ) ; } else { versionText = cpe . getVersion ( ) ; } cpeVersion = DependencyVersionUtil . parseVersion ( versionText ) ; } else { cpeVersion = new DependencyVersion ( "-" ) ; } return cpeVersion ; }
Takes a CPE and parses out the version number.
Takes a CPE and parses out the version number .