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 条
  • [41] Refactoring Java']Java Programs for Customizable Locks Based on Bytecode Transformation
    Zhang, Yang
    Shao, Shuai
    Liu, Huan
    Qiu, Jing
    Zhang, Dongwen
    Zhang, Guanghua
    [J]. IEEE ACCESS, 2019, 7 : 66292 - 66303
  • [42] Evaluation of the 'replace constructors with creation methods' refactoring in Java']Java systems
    Counsell, S.
    Loizou, G.
    Najjar, R.
    [J]. IET SOFTWARE, 2010, 4 (05) : 318 - 333
  • [43] Refactoring Java']Java Monoliths into Executable Microservice-Based Applications
    Freitas, Francisco
    Ferreira, Andre
    Cunha, Jacome
    [J]. 25TH BRAZILIAN SYMPOSIUM ON PROGRAMMING LANGUAGES, SBLP 2021, 2021, : 100 - 107
  • [44] Defaultification Refactoring: A Tool for Automatically Converting Java']Java Methods to Default
    Khatchadourian, Raffi
    Masuhara, Hidehiko
    [J]. PROCEEDINGS OF THE 2017 32ND IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE'17), 2017, : 984 - 989
  • [45] Java']Java classes for nonprocedural variogram modeling
    Faulkner, BR
    [J]. COMPUTERS & GEOSCIENCES, 2002, 28 (03) : 387 - 397
  • [46] Synthesis of interface specifications for Java']Java classes
    Alur, R
    Cerny, P
    Madhusudan, P
    Nam, W
    [J]. ACM SIGPLAN NOTICES, 2005, 40 (01) : 98 - 109
  • [47] Energy Profiles of Java']Java Collections Classes
    Hasan, Samir
    King, Zachary
    Hafiz, Munawar
    Sayagh, Mohammed
    Adams, Bram
    Hindle, Abram
    [J]. 2016 IEEE/ACM 38TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2016, : 225 - 236
  • [48] NetRexx - An alternative for writing Java']Java classes
    Cowlishaw, M
    [J]. IEEE COMPCON 97, PROCEEDINGS, 1997, : 200 - 205
  • [49] Algebraic Java']Java classes for numerical optimization
    Schwab, M
    Schroeder, J
    [J]. CONCURRENCY-PRACTICE AND EXPERIENCE, 1998, 10 (11-13): : 1155 - 1164
  • [50] Discovering documentation for Java']Java container classes
    Henkel, Johannes
    Reichenbach, Christoph
    Diwan, Amer
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2007, 33 (08) : 526 - 543