Hi,
We heard about the case where the application will cause resource leakage
if we fail to close the resources properly.
Existing snippet : try{
// using I/O Stream
// closing the resource
}
catch(IOException e){
//Log the Exception
}
Assume that there exists a issue(say I/O operations) which prevents the execution of the program to close the resource.
Modified snippet : try{
// using I/O Stream
// closing the resource
}
catch(IOException e){
//Log the Exception
}
finally{
// null check
// close the resource
}
The thing is I need to replicate the problem so as to
test whether the introduction of finally block forces the program
to close the resource.
Can anyone help me in replicating the resource leakage problem?
Thanks In Advance.
Kannan