PMD sends a message saying "Ensure that resources like this InputStream object are closed after use", even though Scanner is already closing
Here's the piece of code where it finds the error:
int i = 0;
try {
while (i < arr.length) {
arr[i] = sc.nextFloat();
i+=1;
}
} catch (RuntimeException e) {
throw new RuntimeException(e);
}
finally {
sc.close();
}
PMD отправляет сообщение со словами "Ensure that resources like this InputStream object are closed after use", хотя Сканнер уже закрывается
Сверху часть кода, где он находит ошибку
PMD sends a message saying "Ensure that resources like this InputStream object are closed after use", even though Scanner is already closing Here's the piece of code where it finds the error:
PMD отправляет сообщение со словами "Ensure that resources like this InputStream object are closed after use", хотя Сканнер уже закрывается Сверху часть кода, где он находит ошибку
-- Студент МИРЭА