This repository was archived by the owner on Sep 27, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
main/java/org/owasp/dependencycheck/utils
test/java/org/owasp/dependencycheck/utils Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ public static int getJavaVersion() {
6363 */
6464 public static int getJavaUpdateVersion () {
6565 //"1.8.0_144" "11.0.2+9" "17.0.8.1"
66- String runtimeVersion = System .getProperty ("java.runtime. version" );
66+ String runtimeVersion = System .getProperty ("java.version" );
6767 return parseUpdate (runtimeVersion );
6868 }
6969
Original file line number Diff line number Diff line change 1818package org .owasp .dependencycheck .utils ;
1919
2020import org .junit .Test ;
21+
2122import static org .junit .Assert .*;
2223
2324/**
24- *
2525 * @author Jeremy Long
2626 */
2727public class UtilsTest {
@@ -47,6 +47,11 @@ public void testParseUpdate() {
4747 result = Utils .parseUpdate (runtimeVersion );
4848 assertEquals (expResult , result );
4949
50+ runtimeVersion = "11.0.2" ;
51+ expResult = 2 ;
52+ result = Utils .parseUpdate (runtimeVersion );
53+ assertEquals (expResult , result );
54+
5055 runtimeVersion = "17.0.8.1" ;
5156 expResult = 8 ;
5257 result = Utils .parseUpdate (runtimeVersion );
You can’t perform that action at this time.
0 commit comments