Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class PCClassFileTransformer

private static final Localizer _loc = Localizer.forPackage
(PCClassFileTransformer.class);
private static final ThreadLocal<Boolean> _isTransformingInLocalThread = new ThreadLocal(); // OJ-2817

private final MetaDataRepository _repos;
private final PCEnhancer.Flags _flags;
Expand Down Expand Up @@ -120,12 +121,17 @@ public byte[] transform(ClassLoader loader, String className,
// prevent re-entrant calls, which can occur if the enhancing
// loader is used to also load OpenJPA libraries; this is to prevent
// recursive enhancement attempts for internal openjpa libraries
if (_transforming)
Boolean transforming = _isTransformingInLocalThread.get();
if (transforming != null) {
return null;

_transforming = true;
}
_isTransformingInLocalThread.set(Boolean.TRUE);

return transform0(className, redef, bytes);
try {
return transform0(className, redef, bytes);
} finally {
_isTransformingInLocalThread.remove();
}
}

/**
Expand Down