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
@@ -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,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.
Expand Down Expand Up @@ -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
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 @@ -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}.
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand Down Expand Up @@ -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;
}
}
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 @@ -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}.
Expand Down Expand Up @@ -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];
}
}
Expand All @@ -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];
}
}
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 @@ -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;
Expand All @@ -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.
Expand Down Expand Up @@ -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];
}
}
Expand All @@ -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;
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 @@ -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
Expand Down Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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;
Expand Down Expand Up @@ -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));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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));
}
}

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 @@ -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.
Expand Down Expand Up @@ -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
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 @@ -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
Expand Down Expand Up @@ -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);
}

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 @@ -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
Expand Down Expand Up @@ -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));
}
}
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 @@ -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
Expand Down Expand Up @@ -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));
}
}
Loading
Loading