mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup (inlines and deprecates pointless wrapper)
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.debugger.settings;
|
||||
|
||||
import com.intellij.openapi.components.PersistentStateComponent;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.components.State;
|
||||
import com.intellij.openapi.components.Storage;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.ui.classFilter.ClassFilter;
|
||||
import com.intellij.util.xmlb.annotations.XCollection;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@State(name = "TraceSettings", storages = @Storage("debugger.xml"))
|
||||
public class TraceSettings implements PersistentStateComponent<TraceSettings> {
|
||||
private ClassFilter[] myClassFilters;
|
||||
@@ -30,7 +31,7 @@ public class TraceSettings implements PersistentStateComponent<TraceSettings> {
|
||||
if ((a == null || a.length == 0) && (b == null || b.length == 0)) {
|
||||
return true;
|
||||
}
|
||||
return Comparing.equal(a, b);
|
||||
return Arrays.equals(a, b);
|
||||
}
|
||||
|
||||
@XCollection(propertyElementName = "class-exclusion-filters")
|
||||
|
||||
+4
-3
@@ -1,8 +1,7 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.java.debugger.breakpoints.properties;
|
||||
|
||||
import com.intellij.debugger.InstanceFilter;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.ui.classFilter.ClassFilter;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.xmlb.annotations.OptionTag;
|
||||
@@ -11,6 +10,8 @@ import com.intellij.xdebugger.breakpoints.XBreakpointProperties;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author egor
|
||||
*/
|
||||
@@ -68,7 +69,7 @@ public class JavaBreakpointProperties<T extends JavaBreakpointProperties> extend
|
||||
if ((a == null || a.length == 0) && (b == null || b.length == 0)) {
|
||||
return true;
|
||||
}
|
||||
return Comparing.equal(a, b);
|
||||
return Arrays.equals(a, b);
|
||||
}
|
||||
|
||||
@XCollection(propertyElementName = "class-exclusion-filters")
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package com.intellij.profile.codeInspection.ui;
|
||||
|
||||
@@ -1008,7 +1008,7 @@ public class SingleInspectionProfilePanel extends JPanel {
|
||||
if (myProfile.isChanged()) return true;
|
||||
if (myProfile.getSource().isProjectLevel() != myProfile.isProjectLevel()) return true;
|
||||
if (!Comparing.strEqual(myProfile.getSource().getName(), myProfile.getName())) return true;
|
||||
if (!Comparing.equal(myInitialScopesOrder, myProfile.getScopesOrder())) return true;
|
||||
if (!Arrays.equals(myInitialScopesOrder, myProfile.getScopesOrder())) return true;
|
||||
return descriptorsAreChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,25 +1,10 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ui.treeStructure;
|
||||
|
||||
import com.intellij.ide.projectView.PresentationData;
|
||||
import com.intellij.ide.util.treeView.NodeDescriptor;
|
||||
import com.intellij.ide.util.treeView.PresentableNodeDescriptor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.ui.JBColor;
|
||||
import com.intellij.ui.SimpleTextAttributes;
|
||||
@@ -34,6 +19,7 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class SimpleNode extends PresentableNodeDescriptor implements ComparableObject, LeafState.Supplier {
|
||||
@@ -109,8 +95,8 @@ public abstract class SimpleNode extends PresentableNodeDescriptor implements Co
|
||||
myName = getName();
|
||||
presentation.setPresentableText(myName);
|
||||
|
||||
presentation.setChanged(!Comparing.equal(new Object[]{getIcon(), myName, oldFragments, myColor},
|
||||
new Object[]{oldIcon, oldName, oldFragments, oldColor}));
|
||||
presentation.setChanged(!Arrays.equals(new Object[]{getIcon(), myName, oldFragments, myColor},
|
||||
new Object[]{oldIcon, oldName, oldFragments, oldColor}));
|
||||
|
||||
presentation.setForcedTextForeground(myColor);
|
||||
presentation.setIcon(getIcon());
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.keymap.impl.ui;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -319,7 +305,7 @@ public class ActionsTree {
|
||||
|
||||
Shortcut[] oldShortcuts = oldKeymap.getShortcuts(actionId);
|
||||
Shortcut[] newShortcuts = newKeymap.getShortcuts(actionId);
|
||||
return !Comparing.equal(oldShortcuts, newShortcuts);
|
||||
return !Arrays.equals(oldShortcuts, newShortcuts);
|
||||
}
|
||||
|
||||
private static boolean isGroupChanged(Group group, Keymap oldKeymap, Keymap newKeymap) {
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.roots.impl;
|
||||
|
||||
import com.intellij.openapi.module.Module;
|
||||
@@ -28,6 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class OrderEntryUtil {
|
||||
@@ -121,7 +108,7 @@ public class OrderEntryUtil {
|
||||
if (library2.getTable() != null) return false;
|
||||
|
||||
for (OrderRootType type : OrderRootType.getAllTypes()) {
|
||||
if (!Comparing.equal(library1.getUrls(type), library2.getUrls(type))) {
|
||||
if (!Arrays.equals(library1.getUrls(type), library2.getUrls(type))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ public class TaskUtil {
|
||||
if (!Comparing.equal(t1.getCreated(), t2.getCreated())) return false;
|
||||
if (!Comparing.equal(t1.getUpdated(), t2.getUpdated())) return false;
|
||||
if (!Comparing.equal(t1.getIssueUrl(), t2.getIssueUrl())) return false;
|
||||
if (!Comparing.equal(t1.getComments(), t2.getComments())) return false;
|
||||
if (!Arrays.equals(t1.getComments(), t2.getComments())) return false;
|
||||
if (!Comparing.equal(t1.getIcon(), t2.getIcon())) return false;
|
||||
if (!Comparing.equal(t1.getCustomIcon(), t2.getCustomIcon())) return false;
|
||||
return Comparing.equal(t1.getRepository(), t2.getRepository());
|
||||
|
||||
@@ -31,12 +31,9 @@ public class Comparing {
|
||||
return arg1.equals(arg2);
|
||||
}
|
||||
|
||||
@Contract(value = "null,!null -> false; !null,null -> false; null,null -> true", pure = true)
|
||||
/** @deprecated same as {@link Arrays#equals(Object[], Object[])} */
|
||||
@Deprecated
|
||||
public static <T> boolean equal(@Nullable T[] arr1, @Nullable T[] arr2) {
|
||||
if (arr1 == null || arr2 == null) {
|
||||
//noinspection ArrayEquality
|
||||
return arr1 == arr2;
|
||||
}
|
||||
return Arrays.equals(arr1, arr2);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,7 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.util.ui;
|
||||
|
||||
import com.intellij.openapi.ui.GraphicsConfig;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.ui.Gray;
|
||||
import com.intellij.ui.JBColor;
|
||||
import com.intellij.ui.paint.RectanglePainter;
|
||||
@@ -113,7 +98,7 @@ public class ColorsIcon extends ColorIcon {
|
||||
|
||||
if (getIconWidth() != icon.getIconWidth()) return false;
|
||||
if (getIconHeight() != icon.getIconHeight()) return false;
|
||||
if (!Comparing.equal(myColors, icon.myColors)) return false;
|
||||
if (!Arrays.equals(myColors, icon.myColors)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package com.intellij.openapi.vcs.changes.ui;
|
||||
|
||||
import com.intellij.openapi.options.Configurable;
|
||||
import com.intellij.openapi.options.SearchableConfigurable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.vcs.VcsBundle;
|
||||
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl;
|
||||
import com.intellij.openapi.vcs.changes.IgnoreSettingsType;
|
||||
@@ -19,6 +18,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -110,7 +110,7 @@ public class IgnoredSettingsPanel implements SearchableConfigurable, Configurabl
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return !Comparing.equal(myChangeListManager.getFilesToIgnore(), getItems());
|
||||
return !Arrays.equals(myChangeListManager.getFilesToIgnore(), getItems());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
-4
@@ -1,8 +1,7 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.plugins.groovy.lang.psi.impl.signatures;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -11,6 +10,8 @@ import org.jetbrains.plugins.groovy.lang.psi.api.signatures.GrSignature;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.types.GrClosureParameter;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.TypesUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Maxim.Medvedev
|
||||
*/
|
||||
@@ -96,8 +97,8 @@ public class GrImmediateClosureSignatureImpl implements GrSignature {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof GrSignature) {
|
||||
return Comparing.equal(myParameters, ((GrSignature)obj).getParameters()) &&
|
||||
Comparing.equal(myIsVarargs, ((GrSignature)obj).isVarargs());
|
||||
return Arrays.equals(myParameters, ((GrSignature)obj).getParameters()) &&
|
||||
myIsVarargs == ((GrSignature)obj).isVarargs();
|
||||
}
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
@@ -622,6 +622,7 @@ public class JUnitConfiguration extends JavaTestConfigurationWithDiscoverySuppor
|
||||
private Map<String, String> myEnvs = new LinkedHashMap<>();
|
||||
private String myChangeList = "All";
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object object) {
|
||||
if (!(object instanceof Data)) return false;
|
||||
final Data second = (Data)object;
|
||||
@@ -636,12 +637,13 @@ public class JUnitConfiguration extends JavaTestConfigurationWithDiscoverySuppor
|
||||
Comparing.equal(FORK_MODE, second.FORK_MODE) &&
|
||||
Comparing.equal(DIR_NAME, second.DIR_NAME) &&
|
||||
Comparing.equal(CATEGORY_NAME, second.CATEGORY_NAME) &&
|
||||
Comparing.equal(UNIQUE_ID, second.UNIQUE_ID) &&
|
||||
Arrays.equals(UNIQUE_ID, second.UNIQUE_ID) &&
|
||||
Comparing.equal(TAGS, second.TAGS) &&
|
||||
Comparing.equal(REPEAT_MODE, second.REPEAT_MODE) &&
|
||||
REPEAT_COUNT == second.REPEAT_COUNT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Comparing.hashcode(TEST_OBJECT) ^
|
||||
Comparing.hashcode(getMainClassName()) ^
|
||||
|
||||
+3
-2
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.designer.propertyTable;
|
||||
|
||||
import com.intellij.designer.DesignerBundle;
|
||||
@@ -25,6 +25,7 @@ import javax.swing.event.ListSelectionListener;
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Alexander Lobas
|
||||
@@ -127,7 +128,7 @@ public final class PropertyTablePanel extends JPanel implements ListSelectionLis
|
||||
|
||||
public void setArea(@Nullable DesignerEditorPanel designer, @Nullable EditableArea area) {
|
||||
PropertyTableTab[] tabs = designer == null ? null : designer.getPropertyTableTabs();
|
||||
if (!Comparing.equal(myTabs, tabs)) {
|
||||
if (!Arrays.equals(myTabs, tabs)) {
|
||||
myTabs = tabs;
|
||||
myTabPanel.removeAll();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user