Skip to content

Missing Extract Method instance #26

@osmarleandro

Description

@osmarleandro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions