diff options
author | Simon Kaegi | 2008-12-05 22:14:24 +0000 |
---|---|---|
committer | Simon Kaegi | 2008-12-05 22:14:24 +0000 |
commit | 291e954b6a48400e4a626cd5c992801ee9408451 (patch) | |
tree | 471e651fadc84dcb60496f40847b2b4e5b0b7c66 /bundles/org.eclipse.equinox.p2.metadata | |
parent | 3b83085c9b31808ddd8112b12481b9f0e69d10c7 (diff) | |
download | rt.equinox.p2-291e954b6a48400e4a626cd5c992801ee9408451.tar.gz rt.equinox.p2-291e954b6a48400e4a626cd5c992801ee9408451.tar.xz rt.equinox.p2-291e954b6a48400e4a626cd5c992801ee9408451.zip |
[engine] Missing touchpoint error in N20081204-2000
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.metadata')
2 files changed, 15 insertions, 11 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/MetadataFactory.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/MetadataFactory.java index 7bf5f6691..30cecdc07 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/MetadataFactory.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/MetadataFactory.java @@ -321,12 +321,18 @@ public class MetadataFactory { public static TouchpointType createTouchpointType(String id, Version version) { Assert.isNotNull(id); Assert.isNotNull(version); - TouchpointType result = getCachedTouchpointType(id, version); - if (result != null) + + if (id.equals(TouchpointType.NONE.getId()) && version.equals(TouchpointType.NONE.getVersion())) + return TouchpointType.NONE; + + synchronized (typeCache) { + TouchpointType result = getCachedTouchpointType(id, version); + if (result != null) + return result; + result = new TouchpointType(id, version); + putCachedTouchpointType(result); return result; - result = new TouchpointType(id, version); - putCachedTouchpointType(result); - return result; + } } public static IUpdateDescriptor createUpdateDescriptor(String id, VersionRange range, int severity, String description) { @@ -334,11 +340,9 @@ public class MetadataFactory { } private static TouchpointType getCachedTouchpointType(String id, Version version) { - synchronized (typeCache) { - for (int i = 0; i < typeCache.length; i++) { - if (typeCache[i] != null && typeCache[i].getId().equals(id) && typeCache[i].getVersion().equals(version)) - return typeCache[i]; - } + for (int i = 0; i < typeCache.length; i++) { + if (typeCache[i] != null && typeCache[i].getId().equals(id) && typeCache[i].getVersion().equals(version)) + return typeCache[i]; } return null; } diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/TouchpointType.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/TouchpointType.java index 5ad131795..6c9cd126a 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/TouchpointType.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/TouchpointType.java @@ -21,7 +21,7 @@ public class TouchpointType { * A touchpoint type indicating that the "null" touchpoint should be used. * The null touchpoint does not participate in any install phase. */ - public static final TouchpointType NONE = MetadataFactory.createTouchpointType("null", Version.emptyVersion); //$NON-NLS-1$ + public static final TouchpointType NONE = new TouchpointType("null", Version.emptyVersion); //$NON-NLS-1$ private String id;//never null private Version version;//never null |