Unsafe class loading problem?

Unsafe has a method for initializing classes:

Unsafe.ensureClassInitialized(Class) line: not available [native method]

I suspect that this type of initialization does not block the class like regular java class loading, because I sometimes came across some impossible situations. I can give more details later if necessary, but does anyone know if the loading class has Unsafe using such quirks?

Btw, here's a short stack trace of how this class loads:

Unsafe.ensureClassInitialized(Class) line: not available [native method]               
UnsafeFieldAccessorFactory.newFieldAccessor(Field, boolean) line: 25
ReflectionFactory.newFieldAccessor(Field, boolean) line: 122    
Field.acquireFieldAccessor(boolean) line: 918    
Field.getFieldAccessor(Object) line: 899               
Field.get(Object) line: 358          
+5
source share
2 answers

: https://issues.apache.org/bugzilla/show_bug.cgi?id=43867 ( "", ), , ...

Tomcat, , , - . , log factory, , to null.

, ( Tomcat) ...

+1

- , Unsafe:

Class.forName(cls.getName(), true, cls.getClassLoader());

, .

+1

All Articles