From d3a3baad5402a4c16afa40542956b4bee1e6a3ee Mon Sep 17 00:00:00 2001 From: Simon Kaegi Date: Tue, 11 May 2010 20:12:32 +0000 Subject: Bug 288280 - [engine] profile not current error should log both the current and expected profile timestamps --- .../src/org/eclipse/equinox/internal/p2/engine/Messages.java | 1 + .../org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java | 4 ++-- .../src/org/eclipse/equinox/internal/p2/engine/messages.properties | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Messages.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Messages.java index 44f489e43..94b91b9c9 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Messages.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Messages.java @@ -80,6 +80,7 @@ public class Messages extends NLS { public static String Profile_Duplicate_Root_Profile_Id; public static String profile_lock_not_reentrant; public static String profile_not_current; + public static String profile_changed; public static String profile_not_registered; public static String Profile_Null_Profile_Id; public static String Profile_Parent_Not_Found; diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java index 08a3d7b9b..57aabb9e5 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java @@ -734,12 +734,12 @@ public class SimpleProfileRegistry implements IProfileRegistry, IAgentService { if (profile.isChanged()) { if (DebugHelper.DEBUG_PROFILE_REGISTRY) DebugHelper.debug(PROFILE_REGISTRY, "Profile is marked as changed."); //$NON-NLS-1$ - throw new IllegalStateException(NLS.bind(Messages.profile_not_current, profile.getProfileId())); + throw new IllegalStateException(NLS.bind(Messages.profile_changed, profile.getProfileId())); } if (!checkTimestamps(profile, internalProfile)) { if (DebugHelper.DEBUG_PROFILE_REGISTRY) DebugHelper.debug(PROFILE_REGISTRY, "Unexpected timestamp difference in profile."); //$NON-NLS-1$ - throw new IllegalStateException(NLS.bind(Messages.profile_not_current, profile.getProfileId())); + throw new IllegalStateException(NLS.bind(Messages.profile_not_current, new String[] {profile.getProfileId(), Long.toString(internalProfile.getTimestamp()), Long.toString(profile.getTimestamp())})); } isCurrent = true; } finally { diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/messages.properties b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/messages.properties index 187342857..13784b3cb 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/messages.properties +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/messages.properties @@ -42,7 +42,8 @@ SimpleProfileRegistry_Profile_not_locked_due_to_exception=Profile not locked due SimpleProfileRegistry_Bad_profile_location=Bad profile location: {0} SimpleProfileRegistry_CannotRemoveCurrentSnapshot=Cannot remove the current profile timestamp profile_does_not_exist=Profile to be updated does not exist: {0}. -profile_not_current=Profile {0} is not current. +profile_not_current=Profile {0} is not current. Expected timestamp {1} but was {2}. +profile_changed=Profile {0} is marked as changed. profile_not_registered=Profile {0} not registered. reg_dir_not_available=Registry Directory not available: {0}. thread_not_owner=Thread not lock owner. -- cgit v1.2.3