Skip to content

Commit

Permalink
Do not load sequence number from target files anymore
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
laeubi committed Dec 31, 2024
1 parent 3dfbf59 commit da880f2
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down

0 comments on commit da880f2

Please sign in to comment.