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

Missing Extract Method instance #26

Open
osmarleandro opened this issue Feb 11, 2021 · 0 comments
Open

Missing Extract Method instance #26

osmarleandro opened this issue Feb 11, 2021 · 0 comments

Comments

@osmarleandro
Copy link

Summary

In the source code present in osmarleandro/google-maps-services-java@982b095 commit, I applied a single Extract Method to makeRequest() method in PendingResultBase class, and RefDiff does not detect it.

Code example

Diff fragment between the commit osmarleandro/google-maps-services-java@982b095 and their parent.

@@ -72,11 +72,7 @@ abstract class PendingResultBase<T, A extends PendingResultBase<T, A, R>, R exte
   }
 
   private PendingResult<T> makeRequest() {
-    if (delegate != null) {
-      throw new IllegalStateException(
-          "'await', 'awaitIgnoreError' or 'setCallback' was already called.");
-    }
-    validateRequest();
+    extracted();
     switch (config.requestVerb) {
       case "GET":
         return delegate = context.get(config, responseClass, params);
@@ -88,6 +84,14 @@ abstract class PendingResultBase<T, A extends PendingResultBase<T, A, R>, R exte
     }
   }
 
+private void extracted() {
+       if (delegate != null) {
+      throw new IllegalStateException(
+          "'await', 'awaitIgnoreError' or 'setCallback' was already called.");
+    }
+    validateRequest();
+}
+

Environment details

RefDiff 2.0

Steps to reproduce

  1. Run RefDiff and give as input the commit osmarleandro/google-maps-services-java@982b095.

Actual results

RefDiff yields an empty set of refactorings.

Expected results

A single instance of the Extract Method refactoring applied to makeRequest() method in PendingResultBase class.

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

No branches or pull requests

1 participant