Skip to content

PAMunb/rascal-Java8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0c83985 · Dec 23, 2018
Sep 26, 2016
Sep 26, 2016
Jun 7, 2017
May 22, 2017
May 22, 2017
Oct 1, 2017
Dec 23, 2018
Jun 11, 2017
Sep 26, 2016
Jun 11, 2017
Sep 26, 2016
May 23, 2017
May 23, 2017
Sep 26, 2016

Repository files navigation

Refactoring Java Code towards Language Evolution

Motivation

... when code does not evolve with its language, maintaining backward compatibility means that a language can be expanded, but nothing can be removed ... This leads to a language that is increasingly large and complex and makes the learning curve steeper and maintenance more difficult

(Jeffrey Overbey and Ralph Johnson, Regrowing a Language. Onward! 2009.)

Goal

Implement a set of refactorings (using Rascal-MPL) to evolve a legacy Java systems towards the usage of more recent constructs of the language.

Current transformations

  • Convert Anonymous Inner Classes into Lambda Expressions
  • Convert explicit typing of generic r-alues into Diamond Operator
  • Conver if-then-else-if on the value of strings to Switch String
  • Convert similar catch blocks into MultiCatch

How to use it

  • clone this repository
  • install rascal-mpl ide
  • import this project to the rascal workspace
  • execute the rascal shell using this project as reference
  • import the Driver module (such as > import Driver;)
  • execute the function refactorProjects passing as argument a location for an input file

The input file is in the CSV format, with at least the following columns:

  • project name
  • project revision (to help on reproducibility)
  • type of tranformation (DI for diamond operator, AC for anonymous to lambda, MC for multi-catch)
  • percentage (just a number, with the percentage of transformations with respect to the oportunities) * absolute path to the project

About

Introducing the support for Java 8 in Rascal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published