Skip to content

Visualisation of refactorings

Anna Potriasaeva edited this page Mar 9, 2023 · 8 revisions

Add / Remove (Method, Attribute, Variable, Parameter, Class) Modifier

Comments:

Issue

FIX

Class UMLModifier was introduced that provides LocationInfo

All AddXXXXModifier refactorings have a method UMLModifier getAddedModifier()

All RemoveXXXXModifier refactorings have a method UMLModifier getRemovedModifier()

All ChangeXXXXAccessModifier refactorings have two methods UMLModifier getOldModifier() and UMLModifier getNewModifier() Note These methods will return null if the modifier is package-private, because for package-private access no keyword is used.

Change Variable/Parameter/Attribute Type

Screenshot from 2023-02-14 14-02-44 FIX

Instead of highlighting VariableDeclaration getOriginalVariable() and VariableDeclaration getChangedTypeVariable()

getOriginalVariable().getType() and getChangedTypeVariable().getType() should be highlighted.

getType() returns UMLType object which has a LocationInfo

Extract Variable

ExtractVariable.png

Comments:

You case use List<LeafMapping> getSubExpressionMappings()

LeafMapping.getFragment1() will give you the expression that was extracted from the left.

LeafMapping.getFragment2() will give you the initializer of the extracted variable to the right.

If the List.size() > 1, then it is a case of multi-mapping, where more than one expression from the left were extracted to the same variable initializer to the right.

Updated visualization:

New-Extract-Variable.png

Inline Method

InlineMethod.png

Comments:

Change Return Type

changeReturnType.png

Comments:

Rename and Change Parameter Type

RenameAndChangeParameterType.png

Comments:

Rename Method

RenameMethod.png

Comments:

Extract Method

ExtractMethod.png

Comments:

Add Parameter

AddParameter.png

Comments:

Inline Variable

InlineVariable.png

Comments:

Change Variable Type

ChangeVariableType.png

Comments:

Extract Superclass

Comments:

Nothing is highlighted.

Parameterize Attribute

ParameterizeAttribute.png

Comments:

Move Method

MoveMethod.png

Comments:

Push Down Attribute

PushDownAttribute.png

Comments:

Push Down Attribute

PushDownMethod.png

Comments:

Extract and move method

ExtractAndMoveMethod.png

Comments: