8265375: Bootcycle builds fail with StackOverflowError in cldrconverter

Reviewed-by: joehw
This commit is contained in:
Naoto Sato 2021-04-16 22:23:30 +00:00
parent c108e7abdf
commit ff4997014f

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1038,6 +1038,10 @@ public class CLDRConverter {
Objects.nonNull(p) &&
!candidates.get(i+1).equals(p)) {
List<Locale> applied = candidates.subList(0, i+1);
if (applied.contains(p)) {
// avoid circular recursion (could happen with nb/no case)
continue;
}
applied.addAll(applyParentLocales(baseName, defCon.getCandidateLocales(baseName, p)));
return applied;
}