Correct refactoring of concurrent java code

  • Authors:
  • Max Schäfer;Julian Dolby;Manu Sridharan;Emina Torlak;Frank Tip

  • Affiliations:
  • Oxford University Computing Laboratory, UK;IBM T.J. Watson Research Center;IBM T.J. Watson Research Center;IBM T.J. Watson Research Center;IBM T.J. Watson Research Center

  • Venue:
  • ECOOP'10 Proceedings of the 24th European conference on Object-oriented programming
  • Year:
  • 2010

Quantified Score

Hi-index 0.01

Visualization

Abstract

Automated refactorings as implemented in modern IDEs for Java usually make no special provisions for concurrent code. Thus, refactored programsmay exhibit unexpected new concurrent behaviors.We analyze the types of such behavioral changes caused by current refactoring engines and develop techniques tomake thembehavior-preserving, ranging from simple techniques to deal with concurrency-related language constructs to a framework that computes and tracks synchronization dependencies. By basing our development directly on the JavaMemoryModel, we can state and prove precise correctness results about refactoring concurrent programs. We show that a broad range of refactorings are not influenced by concurrency at all, whereas other important refactorings can be made behavior-preserving for correctly synchronized programs by using our framework. Experience with a prototype implementation shows that our techniques are easy to implement and require only minimal changes to existing refactoring engines.