Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6804588
Votes 0
Synopsis non-Java languages need interface injection to retrofit pre-existing classes
Category hotspot:compiler2
Reported Against
Release Fixed
State 1-Dispatched, request for enhancement
Priority: 3-Medium
Related Bugs
Submit Date 12-FEB-2009
Description
http://blogs.sun.com/jrose/entry/interface_injection_in_the_vm

When Java needs to add a new interface to existing objects, the injection of the new interface can be managed as part of the roll-out of the JDK which contains the new libraries and/or language features.  For example, when the collections API came out, the same JDK release introduced Comparable in various predefined types.

This approach not practical for languages not directly supported by the JDK (i.e., languages other than Java).  We propose a type-safe, secure, modular way for language runtimes to inject new utility interfaces (like Comparable) into pre-existing classes.

This feature also supports "traits", a common feature whereby implementation types can be retroactively assigned new structural interface types, and even be equipped with (generic) methods.

Finally, this feature supports efficient integration of classes into metaobject protocols, even when the classes were written (and their engineering frozen) long before any given metaobject protocol.
Posted Date : 2009-02-12 07:32:25.0
Work Around
N/A
Evaluation
N/A
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang