milamberspace commented on code in PR #6880:
URL: https://github.com/apache/jmeter/pull/6880#discussion_r4737878631
##########
src/core/src/main/java/org/apache/jmeter/gui/action/Load.java:
##########
@@ -202,12 +213,16 @@ public static boolean insertLoadedTree(final int id,
final HashTree tree, final
guiInstance.updateCurrentGui();
guiInstance.getMainFrame().getTree().setSelectionPath(
new TreePath(((JMeterTreeNode)
newTree.getArray()[0]).getPath()));
- final HashTree subTree = guiInstance.getCurrentSubTree();
- // Send different event whether we are merging a test plan into
another test plan,
- // or loading a testplan from scratch
- ActionEvent actionEvent =
- new ActionEvent(subTree.get(subTree.getArray()[subTree.size() -
1]), id,
+ final ActionEvent actionEvent;
+ // A plan without a file of its own has unsaved content, so it is not
recorded as saved
Review Comment:
Non-blocking: for a plan created from a template, "unsaved" relies on
`SUB_TREE_LOADED` leaving the new root out of the `CheckDirty` snapshot, which
is the same quirk that caused the `-t` bug. If someone later makes
`SUB_TREE_LOADED` include the root, templates would silently become "clean"
again. Maybe make it explicit in a follow-up, or at least say in the comment
that this depends on the root not being recorded?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]