Hi here are a couple of lines in the code.
UserAccountVO fun() {
// ...
ObjectInputStream in = xstream.createObjectInputStream(is);
return (UserAccountVO)in.readObject();
}
Now its giving the following warning:
leaked_resource: Variable in going out of scope leaks the resource it refers to".
Can anyone please explain it?
This is how I got it fixed:
try(ObjectInputStream in = xstream.createObjectInputStream(is);) {
return (UserAccountVO)in.readObject();
} catch (IOException e) {
s_logger.error(e.getMessage());
return null;
}