Creating a method from a block of code
Abstract
A method, apparatus, system, and signal-bearing medium that in an embodiment determine whether a block of code associated with a copy-and-paste operation or a punch-out operation has a size greater than a threshold. If the size is greater than the threshold, then a method is created and the block of code is pasted into the method. Also, an invocation to the newly created method is added at the copied-from location and the intended pasted-to location (in the case of the copy-and-paste operation) or an invocation to the newly created method is added at the copied-from location (in the case of the punch-out operation). In this way, future modifications to the block of code need only be made in one place: the method, instead of at all locations where duplicate code exists. Thus, embodiments of the invention may reduce the fragility of the code.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 25 · Forward citations: 2.
Claims (1 — 1 Independent, 0 Dependent)
- Claim 1Independent Claim
A method comprising: receiving an operation from a user interface, a selection of a block of code at a copy location in an application, and a selection of a paste location in the application, wherein the copy location is different than the paste location; in response to the receiving, determining whether the block of code has a size greater than a threshold; if the block of code has the size greater than the threshold, creating a method that comprises the block of code, replacing the block of code at the copy location in the application with a first invocation of the method, adding a second in
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗
Cited By — Indexed Forward Citations (2 of 2 total)
References Cited — Backward Prior Art (25)
Non-Patent Literature (3)
- Gallagher, Keith, Loyola College in Maryland; Layman, Lucas, North Carolina State University; "Are Decomposition Slices Clones?", 2003 IEEE, retrieved from scholar.google.com on Aug. 27, 2007.
- Myers, Brad A; Kosbie, David S; "Reusable Hierarchical Command Objects", 1996 ACM, p. 260-267, retrieved from scholar.google.com Aug. 27, 2007.
- Myers, Brad; Ko, Andrew; "Studying Development and Debugging To help Create a Better Programming Environment: For the CHI 2003 Workshop on Perspectives in End User Development", 2003, retrieved from scholar.google.com Aug. 27, 2007.