8261254: Initialize charset mapping data lazily

Reviewed-by: alanb, jkuhn, naoto
This commit is contained in:
Claes Redestad 2021-02-08 18:45:43 +00:00
parent 351d788809
commit 92c6e6dffa
21 changed files with 215 additions and 250 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 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
@ -931,7 +931,9 @@ public final class ModuleLayer {
servicesCatalog = this.servicesCatalog;
if (servicesCatalog == null) {
servicesCatalog = ServicesCatalog.create();
nameToModule.values().forEach(servicesCatalog::register);
for (Module m : nameToModule.values()) {
servicesCatalog.register(m);
}
this.servicesCatalog = servicesCatalog;
}
}