You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public int loadFrom(File file) throws FileNotFoundException {
if (!file.exists()) throw new FileNotFoundException("File does not exist");
return loadFrom(new FileInputStream(file));
}
The FileInputStream is leaked
Change this to:
public int loadFrom(File file) throws FileNotFoundException {
if (!file.exists()) throw new FileNotFoundException("File does not exist");
try(FileInputStream fais = new FileInputStream(file)) {
return this.loadFrom(fais);
}
}
The text was updated successfully, but these errors were encountered:
public int loadFrom(File file) throws FileNotFoundException {
if (!file.exists()) throw new FileNotFoundException("File does not exist");
return loadFrom(new FileInputStream(file));
}
The FileInputStream is leaked
Change this to:
public int loadFrom(File file) throws FileNotFoundException {
if (!file.exists()) throw new FileNotFoundException("File does not exist");
try(FileInputStream fais = new FileInputStream(file)) {
return this.loadFrom(fais);
}
}
The text was updated successfully, but these errors were encountered: