diff options
| author | Mickael Istria | 2019-05-16 12:04:14 +0000 |
|---|---|---|
| committer | Mickael Istria | 2019-05-16 13:58:10 +0000 |
| commit | 4e383f8f0575316f03a23c7d2c43e615a33fa254 (patch) | |
| tree | 81b8eaaa3847a83e7b0850883cf3ee60120f0425 | |
| parent | 692f123e414689230630b1e173746cfd25e04686 (diff) | |
| download | eclipse.platform.ui-4e383f8f0575316f03a23c7d2c43e615a33fa254.tar.gz eclipse.platform.ui-4e383f8f0575316f03a23c7d2c43e615a33fa254.tar.xz eclipse.platform.ui-4e383f8f0575316f03a23c7d2c43e615a33fa254.zip | |
Bug 546994 - Fix usage of Objects.equals -> Arrays.equalsI20190516-1200I20190516-1055
Change-Id: I24df193b8c3ce086d552e2ce61b5d16131b1d184
Signed-off-by: Mickael Istria <mistria@redhat.com>
5 files changed, 12 insertions, 25 deletions
diff --git a/bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/Command.java b/bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/Command.java index 2e30c207bf5..071517e4e6d 100644 --- a/bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/Command.java +++ b/bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/Command.java @@ -367,7 +367,7 @@ public final class Command extends NamedHandleObjectWithState implements Compara final boolean categoryChanged = !Objects.equals(this.category, category); this.category = category; - final boolean parametersChanged = !Objects.equals(this.parameters, + final boolean parametersChanged = !Arrays.equals(this.parameters, parameters); this.parameters = parameters; diff --git a/bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ParameterizedCommand.java b/bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ParameterizedCommand.java index 4430ba394d5..31aa1c90eb6 100644 --- a/bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ParameterizedCommand.java +++ b/bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ParameterizedCommand.java @@ -431,11 +431,8 @@ public final class ParameterizedCommand implements Comparable { } final ParameterizedCommand command = (ParameterizedCommand) object; - if (!Objects.equals(this.command, command.command)) { - return false; - } - - return Objects.equals(this.parameterizations, command.parameterizations); + return Objects.equals(this.command, command.command) + && Arrays.equals(this.parameterizations, command.parameterizations); } /** diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AggregateWorkingSet.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AggregateWorkingSet.java index 8aa7c19f0af..4497ccf4eca 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AggregateWorkingSet.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AggregateWorkingSet.java @@ -270,7 +270,7 @@ public class AggregateWorkingSet extends AbstractWorkingSet implements IAggregat AggregateWorkingSet workingSet = (AggregateWorkingSet) object; return Objects.equals(workingSet.getName(), getName()) - && Objects.equals(workingSet.getComponentsInternal(), getComponentsInternal()); + && Arrays.equals(workingSet.getComponentsInternal(), getComponentsInternal()); } return false; } diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java index 709dff84066..51a4446bf29 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java @@ -39,7 +39,6 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.Objects; import java.util.StringTokenizer; import org.eclipse.core.commands.common.EventManager; import org.eclipse.core.runtime.IConfigurationElement; @@ -112,7 +111,7 @@ public class EditorRegistry extends EventManager implements IEditorRegistry, IEx /** * Return the objects related to the filename - * + * * @param fileName * @return the objects related to the filename */ @@ -176,7 +175,7 @@ public class EditorRegistry extends EventManager implements IEditorRegistry, IEx /** * Return an instance of the receiver. Adds listeners into the extension * registry for dynamic UI purposes. - * + * * @param contentTypeManager */ public EditorRegistry(IContentTypeManager contentTypeManager) { @@ -456,7 +455,7 @@ public class EditorRegistry extends EventManager implements IEditorRegistry, IEx * if they access any of the images held by these editors that they also dispose * them * </p> - * + * * @return the editor descriptors */ public IEditorDescriptor[] getSortedEditorsFromOS() { @@ -1695,17 +1694,8 @@ class MockMapping implements IFileEditorMapping { } MockMapping mapping = (MockMapping) obj; - if (!this.filename.equals(mapping.filename)) { - return false; - } - - if (!this.extension.equals(mapping.extension)) { - return false; - } - - if (!Objects.equals(this.getEditors(), mapping.getEditors())) { - return false; - } - return Objects.equals(this.getDeletedEditors(), mapping.getDeletedEditors()); + return this.filename.equals(mapping.filename) && this.extension.equals(mapping.extension) + && Arrays.equals(this.getEditors(), mapping.getEditors()) + && Arrays.equals(this.getDeletedEditors(), mapping.getDeletedEditors()); } } diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/ActionSetSourceProvider.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/ActionSetSourceProvider.java index 9bad956f4ae..b32310c62f0 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/ActionSetSourceProvider.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/ActionSetSourceProvider.java @@ -14,9 +14,9 @@ package org.eclipse.ui.internal.services; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import java.util.Objects; import org.eclipse.ui.AbstractSourceProvider; import org.eclipse.ui.ISources; import org.eclipse.ui.internal.ActionSetsEvent; @@ -54,7 +54,7 @@ public final class ActionSetSourceProvider extends AbstractSourceProvider implem @Override public void actionSetsChanged(final ActionSetsEvent event) { final IActionSetDescriptor[] newActionSets = event.getNewActionSets(); - if (!Objects.equals(newActionSets, activeActionSets)) { + if (!Arrays.equals(newActionSets, activeActionSets)) { if (DEBUG) { final StringBuilder message = new StringBuilder(); message.append("Action sets changed to ["); //$NON-NLS-1$ |
