Generally, does simultaneously calling instance methods that use local variables only have bearing on thread safety?
Here's a short example. Multiple threads will call a();
.
public class A {
public boolean a(File file) throws Exception {
boolean t = true;
FileInputStream fin = null;
BufferedInputStream bin = null;
try {
fin = new FileInputStream(file);
bin = new BufferedInputStream(fin);
while(bin.read() > 0) {}
return t;
finally {
try {
if (in != null) in.close();
} catch (IOException e) {}
try {
if (fin != null) fin.close();
} catch (IOException e) {}
}
}
}