protected void checkJavaSerialization ( String variableName , TypedValue value ) { ProcessEngineConfigurationImpl processEngineConfiguration = Context . getProcessEngineConfiguration ( ) ; if ( value instanceof SerializableValue && ! processEngineConfiguration . isJavaSerializationFormatEnabled ( ) ) { SerializableValue serializableValue = ( SerializableValue ) value ; // if Java serialization is prohibited if ( ! serializableValue . isDeserialized ( ) ) { String javaSerializationDataFormat = Variables . SerializationDataFormats . JAVA . getName ( ) ; String requestedDataFormat = serializableValue . getSerializationDataFormat ( ) ; if ( requestedDataFormat == null ) { // check if Java serializer will be used final TypedValueSerializer serializerForValue = TypedValueField . getSerializers ( ) . findSerializerForValue ( serializableValue , processEngineConfiguration . getFallbackSerializerFactory ( ) ) ; if ( serializerForValue != null ) { requestedDataFormat = serializerForValue . getSerializationDataformat ( ) ; } } if ( javaSerializationDataFormat . equals ( requestedDataFormat ) ) { throw ProcessEngineLogger . CORE_LOGGER . javaSerializationProhibitedException ( variableName ) ; } } } }
Checks if Java serialization will be used and if it is allowed to be used .