HHH-13048 Allow for parallel processing of entity enhancements via ByteBuddy

This commit is contained in:
Sanne Grinovero 2018-10-18 13:49:39 +01:00
parent aae9cd14a5
commit 76274bf33e
2 changed files with 5 additions and 1 deletions

View File

@ -96,7 +96,7 @@ public class EnhancerImpl implements Enhancer {
* @throws EnhancementException Indicates a problem performing the enhancement
*/
@Override
public synchronized byte[] enhance(String className, byte[] originalBytes) throws EnhancementException {
public byte[] enhance(String className, byte[] originalBytes) throws EnhancementException {
//Classpool#describe does not accept '/' in the description name as it expects a class name. See HHH-12545
final String safeClassName = className.replace( '/', '.' );
try {

View File

@ -18,6 +18,10 @@ public interface Enhancer {
/**
* Performs the enhancement.
*
* It is possible to invoke this method concurrently, but when doing so make sure
* no two enhancement tasks are invoked on the same class in parallel: the
* Enhancer implementations are not required to guard against this.
*
* @param className The name of the class whose bytecode is being enhanced.
* @param originalBytes The class's original (pre-enhancement) byte code
*