HHH-10078 - Enforce sychronization of non thread-safe method Enhancer.enhance()

This commit is contained in:
barreiro 2015-08-15 14:49:35 +01:00 committed by Steve Ebersole
parent 4d6eca5ff8
commit 03801b62ec
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ public class Enhancer {
* *
* @throws EnhancementException Indicates a problem performing the enhancement * @throws EnhancementException Indicates a problem performing the enhancement
*/ */
public byte[] enhance(String className, byte[] originalBytes) throws EnhancementException { public synchronized byte[] enhance(String className, byte[] originalBytes) throws EnhancementException {
try { try {
final CtClass managedCtClass = classPool.makeClassIfNew( new ByteArrayInputStream( originalBytes ) ); final CtClass managedCtClass = classPool.makeClassIfNew( new ByteArrayInputStream( originalBytes ) );
enhance( managedCtClass ); enhance( managedCtClass );