mirror of https://github.com/apache/lucene.git
Improve error message if codec not found Fixes #12300
This commit is contained in:
parent
f53eb28af0
commit
5b505006e7
|
@ -99,6 +99,8 @@ public final class NamedSPILoader<S extends NamedSPILoader.NamedSPI> implements
|
||||||
return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9');
|
return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("removal")
|
||||||
|
@SuppressForbidden(reason = "security manager")
|
||||||
public S lookup(String name) {
|
public S lookup(String name) {
|
||||||
final S service = services.get(name);
|
final S service = services.get(name);
|
||||||
if (service != null) return service;
|
if (service != null) return service;
|
||||||
|
@ -110,7 +112,13 @@ public final class NamedSPILoader<S extends NamedSPILoader.NamedSPI> implements
|
||||||
+ "' does not exist."
|
+ "' does not exist."
|
||||||
+ " You need to add the corresponding JAR file supporting this SPI to your classpath."
|
+ " You need to add the corresponding JAR file supporting this SPI to your classpath."
|
||||||
+ " The current classpath supports the following names: "
|
+ " The current classpath supports the following names: "
|
||||||
+ availableServices());
|
+ availableServices()
|
||||||
|
+ ((System.getSecurityManager() == null)
|
||||||
|
? ""
|
||||||
|
: "We have detected that a security manager is installed so it is also possible "
|
||||||
|
+ "that the jar containing the codec is inaccessible under the current "
|
||||||
|
+ "security policy. (Java does not throw SecurityException if this is the "
|
||||||
|
+ "case, it just ignores the jar!)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> availableServices() {
|
public Set<String> availableServices() {
|
||||||
|
|
Loading…
Reference in New Issue