[jboss-jira] [JBoss JIRA] (WFLY-10025) Use new org.jboss.modules.ClassTransformer interface instead of j.l.i.ClassFileTransformer

David Lloyd (JIRA) issues at jboss.org
Wed May 30 16:07:00 EDT 2018


    [ https://issues.jboss.org/browse/WFLY-10025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13584674#comment-13584674 ] 

David Lloyd commented on WFLY-10025:
------------------------------------

That's OK; we still need to make the switch though because with the modular JDK, the {{java.instrument}} module which contains the old {{ClassFileTransformer}} interface may or may not be available in a given runtime image.

Converting from array to {{ByteBuffer}} does not incur a copy (using the {{wrap()}} method).  Converting from {{ByteBuffer}} to array _may_ incur a copy.  See [this example in JBoss Modules|https://github.com/jboss-modules/jboss-modules/blob/1.x/src/main/java/org/jboss/modules/JLIClassTransformer.java].

> Use new org.jboss.modules.ClassTransformer interface instead of j.l.i.ClassFileTransformer
> ------------------------------------------------------------------------------------------
>
>                 Key: WFLY-10025
>                 URL: https://issues.jboss.org/browse/WFLY-10025
>             Project: WildFly
>          Issue Type: Enhancement
>          Components: JPA / Hibernate
>            Reporter: David Lloyd
>            Assignee: Scott Marlow
>            Priority: Minor
>
> The JPA classes use {{java.lang.instrument.ClassFileTransformer}} for class transformation, however this style of transformer incurs an extra whole-byte-array copy when loading memory-mapped classes or using other resource loaders which operate on byte buffers.
> After the Modules 1.8.0.Final upgrade, switch to using {{org.jboss.modules.ClassTransformer}} instead.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list