The patent badge is an abbreviated version of the USPTO patent document. The patent badge does contain a link to the full patent document.

The patent badge is an abbreviated version of the USPTO patent document. The patent badge covers the following: Patent number, Date patent was issued, Date patent was filed, Title of the patent, Applicant, Inventor, Assignee, Attorney firm, Primary examiner, Assistant examiner, CPCs, and Abstract. The patent badge does contain a link to the full patent document (in Adobe Acrobat format, aka pdf). To download or print any patent click here.

Date of Patent:
Aug. 19, 2008

Filed:

Dec. 09, 2004
Applicant:

James A. Gosling, Redwood City, CA (US);

Inventor:

James A. Gosling, Redwood City, CA (US);

Assignee:

Sun Microsystems, Inc., Santa Clara, CA (US);

Attorney:
Primary Examiner:
Int. Cl.
CPC ...
H04L 12/56 (2006.01);
U.S. Cl.
CPC ...
Abstract

One embodiment of the present invention provides a system that facilitates moving an original method from a source class to a destination class and for constructing a corresponding forwarding method in the source class that preserves null semantics. During operation, the system translates the original method from the source class into a corresponding moved method, and then incorporates the moved method into the destination class. The system also constructs a forwarding method that invokes the moved method in the destination class. The system then replaces the original method in the source class with the forwarding method. In this way, invoking the forwarding method in the source class causes the moved method to be invoked in the destination class. While constructing the forwarding method, the system generates code that checks whether a 'source parameter' of the original method whose class matches the destination class is null. If so, the generated code executes the body of the original method. Otherwise, the generated code invokes the moved method in the destination class. The system also optimizes the generated code to produce optimized code for the forwarding method, whereby portions of the original method can possibly be optimized away.


Find Patent Forward Citations

Loading…