mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-17 23:04:07 +01:00
Added support for Java update version parsing.
This commit is contained in:
@@ -36,7 +36,7 @@ public final class DependencyVersionUtil {
|
|||||||
/**
|
/**
|
||||||
* Regular expression to extract version numbers from file names.
|
* Regular expression to extract version numbers from file names.
|
||||||
*/
|
*/
|
||||||
private static final Pattern RX_VERSION = Pattern.compile("\\d+(\\.\\d{1,6})+(\\.?([_-](release|beta|alpha|\\d+)|[a-zA-Z_-]{1,3}\\d{0,8}))?");
|
private static final Pattern RX_VERSION = Pattern.compile("\\d+(\\.\\d{1,6})+(\\.?([_-](release|beta|alpha|\\d+)|update_[0-9]{1,3}|[a-zA-Z_-]{1,3}\\d{0,8}))?"); //
|
||||||
/**
|
/**
|
||||||
* Regular expression to extract a single version number without periods.
|
* Regular expression to extract a single version number without periods.
|
||||||
* This is a last ditch effort just to check in case we are missing a
|
* This is a last ditch effort just to check in case we are missing a
|
||||||
|
|||||||
@@ -88,4 +88,10 @@ public class DependencyVersionUtilTest extends BaseTest {
|
|||||||
assertEquals(expResult, result);
|
assertEquals(expResult, result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testParseJavaVersion() {
|
||||||
|
assertEquals(DependencyVersionUtil.parseVersion("1.8.0.45"), DependencyVersionUtil.parseVersion("1.8.0.update_45"));
|
||||||
|
assertEquals(DependencyVersionUtil.parseVersion("1.8.0.145"), DependencyVersionUtil.parseVersion("1.8.0.update_145"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user