Patent ID: 8429623

Claim:
A method performed by a processing engine to enable a set of code intended to be executed on a first platform to be executed on a second platform, the second platform being different from the first platform, the method comprising: receiving the set of code, wherein the set of code is loaded for execution during runtime by a class loader, and wherein the processing engine is invoked when the class loader for loading the set of code is invoked; identifying a class in the set of code, the class comprising a non-static method call to a reflective method targeting a receiver object, wherein the non-static method call produces a different result when executed on the first platform as compared to being executed on the second platform; accessing a set of data that includes a first directive, the first directive specifying to replace the non-static method call with a method call to a substitute method configured to produce identical results to the reflective method; and rewriting, in accordance with the first directive, the set of code to replace the non-static method call with the method call to the substitute method, wherein the non-static method call is replaced by passing the receiver object to the substitute method in the method call, wherein the substitute method is configured to: identify, from a database, a set of methods comprising only methods that are exposed to the set of code when the set of code is executed in both the first platform and the second platform; and return the set of methods.