Repository logo
Log in(current)
Repository logoMIT Open ScholarshipDSpace@MIT
  1. Home
  2. Computer Science and Artificial Intelligence Lab (CSAIL)
  3. CSAIL Digital Archive
  4. CSAIL Technical Reports (July 1, 2003 - present)
  5. Refactoring for parameterizing Java classes

Refactoring for parameterizing Java classes

Thumbnail Image
Download
Name

MIT-CSAIL-TR-2006-061.pdf

Size

262.22 KB

Format

Adobe PDF

Checksum (MD5)

4ecf04b4f47c5d382936fb9f3bed6e9a

Thumbnail Image
Download
Name

MIT-CSAIL-TR-2006-061.ps

Size

1.28 MB

Format

PostScript

Checksum (MD5)

e8ae042794007f3463193559708bdaf7

Author(s)
Kiezun, Adam
•
Ernst, Michael D.
•
Tip, Frank
•
Fuhrer, Robert M.
Advisor(s)
Michael Ernst
Date Issued
September 5, 2006
Series/Report no.
Massachusetts Institute of Technology Computer Science and Artificial Intelligence Laboratory
Abstract
Type safety and expressiveness of many existing Java libraries and theirclient applications would improve, if the libraries were upgraded to definegeneric classes. Efficient and accurate tools exist to assist clientapplications to use generics libraries, but so far the libraries themselvesmust be parameterized manually, which is a tedious, time-consuming, anderror-prone task. We present a type-constraint-based algorithm forconverting non-generic libraries to add type parameters. The algorithmhandles the full Java language and preserves backward compatibility, thusmaking it safe for existing clients. Among other features, it is capableof inferring wildcard types and introducing type parameters formutually-dependent classes. We have implemented the algorithm as a fullyautomatic refactoring in Eclipse.We evaluated our work in two ways. First, our tool parameterized code thatwas lacking type parameters. We contacted the developers of several ofthese applications, and in all cases where we received a response, theyconfirmed that the resulting parameterizations were correct and useful.Second, to better quantify its effectiveness, our tool parameterizedclasses from already-generic libraries, and we compared the results tothose that were created by the libraries' authors. Our tool performed therefactoring accurately -- in 87% of cases the results were as good as thosecreated manually by a human expert, in 9% of cases the tool results werebetter, and in 4% of cases the tool results were worse.
Persistent DSpace Link
http://hdl.handle.net/1721.1/33965
Repository logo
PrivacyPermissionsAccessibilityContact us
Repository logo
Notify us about copyright concerns.