Do not use deprecated CDataUtil.objectsEqual

Objects.equals should be used instead.

Change-Id: I6713d0d4d0fb8b13b3b336af61cdd73048839969
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
Alexander Kurtakov 2020-11-17 15:06:13 +02:00
parent dc5b05442e
commit 57fd1b2847
7 changed files with 27 additions and 25 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2016 Intel Corporation and others. * Copyright (c) 2007, 2020 Intel Corporation and others.
* *
* This program and the accompanying materials * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 * are made available under the terms of the Eclipse Public License 2.0
@ -21,6 +21,7 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
@ -270,7 +271,7 @@ public class CDataDiscoveredInfoCalculator {
if (!fExtsSet.equals(other.fExtsSet)) if (!fExtsSet.equals(other.fExtsSet))
return false; return false;
if (!CDataUtil.objectsEqual(fMaxMatchInfo, other.fMaxMatchInfo)) if (!Objects.equals(fMaxMatchInfo, other.fMaxMatchInfo))
return false; return false;
return true; return true;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2010 Intel Corporation and others. * Copyright (c) 2007, 2020 Intel Corporation and others.
* *
* This program and the accompanying materials * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 * are made available under the terms of the Eclipse Public License 2.0
@ -16,6 +16,7 @@ package org.eclipse.cdt.make.internal.core.scannerconfig;
import java.util.Arrays; import java.util.Arrays;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import org.eclipse.cdt.core.settings.model.ICSettingBase; import org.eclipse.cdt.core.settings.model.ICSettingBase;
@ -116,7 +117,7 @@ public abstract class CDataDiscoveredInfoProcessor {
} }
protected boolean langDatasMatch(CLanguageData lData1, CLanguageData lData2) { protected boolean langDatasMatch(CLanguageData lData1, CLanguageData lData2) {
if (!CDataUtil.objectsEqual(lData1.getLanguageId(), lData2.getLanguageId())) if (!Objects.equals(lData1.getLanguageId(), lData2.getLanguageId()))
return false; return false;
String[] tmp = lData1.getSourceContentTypeIds(); String[] tmp = lData1.getSourceContentTypeIds();

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2016 Intel Corporation and others. * Copyright (c) 2007, 2020 Intel Corporation and others.
* *
* This program and the accompanying materials * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 * are made available under the terms of the Eclipse Public License 2.0
@ -21,6 +21,7 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
@ -266,7 +267,7 @@ public class PerFileSettingsCalculator {
if (!fExtsSet.equals(other.fExtsSet)) if (!fExtsSet.equals(other.fExtsSet))
return false; return false;
if (!CDataUtil.objectsEqual(fMaxMatchInfo, other.fMaxMatchInfo)) if (!Objects.equals(fMaxMatchInfo, other.fMaxMatchInfo))
return false; return false;
return true; return true;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2016 Intel Corporation and others. * Copyright (c) 2007, 2020 Intel Corporation and others.
* *
* This program and the accompanying materials * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 * are made available under the terms of the Eclipse Public License 2.0
@ -14,9 +14,10 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.managedbuilder.core; package org.eclipse.cdt.managedbuilder.core;
import java.util.Objects;
import org.eclipse.cdt.core.settings.model.ICLibraryFileEntry; import org.eclipse.cdt.core.settings.model.ICLibraryFileEntry;
import org.eclipse.cdt.core.settings.model.ICStorageElement; import org.eclipse.cdt.core.settings.model.ICStorageElement;
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
import org.eclipse.cdt.internal.core.SafeStringInterner; import org.eclipse.cdt.internal.core.SafeStringInterner;
import org.eclipse.cdt.managedbuilder.internal.core.Option; import org.eclipse.cdt.managedbuilder.internal.core.Option;
@ -163,16 +164,16 @@ public final class OptionStringValue {
if (isBuiltIn != other.isBuiltIn) if (isBuiltIn != other.isBuiltIn)
return false; return false;
if (!CDataUtil.objectsEqual(value, other.value)) if (!Objects.equals(value, other.value))
return false; return false;
if (!CDataUtil.objectsEqual(srcPath, other.srcPath)) if (!Objects.equals(srcPath, other.srcPath))
return false; return false;
if (!CDataUtil.objectsEqual(srcRootPath, other.srcRootPath)) if (!Objects.equals(srcRootPath, other.srcRootPath))
return false; return false;
if (!CDataUtil.objectsEqual(srcPrefixMapping, other.srcPrefixMapping)) if (!Objects.equals(srcPrefixMapping, other.srcPrefixMapping))
return false; return false;
return true; return true;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2016 Intel Corporation and others. * Copyright (c) 2004, 2020 Intel Corporation and others.
* *
* This program and the accompanying materials * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 * are made available under the terms of the Eclipse Public License 2.0
@ -23,6 +23,7 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.SortedMap; import java.util.SortedMap;
import java.util.StringTokenizer; import java.util.StringTokenizer;
@ -408,14 +409,13 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
setCommand(builder.getCommand()); setCommand(builder.getCommand());
if (!getArgumentsAttribute().equals(builder.getArgumentsAttribute())) if (!getArgumentsAttribute().equals(builder.getArgumentsAttribute()))
setArgumentsAttribute(builder.getArgumentsAttribute()); setArgumentsAttribute(builder.getArgumentsAttribute());
if (!CDataUtil.objectsEqual(getAutoBuildTargetAttribute(), builder.getAutoBuildTargetAttribute())) { if (!Objects.equals(getAutoBuildTargetAttribute(), builder.getAutoBuildTargetAttribute())) {
autoBuildTarget = builder.getAutoBuildTargetAttribute(); autoBuildTarget = builder.getAutoBuildTargetAttribute();
} }
if (!CDataUtil.objectsEqual(getIncrementalBuildTargetAttribute(), if (!Objects.equals(getIncrementalBuildTargetAttribute(), builder.getIncrementalBuildTargetAttribute())) {
builder.getIncrementalBuildTargetAttribute())) {
incrementalBuildTarget = builder.getIncrementalBuildTargetAttribute(); incrementalBuildTarget = builder.getIncrementalBuildTargetAttribute();
} }
if (!CDataUtil.objectsEqual(getCleanBuildTargetAttribute(), builder.getCleanBuildTargetAttribute())) { if (!Objects.equals(getCleanBuildTargetAttribute(), builder.getCleanBuildTargetAttribute())) {
cleanBuildTarget = builder.getCleanBuildTargetAttribute(); cleanBuildTarget = builder.getCleanBuildTargetAttribute();
} }
} }
@ -425,7 +425,6 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
/* public Builder(IToolChain parent, String Id, String name, Builder builder, ICStorageElement el) { /* public Builder(IToolChain parent, String Id, String name, Builder builder, ICStorageElement el) {
this(parent, Id, name, builder); this(parent, Id, name, builder);
loadFromProject(el); loadFromProject(el);
} }
*/ */
@ -1850,7 +1849,6 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
String path = getBuildPathAttribute(); String path = getBuildPathAttribute();
if(path == null) if(path == null)
return true; return true;
if(isWorkspaceBuildPath == null){ if(isWorkspaceBuildPath == null){
if(superClass != null) if(superClass != null)
return superClass.isWorkspaceBuildPath(); return superClass.isWorkspaceBuildPath();

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2016 Intel Corporation and others. * Copyright (c) 2004, 2020 Intel Corporation and others.
* *
* This program and the accompanying materials * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 * are made available under the terms of the Eclipse Public License 2.0
@ -22,6 +22,7 @@ import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.SortedMap; import java.util.SortedMap;
import java.util.StringTokenizer; import java.util.StringTokenizer;
@ -2646,7 +2647,7 @@ public class ToolChain extends HoldsOptions
} }
void setUnusedChildren(String children) { void setUnusedChildren(String children) {
if (CDataUtil.objectsEqual(unusedChildren, children)) if (Objects.equals(unusedChildren, children))
return; return;
unusedChildrenSet = null; unusedChildrenSet = null;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2016 Intel Corporation and others. * Copyright (c) 2007, 2020 Intel Corporation and others.
* *
* This program and the accompanying materials * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 * are made available under the terms of the Eclipse Public License 2.0
@ -18,6 +18,7 @@ import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.extension.CLanguageData; import org.eclipse.cdt.core.settings.model.extension.CLanguageData;
@ -145,7 +146,6 @@ public class BuildLanguageData extends CLanguageData {
optValue = buf.toString(); optValue = buf.toString();
} }
return optValue; return optValue;
} }
*/ */
@Override @Override
@ -316,13 +316,12 @@ public class BuildLanguageData extends CLanguageData {
/* private IOption[] getOptionsForType(int type){ /* private IOption[] getOptionsForType(int type){
Map map = getTypeToOptionArrayMap(); Map map = getTypeToOptionArrayMap();
return (IOption[])map.get(Integer.valueOf(type)); return (IOption[])map.get(Integer.valueOf(type));
} }
*/ */
@Override @Override
public void setLanguageId(String id) { public void setLanguageId(String id) {
if (CDataUtil.objectsEqual(id, fInputType.getLanguageId(fTool))) { if (Objects.equals(id, fInputType.getLanguageId(fTool))) {
// fInputType = fTool.getEdtableInputType(fInputType); // fInputType = fTool.getEdtableInputType(fInputType);
obtainEditableInputType(); obtainEditableInputType();
fInputType.setLanguageIdAttribute(id); fInputType.setLanguageIdAttribute(id);