Open 005Dikshant opened 6 months ago
To implement the TypeChecking refactoring, I examined the refactored method drawMarkerExtracted resulting from the previous duplicate code refinement #3. I noticed that it contained if and else blocks, each handling logic based on whether the Marker object was an instance of ValueMarker or IntervalMarker. To address this, I followed these steps:
Package: org.jfree.chart.renderer className: IntermediateAbstractRenderer
Now duplicate code refactoring is done, I see the drawMarkerExtracted() in IntermediateAbstractRenderer.java, Have some if and else if blocks that are being executed when the Marker object is either of ValueMarker or IntervalMarker.
Clone: Type 2 Clone In both sections of the clone, the code validates whether the marker is either a ValueMarker or an IntervalMarker using instanceof checks. However, the subsequent actions taken for each type differ significantly.
For instance:
Despite these distinctions in behavior, the underlying structure and approach remain consistent, showcasing a Type-2 clone where the code follows a similar pattern but diverges in the details of execution based on the marker type encountered