--- old/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java 2020-07-22 12:00:43.628254247 -0700 +++ new/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java 2020-07-22 12:00:43.448247472 -0700 @@ -171,6 +171,13 @@ return catalog; } + static void setServicesCatalog(ClassLoader loader, ServicesCatalog catalog) { + ServicesCatalog previous = CLV.putIfAbsent(loader, catalog); + if (previous != null) { + throw new RuntimeException("unexpected: " + previous); + } + } + // the ServicesCatalog registered to a class loader private static final ClassLoaderValue CLV = new ClassLoaderValue<>(); }