Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JavaRecreation of JS Extract Method] Cannot detect relatively simple Extract Operation refactoring #262

Open
mkshiblu opened this issue Jun 27, 2022 · 2 comments

Comments

@mkshiblu
Copy link

Problem

Refactoring Miner was not able to detect that stringifyFn() was extracted from extractArgs().

Steps to Reproduce

  1. Go to mkshiblu/practice@e6c793b
  2. Run the chrome extension

Observed Behavior

  • No refactorings are reported by RefactoringMiner.

Java Diff

image

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)

@tsantalis
Copy link
Owner

This is a duplicate with #253 related to sub-expression matching

@tsantalis
Copy link
Owner

@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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants