diff options
2 files changed, 5 insertions, 18 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/OmniVersion.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/OmniVersion.java index 5a8e349da..b5a6f6372 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/OmniVersion.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/OmniVersion.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 Cloudsmith Inc. and others. + * Copyright (c) 2009, 2016 Cloudsmith Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -62,7 +62,7 @@ public class OmniVersion extends BasicVersion { if (padValue == VersionVector.MAX_VALUE) return (BasicVersion) MAX_VERSION; } - if (vtop == 3 && padValue == null && vector.get(0) == VersionParser.ZERO_INT && vector.get(1) == VersionParser.ZERO_INT && vector.get(2) == VersionParser.ZERO_INT) + if (vtop == 3 && padValue == null && vector.get(0) == (Integer) 0 && vector.get(1) == (Integer) 0 && vector.get(2) == (Integer) 0) return (BasicVersion) emptyVersion; return new OmniVersion(vector, format, original); diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionParser.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionParser.java index 3b71bec6d..49fda092c 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionParser.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 Cloudsmith Inc. and others. + * Copyright (c) 2009, 2016 Cloudsmith Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -24,23 +24,10 @@ import org.eclipse.osgi.util.NLS; * @noextend This class is not intended to be subclassed by clients. */ public abstract class VersionParser { - public static final Integer ZERO_INT = new Integer(0); - - public static final Integer MAX_INT_OBJ = new Integer(Integer.MAX_VALUE); - - private static final Integer cache[] = new Integer[100]; - - static { - cache[0] = ZERO_INT; - for (int i = 1; i < cache.length; i++) - cache[i] = new Integer(i); - } + public static final Integer MAX_INT_OBJ = Integer.MAX_VALUE; public static Integer valueOf(int i) { - if (i >= 0 && i < cache.length) - return cache[i]; - - return (i == Integer.MAX_VALUE) ? MAX_INT_OBJ : new Integer(i); + return (i == Integer.MAX_VALUE) ? MAX_INT_OBJ : Integer.valueOf(i); } static Comparable<?> removeRedundantTrail(List<Comparable<?>> segments, Comparable<?> padValue) { |