# HG changeset patch
# User Jan Vrany <jan.vrany@fit.cvut.cz>
# Date 1508138698 -3600
# Mon Oct 16 08:24:58 2017 +0100
# Branch jv
# Node ID 90d1d10f51ca6002576d4b5e0742b75e3c6143c4
# Parent c95ae929a0b1e748f2d2402f9ec89a742834cad5
Issue #108: Fixed update of method list in case methid is re-wrapped
When updating method list, must (also) search for a class whose
`#originalMethod` is the same as current method's `#originalMethod`.
This is to handle the case a method was wrapped before and now it's
wrapped again. For example the method was *Trace*d and user selects
*Trace Sender*.
See https://swing.fit.cvut.cz/projects/stx-jv/ticket/108
diff -r c95ae929a0b1 -r 90d1d10f51ca Tools__MethodList.st
a
|
b
|
|
498 | 498 | (something == #methodTrap) ifTrue:[ |
499 | 499 | newMethod isWrapped ifTrue:[ |
500 | 500 | oldMethod := newMethod originalMethod. |
| 501 | "/ We have to handle the case the method was wrapped before |
| 502 | "/ and now is wrapped differently - for example there was be breakpoint |
| 503 | "/ changed to trace point. |
| 504 | "/ |
| 505 | "/ In that case, the oldMethod (the one that is in the selection and the one |
| 506 | "/ that WAS installed in the class is not `newMethod originalMethod` but it's the |
| 507 | "/ method whose originalMethod is the same as `newMethod originalMethod`. |
| 508 | "/ |
| 509 | "/ Since we're interested in this case if such method is selected, checn the selection. |
| 510 | "/ A little tricky, we'll see. |
| 511 | "/ |
| 512 | "/ See https://swing.fit.cvut.cz/projects/ticket/103 |
| 513 | "/ |
| 514 | selection notEmpty ifTrue:[ |
| 515 | oldMethod := selection detect:[:each | each isWrapped and:[each originalMethod == oldMethod"newMethod originalMethod"]] ifNone:oldMethod. |
| 516 | ] |
501 | 517 | ] ifFalse:[ |
502 | 518 | selection notEmpty ifTrue:[ |
503 | 519 | oldMethod := selection detect:[:each | each isWrapped and:[each originalMethod == newMethod]] ifNone:nil. |
… |
… |
|
730 | 746 | |
731 | 747 | "Created: / 05-02-2000 / 13:42:14 / cg" |
732 | 748 | "Modified: / 05-06-2012 / 23:47:15 / cg" |
733 | | "Modified: / 15-10-2017 / 23:49:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 749 | "Modified: / 16-10-2017 / 00:05:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
734 | 750 | ! |
735 | 751 | |
736 | 752 | selectedMethodsChanged |