Bug 565949 - Remove usage of deprecated new Long and new Double
constructors

Change-Id: I91933a37b055da0b4993a2c52aeedc5054e86541
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverBundle.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverBundle.java
index a92888b..5fcfddf 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverBundle.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverBundle.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2018 IBM Corporation and others.
+ * Copyright (c) 2004, 2020 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -71,7 +71,7 @@
 
 	ResolverBundle(BundleDescription bundle, ResolverImpl resolver) {
 		super(bundle);
-		this.bundleID = new Long(bundle.getBundleId());
+		this.bundleID = Long.valueOf(bundle.getBundleId());
 		this.resolver = resolver;
 		initialize(bundle.isResolved());
 	}
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java
index 6bb5d87..25af89e 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2018 IBM Corporation and others.
+ * Copyright (c) 2004, 2020 IBM Corporation and others.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License 2.0 which accompanies this distribution,
@@ -2153,7 +2153,7 @@
 	private void internalBundleRemoved(BundleDescription bundle, boolean pending) {
 		// check if there are any dependants
 		if (pending)
-			removalPending.put(new Long(bundle.getBundleId()), bundle);
+			removalPending.put(Long.valueOf(bundle.getBundleId()), bundle);
 		if (!initialized)
 			return;
 		ResolverBundle rb = bundleMapping.get(bundle);
@@ -2174,7 +2174,7 @@
 
 	private void unresolveBundle(ResolverBundle bundle, boolean removed) {
 		// check the removed list if unresolving then remove from the removed list
-		List<BundleDescription> removedBundles = removalPending.remove(new Long(bundle.getBundleDescription().getBundleId()));
+		List<BundleDescription> removedBundles = removalPending.remove(Long.valueOf(bundle.getBundleDescription().getBundleId()));
 		for (BundleDescription removedDesc : removedBundles) {
 			ResolverBundle re = bundleMapping.get(removedDesc);
 			if (re == null) {
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java
index 3665e17..0c6d04e 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2016 IBM Corporation and others.
+ * Copyright (c) 2003, 2020 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -530,7 +530,7 @@
 	}
 
 	public Object getKey() {
-		return new Long(bundleId);
+		return Long.valueOf(bundleId);
 	}
 
 	public boolean compare(KeyedElement other) {
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
index 65e4412..1735efa 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2018 IBM Corporation and others.
+ * Copyright (c) 2003, 2020 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -457,9 +457,9 @@
 
 		String trimmed = value.trim();
 		if (ATTR_TYPE_DOUBLE.equalsIgnoreCase(type))
-			return new Double(trimmed);
+			return Double.valueOf(trimmed);
 		else if (ATTR_TYPE_LONG.equalsIgnoreCase(type))
-			return new Long(trimmed);
+			return Long.valueOf(trimmed);
 		else if (ATTR_TYPE_URI.equalsIgnoreCase(type))
 			try {
 				Class<?> uriClazz = Class.forName("java.net.URI"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateImpl.java
index 5973a2c..f02fde8 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2018 IBM Corporation and others.
+ * Copyright (c) 2003, 2020 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -94,6 +94,7 @@
 	 * <tt>Dictionary</tt> object returned by the <tt>Bundle.getHeaders</tt> method.
 	 * @deprecated
 	 */
+	@Deprecated
 	public final static String PROVIDE_PACKAGE = "Provide-Package"; //$NON-NLS-1$
 
 	/**
@@ -113,6 +114,7 @@
 	 * syntax version 2 will not recognize this attribute.
 	 * @deprecated
 	 */
+	@Deprecated
 	public final static String REPROVIDE_ATTRIBUTE = "reprovide"; //$NON-NLS-1$
 
 	/**
@@ -134,6 +136,7 @@
 	 * @since 1.3 <b>EXPERIMENTAL</b>
 	 * @deprecated
 	 */
+	@Deprecated
 	public final static String OPTIONAL_ATTRIBUTE = "optional"; //$NON-NLS-1$
 
 	public static final String OSGI_RESOLVER_MODE = "osgi.resolverMode"; //$NON-NLS-1$
@@ -420,6 +423,7 @@
 	/**
 	 * @deprecated
 	 */
+	@Deprecated
 	public void resolveBundle(BundleDescription bundle, boolean status, BundleDescription[] hosts, ExportPackageDescription[] selectedExports, BundleDescription[] resolvedRequires, ExportPackageDescription[] resolvedImports) {
 		resolveBundle(bundle, status, hosts, selectedExports, null, resolvedRequires, resolvedImports);
 	}
@@ -427,6 +431,7 @@
 	/**
 	 * @deprecated
 	 */
+	@Deprecated
 	public void resolveBundle(BundleDescription bundle, boolean status, BundleDescription[] hosts, ExportPackageDescription[] selectedExports, ExportPackageDescription[] substitutedExports, BundleDescription[] resolvedRequires, ExportPackageDescription[] resolvedImports) {
 		resolveBundle(bundle, status, hosts, selectedExports, substitutedExports, null, resolvedRequires, resolvedImports, null, null);
 	}
@@ -1148,7 +1153,7 @@
 				// ask the resolver to resolve our dynamic import
 				ExportPackageDescriptionImpl result = (ExportPackageDescriptionImpl) resolver.resolveDynamicImport(importingBundle, requestedPackage);
 				if (result == null)
-					importer.setDynamicStamp(requestedPackage, new Long(getTimeStamp()));
+					importer.setDynamicStamp(requestedPackage, Long.valueOf(getTimeStamp()));
 				else {
 					importer.setDynamicStamp(requestedPackage, null); // remove any cached timestamp
 					// need to add the result to the list of resolved imports
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateReader.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateReader.java
index ddb8d41..06422cd 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateReader.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateReader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2019 IBM Corporation and others.
+ * Copyright (c) 2003, 2020 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -363,7 +363,7 @@
 			HashMap<String, Long> dynamicStamps = new HashMap<>(dynamicPkgCnt);
 			for (int i = 0; i < dynamicPkgCnt; i++) {
 				String pkg = readString(in, false);
-				Long stamp = new Long(in.readLong());
+				Long stamp = Long.valueOf(in.readLong());
 				dynamicStamps.put(pkg, stamp);
 			}
 			result.setDynamicStamps(dynamicStamps);
@@ -471,9 +471,9 @@
 			else if (type == 3)
 				value = Integer.valueOf(in.readInt());
 			else if (type == 4)
-				value = new Long(in.readLong());
+				value = Long.valueOf(in.readLong());
 			else if (type == 5)
-				value = new Double(in.readDouble());
+				value = Double.valueOf(in.readDouble());
 			else if (type == 6)
 				value = readVersion(in);
 			else if (type == 7) {
@@ -502,10 +502,10 @@
 							list.add(Integer.valueOf(in.readInt()));
 							break;
 						case 4 :
-							list.add(new Long(in.readLong()));
+							list.add(Long.valueOf(in.readLong()));
 							break;
 						case 5 :
-							list.add(new Double(in.readDouble()));
+							list.add(Double.valueOf(in.readDouble()));
 							break;
 						case 6 :
 							list.add(readVersion(in));