Mercurial > hg > openjdk > jdk9 > nashorn
changeset 1635:70f0c3970211 jdk-9+109
8148148: Remove pluggable CodeStore API
Reviewed-by: attila, mhaupt
author | hannesw |
---|---|
date | Mon, 07 Mar 2016 13:28:51 +0100 |
parents | 10d21e3ecd4f |
children | 0714a30d7833 f27bb66ac9d3 |
files | src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CodeStore.java |
diffstat | 1 files changed, 1 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CodeStore.java Thu Mar 03 12:26:03 2016 -0800 +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CodeStore.java Mon Mar 07 13:28:51 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2016, 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 @@ -34,13 +34,10 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; -import java.security.AccessControlException; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; -import java.util.Iterator; import java.util.Map; -import java.util.ServiceLoader; import jdk.nashorn.internal.codegen.OptimisticTypesPersistence; import jdk.nashorn.internal.codegen.types.Type; import jdk.nashorn.internal.runtime.logging.DebugLogger; @@ -54,11 +51,6 @@ @Logger(name="codestore") public abstract class CodeStore implements Loggable { - /** - * Permission needed to provide a CodeStore instance via ServiceLoader. - */ - public final static String NASHORN_PROVIDE_CODE_STORE = "nashorn.provideCodeStore"; - private DebugLogger log; /** @@ -85,23 +77,6 @@ * @return The instance, or null if code store could not be created */ public static CodeStore newCodeStore(final Context context) { - final Class<CodeStore> baseClass = CodeStore.class; - try { - // security check first - final SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(new RuntimePermission(NASHORN_PROVIDE_CODE_STORE)); - } - final ServiceLoader<CodeStore> services = ServiceLoader.load(baseClass); - final Iterator<CodeStore> iterator = services.iterator(); - if (iterator.hasNext()) { - final CodeStore store = iterator.next(); - store.initLogger(context).info("using code store provider ", store.getClass().getCanonicalName()); - return store; - } - } catch (final AccessControlException e) { - context.getLogger(CodeStore.class).warning("failed to load code store provider ", e); - } try { final CodeStore store = new DirectoryCodeStore(context); store.initLogger(context);