Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw in Finally #27

Open
QiAnXinCodeSafe opened this issue Jul 8, 2019 · 0 comments
Open

Throw in Finally #27

QiAnXinCodeSafe opened this issue Jul 8, 2019 · 0 comments

Comments

@QiAnXinCodeSafe
Copy link

Any exceptions thrown from the try or catch segments are eliminated when an exception is thrown in the finally block

try{
ois = new ObjectInputStream(new BufferedInputStream(
context.getResources().openRawResource(R.raw.model)));
method = (MLRegression) ois.readObject();
helper = (NormalizationHelper) ois.readObject();
}
catch (ClassNotFoundException e){
throw new IOException("Could not read object from stream", e);
}
finally {
if(ois != null){
ois.close();
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant