Skip to content

Commit

Permalink
UghUtils: Fix resource leak on exceptional path (Coverity Scan)
Browse files Browse the repository at this point in the history
CID 44607 (#1 of 1): Resource leak on an exceptional path (RESOURCE_LEAK)

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Sep 23, 2016
1 parent 233d259 commit e7265f8
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ public class UghUtils {
*/
// TODO: Try to replace this with an external library
public static String convertUmlaut(String line) {
try {
BufferedReader in = open("goobi_opacUmlaut.txt");
try (BufferedReader in = open("goobi_opacUmlaut.txt")) {
String str;
while ((str = in.readLine()) != null) {
if (str.length() > 0) {
line = line.replaceAll(str.split(" ")[0], str.split(" ")[1]);
}
}
in.close();
} catch (IOException e) {
myLogger.error("IOException bei Umlautkonvertierung", e);
}
Expand Down

0 comments on commit e7265f8

Please sign in to comment.