HHH-9541 : NullPointerException at AbstractClassTransformerImpl#transform

This commit is contained in:
Gail Badner 2015-09-01 21:04:24 -07:00
parent 1d5dcf4ad3
commit 5912f65120
1 changed files with 9 additions and 7 deletions

View File

@ -50,14 +50,16 @@ public abstract class AbstractClassTransformerImpl implements ClassTransformer {
Class classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer) {
// to be safe...
className = className.replace( '/', '.' );
if ( classFilter.shouldInstrumentClass( className ) ) {
return doTransform( loader, className, classBeingRedefined, protectionDomain, classfileBuffer );
}
else {
return classfileBuffer;
// Java 8's resolution of lambda expressions can result in synthetic classes with no name.
// If that is the case, skip transformation.
if ( className != null ) {
// to be safe...
className = className.replace( '/', '.' );
if ( classFilter.shouldInstrumentClass( className ) ) {
return doTransform( loader, className, classBeingRedefined, protectionDomain, classfileBuffer );
}
}
return classfileBuffer;
}
/**