Refactoring for parameterizing Java']Java classes

被引:0
|
作者
Kiezun, Adam
Ernst, Michael D.
Tip, Frank
Fuhrer, Robert M.
机构
关键词
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Type safety and expressiveness of many existing Java libraries and their client applications would improve, if the libraries were upgraded to define generic classes. Efficient and accurate tools exist to assist client applications to use generic libraries, but so far the libraries themselves must be parameterized manually, which is a tedious, time-consuming, and error-prone task. We present a type-constraint-based algorithm for converting non-generic libraries to add type parameters. The algorithm handles the full Java language and preserves backward compatibility, thus making it safe for existing clients. Among other features, it is capable of inferring wildcard types and introducing type parameters for mutually-dependent classes. We have implemented the algorithm as a fully automatic refactoring in Eclipse. We evaluated our work in two ways. First, our tool parameterized code that was lacking type parameters. We contacted the developers of several of these applications, and in all cases they confirmed that the resulting parameterizations were correct and useful. Second, to better quantify its effectiveness, our tool parameterized classes from already-generic libraries, and we compared the results to those that were created by the libraries' authors. Our tool performed the refactoring accurately-in 87% of cases the results were as good as those created manually, by a human expert, in 9% of cases the tool results were better, and in 4% of cases the tool results were worse.
引用
收藏
页码:437 / 446
页数:10
相关论文
共 50 条
  • [1] Characterizing refactoring graphs in Java']Java and Java']JavaScript projects
    Brito, Aline
    Hora, Andre
    Valente, Marco Tulio
    [J]. EMPIRICAL SOFTWARE ENGINEERING, 2021, 26 (06)
  • [2] An automatic method for refactoring Java']Java programs
    Yamazaki, S
    Nagata, M
    [J]. KNOWLEDGE-BASED SOFTWARE ENGINEERING, 2002, 80 : 167 - 172
  • [3] A Refactoring Catalog for Lambda Expressions in Java']Java
    Teixeira Junior, Janio Elias
    Valdivieso Tobar Neto, Heres Edison
    de Faveri, Cristiano
    Saccol, Deise de Brum
    Vizzotto, Juliana Kaizer
    Piveta, Eduardo Kessler
    [J]. INTERNATIONAL JOURNAL OF SOFTWARE ENGINEERING AND KNOWLEDGE ENGINEERING, 2019, 29 (06) : 791 - 818
  • [4] Refactoring Java']Java Programs for Flexible Locking
    Schaefer, Max
    Sridharan, Manu
    Dolby, Julian
    Tip, Frank
    [J]. 2011 33RD INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2011, : 71 - 80
  • [5] Refactoring Java']Java Software Product Lines
    Kim, Jongwook
    Batory, Don
    Dig, Danny
    [J]. 21ST INTERNATIONAL SYSTEMS & SOFTWARE PRODUCT LINE CONFERENCE (SPLC 2017), VOL 1, 2017, : 59 - 68
  • [6] Correct Refactoring of Concurrent Java']Java Code
    Schaefer, Max
    Dolby, Julian
    Sridharan, Manu
    Torlak, Emina
    Tip, Frank
    [J]. ECOOP 2010: OBJECT-ORIENTED PROGRAMMING, 2010, 6183 : 225 - +
  • [7] Systematically Refactoring Inheritance to Delegation in Java']Java
    Kegel, Hannes
    Steimann, Friedrich
    [J]. ICSE'08 PROCEEDINGS OF THE THIRTIETH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, 2008, : 431 - 440
  • [8] Secure Refactoring with Java']Java Information Flow
    Helke, Steffen
    Kammuller, Florian
    Probst, Christian W.
    [J]. DATA PRIVACY MANAGEMENT, AND SECURITY ASSURANCE, 2016, 9481 : 264 - 272
  • [9] Refactoring Clustering in Java']Java Software Networks
    Concas, Giulio
    Monni, C.
    Orru, M.
    Ortu, M.
    Tonelli, Roberto
    [J]. AGILE METHODS: LARGE-SCALE DEVELOPMENT, REFACTORING, TESTING, AND ESTIMATION, 2014, 199 : 121 - 135
  • [10] Tool-supported Refactoring for Java']Java Script
    Feldthaus, Asger
    Millstein, Todd
    Moller, Anders
    Schaefer, Max
    Tip, Frank
    [J]. ACM SIGPLAN NOTICES, 2011, 46 (10) : 119 - 137