You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the source code present in osmarleandro/incubator-gobblin@26c45ca commit, I applied a single Extract Interface to the Watermark interface, extracting the IWatermark interface. RefDiff yields a list of refactorings, which includes Extract Interface, Change Signature Method, Move Method, and Pull Up Method.
The Move Method instance points to a method that changes the signature moved to the IWatermark interface, while the Pull Up Method points to a method with the same signature moved to the IWatermark interface. Fowler’s book (2020) shows that the Extract Interface can be followed by Pull Up Method, Pull Up Field, and Change Function Declaration, but it was not mentioned the Move Method.
Considering Fowler's definition and the IWatermark interface was created between the revisions, is the Move Method a valid refactoring transformation?
@@ -0,0 +1,24 @@+public interface IWatermark {++ /**+ * Convert this {@link Watermark} into a {@link JsonElement}.+ * @return a {@link JsonElement} representing this {@link Watermark}.+ */+ JsonElement toJson();++ /**+ * This method must return a value from [0, 100]. The value should correspond to a percent completion. Given two+ * {@link Watermark} values, where the lowWatermark is the starting point, and the highWatermark is the goal, what+ * is the percent completion of this {@link Watermark}.+ *+ * @param lowWatermark is the starting {@link Watermark} for the percent completion calculation. So if this.equals(lowWatermark) is true, this method should return 0.+ * @param highWatermark is the end value {@link Watermark} for the percent completion calculation. So if this.equals(highWatermark) is true, this method should return 100.+ * @return a value from [0, 100] representing the percentage completion of this {@link Watermark}.+ */+ short calculatePercentCompletion(IWatermark lowWatermark, IWatermark highWatermark);++}@@ -30,22 +30,5 @@ import com.google.gson.JsonElement;
-public interface Watermark {-- /**- * Convert this {@link Watermark} into a {@link JsonElement}.- * @return a {@link JsonElement} representing this {@link Watermark}.- */- public JsonElement toJson();-- /**- * This method must return a value from [0, 100]. The value should correspond to a percent completion. Given two- * {@link Watermark} values, where the lowWatermark is the starting point, and the highWatermark is the goal, what- * is the percent completion of this {@link Watermark}.- *- * @param lowWatermark is the starting {@link Watermark} for the percent completion calculation. So if this.equals(lowWatermark) is true, this method should return 0.- * @param highWatermark is the end value {@link Watermark} for the percent completion calculation. So if this.equals(highWatermark) is true, this method should return 100.- * @return a value from [0, 100] representing the percentage completion of this {@link Watermark}.- */- public short calculatePercentCompletion(Watermark lowWatermark, Watermark highWatermark);+public interface Watermark extends IWatermark {
}
Summary
In the source code present in osmarleandro/incubator-gobblin@26c45ca commit, I applied a single Extract Interface to the Watermark interface, extracting the IWatermark interface. RefDiff yields a list of refactorings, which includes Extract Interface, Change Signature Method, Move Method, and Pull Up Method.
The Move Method instance points to a method that changes the signature moved to the IWatermark interface, while the Pull Up Method points to a method with the same signature moved to the IWatermark interface. Fowler’s book (2020) shows that the Extract Interface can be followed by Pull Up Method, Pull Up Field, and Change Function Declaration, but it was not mentioned the Move Method.
Considering Fowler's definition and the IWatermark interface was created between the revisions, is the Move Method a valid refactoring transformation?
Code example
Diff fragment between the commit osmarleandro/incubator-gobblin@26c45ca and their parent.
Environment details
RefDiff 2.0
Steps to reproduce
Actual results
Expected results
A single instance of the Extract Interface refactoring applied to Watermark interface.
The text was updated successfully, but these errors were encountered: