API refactoring (was: on the white board)

Jesse Glick jesse.glick at oracle.com
Thu Feb 16 14:41:33 PST 2012


On 02/16/2012 04:30 PM, mark.reinhold at oracle.com wrote:
> It turns out to get very complicated very quickly

Perhaps this kind of thing could be delegated to libraries rather than baked into the module system, as way to manage the complexity. An API-exporting module could 
declare a class implementing java.lang.instrument.ClassFileTransformer which would be given a chance to fix up classes in modules depending on it. A helper library based 
on something like ASM could offer convenient transformations such as renaming a class, rewriting usages of a method, etc.

In fact the same system would be very useful for libraries which require bytecode transformation for reasons other than backward compatibility, such as JMockit or AspectJ 
or RIFE/Continuations, which currently require you to either manually specify -agent when running or perform a build-time transformation.



More information about the jigsaw-dev mailing list