# HG changeset patch # User robm # Date 1519135202 0 # Node ID 4bf938177d4780a89233ed6223b53fa94d39a9ef # Parent e32be26dcc8c26ed61cf3b5b7f5d98f53311df87 8191909: Nightly failures in nashorn suite Reviewed-by: chegar diff -r e32be26dcc8c -r 4bf938177d47 src/share/classes/sun/misc/Launcher.java --- a/src/share/classes/sun/misc/Launcher.java Tue Dec 12 23:34:13 2017 -0800 +++ b/src/share/classes/sun/misc/Launcher.java Tue Feb 20 14:00:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, 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 @@ -52,7 +52,7 @@ /** * This class is used by the system to launch the main application. -Launcher */ + */ public class Launcher { private static URLStreamHandlerFactory factory = new Factory(); private static Launcher launcher = new Launcher(); @@ -129,6 +129,17 @@ */ public static ExtClassLoader getExtClassLoader() throws IOException { + if (instance == null) { + synchronized(ExtClassLoader.class) { + if (instance == null) { + instance = createExtClassLoader(); + } + } + } + return instance; + } + + private static ExtClassLoader createExtClassLoader() throws IOException { try { // Prior implementations of this doPrivileged() block supplied // aa synthesized ACC via a call to the private method @@ -149,6 +160,7 @@ throw (IOException) e.getException(); } } + private static volatile ExtClassLoader instance = null; void addExtURL(URL url) { super.addURL(url);