diff --git a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/eval/evaluators/BooleanEvaluator.java b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/eval/evaluators/BooleanEvaluator.java index 25f341661..5e4e21d2c 100644 --- a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/eval/evaluators/BooleanEvaluator.java +++ b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/eval/evaluators/BooleanEvaluator.java @@ -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 @@ -25,9 +25,8 @@ import org.eclipse.jdt.core.dom.InfixExpression.Operator; import org.eclipse.jdt.core.dom.PrefixExpression; -import org.apache.commons.lang3.ObjectUtils; - import java.util.List; +import java.util.Objects; /** * Implementation of {@link IExpressionEvaluator} for "boolean" type. @@ -74,11 +73,11 @@ public Object evaluate(EvaluationContext context, Object rightObject = AstEvaluationEngine.evaluate(context, rightOperand); // == if (operator == InfixExpression.Operator.EQUALS) { - return ObjectUtils.equals(leftObject, rightObject); + return Objects.equals(leftObject, rightObject); } // != if (operator == InfixExpression.Operator.NOT_EQUALS) { - return !ObjectUtils.equals(leftObject, rightObject); + return !Objects.equals(leftObject, rightObject); } } // prepare operands diff --git a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/description/ComponentDescriptionKey.java b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/description/ComponentDescriptionKey.java index 56cf6afa8..9eadbebcf 100644 --- a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/description/ComponentDescriptionKey.java +++ b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/description/ComponentDescriptionKey.java @@ -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 @@ -15,7 +15,7 @@ import org.eclipse.wb.core.model.JavaInfo; import org.eclipse.wb.internal.core.utils.check.Assert; -import org.apache.commons.lang3.ObjectUtils; +import java.util.Objects; /** * The key for caching {@link ComponentDescription}. @@ -71,8 +71,8 @@ public int hashCode() { public boolean equals(Object obj) { if (obj instanceof ComponentDescriptionKey key) { return m_componentClass == key.m_componentClass - && ObjectUtils.equals(m_host, key.m_host) - && ObjectUtils.equals(m_suffix, key.m_suffix); + && Objects.equals(m_host, key.m_host) + && Objects.equals(m_suffix, key.m_suffix); } return false; } diff --git a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/GenericPropertyComposite.java b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/GenericPropertyComposite.java index 108fd1ff8..8f5c6ef2c 100644 --- a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/GenericPropertyComposite.java +++ b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/GenericPropertyComposite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * 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 @@ -18,7 +18,8 @@ import org.eclipse.jdt.core.dom.Expression; import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.ObjectUtils; + +import java.util.Objects; /** * Implementation of {@link GenericProperty} for composite property. @@ -110,7 +111,7 @@ public Object getValue() throws Exception { Object propertyValue = property.getValue(); if (value == NO_VALUE) { value = propertyValue; - } else if (!ObjectUtils.equals(value, propertyValue)) { + } else if (!Objects.equals(value, propertyValue)) { return UNKNOWN_VALUE; } } @@ -125,7 +126,7 @@ public Object getDefaultValue() { Object propertyValue = property.getDefaultValue(); if (value == NO_VALUE) { value = propertyValue; - } else if (!ObjectUtils.equals(value, propertyValue)) { + } else if (!Objects.equals(value, propertyValue)) { return UNKNOWN_VALUE; } } diff --git a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/GenericPropertyImpl.java b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/GenericPropertyImpl.java index d924116e6..d47f2ba61 100644 --- a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/GenericPropertyImpl.java +++ b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/GenericPropertyImpl.java @@ -38,13 +38,13 @@ import org.eclipse.jdt.core.dom.Expression; -import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.Objects; /** * Concrete implementation of {@link GenericProperty}. @@ -338,7 +338,7 @@ private boolean setExpressionUsingAccessor(ExpressionAccessor accessor, Object value) throws Exception { // check for default value if (value != UNKNOWN_VALUE) { - if (ObjectUtils.equals(getDefaultValue(accessor), value)) { + if (Objects.equals(getDefaultValue(accessor), value)) { source = null; } } diff --git a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/editor/EnumerationValuesPropertyEditor.java b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/editor/EnumerationValuesPropertyEditor.java index de08e35f3..0457eaf4f 100644 --- a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/editor/EnumerationValuesPropertyEditor.java +++ b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/editor/EnumerationValuesPropertyEditor.java @@ -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 @@ -17,9 +17,8 @@ import org.eclipse.wb.internal.core.model.property.GenericProperty; import org.eclipse.wb.internal.core.model.property.Property; -import org.apache.commons.lang3.ObjectUtils; - import java.beans.PropertyDescriptor; +import java.util.Objects; /** * {@link PropertyEditor} for "enumerationValues" attribute of {@link PropertyDescriptor}. @@ -66,7 +65,7 @@ public String getText(Property property) throws Exception { // return name for value if (value != Property.UNKNOWN_VALUE) { for (int i = 0; i < m_values.length; i++) { - if (ObjectUtils.equals(m_values[i], value)) { + if (Objects.equals(m_values[i], value)) { return m_names[i]; } } @@ -84,7 +83,7 @@ public String getText(Property property) throws Exception { public String getValueSource(Object value) throws Exception { if (value != Property.UNKNOWN_VALUE) { for (int i = 0; i < m_values.length; i++) { - if (ObjectUtils.equals(m_values[i], value)) { + if (Objects.equals(m_values[i], value)) { return m_sources[i]; } } diff --git a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/editor/StaticFieldPropertyEditor.java b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/editor/StaticFieldPropertyEditor.java index aac83e890..61037185b 100644 --- a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/editor/StaticFieldPropertyEditor.java +++ b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/property/editor/StaticFieldPropertyEditor.java @@ -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 @@ -23,7 +23,6 @@ import org.eclipse.wb.internal.core.utils.state.EditorState; import org.eclipse.wb.internal.core.utils.state.EditorWarning; -import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import java.lang.reflect.Field; @@ -32,6 +31,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; /** * The {@link PropertyEditor} for selecting single field of class from given set. @@ -79,7 +79,7 @@ public String getText(Property property) throws Exception { if (value != Property.UNKNOWN_VALUE) { for (int i = 0; i < m_values.length; i++) { Object fieldValue = m_values[i]; - if (ObjectUtils.equals(fieldValue, value)) { + if (Objects.equals(fieldValue, value)) { return m_titles[i]; } } @@ -98,7 +98,7 @@ public String getValueSource(Object value) throws Exception { if (value != Property.UNKNOWN_VALUE) { for (int i = 0; i < m_values.length; i++) { Object fieldValue = m_values[i]; - if (ObjectUtils.equals(fieldValue, value)) { + if (Objects.equals(fieldValue, value)) { String fieldName = m_names[i]; if (fieldName == null) { return null; diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/graphical/GraphicalViewer.java b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/graphical/GraphicalViewer.java index 64430156d..13a5a412f 100644 --- a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/graphical/GraphicalViewer.java +++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/graphical/GraphicalViewer.java @@ -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 @@ -30,9 +30,8 @@ import org.eclipse.swt.graphics.Cursor; import org.eclipse.swt.widgets.Composite; -import org.apache.commons.lang3.ObjectUtils; - import java.util.Collection; +import java.util.Objects; /** * @author lobas_av @@ -186,7 +185,7 @@ public EditPart findTargetEditPart(int x, protected boolean acceptVisit(Figure figure) { for (org.eclipse.gef.EditPart editPart : exclude) { GraphicalEditPart graphicalPart = (GraphicalEditPart) editPart; - if (ObjectUtils.equals(figure, graphicalPart.getFigure())) { + if (Objects.equals(figure, graphicalPart.getFigure())) { return false; } } diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/core/editor/actions/assistant/AbstractAssistantPage.java b/org.eclipse.wb.core/src/org/eclipse/wb/core/editor/actions/assistant/AbstractAssistantPage.java index 2e06ebf3e..1c49bc15f 100644 --- a/org.eclipse.wb.core/src/org/eclipse/wb/core/editor/actions/assistant/AbstractAssistantPage.java +++ b/org.eclipse.wb.core/src/org/eclipse/wb/core/editor/actions/assistant/AbstractAssistantPage.java @@ -37,13 +37,13 @@ import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Text; -import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Objects; /** * Abstract implementation of {@link ILayoutAssistantPage} with convenient function to create @@ -186,7 +186,7 @@ protected final Object getValue() { Object value = property.getValue(); if (commonValue == NO_VALUE) { commonValue = value; - } else if (!ObjectUtils.equals(commonValue, value)) { + } else if (!Objects.equals(commonValue, value)) { return Property.UNKNOWN_VALUE; } } @@ -200,7 +200,7 @@ protected final Object getValue() { */ protected final void setValue(final Object value) { prepareProperties(); - if (m_currentValue != Property.UNKNOWN_VALUE && ObjectUtils.equals(m_currentValue, value)) { + if (m_currentValue != Property.UNKNOWN_VALUE && Objects.equals(m_currentValue, value)) { return; } m_currentValue = value; @@ -630,7 +630,7 @@ public void showValue() { Object value = getValue(); for (Button button : m_buttons) { Object buttonValue = button.getData(); - button.setSelection(ObjectUtils.equals(value, buttonValue)); + button.setSelection(Objects.equals(value, buttonValue)); } } diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/core/gef/policy/PolicyUtils.java b/org.eclipse.wb.core/src/org/eclipse/wb/core/gef/policy/PolicyUtils.java index c0e927cfd..8211f9b3e 100644 --- a/org.eclipse.wb.core/src/org/eclipse/wb/core/gef/policy/PolicyUtils.java +++ b/org.eclipse.wb.core/src/org/eclipse/wb/core/gef/policy/PolicyUtils.java @@ -35,9 +35,8 @@ import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.draw2d.geometry.Translatable; -import org.apache.commons.lang3.ObjectUtils; - import java.lang.reflect.Method; +import java.util.Objects; /** * Helper for {@link EditPolicy}'s. @@ -223,7 +222,7 @@ public static void translateModelToFeedback(GraphicalEditPolicy policy, Translat } else if (policy instanceof SelectionEditPolicy) { translateAbsoluteToModel((SelectionEditPolicy) policy, t); } else { - throw new IllegalArgumentException(ObjectUtils.toString(policy)); + throw new IllegalArgumentException(Objects.toString(policy)); } } diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/Pair.java b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/Pair.java index 4c1bcc84f..bc7f03373 100644 --- a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/Pair.java +++ b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/Pair.java @@ -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 @@ -12,7 +12,7 @@ *******************************************************************************/ package org.eclipse.wb.internal.core.utils; -import org.apache.commons.lang3.ObjectUtils; +import java.util.Objects; /** * Pair of two objects. @@ -47,8 +47,8 @@ public boolean equals(Object o) { if (!(o instanceof Pair other)) { return false; } - return ObjectUtils.equals(getLeft(), other.getLeft()) - && ObjectUtils.equals(getRight(), other.getRight()); + return Objects.equals(getLeft(), other.getLeft()) + && Objects.equals(getRight(), other.getRight()); } @Override diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/ValueUtils.java b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/ValueUtils.java index a568db491..71ae7fd77 100644 --- a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/ValueUtils.java +++ b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/ValueUtils.java @@ -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 @@ -13,9 +13,9 @@ package org.eclipse.wb.internal.core.utils.binding; import org.apache.commons.lang3.BooleanUtils; -import org.apache.commons.lang3.ObjectUtils; import java.util.List; +import java.util.Objects; /** * @author lobas_av @@ -43,7 +43,7 @@ public static boolean objectToBoolean(Object value) { return booleanObject.booleanValue(); } // extract from Object - String stringObject = ObjectUtils.toString(value); + String stringObject = Objects.toString(value); return BooleanUtils.toBoolean(stringObject); } diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/editors/StringComboEditor.java b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/editors/StringComboEditor.java index 04f52a862..60001652f 100644 --- a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/editors/StringComboEditor.java +++ b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/editors/StringComboEditor.java @@ -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 @@ -15,7 +15,7 @@ import org.eclipse.wb.internal.core.utils.binding.IDataEditor; import org.eclipse.wb.internal.core.utils.dialogfields.ComboDialogField; -import org.apache.commons.lang3.ObjectUtils; +import java.util.Objects; /** * @author lobas_av @@ -45,6 +45,6 @@ public Object getValue() { @Override public void setValue(Object value) { - m_field.setText(ObjectUtils.toString(value)); + m_field.setText(Objects.toString(value)); } } \ No newline at end of file diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/editors/StringEditor.java b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/editors/StringEditor.java index bff3c9dcf..1c92f24a2 100644 --- a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/editors/StringEditor.java +++ b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/editors/StringEditor.java @@ -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 @@ -15,7 +15,7 @@ import org.eclipse.wb.internal.core.utils.binding.IDataEditor; import org.eclipse.wb.internal.core.utils.dialogfields.StringDialogField; -import org.apache.commons.lang3.ObjectUtils; +import java.util.Objects; /** * @author lobas_av @@ -45,6 +45,6 @@ public Object getValue() { @Override public void setValue(Object value) { - m_field.setText(ObjectUtils.toString(value)); + m_field.setText(Objects.toString(value)); } } \ No newline at end of file diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/editors/StringListEditor.java b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/editors/StringListEditor.java index 73a2d870c..af6d7116d 100644 --- a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/editors/StringListEditor.java +++ b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/editors/StringListEditor.java @@ -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 @@ -16,11 +16,11 @@ import org.eclipse.wb.internal.core.utils.dialogfields.ListDialogField; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.List; +import java.util.Objects; /** * @author lobas_av @@ -61,7 +61,7 @@ public Object getValue() { @Override public void setValue(Object value) { - String stringValue = ObjectUtils.toString(value); + String stringValue = Objects.toString(value); String[] values = StringUtils.split(stringValue, m_separator); List elements = new ArrayList<>(); CollectionUtils.addAll(elements, values); diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/providers/StringPreferenceProvider.java b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/providers/StringPreferenceProvider.java index 73b54850d..3976ab7d4 100644 --- a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/providers/StringPreferenceProvider.java +++ b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/binding/providers/StringPreferenceProvider.java @@ -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 @@ -14,7 +14,7 @@ import org.eclipse.jface.preference.IPreferenceStore; -import org.apache.commons.lang3.ObjectUtils; +import java.util.Objects; /** * @author lobas_av @@ -42,6 +42,6 @@ public Object getValue(boolean def) { @Override public void setValue(Object value) { - m_store.setValue(m_key, ObjectUtils.toString(value)); + m_store.setValue(m_key, Objects.toString(value)); } } \ No newline at end of file diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/external/ExternalFactoriesHelper.java b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/external/ExternalFactoriesHelper.java index 7476bf7da..f26455dbf 100644 --- a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/external/ExternalFactoriesHelper.java +++ b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/external/ExternalFactoriesHelper.java @@ -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 @@ -25,7 +25,6 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.ObjectUtils; import org.osgi.framework.Bundle; import java.lang.reflect.Field; @@ -36,6 +35,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Objects; /** * Helper for accessing external factories contributed via extension points. @@ -276,7 +276,7 @@ private int getPriority(IConfigurationElement element) { public static synchronized IExtension getExtension(String pointId, String extensionId) { for (IExtension extension : getExtensions(pointId)) { if (extension.isValid()) { - if (ObjectUtils.equals(extension.getUniqueIdentifier(), extensionId)) { + if (Objects.equals(extension.getUniqueIdentifier(), extensionId)) { return extension; } } else { diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/reflect/ReflectionUtils.java b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/reflect/ReflectionUtils.java index 4ccfe28c2..95d63da0d 100644 --- a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/reflect/ReflectionUtils.java +++ b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/reflect/ReflectionUtils.java @@ -18,7 +18,6 @@ import org.apache.commons.collections4.MultiValuedMap; import org.apache.commons.collections4.multimap.HashSetValuedHashMap; -import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.reflect.FieldUtils; @@ -46,6 +45,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; @@ -333,7 +333,7 @@ public static boolean isSuccessorOf(Object candidate, String requiredClass) { Field fieldTYPE = getFieldByName(candidateClass, "TYPE"); if (fieldTYPE != null) { Class primitiveType = (Class) getFieldObject(candidateClass, "TYPE"); - if (ObjectUtils.equals(primitiveType.getName(), requiredClass)) { + if (Objects.equals(primitiveType.getName(), requiredClass)) { return true; } } @@ -1191,7 +1191,7 @@ public static boolean equals(Constructor constructor_1, Constructor constr return true; } return constructor_1.getDeclaringClass() == constructor_2.getDeclaringClass() - && ObjectUtils.equals( + && Objects.equals( getConstructorSignature(constructor_1), getConstructorSignature(constructor_2)); } diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/ui/UiUtils.java b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/ui/UiUtils.java index cade59ffc..58d4e094d 100644 --- a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/ui/UiUtils.java +++ b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/utils/ui/UiUtils.java @@ -42,12 +42,12 @@ import org.eclipse.swt.widgets.Widget; import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.ObjectUtils; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; /** * Utilities for UI. @@ -519,7 +519,7 @@ public static Image getCroppedImage(Image fullImage, Rectangle cropBounds) { */ public static boolean equals(Image image_1, Image image_2) { // try to compare as plain Object's - if (ObjectUtils.equals(image_1, image_2)) { + if (Objects.equals(image_1, image_2)) { return true; } // compare bounds @@ -535,7 +535,7 @@ public static boolean equals(Image image_1, Image image_2) { */ public static boolean equals(ImageDescriptor imageDesc_1, ImageDescriptor imageDesc_2) { // try to compare as plain Object's - if (ObjectUtils.equals(imageDesc_1, imageDesc_2)) { + if (Objects.equals(imageDesc_1, imageDesc_2)) { return true; } // compare bounds diff --git a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/gef/policy/forms/layout/grid/header/actions/SetAlignmentAction.java b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/gef/policy/forms/layout/grid/header/actions/SetAlignmentAction.java index ce58d5612..46c8047dc 100644 --- a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/gef/policy/forms/layout/grid/header/actions/SetAlignmentAction.java +++ b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/gef/policy/forms/layout/grid/header/actions/SetAlignmentAction.java @@ -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 @@ -19,7 +19,7 @@ import org.eclipse.jface.action.Action; import org.eclipse.jface.resource.ImageDescriptor; -import org.apache.commons.lang3.ObjectUtils; +import java.util.Objects; /** * {@link Action} for modifying alignment of {@link TableWrapDimensionInfo}. @@ -41,7 +41,7 @@ public SetAlignmentAction(DimensionHeaderEditPart header, int alignment) { super(header, text, imageDescriptor, AS_RADIO_BUTTON); m_alignment = alignment; - setChecked(ObjectUtils.equals(header.getDimension().getAlignment(), m_alignment)); + setChecked(Objects.equals(header.getDimension().getAlignment(), m_alignment)); } //////////////////////////////////////////////////////////////////////////// diff --git a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/CategoriesAndViewsDialog.java b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/CategoriesAndViewsDialog.java index 7f6fe1c72..fcaa8f10f 100644 --- a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/CategoriesAndViewsDialog.java +++ b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/CategoriesAndViewsDialog.java @@ -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 @@ -62,12 +62,12 @@ import org.eclipse.swt.widgets.Tree; import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; +import java.util.Objects; /** * {@link Dialog} for editing categories and moving views between them. @@ -222,7 +222,7 @@ public boolean equals(Object a, Object b) { IPluginElement elementB = (IPluginElement) b; String idA = PdeUtils.getAttribute(elementA, "id"); String idB = PdeUtils.getAttribute(elementB, "id"); - return ObjectUtils.equals(idA, idB); + return Objects.equals(idA, idB); } return a == null ? b == null : a.equals(b); } @@ -459,7 +459,7 @@ public Object getParent(Object element) { } // find category with given id for (IPluginElement category : m_categories) { - if (ObjectUtils.equals(PdeUtils.getAttribute(category, "id"), viewCategoryId)) { + if (Objects.equals(PdeUtils.getAttribute(category, "id"), viewCategoryId)) { return category; } } diff --git a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/ExtensionElementProperty.java b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/ExtensionElementProperty.java index f7e8cb172..eafc7f48a 100644 --- a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/ExtensionElementProperty.java +++ b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/ExtensionElementProperty.java @@ -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 @@ -19,8 +19,7 @@ import org.eclipse.core.resources.IProject; import org.eclipse.pde.core.plugin.IPluginElement; -import org.apache.commons.lang3.ObjectUtils; - +import java.util.Objects; import java.util.function.Function; /** @@ -98,7 +97,7 @@ public String getTitle() { @Override public boolean isModified() throws Exception { Object value = getValue(); - return value != UNKNOWN_VALUE && !ObjectUtils.equals(value, m_defaultValue); + return value != UNKNOWN_VALUE && !Objects.equals(value, m_defaultValue); } //////////////////////////////////////////////////////////////////////////// @@ -122,9 +121,9 @@ public Object getValue() throws Exception { @SuppressWarnings("unchecked") public void setValue(Object value) throws Exception { IPluginElement element = getElement(); - if (element != null && !ObjectUtils.equals(value, getValue())) { + if (element != null && !Objects.equals(value, getValue())) { String attributeValue; - if (value == UNKNOWN_VALUE || ObjectUtils.equals(value, m_defaultValue)) { + if (value == UNKNOWN_VALUE || Objects.equals(value, m_defaultValue)) { attributeValue = null; } else { attributeValue = m_fromValueConverter.apply((T) value); diff --git a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/PdeUtils.java b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/PdeUtils.java index 1ddb3da84..0a7786c2d 100644 --- a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/PdeUtils.java +++ b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/PdeUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * 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 @@ -47,7 +47,6 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.ui.part.EditorPart; -import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.osgi.framework.Bundle; @@ -58,6 +57,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; @@ -749,7 +749,7 @@ public List getViews() { @Override public boolean visit(IPluginElement element) { String categoryId = getAttribute(element, "category"); - if (ObjectUtils.equals(m_id, categoryId)) { + if (Objects.equals(m_id, categoryId)) { views.add(createViewInfo(element)); } return false; diff --git a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/widgets/DialogInfo.java b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/widgets/DialogInfo.java index 4e31caa64..8846b14ea 100644 --- a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/widgets/DialogInfo.java +++ b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/widgets/DialogInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * 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 @@ -43,9 +43,8 @@ import net.bytebuddy.ByteBuddy; import net.bytebuddy.dynamic.loading.ClassLoadingStrategy; -import org.apache.commons.lang3.ObjectUtils; - import java.util.List; +import java.util.Objects; /** * Model for {@link Dialog}. @@ -105,7 +104,7 @@ public Object evaluateParameter(EvaluationContext context, String methodSignature, SingleVariableDeclaration parameter, int index) throws Exception { - if (ObjectUtils.equals(parameter.getName().getIdentifier(), "style")) { + if (Objects.equals(parameter.getName().getIdentifier(), "style")) { return SWT.DIALOG_TRIM; } return AstEvaluationEngine.UNKNOWN; diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/customize/CustomizerAction.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/customize/CustomizerAction.java index f8e05bb71..21b0527c4 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/customize/CustomizerAction.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/customize/CustomizerAction.java @@ -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 @@ -23,8 +23,6 @@ import org.eclipse.jface.action.Action; import org.eclipse.jface.window.Window; -import org.apache.commons.lang3.ObjectUtils; - import java.awt.Component; import java.beans.BeanDescriptor; import java.beans.BeanInfo; @@ -32,6 +30,7 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.text.MessageFormat; +import java.util.Objects; /** * {@link Action} for performing customization. @@ -126,7 +125,7 @@ public void run() throws Exception { if (javaInfoState.changedProperties.contains(property.getTitle())) { Object newValue = javaInfoState.changedPropertyValues.get(property.getTitle()); Object oldValue = javaInfoState.oldValues.get(i); - if (!ObjectUtils.equals(newValue, oldValue)) { + if (!Objects.equals(newValue, oldValue)) { property.setValue(newValue); } } @@ -142,7 +141,7 @@ public void run() throws Exception { for (int i = 0; i < size; i++) { Object newValue = javaInfoState.getters.get(i).invoke(javaInfoState.object); Object oldValue = javaInfoState.oldValues.get(i); - if (!ObjectUtils.equals(newValue, oldValue)) { + if (!Objects.equals(newValue, oldValue)) { javaInfoState.properties.get(i).setValue(newValue); } } @@ -161,7 +160,7 @@ public void run() throws Exception { for (int i = 0; i < size; i++) { Object newValue = javaInfoState.getters.get(i).invoke(javaInfoState.object); Object oldValue = javaInfoState.oldValues.get(i); - if (!ObjectUtils.equals(newValue, oldValue)) { + if (!Objects.equals(newValue, oldValue)) { javaInfoState.setters.get(i).invoke(javaInfoState.object, oldValue); } } diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/fields/BooleanField.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/fields/BooleanField.java index 8159d1a1b..ecf35ec73 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/fields/BooleanField.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/fields/BooleanField.java @@ -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 @@ -20,7 +20,7 @@ import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; -import org.apache.commons.lang3.ObjectUtils; +import java.util.Objects; /** * {@link AbstractBorderField} that allows to select {@link Boolean} value. @@ -76,7 +76,7 @@ public void handleEvent(Event e) { * Sets the value, that should correspond to the one of the field values. */ public void setValue(Object value) throws Exception { - if (ObjectUtils.equals(Boolean.FALSE, value)) { + if (Objects.equals(Boolean.FALSE, value)) { m_source = "false"; m_buttons[0].setSelection(true); m_buttons[1].setSelection(false); diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/fields/ComboField.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/fields/ComboField.java index 9e74f3627..bf944f6fd 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/fields/ComboField.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/fields/ComboField.java @@ -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 @@ -21,9 +21,8 @@ import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; -import org.apache.commons.lang3.ObjectUtils; - import java.lang.reflect.Field; +import java.util.Objects; /** * {@link AbstractBorderField} that allows to select one field from many. @@ -78,7 +77,7 @@ public void setValue(Object value) throws Exception { for (int i = 0; i < m_fields.length; i++) { String fieldName = m_fields[i]; Field field = m_clazz.getField(fieldName); - if (ObjectUtils.equals(field.get(null), value)) { + if (Objects.equals(field.get(null), value)) { m_source = m_clazz.getName() + "." + m_fields[i]; m_combo.select(i); break; diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/fields/RadioField.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/fields/RadioField.java index 2da8109c3..9d40cd5ec 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/fields/RadioField.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/fields/RadioField.java @@ -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 @@ -20,9 +20,8 @@ import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; -import org.apache.commons.lang3.ObjectUtils; - import java.lang.reflect.Field; +import java.util.Objects; /** * {@link AbstractBorderField} that allows to select one field from many. @@ -78,7 +77,7 @@ public void setValue(Object value) throws Exception { for (int i = 0; i < m_fields.length; i++) { String fieldName = m_fields[i]; Field field = m_clazz.getField(fieldName); - if (ObjectUtils.equals(field.get(null), value)) { + if (Objects.equals(field.get(null), value)) { m_source = m_clazz.getName() + "." + m_fields[i]; m_buttons[i].setSelection(true); } else { diff --git a/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/DescriptionProcessor.java b/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/DescriptionProcessor.java index eb8451e46..4673e3a36 100644 --- a/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/DescriptionProcessor.java +++ b/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/DescriptionProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * 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 @@ -32,7 +32,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Layout; -import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import java.beans.BeanInfo; @@ -42,6 +41,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Objects; import java.util.TreeMap; /** @@ -280,7 +280,7 @@ private void ifHasNoLayout_then_setLayout_isNotAssociation() { if (!isComposite(componentClass)) { return; } - if (!ObjectUtils.equals(componentDescription.getParameter("layout.has"), "false")) { + if (!Objects.equals(componentDescription.getParameter("layout.has"), "false")) { return; } // remove setLayout() method diff --git a/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/gef/policy/layout/grid/header/actions/SetAlignmentAction.java b/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/gef/policy/layout/grid/header/actions/SetAlignmentAction.java index abe66b4e2..e0045b84a 100644 --- a/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/gef/policy/layout/grid/header/actions/SetAlignmentAction.java +++ b/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/gef/policy/layout/grid/header/actions/SetAlignmentAction.java @@ -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 @@ -19,7 +19,7 @@ import org.eclipse.jface.action.Action; import org.eclipse.jface.resource.ImageDescriptor; -import org.apache.commons.lang3.ObjectUtils; +import java.util.Objects; /** * {@link Action} for modifying alignment of {@link FormDimensionInfo}. @@ -41,7 +41,7 @@ public SetAlignmentAction(DimensionHeaderEditPart header, int alignment) { super(header, text, imageDescriptor, AS_RADIO_BUTTON); m_alignment = alignment; - setChecked(ObjectUtils.equals(header.getDimension().getAlignment(), m_alignment)); + setChecked(Objects.equals(header.getDimension().getAlignment(), m_alignment)); } //////////////////////////////////////////////////////////////////////////// diff --git a/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/model/widgets/CompositeInfo.java b/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/model/widgets/CompositeInfo.java index 8b0f6ab82..3f58c1839 100644 --- a/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/model/widgets/CompositeInfo.java +++ b/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/model/widgets/CompositeInfo.java @@ -85,12 +85,12 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Layout; -import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.osgi.framework.Bundle; import java.lang.reflect.Constructor; import java.util.List; +import java.util.Objects; /** * Model for any SWT {@link Composite}. @@ -288,7 +288,7 @@ public Object evaluateParameter(EvaluationContext context, String methodSignature, SingleVariableDeclaration parameter, int index) throws Exception { - if (ObjectUtils.equals(parameter.getName().getIdentifier(), "style")) { + if (Objects.equals(parameter.getName().getIdentifier(), "style")) { return SWT.NONE; } return AstEvaluationEngine.UNKNOWN; diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/editor/validator/LayoutRequestValidatorsTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/editor/validator/LayoutRequestValidatorsTest.java index 0dbdff64b..71a55c4a6 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/editor/validator/LayoutRequestValidatorsTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/editor/validator/LayoutRequestValidatorsTest.java @@ -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 @@ -22,10 +22,11 @@ import org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils; import org.eclipse.wb.internal.swing.model.component.ContainerInfo; -import org.apache.commons.lang3.ObjectUtils; import org.assertj.core.api.Assertions; import org.junit.Test; +import java.util.Objects; + /** * Tests for {@link LayoutRequestValidators}. * @@ -129,7 +130,7 @@ private static void assertHas_ModelType(ILayoutRequestValidator compoundValidato ILayoutRequestValidator[] validators = getValidators(compoundValidator); for (ILayoutRequestValidator validator : validators) { if (validator instanceof ModelClassLayoutRequestValidator) { - if (ObjectUtils.equals( + if (Objects.equals( ReflectionUtils.getFieldObject(validator, "m_requiredModelClass"), requiredModelClass)) { return; @@ -144,7 +145,7 @@ private static void assertHas_ComponentType(ILayoutRequestValidator compoundVali ILayoutRequestValidator[] validators = getValidators(compoundValidator); for (ILayoutRequestValidator validator : validators) { if (validator instanceof ComponentClassLayoutRequestValidator) { - if (ObjectUtils.equals( + if (Objects.equals( ReflectionUtils.getFieldObject(validator, "m_requiredClass"), requiredComponentClass)) { return; diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/GraphicalRobot.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/GraphicalRobot.java index 48e750f48..4d921a951 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/GraphicalRobot.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/gef/GraphicalRobot.java @@ -46,13 +46,13 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import org.apache.commons.lang3.ObjectUtils; import org.assertj.core.api.Assertions; import org.assertj.core.description.Description; import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Objects; import java.util.function.Predicate; /** @@ -224,7 +224,7 @@ public GraphicalRobot toResizeHandle(Object object, final Object type, final int if (handle.getDragTrackerTool() instanceof ResizeTracker) { ResizeTracker resizeTracker = (ResizeTracker) handle.getDragTrackerTool(); return resizeTracker.getDirection() == direction - && ObjectUtils.equals(resizeTracker.getRequestType(), type); + && Objects.equals(resizeTracker.getRequestType(), type); } return false; };