Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

import org.eclipse.jdt.core.dom.Expression;

import org.apache.commons.lang3.ArrayUtils;

import java.util.Objects;

/**
Expand Down Expand Up @@ -80,7 +78,7 @@ public boolean equals(Object obj) {
}
//
if (obj instanceof GenericPropertyComposite property) {
return ArrayUtils.isEquals(m_properties, property.m_properties);
return Objects.deepEquals(m_properties, property.m_properties);
}
//
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -189,7 +189,7 @@ static void addPreviousTypeName(JavaInfo component, String typeName) throws Core
String[] typeNames = getPreviousTypeNames(component);
// move element into head
typeNames = ArrayUtils.removeElement(typeNames, typeName);
typeNames = ArrayUtils.add(typeNames, 0, typeName);
typeNames = ArrayUtils.insert(0, typeNames, typeName);
// limit history size
if (typeNames.length > MAX_PREVIOUS_FACTORIES) {
typeNames = ArrayUtils.remove(typeNames, typeNames.length - 1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -14,10 +14,11 @@

import org.eclipse.wb.tests.designer.core.eval.AbstractEngineTest;

import org.apache.commons.lang3.ArrayUtils;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.Objects;

/**
* @author scheglov_ke
*/
Expand Down Expand Up @@ -50,12 +51,6 @@ public void _test_exit() throws Exception {
// Array
//
////////////////////////////////////////////////////////////////////////////
@Test
public void test_array_compare() throws Exception {
int[] a_1 = new int[]{1, 2, 3};
int[] a_2 = new int[]{1, 2, 3};
assertTrue(ArrayUtils.isEquals(a_1, a_2));
}
Comment on lines -53 to -58
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No clue why we test the correctness of commons-lang...


@Test
public void test_array_int_1() throws Exception {
Expand Down Expand Up @@ -160,6 +155,6 @@ public void test_arrayElement_1() throws Exception {
//
////////////////////////////////////////////////////////////////////////////
private void check_array(Object expected, String expression, String returnType) throws Exception {
assertTrue(ArrayUtils.isEquals(expected, evaluateExpression(expression, returnType)));
assertTrue(Objects.deepEquals(expected, evaluateExpression(expression, returnType)));
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -28,7 +28,6 @@
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;

import org.apache.commons.lang3.ArrayUtils;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mockito.InOrder;
Expand Down Expand Up @@ -379,7 +378,7 @@ public void invoke(ObjectInfo _parent, ObjectInfo _child) {
parent.addChild(child_1);
parent.addChild(child_2);
// test children and parent
assertTrue(ArrayUtils.isEquals(new Object[]{child_1, child_2}, parent.getChildren().toArray()));
assertArrayEquals(new Object[] { child_1, child_2 }, parent.getChildren().toArray());
assertSame(parent, child_1.getParent());
assertSame(parent, child_2.getParent());
// check getChildren(Class)
Expand Down Expand Up @@ -411,9 +410,7 @@ public void test_addChild_2() throws Exception {
parent.addChild(child_1);
parent.addChild(child_2);
parent.addChild(child_3, child_2);
assertTrue(ArrayUtils.isEquals(
new Object[]{child_1, child_3, child_2},
parent.getChildren().toArray()));
assertArrayEquals(new Object[] { child_1, child_3, child_2 }, parent.getChildren().toArray());
assertSame(parent, child_1.getParent());
assertSame(parent, child_2.getParent());
assertSame(parent, child_3.getParent());
Expand Down Expand Up @@ -471,9 +468,7 @@ public void childMoveAfter(ObjectInfo _parent,
{
buffer.setLength(0);
parent.moveChild(child_3, child_1);
assertTrue(ArrayUtils.isEquals(
new Object[]{child_3, child_1, child_2},
parent.getChildren().toArray()));
assertArrayEquals(new Object[] { child_3, child_1, child_2 }, parent.getChildren().toArray());
assertEquals(
getSourceDQ(
"childMoveBefore parent child_3 child_1",
Expand All @@ -484,9 +479,7 @@ public void childMoveAfter(ObjectInfo _parent,
{
buffer.setLength(0);
parent.moveChild(child_1, null);
assertTrue(ArrayUtils.isEquals(
new Object[]{child_3, child_2, child_1},
parent.getChildren().toArray()));
assertArrayEquals(new Object[] { child_3, child_2, child_1 }, parent.getChildren().toArray());
assertEquals(
getSourceDQ("childMoveBefore parent child_1 null", "childMoveAfter parent child_1 null"),
buffer.toString());
Expand All @@ -507,7 +500,7 @@ public void test_moveChild_beforeItself() throws Exception {
parent.addChild(child_2);
// do move
parent.moveChild(child_2, child_2);
assertTrue(ArrayUtils.isEquals(new Object[]{child_1, child_2}, parent.getChildren().toArray()));
assertArrayEquals(new Object[] { child_1, child_2 }, parent.getChildren().toArray());
}

////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jface.preference.FieldEditor;

import org.apache.commons.lang3.ArrayUtils;
import org.junit.jupiter.api.Test;

import javax.swing.JButton;
Expand Down Expand Up @@ -391,11 +390,11 @@ public void test_constructorParameterEditor() throws Exception {
assertEquals("scrollbars", subProperties[3].getTitle());
// check that last property has static field editor
StaticFieldPropertyEditor editor = (StaticFieldPropertyEditor) subProperties[3].getEditor();
assertTrue(ArrayUtils.isEquals(new String[]{
assertArrayEquals(new String[]{
"SCROLLBARS_BOTH",
"SCROLLBARS_VERTICAL_ONLY",
"SCROLLBARS_HORIZONTAL_ONLY",
"SCROLLBARS_NONE"}, getFieldValue(editor, "m_titles")));
"SCROLLBARS_NONE" }, (String[]) getFieldValue(editor, "m_titles"));
}

////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -25,7 +25,6 @@
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;

import org.apache.commons.lang3.ArrayUtils;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -234,7 +233,7 @@ private void assertConfiguration(StaticFieldPropertyEditor editor,
assertEquals(e_classSourceName, getFieldValue(editor, "m_classSourceName"));
Assertions.<Object>assertThat((String[]) getFieldValue(editor, "m_names")).containsOnly(e_names);
Assertions.<Object>assertThat((String[]) getFieldValue(editor, "m_titles")).containsOnly(e_titles);
assertTrue(ArrayUtils.isEquals(e_values, getFieldValue(editor, "m_values")));
assertArrayEquals(e_values, (Object[]) getFieldValue(editor, "m_values"));
}

////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -18,7 +18,6 @@
import org.eclipse.wb.internal.swing.model.component.ContainerInfo;
import org.eclipse.wb.tests.designer.swing.SwingModelTest;

import org.apache.commons.lang3.ArrayUtils;
import org.junit.jupiter.api.Test;

/**
Expand Down Expand Up @@ -67,7 +66,7 @@ public void test_0() throws Exception {
{
assertEquals("[aaa,bbb]", getPropertyText(itemsProperty));
assertTrue(itemsProperty.isModified());
assertTrue(ArrayUtils.isEquals(new String[]{"aaa", "bbb"}, itemsProperty.getValue()));
assertArrayEquals(new String[] { "aaa", "bbb" }, (String[]) itemsProperty.getValue());
}
// set new items
{
Expand All @@ -82,7 +81,7 @@ public void test_0() throws Exception {
"}");
assertEquals("[000,111,222]", getPropertyText(itemsProperty));
assertTrue(itemsProperty.isModified());
assertTrue(ArrayUtils.isEquals(new String[]{"000", "111", "222"}, itemsProperty.getValue()));
assertArrayEquals(new String[] { "000", "111", "222" }, (String[]) itemsProperty.getValue());
}
}

Expand Down Expand Up @@ -124,7 +123,7 @@ public void test_removeMethods() throws Exception {
{
assertEquals("[aaa,bbb]", getPropertyText(itemsProperty));
assertTrue(itemsProperty.isModified());
assertTrue(ArrayUtils.isEquals(new String[]{"aaa", "bbb"}, itemsProperty.getValue()));
assertArrayEquals(new String[] { "aaa", "bbb" }, (String[]) itemsProperty.getValue());
}
// set new items
{
Expand All @@ -139,7 +138,7 @@ public void test_removeMethods() throws Exception {
"}");
assertEquals("[000,111,222]", getPropertyText(itemsProperty));
assertTrue(itemsProperty.isModified());
assertTrue(ArrayUtils.isEquals(new String[]{"000", "111", "222"}, itemsProperty.getValue()));
assertArrayEquals(new String[] { "000", "111", "222" }, (String[]) itemsProperty.getValue());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@

import static org.mockito.Mockito.mock;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.assertj.core.api.Assertions;
import org.assertj.core.util.Lists;
Expand Down Expand Up @@ -2235,7 +2234,7 @@ int getSum(String s, double d) {
}
}""");
MethodDeclaration method = typeDeclaration.getMethods()[0];
assertTrue(ArrayUtils.isEquals(new String[]{"s", "d"}, m_lastEditor.getParameterNames(method)));
assertArrayEquals(new String[] { "s", "d" }, m_lastEditor.getParameterNames(method));
}

////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
import org.eclipse.jdt.core.dom.VariableDeclaration;
import org.eclipse.jdt.core.dom.VariableDeclarationFragment;

import org.apache.commons.lang3.ArrayUtils;
import org.assertj.core.api.Assertions;
import org.assertj.core.util.Lists;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -3676,14 +3675,14 @@ public void test_comparators() throws Exception {
Statement[] statements = new Statement[]{statement_1, statement_3, statement_2};
// forward comparator
Arrays.sort(statements, AstNodeUtils.SORT_BY_POSITION);
assertTrue(ArrayUtils.isEquals(
assertArrayEquals(
new Statement[]{statement_1, statement_2, statement_3},
statements));
statements);
// reverse comparator
Arrays.sort(statements, AstNodeUtils.SORT_BY_REVERSE_POSITION);
assertTrue(ArrayUtils.isEquals(
assertArrayEquals(
new Statement[]{statement_3, statement_2, statement_1},
statements));
statements);
}

////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,18 @@ public void test_isSamePackage() {
////////////////////////////////////////////////////////////////////////////
@Test
public void test_join_1() {
assertTrue(ArrayUtils.isEquals(new String[]{"aaa"}, CodeUtils.join(null, "aaa")));
assertTrue(ArrayUtils.isEquals(
new String[]{"aaa", "bbb", "ccc"},
CodeUtils.join(new String[]{"aaa", "bbb"}, "ccc")));
assertArrayEquals(new String[] { "aaa" }, CodeUtils.join(null, "aaa"));
assertArrayEquals(new String[] { "aaa", "bbb", "ccc" }, CodeUtils.join(new String[] { "aaa", "bbb" }, "ccc"));
}

@Test
public void test_join_2() {
assertTrue(ArrayUtils.isEquals(
new String[]{"aaa", "bbb"},
CodeUtils.join(null, new String[]{"aaa", "bbb"})));
assertTrue(ArrayUtils.isEquals(
new String[]{"aaa", "bbb"},
CodeUtils.join(new String[]{"aaa", "bbb"}, (String[]) null)));
assertTrue(ArrayUtils.isEquals(
new String[]{"aaa", "bbb", "ccc"},
CodeUtils.join(new String[]{"aaa", "bbb"}, new String[]{"ccc"})));
assertArrayEquals(new String[] { "aaa", "bbb" },
CodeUtils.join(null, new String[] { "aaa", "bbb" }));
assertArrayEquals(new String[] { "aaa", "bbb" },
CodeUtils.join(new String[] { "aaa", "bbb" }, (String[]) null));
assertArrayEquals(new String[] { "aaa", "bbb", "ccc" },
CodeUtils.join(new String[] { "aaa", "bbb" }, new String[] { "ccc" }));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.ide.IDE;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.function.FailableConsumer;
import org.apache.commons.lang3.function.FailableRunnable;
import org.junit.jupiter.api.AfterEach;
Expand Down Expand Up @@ -288,7 +287,7 @@ protected final void assertTreeSelectionModels(Object... models) {
IStructuredSelection selection =
(IStructuredSelection) m_componentsTree.getSelectionProvider().getSelection();
Object[] actualModels = selection.toArray();
assertTrue(ArrayUtils.isEquals(models, actualModels));
assertArrayEquals(models, actualModels);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -19,7 +19,6 @@
import org.eclipse.wb.internal.swing.model.component.ContainerInfo;
import org.eclipse.wb.tests.designer.swing.SwingModelTest;

import org.apache.commons.lang3.ArrayUtils;
import org.junit.jupiter.api.Test;

import java.lang.reflect.Field;
Expand Down Expand Up @@ -76,6 +75,6 @@ private void checkStaticFieldsProperty(ComponentInfo button,
// check fields
Field namesField = editor.getClass().getDeclaredField("m_names");
namesField.setAccessible(true);
ArrayUtils.isEquals(expectedNames, namesField.get(editor));
assertArrayEquals(expectedNames, (String[]) namesField.get(editor));
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2023 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -17,7 +17,6 @@
import org.eclipse.wb.internal.swing.model.property.editor.models.list.ListModelPropertyEditor;
import org.eclipse.wb.tests.designer.swing.SwingModelTest;

import org.apache.commons.lang3.ArrayUtils;
import org.junit.jupiter.api.Test;

import javax.swing.JList;
Expand Down Expand Up @@ -68,7 +67,7 @@ public void test_parsing() throws Exception {
{
Property modelProperty = listInfo.getPropertyByTitle("model");
String[] actualItems = ListModelPropertyEditor.getItems(modelProperty);
assertTrue(ArrayUtils.isEquals(new String[]{"111", "222", "333"}, actualItems));
assertArrayEquals(new String[] { "111", "222", "333" }, actualItems);
}
}

Expand Down
Loading
Loading