Skip to content

Commit

Permalink
Sonarlint fixes
Browse files Browse the repository at this point in the history
Adding a more specific SecurityException for the DefaultCountriesDataLoaderImpl.java
  • Loading branch information
tomaytotomato committed Aug 11, 2024
1 parent b7ede91 commit fa782ec
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down

0 comments on commit fa782ec

Please sign in to comment.