aserg-ufmg / RefDiff

A tool to mine refactorings in the commit history of git repositories.
MIT License
148 stars 44 forks source link

Missing Inline Method instance #25

Open osmarleandro opened 3 years ago

osmarleandro commented 3 years ago

Summary

In the source code present in osmarleandro/spring-boot@9576873 commit, I applied a single Inline Method to applyAdvisors() method in DiscoveredOperationsFactory class, and RefDiff does not detect it.

Code example

Diff fragment between the commit osmarleandro/spring-boot@9576873 and their parent.

@@ -89,19 +89,15 @@ abstract class DiscoveredOperationsFactory<O extends Operation> {
                DiscoveredOperationMethod operationMethod = new DiscoveredOperationMethod(method, operationType,
                                annotation.asAnnotationAttributes());
                OperationInvoker invoker = new ReflectiveOperationInvoker(target, operationMethod, this.parameterValueMapper);
-               invoker = applyAdvisors(endpointId, operationMethod, invoker);
-               return createOperation(endpointId, operationMethod, invoker);
-       }
-
-       private OperationInvoker applyAdvisors(EndpointId endpointId, OperationMethod operationMethod,
-                       OperationInvoker invoker) {
+               OperationInvoker invoker1 = invoker;
                if (this.invokerAdvisors != null) {
                        for (OperationInvokerAdvisor advisor : this.invokerAdvisors) {
-                               invoker = advisor.apply(endpointId, operationMethod.getOperationType(), operationMethod.getParameters(),
-                                               invoker);
+                               invoker1 = advisor.apply(endpointId, operationMethod.getOperationType(), operationMethod.getParameters(),
+                                               invoker1);
                        }
                }
-               return invoker;
+               invoker = invoker1;
+               return createOperation(endpointId, operationMethod, invoker);
        }

Environment details

RefDiff 2.0

Steps to reproduce

  1. Run RefDiff and give as input the commit osmarleandro/spring-boot@9576873.

Actual results

RefDiff yields an empty set of refactorings.

Expected results

A single instance of the Inline Method refactoring applied to applyAdvisors() method in DiscoveredOperationsFactory class.