RFR: JDK-8305644: IGV: Node text not updated when switching from/to CFG view [v2]
Tobias Holenstein
tholenstein at openjdk.org
Wed Apr 5 11:53:06 UTC 2023
On Wed, 5 Apr 2023 11:33:53 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
> Given that this line was dropped by mistake, the fix to add the line again looks good and trivial. Nevertheless, setting a field in a getter method like that seems wrong/unexpected.
You are right. Even though re-adding the dropped line fixes the issue, it is still bad practice. I fixed the issue now in the proper way:
`showCFG` is set in `setShowCFG(boolean enable)` - there is the right place to also set `diagram.setCFG(enable);` and NOT in the `getDiagram()` since getters should be side effect free. Thanks for the input @chhagedorn !
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13348#issuecomment-1497352443
More information about the hotspot-compiler-dev
mailing list