Skip to content

Commit a3c9d16

Browse files
committed
Fix DS editor showing dirty on open without actual changes
The DSComponent constructor called setNamespace() and setNamespacePrefix() which fired property change events, causing the model to be marked dirty during initial loading. Use super calls to set namespace defaults without triggering change events. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b9b8bc5 commit a3c9d16

File tree

1 file changed

+4
-2
lines changed
  • ds/org.eclipse.pde.ds.core/src/org/eclipse/pde/internal/ds/core/text

1 file changed

+4
-2
lines changed

ds/org.eclipse.pde.ds.core/src/org/eclipse/pde/internal/ds/core/text/DSComponent.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ public class DSComponent extends DSObject implements IDSComponent {
5151
public DSComponent(DSModel model) {
5252
super(model, ELEMENT_COMPONENT);
5353
setAttributeName(IDSConstants.ELEMENT_COMPONENT);
54-
setNamespace(IDSConstants.NAMESPACE); // hard code namespace to be 1.1
55-
setNamespacePrefix("scr"); //$NON-NLS-1$
54+
// Use super calls to set namespace defaults without firing property
55+
// change events that would incorrectly mark the model as dirty
56+
super.setNamespace(IDSConstants.NAMESPACE);
57+
super.setNamespacePrefix("scr"); //$NON-NLS-1$
5658
setInTheModel(true);
5759
}
5860

0 commit comments

Comments
 (0)