Semantic patches for Java program transformation

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...

Full description

Saved in:
Bibliographic Details
Main Authors: KANG, Hong Jin, THUNG, Ferdian, LAWALL, Julia, MULLER, Gilles, JIANG, Lingxiao, LO, David
Format: text
Language:English
Published: Institutional Knowledge at Singapore Management University 2019
Subjects:
Online Access:https://ink.library.smu.edu.sg/sis_research/4485
https://ink.library.smu.edu.sg/context/sis_research/article/5488/viewcontent/LIPIcs_ECOOP_2019_22.pdf
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: Singapore Management University
Language: English
id sg-smu-ink.sis_research-5488
record_format dspace
spelling sg-smu-ink.sis_research-54882020-04-03T08:35:03Z Semantic patches for Java program transformation KANG, Hong Jin THUNG, Ferdian LAWALL, Julia MULLER, Gilles JIANG, Lingxiao LO, David 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. 2019-07-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/4485 info:doi/10.4230/LIPIcs.ECOOP.2019.22 https://ink.library.smu.edu.sg/context/sis_research/article/5488/viewcontent/LIPIcs_ECOOP_2019_22.pdf http://creativecommons.org/licenses/by-sa/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Program transformation Java Software Engineering
institution Singapore Management University
building SMU Libraries
continent Asia
country Singapore
Singapore
content_provider SMU Libraries
collection InK@SMU
language English
topic Program transformation
Java
Software Engineering
spellingShingle Program transformation
Java
Software Engineering
KANG, Hong Jin
THUNG, Ferdian
LAWALL, Julia
MULLER, Gilles
JIANG, Lingxiao
LO, David
Semantic patches for Java program transformation
description 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.
format text
author KANG, Hong Jin
THUNG, Ferdian
LAWALL, Julia
MULLER, Gilles
JIANG, Lingxiao
LO, David
author_facet KANG, Hong Jin
THUNG, Ferdian
LAWALL, Julia
MULLER, Gilles
JIANG, Lingxiao
LO, David
author_sort KANG, Hong Jin
title Semantic patches for Java program transformation
title_short Semantic patches for Java program transformation
title_full Semantic patches for Java program transformation
title_fullStr Semantic patches for Java program transformation
title_full_unstemmed Semantic patches for Java program transformation
title_sort semantic patches for java program transformation
publisher Institutional Knowledge at Singapore Management University
publishDate 2019
url https://ink.library.smu.edu.sg/sis_research/4485
https://ink.library.smu.edu.sg/context/sis_research/article/5488/viewcontent/LIPIcs_ECOOP_2019_22.pdf
_version_ 1770574872667226112