Skip to content

Commit 91cdb59

Browse files
committed
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.
1 parent 6e21922 commit 91cdb59

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/P2TargetUtils.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@ public class P2TargetUtils {
163163
*/
164164
static final String PROP_ALL_ENVIRONMENTS = PDECore.PLUGIN_ID + ".all_environments"; //$NON-NLS-1$
165165

166-
/**
167-
* Profile property that keeps track of the target sequence number
168-
*/
169-
static final String PROP_SEQUENCE_NUMBER = PDECore.PLUGIN_ID + ".sequence"; //$NON-NLS-1$
170-
171166
/**
172167
* Profile property that tracks whether or not source to be auto-included
173168
*/
@@ -317,11 +312,7 @@ public static void forceCheckTarget(final ITargetDefinition target) {
317312
result.resetProfile();
318313
}
319314

320-
@SuppressWarnings("restriction")
321315
private synchronized void resetProfile() {
322-
if (getProfile() instanceof org.eclipse.equinox.internal.p2.engine.Profile profile) {
323-
profile.setProperty(PROP_SEQUENCE_NUMBER, "-1"); //$NON-NLS-1$
324-
}
325316
fProfile = null;
326317
}
327318

@@ -515,13 +506,6 @@ private boolean checkProfile(ITargetDefinition target, final IProfile profile) {
515506
return false;
516507
}
517508

518-
// check that the target and profiles are in sync. If they are then life is good.
519-
// If they are not equal, there is still a chance that everything is ok.
520-
String profileNumber = profile.getProperty(PROP_SEQUENCE_NUMBER);
521-
if (Integer.toString(((TargetDefinition) target).getSequenceNumber()).equals(profileNumber)) {
522-
return true;
523-
}
524-
525509
// check if all environments setting is the same
526510
boolean all = false;
527511
String value = profile.getProperty(PROP_ALL_ENVIRONMENTS);
@@ -1200,7 +1184,6 @@ private void setProperties(BiConsumer<String, String> setter, ITargetDefinition
12001184
setter.accept(PROP_AUTO_INCLUDE_SOURCE, Boolean.toString(getIncludeSource()));
12011185
setter.accept(PROP_INCLUDE_CONFIGURE_PHASE, Boolean.toString(getIncludeConfigurePhase()));
12021186
setter.accept(PROP_FOLLOW_REPOSITORY_REFERENCES, Boolean.toString(isFollowRepositoryReferences()));
1203-
setter.accept(PROP_SEQUENCE_NUMBER, Integer.toString(((TargetDefinition) target).getSequenceNumber()));
12041187
setter.accept(PROP_DECLARED_REPOSITORIES, iuBundleContainersOf(target).map(IUBundleContainer::getRepositories)
12051188
.flatMap(List::stream).collect(joiningEncodeURIs()));
12061189
}

0 commit comments

Comments
 (0)