NullPointerException if SecurityManager is set after startup

Description

I had a NullPointerException reported to Byte Buddy: https://github.com/raphw/byte-buddy/issues/625

The reason is that two visitors are only created if a security manager is set during the creation of: https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/bytecode/internal/bytebuddy/ByteBuddyState.java#L84

If the security manager is set later, both visitors are null such that the exception occurs.

Environment

None

Assignee

Unassigned

Reporter

Rafael Winterhalter

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Priority

Minor
Configure