As long as variables using in the method are defined in the method(i.e. not as class member variables or anywhere outside method scope),it is thread safe.The code you described is thread safe.