Skip to content
Permalink
Browse files
1125: OpenJDK 7 backports incorrectly tagged with hgupdate-sync
Reviewed-by: kcr, ihse
  • Loading branch information
erikj79 committed Sep 7, 2021
1 parent 3293f7a commit 34c565e99d217afb25db9d776f176c6b5d17a8d7
@@ -39,7 +39,7 @@ public class JdkVersion implements Comparable<JdkVersion> {
private final static Pattern fxVersionPattern = Pattern.compile("(openjfx[1-9][0-9]?)(u([0-9]{1,3}))?$");

// Match a version string symbolizing some future, but yet undefined, update of a major version
private final static Pattern futureUpdatePattern = Pattern.compile("([1-9][0-9]*u)(-([a-z0-9]+))?$");
private final static Pattern futureUpdatePattern = Pattern.compile("((openjdk)?[1-9][0-9]*u)(-([a-z0-9]+))?$");

private final static Pattern prefixPattern = Pattern.compile("([a-z]+)([0-9.]+)$");

@@ -65,10 +65,10 @@ private static List<String> splitComponents(String raw) {
var matcher = futureUpdatePattern.matcher(raw);
if (matcher.matches()) {
finalComponents.add(matcher.group(1));
// Group 3 is the opt field
if (matcher.group(3) != null) {
// Group 4 is the opt field
if (matcher.group(4) != null) {
finalComponents.add(null);
finalComponents.add(matcher.group(3));
finalComponents.add(matcher.group(4));
}
}
}
@@ -805,4 +805,15 @@ void uCpu(TestInfo testInfo) throws IOException {
backports.assertLabeled("16.0.2", "17");
}
}

@Test
void openjdk7u(TestInfo testInfo) throws IOException {
try (var credentials = new HostCredentials(testInfo)) {
var backports = new BackportManager(credentials, "17");
backports.assertLabeled();

backports.addBackports("openjdk7u", "7u321", "openjdk8u302", "openjdk8u312");
backports.assertLabeled("openjdk8u312");
}
}
}
@@ -78,6 +78,7 @@ void futureUpdates() {
var jdk16uCpu = from("16u-cpu");
assertEquals(List.of("16u"), jdk16uCpu.components());
assertEquals("cpu", jdk16uCpu.opt().orElseThrow());
assertEquals(List.of("openjdk7u"), from("openjdk7u").components());
}

@Test
@@ -112,5 +113,6 @@ void cpuOrder() {
void nonConforming() {
assertEquals(Optional.empty(), JdkVersion.parse("bla"));
assertEquals(Optional.empty(), JdkVersion.parse(""));
assertEquals(Optional.empty(), JdkVersion.parse("foobar7u"));
}
}

1 comment on commit 34c565e

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 34c565e Sep 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.