RefactoringMiner
RefactoringMiner copied to clipboard
[JavaRecreation of JS Extract Method] Cannot detect relatively simple Extract Operation refactoring
Problem
Refactoring Miner was not able to detect that stringifyFn() was extracted from extractArgs().
Steps to Reproduce
- Go to https://github.com/mkshiblu/practice/commit/e6c793bfa5c087e41d1d32af87757411ca96b08b
- Run the chrome extension
Observed Behavior
- No refactorings are reported by RefactoringMiner.
Java Diff

Note
-
The Above Java Example Test Code is a close recreation to this original javaScript code (injector.js).
-
Source code is compilable because of the addition of mock classes (e.g. Function, StringVar)
This is a duplicate with #253 related to sub-expression matching
@mkshiblu
I think the reason is that you have two variables (fnText and args) declared in the same statement.
StringVar fnText = Function.prototype.toString.call(fn).replace(STRIP_COMMENTS, ""),
args = fnText.match(ARROW_ARG).match(FN_ARGS);