Patent ID: 8806465

Claim:
A method comprising: searching exception classes stored in computer memory for those of the exception classes that match a pattern; refactoring the parent classes of the matched exception classes to accept an exception type argument; rewriting a section of code that throws the matched exceptions by replacing the exception class with the parent class and adding a corresponding exception type; changing a list of thrown exceptions in a method declaration; rewriting a section of code that catches the thrown exceptions by changing a catch clause to catch a parent exception class and inserting a case statement for the exception type in that catch clause; and removing the matched exception classes; wherein the matched exception classes are refactored by: adding a public field that encodes a type of the exception; adding constructor methods that take the type of the exception as an argument; creating constants for each numeric exception type and using the constants with throwing and catching the exceptions; and creating an array with the name of the exception classes for use in the text representation of the exception classes.