xinitrc86 / zthread

Simple Thread implementation for ABAP. Based on JAVA Thread, its Runnable interface with some additional callback capabilities.
MIT License
40 stars 8 forks source link

Usage of "is instance of" in 740 #4

Open marianfoo opened 3 years ago

marianfoo commented 3 years ago

It is checked whether runnable is an instance of ZIF_RUNNABLE. https://github.com/xinitrc86/zthread/blob/0c8cdb7ebde82475a639a55954e063a920559bb7/src/zcl_thread.clas.abap#L251 This is done using "is instance of" which is only available from 7.50 onwards. We are still on 7.4 and this displays an syntax error: image

We´ve replaced it currently with: rv_is_runnable = xsdbool( cl_wdy_wb_reflection_helper=>is_instance_of( object = o_runnable type_name = 'ZIF_RUNNABLE' ) and lv_name <> '\CLASS=ZCL_THREAD' ). https://codezentrale.de/abap-funktion-instanceof/

Do we have another option here?

xinitrc86 commented 3 years ago

Hi marianfoo, I'm unaware of options at the moment. I'm currently off. When I get the time I will have a look on the code you sent and see if I can find a more generally available option. Thank you for

xinitrc86 commented 3 years ago

Damn phone...continuing... Thank you for sharing this!

xinitrc86 commented 3 years ago

I'm also aware the serialization is not correct for some scenarios, I have the fix but still need to merge.