diff options
author | Alexander Kurtakov | 2018-01-30 18:36:31 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-01-30 18:36:31 +0000 |
commit | 263e9c737fb38f45777ac83a924f151d97826394 (patch) | |
tree | b86698b7276f4387f40238ef800d4fac539f0438 /bundles | |
parent | 8d990a7a055c3b929818fb4cb3b8cc5525b75b52 (diff) | |
download | rt.equinox.p2-263e9c737fb38f45777ac83a924f151d97826394.tar.gz rt.equinox.p2-263e9c737fb38f45777ac83a924f151d97826394.tar.xz rt.equinox.p2-263e9c737fb38f45777ac83a924f151d97826394.zip |
Bug 530526 - Don't use deprecated Number children constructors
Deprecated in Java 9 but the replacment methods are here for long time.
Change-Id: I645d66492831a95d27f61bc443c8896d73440579
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles')
12 files changed, 29 insertions, 29 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java index 4e87c3fe5..73fb34692 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2017 IBM Corporation and others. + * Copyright (c) 2008, 2018 IBM Corporation 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 @@ -239,7 +239,7 @@ public class MirrorSelector { // similarities from o1 to Q and o2 to Q (where q=query) double sim1 = dp_1 / (qel * o1_el); double sim2 = dp_2 / (qel * o2_el); - return new Double(sim2).compareTo(new Double(sim1)); + return Double.valueOf(sim2).compareTo(Double.valueOf(sim1)); } } diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java index 75f3761bc..9053227f2 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. + * Copyright (c) 2007, 2018 IBM Corporation 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 @@ -659,7 +659,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme int bufferSize = 16 * 1024; byte[] buffer = new byte[bufferSize]; // Number of passes in the below loop, convert to integer which is needed in monitor conversion below - int expected_loops = new Double(in.length() / bufferSize).intValue() + 1; // +1: also count the initial run + int expected_loops = Double.valueOf(in.length() / bufferSize).intValue() + 1; // +1: also count the initial run SubMonitor sub = SubMonitor.convert(monitor, Messages.downloading + in.getName(), expected_loops); // Be optimistic about the outcome of this... IStatus status = new DownloadStatus(IStatus.OK, Activator.ID, Status.OK_STATUS.getMessage()); diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java index 03be85e9a..02d7c8ed5 100644 --- a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java +++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. All rights reserved. This + * Copyright (c) 2007, 2018 IBM Corporation 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 http://www.eclipse.org/legal/epl-v10.html @@ -466,7 +466,7 @@ public class ProvCommandProvider implements CommandProvider { interpreter.println(profileId); for (int i = 0; i < profileTimestamps.length; i++) { interpreter.print("\t"); //$NON-NLS-1$ - interpreter.println(new Long(profileTimestamps[i])); + interpreter.println(Long.valueOf(profileTimestamps[i])); } } @@ -481,7 +481,7 @@ public class ProvCommandProvider implements CommandProvider { } Long ts = null; try { - ts = new Long(timestamp); + ts = Long.valueOf(timestamp); } catch (NumberFormatException e) { interpreter.println("Timestamp " + timestamp + " not valid. Timestamps can be retrieved via 'provlpts' command."); return; diff --git a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java index 03de3cbdf..4409ba564 100644 --- a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java +++ b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. + * Copyright (c) 2007, 2018 IBM Corporation 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 @@ -303,7 +303,7 @@ public class DirectorApplication implements IApplication, ProvisioningListener { return null; } Properties properties = new Properties(); - try (InputStream input = new BufferedInputStream(new FileInputStream(file))){ + try (InputStream input = new BufferedInputStream(new FileInputStream(file))) { properties.load(input); } catch (IOException e) { logFailure(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.Problem_loading_file, file.getAbsolutePath()), e)); @@ -1114,7 +1114,7 @@ public class DirectorApplication implements IApplication, ProvisioningListener { performPrintTags(); if (purgeRegistry) purgeRegistry(); - printMessage(NLS.bind(Messages.Operation_complete, new Long(System.currentTimeMillis() - time))); + printMessage(NLS.bind(Messages.Operation_complete, Long.valueOf(System.currentTimeMillis() - time))); } return IApplication.EXIT_OK; } catch (CoreException e) { diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java index 23a93369c..63a551e6f 100644 --- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java +++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. + * Copyright (c) 2007, 2018 IBM Corporation 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 @@ -271,7 +271,7 @@ public class RepositoryListener extends DirectoryChangeListener { } } else { File iuFile = new File(filename); - Long iuLastModified = new Long(iu.getProperty(FILE_LAST_MODIFIED)); + Long iuLastModified = Long.valueOf(iu.getProperty(FILE_LAST_MODIFIED)); currentFiles.put(iuFile, iuLastModified); } } diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java index c6d31687d..294492642 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2017 Cloudsmith Inc. and others. + * Copyright (c) 2010, 2018 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 @@ -168,7 +168,7 @@ public abstract class CoercingComparator<T> { if (v instanceof Long) return (Long) v; if (v instanceof Number) - return new Long(((Number) v).longValue()); + return Long.valueOf(((Number) v).longValue()); if (v instanceof String) { try { return Long.valueOf(((String) v).trim()); diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/ProgressStatistics.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/ProgressStatistics.java index 8db17a7b2..4c4be1c3a 100644 --- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/ProgressStatistics.java +++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/ProgressStatistics.java @@ -111,7 +111,7 @@ public class ProgressStatistics { removeObsoleteRecentSpeedData(getDuration() / SPEED_RESOLUTION); long dur = 0L; long amount = 0L; - SortedMap<Long, Long> relevantData = m_recentSpeedMap.headMap(new Long(m_recentSpeedMapKey)); + SortedMap<Long, Long> relevantData = m_recentSpeedMap.headMap(Long.valueOf(m_recentSpeedMapKey)); if (!relevantData.isEmpty()) { for (Long rl : relevantData.values()) { @@ -176,13 +176,13 @@ public class ProgressStatistics { } synchronized private void registerRecentSpeed(long key, long inc) { - Long keyL = new Long(key); + Long keyL = Long.valueOf(key); Long currentValueL = m_recentSpeedMap.get(keyL); long currentValue = 0L; if (currentValueL != null) currentValue = currentValueL.longValue(); - m_recentSpeedMap.put(keyL, new Long(inc + currentValue)); + m_recentSpeedMap.put(keyL, Long.valueOf(inc + currentValue)); if (m_recentSpeedMapKey != key) { m_recentSpeedMapKey = key; @@ -192,6 +192,6 @@ public class ProgressStatistics { synchronized private void removeObsoleteRecentSpeedData(long lastKey) { long threshold = lastKey - SPEED_INTERVAL / SPEED_RESOLUTION; - m_recentSpeedMap.headMap(new Long(threshold)).clear(); + m_recentSpeedMap.headMap(Long.valueOf(threshold)).clear(); } } diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/MarkStartedAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/MarkStartedAction.java index e0f69eb59..73394d4eb 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/MarkStartedAction.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/MarkStartedAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 IBM Corporation and others. + * Copyright (c) 2008, 2018 IBM Corporation 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 @@ -43,7 +43,7 @@ public class MarkStartedAction extends ProvisioningAction { return Status.OK_STATUS; } - getMemento().put(ActionConstants.PARM_PREVIOUS_STARTED, new Boolean(bundleInfo.isMarkedAsStarted())); + getMemento().put(ActionConstants.PARM_PREVIOUS_STARTED, Boolean.valueOf(bundleInfo.isMarkedAsStarted())); bundleInfo.setMarkedAsStarted(Boolean.valueOf(started).booleanValue()); return Status.OK_STATUS; } diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetStartLevelAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetStartLevelAction.java index ae9c58bbb..cc315429d 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetStartLevelAction.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetStartLevelAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2016 IBM Corporation and others. + * Copyright (c) 2008, 2018 IBM Corporation 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 @@ -43,7 +43,7 @@ public class SetStartLevelAction extends ProvisioningAction { return Status.OK_STATUS; } - getMemento().put(ActionConstants.PARM_PREVIOUS_START_LEVEL, new Integer(bundleInfo.getStartLevel())); + getMemento().put(ActionConstants.PARM_PREVIOUS_START_LEVEL, Integer.valueOf(bundleInfo.getStartLevel())); try { bundleInfo.setStartLevel(Integer.parseInt(startLevel)); return Status.OK_STATUS; diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/BackupStore.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/BackupStore.java index 482de70ba..de5207860 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/BackupStore.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/BackupStore.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2017 Cloudsmith Inc. and others. + * Copyright (c) 2009, 2018 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 @@ -531,9 +531,9 @@ public class BackupStore implements IBackupStore { // check external tampering with backup store if (backupCounter != restoreCounter) { if (!fullyRestored) - logError(NLS.bind(Messages.BackupStore_0_of_1_items_restored, new Long(restoreCounter), new Long(backupCounter))); + logError(NLS.bind(Messages.BackupStore_0_of_1_items_restored, Long.valueOf(restoreCounter), Long.valueOf(backupCounter))); else { - logError(NLS.bind(Messages.BackupStore_externally_modified_0_of_1_restored, new Long(restoreCounter), new Long(backupCounter))); + logError(NLS.bind(Messages.BackupStore_externally_modified_0_of_1_restored, Long.valueOf(restoreCounter), Long.valueOf(backupCounter))); fullyRestored = false; } } diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SizeComputingWizardPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SizeComputingWizardPage.java index 5066f9003..3b1c582d8 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SizeComputingWizardPage.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SizeComputingWizardPage.java @@ -101,9 +101,9 @@ public abstract class SizeComputingWizardPage extends ResolutionResultsWizardPag return ProvUIMessages.IUDetailsLabelProvider_Unknown; if (size > 1000L) { long kb = size / 1000L; - return NLS.bind(ProvUIMessages.IUDetailsLabelProvider_KB, NumberFormat.getInstance().format(new Long(kb))); + return NLS.bind(ProvUIMessages.IUDetailsLabelProvider_KB, NumberFormat.getInstance().format(Long.valueOf(kb))); } - return NLS.bind(ProvUIMessages.IUDetailsLabelProvider_Bytes, NumberFormat.getInstance().format(new Long(size))); + return NLS.bind(ProvUIMessages.IUDetailsLabelProvider_Bytes, NumberFormat.getInstance().format(Long.valueOf(size))); } @Override diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDetailsLabelProvider.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDetailsLabelProvider.java index cf0c41dc6..b024d381c 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDetailsLabelProvider.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDetailsLabelProvider.java @@ -194,9 +194,9 @@ public class IUDetailsLabelProvider extends ColumnLabelProvider implements ITabl return ProvUIMessages.IUDetailsLabelProvider_Unknown; if (size > 1000L) { long kb = size / 1000L; - return NLS.bind(ProvUIMessages.IUDetailsLabelProvider_KB, NumberFormat.getInstance().format(new Long(kb))); + return NLS.bind(ProvUIMessages.IUDetailsLabelProvider_KB, NumberFormat.getInstance().format(Long.valueOf(kb))); } - return NLS.bind(ProvUIMessages.IUDetailsLabelProvider_Bytes, NumberFormat.getInstance().format(new Long(size))); + return NLS.bind(ProvUIMessages.IUDetailsLabelProvider_Bytes, NumberFormat.getInstance().format(Long.valueOf(size))); } public void setToolTipProperty(String propertyName) { |