# HG changeset patch # User Gilles Duboscq # Date 1433164460 -7200 # Node ID 9966b358bc2b24361271bc75cf945c30d59612f1 # Parent abcb811659e0785b388ded22aef171249e59b5fd Services: don't throw exceptions or print warnings when there are no implementations for a non-required service diff -r abcb811659e0 -r 9966b358bc2b graal/com.oracle.jvmci.service/src/com/oracle/jvmci/service/Services.java --- a/graal/com.oracle.jvmci.service/src/com/oracle/jvmci/service/Services.java Mon Jun 01 15:13:16 2015 +0200 +++ b/graal/com.oracle.jvmci.service/src/com/oracle/jvmci/service/Services.java Mon Jun 01 15:14:20 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.jvmci.service; -import static java.lang.String.*; - import java.util.*; import sun.reflect.*; @@ -39,13 +37,7 @@ private static final ClassValue> cache = new ClassValue>() { @Override protected List computeValue(Class type) { - Service[] names = getServiceImpls(type); - if (names == null || names.length == 0) { - throw new InternalError( - format("No implementations for %s found (ensure %s extends %s and that in suite.py the \"annotationProcessors\" attribute for the project enclosing %s includes \"com.oracle.jvmci.service.processor\")", - type.getSimpleName(), type.getSimpleName(), Service.class, type.getSimpleName())); - } - return Arrays.asList(names); + return Arrays.asList(getServiceImpls(type)); } }; diff -r abcb811659e0 -r 9966b358bc2b src/share/vm/jvmci/jvmciRuntime.cpp --- a/src/share/vm/jvmci/jvmciRuntime.cpp Mon Jun 01 15:13:16 2015 +0200 +++ b/src/share/vm/jvmci/jvmciRuntime.cpp Mon Jun 01 15:14:20 2015 +0200 @@ -1205,7 +1205,7 @@ char sep = os::file_separator()[0]; sprintf(path, "%s%clib%cjvmci%cservices%c%s", home, sep, sep, sep, sep, serviceName); ServiceParseClosure closure; - parse_lines(path, &closure, true); // TODO(gd) cache parsing results? + parse_lines(path, &closure, false); GrowableArray* implNames = closure.implNames(); objArrayOop servicesOop = oopFactory::new_objArray(serviceKlass(), implNames->length(), CHECK_(objArrayHandle()));