Skip to content

Commit

Permalink
Fix issue reported in #65
Browse files Browse the repository at this point in the history
  • Loading branch information
uschindler committed Sep 4, 2015
1 parent 942049a commit bc413f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/de/thetaphi/forbiddenapis/Checker.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,12 @@ public final void parseBundledSignatures(String name, String jdkTargetVersion) t
if (!name.matches("[A-Za-z0-9\\-\\.]+")) {
throw new ParseException("Invalid bundled signature reference: " + name);
}
InputStream in = this.getClass().getResourceAsStream("signatures/" + name + ".txt");
// use Checker.class hardcoded (not getClass) so we have a fixed package name:
InputStream in = Checker.class.getResourceAsStream("signatures/" + name + ".txt");
// automatically expand the compiler version in here (for jdk-* signatures without version):
if (in == null && jdkTargetVersion != null && name.startsWith("jdk-") && !name.matches(".*?\\-\\d\\.\\d")) {
name = name + "-" + jdkTargetVersion;
in = this.getClass().getResourceAsStream("signatures/" + name + ".txt");
in = Checker.class.getResourceAsStream("signatures/" + name + ".txt");
}
if (in == null) {
throw new FileNotFoundException("Bundled signatures resource not found: " + name);
Expand Down

0 comments on commit bc413f5

Please sign in to comment.