diff --git a/location4j/src/main/java/com/tomaytotomato/loader/DefaultCountriesDataLoaderImpl.java b/location4j/src/main/java/com/tomaytotomato/loader/DefaultCountriesDataLoaderImpl.java index f4f320c..a4c9711 100644 --- a/location4j/src/main/java/com/tomaytotomato/loader/DefaultCountriesDataLoaderImpl.java +++ b/location4j/src/main/java/com/tomaytotomato/loader/DefaultCountriesDataLoaderImpl.java @@ -27,8 +27,8 @@ public DefaultCountriesDataLoaderImpl() { String urlToThis = this.getClass().getResource(this.getClass().getSimpleName() + ".class").toString(); String trimmed = urlToFile.substring(0, urlToFile.indexOf(DEFAULT_FILE)); - if (!urlToThis.substring(0, trimmed.length()).equals(trimmed)) { - throw new RuntimeException( + if (!urlToThis.startsWith(trimmed)) { + throw new SecurityException( DEFAULT_FILE + " is not in the same artifact as the loader: security issue"); }