From 91cdb59946f572b6463d4a1b004ad8d1a3e1210d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Tue, 31 Dec 2024 09:18:26 +0100 Subject: [PATCH] Remove the check for sequence number from P2TargetUtils.checkProfile Currently it is assumed that a profile is up-to-date if the sequence number does not change, but this has some risk to produce strange errors if for some reason there is no number or it is not changed. And even if the number changed, we still perform a check for actual changes. Because of the constant problems in inconsistent behavior this now completely removes the check for the sequence number from the profile. --- .../pde/internal/core/target/P2TargetUtils.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/P2TargetUtils.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/P2TargetUtils.java index 81b0c2e6cf..91676f40b7 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/P2TargetUtils.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/P2TargetUtils.java @@ -163,11 +163,6 @@ public class P2TargetUtils { */ static final String PROP_ALL_ENVIRONMENTS = PDECore.PLUGIN_ID + ".all_environments"; //$NON-NLS-1$ - /** - * Profile property that keeps track of the target sequence number - */ - static final String PROP_SEQUENCE_NUMBER = PDECore.PLUGIN_ID + ".sequence"; //$NON-NLS-1$ - /** * Profile property that tracks whether or not source to be auto-included */ @@ -317,11 +312,7 @@ public static void forceCheckTarget(final ITargetDefinition target) { result.resetProfile(); } - @SuppressWarnings("restriction") private synchronized void resetProfile() { - if (getProfile() instanceof org.eclipse.equinox.internal.p2.engine.Profile profile) { - profile.setProperty(PROP_SEQUENCE_NUMBER, "-1"); //$NON-NLS-1$ - } fProfile = null; } @@ -515,13 +506,6 @@ private boolean checkProfile(ITargetDefinition target, final IProfile profile) { return false; } - // check that the target and profiles are in sync. If they are then life is good. - // If they are not equal, there is still a chance that everything is ok. - String profileNumber = profile.getProperty(PROP_SEQUENCE_NUMBER); - if (Integer.toString(((TargetDefinition) target).getSequenceNumber()).equals(profileNumber)) { - return true; - } - // check if all environments setting is the same boolean all = false; String value = profile.getProperty(PROP_ALL_ENVIRONMENTS); @@ -1200,7 +1184,6 @@ private void setProperties(BiConsumer setter, ITargetDefinition setter.accept(PROP_AUTO_INCLUDE_SOURCE, Boolean.toString(getIncludeSource())); setter.accept(PROP_INCLUDE_CONFIGURE_PHASE, Boolean.toString(getIncludeConfigurePhase())); setter.accept(PROP_FOLLOW_REPOSITORY_REFERENCES, Boolean.toString(isFollowRepositoryReferences())); - setter.accept(PROP_SEQUENCE_NUMBER, Integer.toString(((TargetDefinition) target).getSequenceNumber())); setter.accept(PROP_DECLARED_REPOSITORIES, iuBundleContainersOf(target).map(IUBundleContainer::getRepositories) .flatMap(List::stream).collect(joiningEncodeURIs())); }