Mercurial > hg > truffle
diff graal/com.oracle.jvmci.service/src/com/oracle/jvmci/service/Services.java @ 21675:2e8c01def9a5
moved [AMD64|SPARC]HotSpotJVMCIBackendFactory into JVMCI namespace (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 03 Jun 2015 00:30:44 +0200 |
parents | b45e0f791465 |
children | 55058b8000ea |
line wrap: on
line diff
--- a/graal/com.oracle.jvmci.service/src/com/oracle/jvmci/service/Services.java Tue Jun 02 23:29:27 2015 +0200 +++ b/graal/com.oracle.jvmci.service/src/com/oracle/jvmci/service/Services.java Wed Jun 03 00:30:44 2015 +0200 @@ -34,10 +34,23 @@ */ public class Services { + /** + * Determines whether to suppress the {@link NoClassDefFoundError} raised if a service + * implementation class specified in a {@code <jre>/jvmci/services/*} file is missing. + */ + private static final boolean SuppressNoClassDefFoundError = Boolean.getBoolean("jvmci.service.suppressNoClassDefFoundError"); + private static final ClassValue<List<Service>> cache = new ClassValue<List<Service>>() { @Override protected List<Service> computeValue(Class<?> type) { - return Arrays.asList(getServiceImpls(type)); + try { + return Arrays.asList(getServiceImpls(type)); + } catch (NoClassDefFoundError e) { + if (SuppressNoClassDefFoundError) { + return Collections.emptyList(); + } + throw e; + } } };