Skip to content

Commit

Permalink
Remove the testdata directory hack.
Browse files Browse the repository at this point in the history
Note for third-party users: sorry if this breaks you! Just fix the paths to be relative to the test's path.

PiperOrigin-RevId: 681045623
  • Loading branch information
graememorgan authored and Error Prone Team committed Oct 1, 2024
1 parent 0cec00e commit 097ab7a
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,13 @@ public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOExcept
};
}

// TODO(b/176096448): the testdata/ fallback is a hack, fix affected tests and remove it
@MustBeClosed
private static InputStream findResource(Class<?> clazz, String name) {
InputStream is = clazz.getResourceAsStream(name);
if (is != null) {
return is;
if (is == null) {
throw new AssertionError("could not find resource: " + name + " for: " + clazz);
}
is = clazz.getResourceAsStream("testdata/" + name);
if (is != null) {
return is;
}
throw new AssertionError("could not find resource: " + name + " for: " + clazz);
return is;
}

/** Creates a {@link JavaFileObject} with the given name and content. */
Expand Down

0 comments on commit 097ab7a

Please sign in to comment.