From da880f23d4e97375362660f3e77e3921e5c3bfa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Tue, 31 Dec 2024 13:21:54 +0100 Subject: [PATCH] Do not load sequence number from target files anymore As the sequence number is not persisted into a target file by the target editor, there is actually no point in loading it as it only can lead to inconsistent state. --- .../pde/internal/core/target/TargetDefinition.java | 9 --------- .../core/target/TargetDefinitionPersistenceHelper.java | 1 - .../internal/core/target/TargetPersistence36Helper.java | 8 -------- .../internal/core/target/TargetPersistence38Helper.java | 8 -------- 4 files changed, 26 deletions(-) diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinition.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinition.java index 26e6fa3ccf..e4c40f784b 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinition.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinition.java @@ -1126,15 +1126,6 @@ public int incrementSequenceNumber() { return ++fSequenceNumber; } - /** - * Convenience method to set the sequence number to a specific - * value. Used when loading a target from a persisted file. - * @param value value to set the sequence number to - */ - void setSequenceNumber(int value) { - fSequenceNumber = value; - } - private void removeElement(String... childNames) { if (fRoot != null) { TargetDefinitionDocumentTools.removeElement(fRoot, childNames); diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinitionPersistenceHelper.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinitionPersistenceHelper.java index c26803a6fb..14e412b081 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinitionPersistenceHelper.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinitionPersistenceHelper.java @@ -90,7 +90,6 @@ public class TargetDefinitionPersistenceHelper { static final String ATTR_FOLLOW_REPOSITORY_REFERENCES = "followRepositoryReferences"; //$NON-NLS-1$ static final String ATTR_VERSION = "version"; //$NON-NLS-1$ static final String ATTR_CONFIGURATION = "configuration"; //$NON-NLS-1$ - static final String ATTR_SEQUENCE_NUMBER = "sequenceNumber"; //$NON-NLS-1$ static final String CONTENT = "content"; //$NON-NLS-1$ static final String ATTR_USE_ALL = "useAllPlugins"; //$NON-NLS-1$ static final String PLUGINS = "plugins"; //$NON-NLS-1$ diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetPersistence36Helper.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetPersistence36Helper.java index 729c481346..31a2b19893 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetPersistence36Helper.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetPersistence36Helper.java @@ -165,14 +165,6 @@ public static void initFromDoc(ITargetDefinition definition, Element root) throw } } } - - // Set the sequence number at the very end - String sequenceNumber = root.getAttribute(TargetDefinitionPersistenceHelper.ATTR_SEQUENCE_NUMBER); - try { - ((TargetDefinition) definition).setSequenceNumber(Integer.parseInt(sequenceNumber)); - } catch (NumberFormatException e) { - ((TargetDefinition) definition).setSequenceNumber(0); - } } /** diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetPersistence38Helper.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetPersistence38Helper.java index 9efba4ea04..3130aece1b 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetPersistence38Helper.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetPersistence38Helper.java @@ -193,14 +193,6 @@ public static void initFromDoc(ITargetDefinition definition, Element root) { } } } - - // Set the sequence number at the very end - String sequenceNumber = root.getAttribute(TargetDefinitionPersistenceHelper.ATTR_SEQUENCE_NUMBER); - try { - ((TargetDefinition) definition).setSequenceNumber(Integer.parseInt(sequenceNumber)); - } catch (NumberFormatException e) { - ((TargetDefinition) definition).setSequenceNumber(0); - } } /**