Patent ID: 7464370

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 invocation of the method at the paste location, determining that the block of code is to return a plurality of values, and creating a helper class for the method, wherein the helper class returns the plurality of values, wherein the generating the helper class further comprises obtaining names and types for variables in the block of code and generating helper code that sets the variables; if the operation requested that the block of code be copied within a single part, designating a created private method option as a default in the user interface; if the operation requested that the block of code be copied between two parts in a single package, designating a created protected method option as the default in the user interface and making the created private method option unavailable in the user interface; if the operation requested that the block of code be copied between different packages, designating a created public method option as the default in the user interface and making the created private method option and the created protected method option unavailable in the user interface; and if the block of code does not have the size greater than the threshold, performing the operation.