Github user pmouawad commented on a diff in the pull request:

    https://github.com/apache/jmeter/pull/300#discussion_r130241103
  
    --- Diff: src/core/org/apache/jmeter/gui/UndoHistory.java ---
    @@ -160,63 +133,46 @@ public void add(JMeterTreeModel treeModel, String 
comment) {
             // first clone to not convert original tree
             tree = (HashTree) tree.getTree(tree.getArray()[0]).clone();
     
    -        position++;
    -        while (history.size() > position) {
    -            if (log.isDebugEnabled()) {
    -                log.debug("Removing further record, position: {}, size: 
{}", position, history.size());
    -            }
    -            history.remove(history.size() - 1);
    -        }
    -
             // cloning is required because we need to immute stored data
             HashTree copy = UndoCommand.convertAndCloneSubTree(tree);
     
    -        history.add(new UndoHistoryItem(copy, comment));
    +        GuiPackage guiPackage = GuiPackage.getInstance();
    +        //or maybe a Boolean?
    +        boolean dirty = guiPackage != null ? guiPackage.isDirty() : false;
    --- End diff --
    
    I investigated further code and behaviour, I think issue in incorrect dirty 
detection is due to the hypothesis made on GuiPackage#isDirty(), it appears it 
is not up to date when added to UndoHistory. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to