leehaut opened a new pull request, #8247:
URL: https://github.com/apache/hop/pull/8247

   Opening a transform or action, changing nothing, and clicking OK used to 
mark the pipeline or workflow as needing save. Cancel or closing the dialog 
without OK did not. This was easy to hit on every component, because it came 
from the shared OK path rather than from one plugin.
   
   
   ## How it works
   
   Two separate false positives were stacked:
   
   1. **SWT widgets turn `null` into `""`.** `XmlMetadataUtil` omits a `null` 
field and writes `<tag/>` for an empty string. Dialog `getInfo()` / `ok()` 
always writes widget text back, so OK without edits produced XML that failed a 
string equals. Comparison now uses `XmlHandler.sameContentIgnoringEmptyValues`, 
which treats an omitted element as the same as an empty one. Undo snapshot 
compare uses the same helper. Disk format is unchanged: `null` is still 
omitted, `""` is still a tag.
   
   2. **The dirty flag was restored from a clone.** After OK, the delegate did 
`setChanged(before.hasChanged())` when XML matched. Copying a transform or 
action goes through `setLocation` / `setRowDistribution`, and those setters 
flip `wrapperChanged`. A clone of a clean object therefore looked dirty, so OK 
without edits still marked the file changed. The live `hasChanged()` flag from 
before the dialog is used instead. Copy factories also clear that induced flag 
when the source is unchanged.
   
   Workflow actions had no XML compare at all. Several dialogs call 
`setChanged()` unconditionally on OK (Start is the obvious case). They now use 
the same omitted-vs-empty comparison, then restore the live flag when content 
did not change.
   
   Entry points:
   
   * `HopGuiPipelineTransformDelegate` (transform dialog, partitioning, error 
handling)
   * `HopGuiWorkflowActionDelegate`
   * `DefaultTransformMetaCopyFactory` / `DefaultActionCopyFactory`
   
   ## Tests
   
   * `XmlHandlerUnitTest` (omitted vs `<tag/>` / `<tag></tag>`, nested empty 
shells, real text still detected, trailing empty list item)
   * 
`XmlMetadataUtilTest.nullAndEmptyStringSerializeDifferentlyButCompareEqualForChangeDetection`
   * `XmlSnapshotUndoTest.sameXmlContentTreatsOmittedAndEmptyElementsAsEqual`
   * 
`DefaultTransformMetaCopyFactoryTest.copyOfUnchangedTransformIsNotMarkedChanged`
   * `DefaultActionCopyFactoryTest.copyOfUnchangedActionMetaIsNotMarkedChanged`


-- 
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]

Reply via email to