-
Notifications
You must be signed in to change notification settings - Fork 139
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerspriority:minorMinor loss of function, or other problem where easy workaround is presentMinor loss of function, or other problem where easy workaround is present
Description
New feature, improvement proposal
There's a lot of code like this scattered throughout the project:
FileOutputStream fos = null;
try {
fos = new FileOutputStream(file);
if (data != null) {
fos.write(data.getBytes(StandardCharsets.UTF_8));
}
fos.close();
fos = null;
} finally {
try {
if (fos != null) {
fos.close();
}
} catch (final IOException e) {
// Suppressed due to an exception already thrown in the try block.
}
}
Use try-with-resources from Java 7
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerspriority:minorMinor loss of function, or other problem where easy workaround is presentMinor loss of function, or other problem where easy workaround is present