Merge branch 'master' of github.com:ZUGFeRD/mustangproject

This commit is contained in:
jstaerk
2025-07-22 16:29:30 +02:00
2 changed files with 3 additions and 6 deletions

View File

@@ -17,8 +17,7 @@ public class ResourceCase extends TestCase {
private static final Logger LOGGER = LoggerFactory.getLogger(ResourceCase.class.getCanonicalName()); // log output is
public static File getResourceAsFile(String resourcePath) {
try {
InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(resourcePath);
try(InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(resourcePath)) {
if (in == null) {
return null;
}
@@ -42,8 +41,7 @@ public class ResourceCase extends TestCase {
}
public static byte[] getResourceAsByteArray(String resourcePath) {
try {
InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(resourcePath);
try(InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(resourcePath)) {
if (in == null) {
return null;
}