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

(cherry picked from commit 03801b62ec2aa7cc9707e1014da0967101ef85ea)
This commit is contained in:
barreiro 2015-08-15 14:49:35 +01:00 committed by Steve Ebersole
parent e3c6c02178
commit 60c4c9846a

View File

@ -81,7 +81,7 @@ public Enhancer(EnhancementContext enhancementContext) {
*
* @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 {
final CtClass managedCtClass = classPool.makeClassIfNew( new ByteArrayInputStream( originalBytes ) );
enhance( managedCtClass );