首页    期刊浏览 2024年10月05日 星期六
登录注册

文章基本信息

  • 标题:Semantic Patches for Java Program Transformation (Experience Report)
  • 本地全文:下载
  • 作者:Hong Jin Kang ; Ferdian Thung ; Julia Lawall
  • 期刊名称:LIPIcs : Leibniz International Proceedings in Informatics
  • 电子版ISSN:1868-8969
  • 出版年度:2019
  • 卷号:134
  • 页码:1-27
  • DOI:10.4230/LIPIcs.ECOOP.2019.22
  • 出版社:Schloss Dagstuhl -- Leibniz-Zentrum fuer Informatik
  • 摘要: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.
  • 关键词:Program transformation; Java
国家哲学社会科学文献中心版权所有