Skip to content

Commit

Permalink
refactor: Avoid explicitly accessing getClassLoader() (#475)
Browse files Browse the repository at this point in the history
* Avoid explicitly accessing getClassLoader()

This avoids a false positive for rule 3032

* Make resource path absolute
  • Loading branch information
slarse authored Apr 13, 2021
1 parent a3f3feb commit c889405
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/sorald/cli/SoraldVersionProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public String[] getVersion() {
public static String getVersionFromPropertiesResource(String resourceName) {
Properties props = new Properties();
try {
props.load(
SoraldVersionProvider.class.getClassLoader().getResourceAsStream(resourceName));
props.load(SoraldVersionProvider.class.getResourceAsStream("/" + resourceName));
} catch (Exception e) {
return LOCAL_VERSION;
}
Expand Down

0 comments on commit c889405

Please sign in to comment.