Skip to content

Is it possible to apply both an 'Overtake' and an 'Override' to the same method, since one part of the method needs pre/post-processing code added around it while another specific part needs its existing logic replaced?

Answer

No — only one or the other (Overtake or Override) can be applied to a given source file's method within the same layer; attempting both on the same method raises a code-generation exception about a duplicate method signature. The practical way to achieve the combined effect within a single Overtake instead: use $PREPEND to inject pre-processing code before the first original line of the method, one or more $SEARCH/$REPLACE blocks (or a surgical overtake) to modify whichever specific existing lines need to change in the middle of the method, and $APPEND to inject post-processing code after the last original line — combining pre-processing, targeted replacement, and post-processing all within the same Overtake block, which covers what layering Overtake and Override together was trying to accomplish.

← Browse Developer Studio, deployment, and upgrades questions