flow-development-collection icon indicating copy to clipboard operation
flow-development-collection copied to clipboard

BUGFIX: Fix proxy compilation for edge cases

Open robertlemke opened this issue 4 years ago • 2 comments

This change fixes proxy compilation for certain cases where "class" was used as a string in multi-line quoted strings or within comments.

Resolves: #1835

robertlemke avatar Nov 10 '21 22:11 robertlemke

Dang… seems as if the extra-weird testcase by @albe makes it fail… 🙈 What to do about that?

kdambekalns avatar May 18 '22 15:05 kdambekalns

Dang… seems as if the extra-weird testcase by @albe makes it fail… 🙈 What to do about that?

Sorry! 🙈 Maybe document as DONT WRITE COMMENTS BETWEEN THE CLASS KEYWORD AND YOUR CLASSNAME THAT CONTAINS THE WORD "CLASS", STUPID! cuts it? 😂

For real though, Christian is onto it - see the comment

albe avatar Jun 22 '22 11:06 albe

I took a new approach: Instead of using a regex replacing the class name, I regenerate the beginning of the source code until the class name appears by rendering the respective tokens. Usually, this amount of code until the class name appears, will be relatively short, so I guess that taking this approach is feasible in terms of speed.

I also added a new unit test cases which covers more edge cases than the ones we already had in mind.

I tested this patch with a real application and ran all tests, so this should hopefully work in all cases.

Is it okay to target this to 8.3 and 9.0 or do I need to port this to earlier versions, too?

robertlemke avatar May 09 '23 13:05 robertlemke

Is it okay to target this to 8.3 and 9.0 or do I need to port this to earlier versions, too?

I think 8.3 is fine, but if you really like, it could even go into ealier releases. Not a must, though.

kdambekalns avatar May 09 '23 17:05 kdambekalns

This fix is now targeted to 8.0.

robertlemke avatar May 10 '23 06:05 robertlemke