Service interruption on Monday 11 July from 12:30 to 13:00: all the sites of the CCSD (HAL, EpiSciences, SciencesConf, AureHAL) will be inaccessible (network hardware connection).
Skip to Main content Skip to Navigation
Conference papers

Semantic Patches for Java Program Transformation

Abstract : Developing software often requires code changes that are widespread and applied to multiple locations. There are tools for Java that allow developers to specify patterns for program matching and source-to-source transformation. However, to our knowledge, none allows for transforming code based on its control-flow context. We prototype Coccinelle4J, an extension to Coccinelle, which is a program transformation tool designed for widespread changes in C code, in order to work on Java source code. We adapt Coccinelle to be able to apply scripts written in the Semantic Patch Language (SmPL), a language provided by Coccinelle, to Java source files. As a case study, we demonstrate the utility of Coccinelle4J with the task of API migration. We show 6 semantic patches to migrate from deprecated Android API methods on several open source Android projects. We describe how SmPL can be used to express several API migrations and justify several of our design decisions.
Document type :
Conference papers
Complete list of metadata

Cited literature [31 references]  Display  Hide  Download
Contributor : Julia Lawall Connect in order to contact the contributor
Submitted on : Friday, July 12, 2019 - 7:06:08 PM
Last modification on : Thursday, June 9, 2022 - 3:41:04 AM


Files produced by the author(s)



Hong Jin Kang, Ferdian Thung, Julia L. Lawall, Gilles Muller, Lingxiao Jiang, et al.. Semantic Patches for Java Program Transformation. 33rd European Conference on Object-Oriented Programming (ECOOP 2019), Jul 2019, London, United Kingdom. pp.22:1--22:27, ⟨10.4230/LIPIcs.ECOOP.2019.22⟩. ⟨hal-02182522⟩



Record views


Files downloads