-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P3
-
Affects Version/s: 9, 10, 11
-
Component/s: core-libs
-
b18
Based on JDK-8130493.
When using a ServiceLoader to load unnamed module classes, and if loading of that class fails with a LinkageError, the LinkageError is thrown out of the ServiceLoader's Iterator's hasNext() method, which seems to be against the javadoc/specification:
(From the ServiceLoader's top level javadoc:)
{quote}
* <p> When using the service loader's {@code iterator}, the {@link
* Iterator#hasNext() hasNext} and {@link Iterator#next() next} methods will
* fail with {@link ServiceConfigurationError} if an error occurs locating,
* loading or instantiating a service provider. When processing the service
{quote}
A testcase is attached.
When using a ServiceLoader to load unnamed module classes, and if loading of that class fails with a LinkageError, the LinkageError is thrown out of the ServiceLoader's Iterator's hasNext() method, which seems to be against the javadoc/specification:
(From the ServiceLoader's top level javadoc:)
{quote}
* <p> When using the service loader's {@code iterator}, the {@link
* Iterator#hasNext() hasNext} and {@link Iterator#next() next} methods will
* fail with {@link ServiceConfigurationError} if an error occurs locating,
* loading or instantiating a service provider. When processing the service
{quote}
A testcase is attached.
- csr for
-
JDK-8381777 ServiceLoader.iterator().hasNext()/.next() may throw a LinkageError
-
- Closed
-
- relates to
-
JDK-8130493 javac silently ignores malformed annotation processor class
-
- Closed
-
-
JDK-8350481 ServiceLoader throws NCDEF instead of ServiceConfigurationError
-
- Resolved
-
- links to
-
Commit(master)
openjdk/jdk/e893f4cf
-
Review(master)
openjdk/jdk/30405