### Eclipse Workspace Patch 1.0 #P org.eclipse.ui.workbench Index: Eclipse UI/org/eclipse/ui/LegacyHandlerSubmissionExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/LegacyHandlerSubmissionExpression.java,v retrieving revision 1.7 diff -u -r1.7 LegacyHandlerSubmissionExpression.java --- Eclipse UI/org/eclipse/ui/LegacyHandlerSubmissionExpression.java 21 Feb 2006 21:27:45 -0000 1.7 +++ Eclipse UI/org/eclipse/ui/LegacyHandlerSubmissionExpression.java 22 Feb 2006 17:56:25 -0000 @@ -16,7 +16,6 @@ import org.eclipse.core.expressions.ExpressionInfo; import org.eclipse.core.expressions.IEvaluationContext; import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.internal.util.Util; /** *
@@ -29,17 +28,6 @@
public final class LegacyHandlerSubmissionExpression extends Expression {
/**
- * The constant integer hash code value meaning the hash code has not yet
- * been computed.
- */
- private static final int HASH_CODE_NOT_COMPUTED = -1;
-
- /**
- * A factor for computing the hash code for all schemes.
- */
- private static final int HASH_FACTOR = 89;
-
- /**
* The seed for the hash code for all schemes.
*/
private static final int HASH_INITIAL = LegacyHandlerSubmissionExpression.class
@@ -67,12 +55,6 @@
private final IWorkbenchPartSite activeSite;
/**
- * The hash code for this object. This value is computed lazily, and marked
- * as invalid when one of the values on which it is based changes.
- */
- private transient int hashCode = HASH_CODE_NOT_COMPUTED;
-
- /**
* Constructs a new instance of
* LegacyHandlerSubmissionExpression
*
@@ -111,9 +93,9 @@
public final boolean equals(final Object object) {
if (object instanceof LegacyHandlerSubmissionExpression) {
final LegacyHandlerSubmissionExpression that = (LegacyHandlerSubmissionExpression) object;
- return Util.equals(this.activePartId, that.activePartId)
- && Util.equals(this.activeShell, that.activeShell)
- && Util.equals(this.activeSite, that.activeSite);
+ return equals(this.activePartId, that.activePartId)
+ && equals(this.activeShell, that.activeShell)
+ && equals(this.activeSite, that.activeSite);
}
return false;
@@ -161,16 +143,11 @@
return EvaluationResult.TRUE;
}
- /**
- * Computes the hash code for this object based on the id.
- *
- * @return The hash code for this object.
- */
public final int hashCode() {
if (hashCode == HASH_CODE_NOT_COMPUTED) {
- hashCode = HASH_INITIAL * HASH_FACTOR + Util.hashCode(activePartId);
- hashCode = hashCode * HASH_FACTOR + Util.hashCode(activeShell);
- hashCode = hashCode * HASH_FACTOR + Util.hashCode(activeSite);
+ hashCode = HASH_INITIAL * HASH_FACTOR + hashCode(activePartId);
+ hashCode = hashCode * HASH_FACTOR + hashCode(activeShell);
+ hashCode = hashCode * HASH_FACTOR + hashCode(activeSite);
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode++;
}
Index: Eclipse UI/org/eclipse/ui/ActiveShellExpression.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ActiveShellExpression.java,v
retrieving revision 1.6
diff -u -r1.6 ActiveShellExpression.java
--- Eclipse UI/org/eclipse/ui/ActiveShellExpression.java 21 Feb 2006 21:27:45 -0000 1.6
+++ Eclipse UI/org/eclipse/ui/ActiveShellExpression.java 22 Feb 2006 17:56:25 -0000
@@ -16,7 +16,6 @@
import org.eclipse.core.expressions.ExpressionInfo;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.internal.util.Util;
/**
*
@@ -32,17 +31,6 @@
public final class ActiveShellExpression extends Expression {
/**
- * The constant integer hash code value meaning the hash code has not yet
- * been computed.
- */
- private static final int HASH_CODE_NOT_COMPUTED = -1;
-
- /**
- * A factor for computing the hash code for all schemes.
- */
- private static final int HASH_FACTOR = 89;
-
- /**
* The seed for the hash code for all schemes.
*/
private static final int HASH_INITIAL = ActiveShellExpression.class
@@ -62,12 +50,6 @@
private final Shell activeShell;
/**
- * The hash code for this object. This value is computed lazily, and marked
- * as invalid when one of the values on which it is based changes.
- */
- private transient int hashCode = HASH_CODE_NOT_COMPUTED;
-
- /**
* Constructs a new instance of ActiveShellExpression
*
* @param activeShell
@@ -86,7 +68,7 @@
public final boolean equals(final Object object) {
if (object instanceof ActiveShellExpression) {
final ActiveShellExpression that = (ActiveShellExpression) object;
- return Util.equals(this.activeShell, that.activeShell);
+ return equals(this.activeShell, that.activeShell);
}
return false;
@@ -120,14 +102,9 @@
return EvaluationResult.TRUE;
}
- /**
- * Computes the hash code for this object based on the id.
- *
- * @return The hash code for this object.
- */
public final int hashCode() {
if (hashCode == HASH_CODE_NOT_COMPUTED) {
- hashCode = HASH_INITIAL * HASH_FACTOR + Util.hashCode(activeShell);
+ hashCode = HASH_INITIAL * HASH_FACTOR + hashCode(activeShell);
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode++;
}
Index: Eclipse UI/org/eclipse/ui/internal/expressions/WorkbenchWindowExpression.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/WorkbenchWindowExpression.java,v
retrieving revision 1.3
diff -u -r1.3 WorkbenchWindowExpression.java
--- Eclipse UI/org/eclipse/ui/internal/expressions/WorkbenchWindowExpression.java 21 Feb 2006 21:27:46 -0000 1.3
+++ Eclipse UI/org/eclipse/ui/internal/expressions/WorkbenchWindowExpression.java 22 Feb 2006 17:56:25 -0000
@@ -1 +1 @@
-/*******************************************************************************
* Copyright (c) 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.ui.internal.expressions;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.ExpressionInfo;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.ISources;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.internal.util.Util;
/**
*
* An expression that evaluates to {@link EvaluationResult#TRUE} when the active * workbench window matches the window held by this expression. *
* * @since 3.2 */ public class WorkbenchWindowExpression extends Expression { /** * The constant integer hash code value meaning the hash code has not yet * been computed. */ protected static final int HASH_CODE_NOT_COMPUTED = -1; /** * A factor for computing the hash code for all schemes. */ protected static final int HASH_FACTOR = 89; /** * The seed for the hash code for all schemes. */ private static final int HASH_INITIAL = WorkbenchWindowExpression.class .getName().hashCode(); /** * The hash code for this object. This value is computed lazily, and marked * as invalid when one of the values on which it is based changes. */ protected transient int hashCode = HASH_CODE_NOT_COMPUTED; /** * The workbench window that must be active for this expression to evaluate * totrue
. If this value is null
, then any
* workbench window may be active.
*/
private final IWorkbenchWindow window;
/**
* Constructs a new instance.
*
* @param window
* The workbench window which must be active for this expression
* to evaluate to true
; may be null
* if this expression is always true
.
*/
public WorkbenchWindowExpression(final IWorkbenchWindow window) {
this.window = window;
}
public void collectExpressionInfo(final ExpressionInfo info) {
if (window != null) {
info.addVariableNameAccess(ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
}
}
public boolean equals(final Object object) {
if (object instanceof WorkbenchWindowExpression) {
final WorkbenchWindowExpression that = (WorkbenchWindowExpression) object;
return Util.equals(this.window, that.window);
}
return false;
}
public EvaluationResult evaluate(final IEvaluationContext context)
throws CoreException {
if (window != null) {
Object value = context
.getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
if (window.equals(value)) {
return EvaluationResult.TRUE;
}
}
return EvaluationResult.FALSE;
}
/**
* Returns the workbench window to which this expression applies.
*
* @return The workbench window to which this expression applies; may be
* null
.
*/
protected final IWorkbenchWindow getWindow() {
return window;
}
/**
* Computes the hash code for this object based on the id.
*
* @return The hash code for this object.
*/
public int hashCode() {
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode = HASH_INITIAL * HASH_FACTOR + Util.hashCode(window);
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode++;
}
}
return hashCode;
}
public String toString() {
final StringBuffer buffer = new StringBuffer();
buffer.append("WorkbenchWindowExpression("); //$NON-NLS-1$
buffer.append(window);
buffer.append(')');
return buffer.toString();
}
}
\ No newline at end of file
+/*******************************************************************************
* Copyright (c) 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.ui.internal.expressions;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.ExpressionInfo;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.ISources;
import org.eclipse.ui.IWorkbenchWindow;
/**
* * An expression that evaluates to {@link EvaluationResult#TRUE} when the active * workbench window matches the window held by this expression. *
* * @since 3.2 */ public class WorkbenchWindowExpression extends Expression { /** * The seed for the hash code for all schemes. */ private static final int HASH_INITIAL = WorkbenchWindowExpression.class .getName().hashCode(); /** * The workbench window that must be active for this expression to evaluate * totrue
. If this value is null
, then any
* workbench window may be active.
*/
private final IWorkbenchWindow window;
/**
* Constructs a new instance.
*
* @param window
* The workbench window which must be active for this expression
* to evaluate to true
; may be null
* if this expression is always true
.
*/
public WorkbenchWindowExpression(final IWorkbenchWindow window) {
this.window = window;
}
public void collectExpressionInfo(final ExpressionInfo info) {
if (window != null) {
info.addVariableNameAccess(ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
}
}
public boolean equals(final Object object) {
if (object instanceof WorkbenchWindowExpression) {
final WorkbenchWindowExpression that = (WorkbenchWindowExpression) object;
return equals(this.window, that.window);
}
return false;
}
public EvaluationResult evaluate(final IEvaluationContext context)
throws CoreException {
if (window != null) {
Object value = context
.getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
if (window.equals(value)) {
return EvaluationResult.TRUE;
}
}
return EvaluationResult.FALSE;
}
/**
* Returns the workbench window to which this expression applies.
*
* @return The workbench window to which this expression applies; may be
* null
.
*/
protected final IWorkbenchWindow getWindow() {
return window;
}
public int hashCode() {
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode = HASH_INITIAL * HASH_FACTOR + hashCode(window);
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode++;
}
}
return hashCode;
}
public String toString() {
final StringBuffer buffer = new StringBuffer();
buffer.append("WorkbenchWindowExpression("); //$NON-NLS-1$
buffer.append(window);
buffer.append(')');
return buffer.toString();
}
}
\ No newline at end of file
Index: Eclipse UI/org/eclipse/ui/internal/expressions/ActivePartExpression.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/ActivePartExpression.java,v
retrieving revision 1.4
diff -u -r1.4 ActivePartExpression.java
--- Eclipse UI/org/eclipse/ui/internal/expressions/ActivePartExpression.java 21 Feb 2006 21:27:46 -0000 1.4
+++ Eclipse UI/org/eclipse/ui/internal/expressions/ActivePartExpression.java 22 Feb 2006 17:56:25 -0000
@@ -1 +1 @@
-/*******************************************************************************
* Copyright (c) 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.ui.internal.expressions;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.ExpressionInfo;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.ui.ISources;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.internal.util.Util;
/**
* * An expression that is bound to a particular part instance. *
*
* This class is not intended for use outside of the
* org.eclipse.ui.workbench
plug-in.
*
true
. This value is never null
.
*/
private final IWorkbenchPart activePart;
/**
* The hash code for this object. This value is computed lazily, and marked
* as invalid when one of the values on which it is based changes.
*/
private transient int hashCode = HASH_CODE_NOT_COMPUTED;
/**
* Constructs a new instance of ActivePartExpression
*
* @param activePart
* The part to match with the active part; may be
* null
*/
public ActivePartExpression(final IWorkbenchPart activePart) {
if (activePart == null) {
throw new NullPointerException("The active part must not be null"); //$NON-NLS-1$
}
this.activePart = activePart;
}
public final void collectExpressionInfo(final ExpressionInfo info) {
info.addVariableNameAccess(ISources.ACTIVE_PART_NAME);
}
public final boolean equals(final Object object) {
if (object instanceof ActivePartExpression) {
final ActivePartExpression that = (ActivePartExpression) object;
return Util.equals(this.activePart, that.activePart);
}
return false;
}
public final EvaluationResult evaluate(final IEvaluationContext context) {
final Object variable = context.getVariable(ISources.ACTIVE_PART_NAME);
if (Util.equals(activePart, variable)) {
return EvaluationResult.TRUE;
}
return EvaluationResult.FALSE;
}
/**
* Computes the hash code for this object based on the id.
*
* @return The hash code for this object.
*/
public final int hashCode() {
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode = HASH_INITIAL * HASH_FACTOR + Util.hashCode(activePart);
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode++;
}
}
return hashCode;
}
public final String toString() {
final StringBuffer buffer = new StringBuffer();
buffer.append("ActivePartExpression("); //$NON-NLS-1$
buffer.append(activePart);
buffer.append(')');
return buffer.toString();
}
}
\ No newline at end of file
+/*******************************************************************************
* Copyright (c) 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.ui.internal.expressions;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.ExpressionInfo;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.ui.ISources;
import org.eclipse.ui.IWorkbenchPart;
/**
* * An expression that is bound to a particular part instance. *
*
* This class is not intended for use outside of the
* org.eclipse.ui.workbench
plug-in.
*
true
. This value is never null
.
*/
private final IWorkbenchPart activePart;
/**
* Constructs a new instance of ActivePartExpression
*
* @param activePart
* The part to match with the active part; may be
* null
*/
public ActivePartExpression(final IWorkbenchPart activePart) {
if (activePart == null) {
throw new NullPointerException("The active part must not be null"); //$NON-NLS-1$
}
this.activePart = activePart;
}
public final void collectExpressionInfo(final ExpressionInfo info) {
info.addVariableNameAccess(ISources.ACTIVE_PART_NAME);
}
public final boolean equals(final Object object) {
if (object instanceof ActivePartExpression) {
final ActivePartExpression that = (ActivePartExpression) object;
return equals(this.activePart, that.activePart);
}
return false;
}
public final EvaluationResult evaluate(final IEvaluationContext context) {
final Object variable = context.getVariable(ISources.ACTIVE_PART_NAME);
if (equals(activePart, variable)) {
return EvaluationResult.TRUE;
}
return EvaluationResult.FALSE;
}
public final int hashCode() {
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode = HASH_INITIAL * HASH_FACTOR + hashCode(activePart);
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode++;
}
}
return hashCode;
}
public final String toString() {
final StringBuffer buffer = new StringBuffer();
buffer.append("ActivePartExpression("); //$NON-NLS-1$
buffer.append(activePart);
buffer.append(')');
return buffer.toString();
}
}
\ No newline at end of file
Index: Eclipse UI/org/eclipse/ui/internal/expressions/AndExpression.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/AndExpression.java,v
retrieving revision 1.3
diff -u -r1.3 AndExpression.java
--- Eclipse UI/org/eclipse/ui/internal/expressions/AndExpression.java 21 Feb 2006 21:27:46 -0000 1.3
+++ Eclipse UI/org/eclipse/ui/internal/expressions/AndExpression.java 22 Feb 2006 17:56:25 -0000
@@ -1 +1 @@
-/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.ui.internal.expressions;
import java.util.Iterator;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.internal.util.Util;
/**
* Copied from org.eclipse.core.internal.expressions.
*/
public final class AndExpression extends CompositeExpression {
/**
* The constant integer hash code value meaning the hash code has not yet
* been computed.
*/
private static final int HASH_CODE_NOT_COMPUTED = -1;
/**
* A factor for computing the hash code for all schemes.
*/
private static final int HASH_FACTOR = 89;
/**
* The seed for the hash code for all schemes.
*/
private static final int HASH_INITIAL = AndExpression.class.getName()
.hashCode();
/**
* The hash code for this object. This value is computed lazily, and marked
* as invalid when one of the values on which it is based changes.
*/
private transient int hashCode = HASH_CODE_NOT_COMPUTED;
public final boolean equals(final Object object) {
if (object instanceof AndExpression) {
final AndExpression that = (AndExpression) object;
return Util.equals(this.fExpressions, that.fExpressions);
}
return false;
}
public final EvaluationResult evaluate(final IEvaluationContext context)
throws CoreException {
return evaluateAnd(context);
}
/**
* Computes the hash code for this object based on the id.
*
* @return The hash code for this object.
*/
public final int hashCode() {
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode = HASH_INITIAL * HASH_FACTOR + Util.hashCode(fExpressions);
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode++;
}
}
return hashCode;
}
public final String toString() {
final StringBuffer buffer = new StringBuffer();
buffer.append("AndExpression("); //$NON-NLS-1$
if (fExpressions != null) {
final Iterator itr = fExpressions.iterator();
while (itr.hasNext()) {
final Expression expression = (Expression) itr.next();
buffer.append(expression.toString());
if (itr.hasNext()) {
buffer.append(',');
}
}
}
buffer.append(')');
return buffer.toString();
}
}
\ No newline at end of file
+/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.ui.internal.expressions;
import java.util.Iterator;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;
/**
* Copied from org.eclipse.core.internal.expressions.
*/
public final class AndExpression extends CompositeExpression {
/**
* The seed for the hash code for all schemes.
*/
private static final int HASH_INITIAL = AndExpression.class.getName()
.hashCode();
public final boolean equals(final Object object) {
if (object instanceof AndExpression) {
final AndExpression that = (AndExpression) object;
return equals(this.fExpressions, that.fExpressions);
}
return false;
}
public final EvaluationResult evaluate(final IEvaluationContext context)
throws CoreException {
return evaluateAnd(context);
}
public final int hashCode() {
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode = HASH_INITIAL * HASH_FACTOR + hashCode(fExpressions);
if (hashCode == HASH_CODE_NOT_COMPUTED) {
hashCode++;
}
}
return hashCode;
}
public final String toString() {
final StringBuffer buffer = new StringBuffer();
buffer.append("AndExpression("); //$NON-NLS-1$
if (fExpressions != null) {
final Iterator itr = fExpressions.iterator();
while (itr.hasNext()) {
final Expression expression = (Expression) itr.next();
buffer.append(expression.toString());
if (itr.hasNext()) {
buffer.append(',');
}
}
}
buffer.append(')');
return buffer.toString();
}
}
\ No newline at end of file
#P org.eclipse.ui.navigator
Index: src/org/eclipse/ui/internal/navigator/CustomAndExpression.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/CustomAndExpression.java,v
retrieving revision 1.1
diff -u -r1.1 CustomAndExpression.java
--- src/org/eclipse/ui/internal/navigator/CustomAndExpression.java 6 Feb 2006 22:23:24 -0000 1.1
+++ src/org/eclipse/ui/internal/navigator/CustomAndExpression.java 22 Feb 2006 17:56:26 -0000
@@ -21,6 +21,12 @@
*/
public class CustomAndExpression extends Expression {
+ /**
+ * The seed for the hash code for all custom and expressions.
+ */
+ private static final int HASH_INITIAL = CustomAndExpression.class.getName()
+ .hashCode();
+
protected List fExpressions;
/**
@@ -48,6 +54,15 @@
}
}
+ public final boolean equals(final Object object) {
+ if (object instanceof CustomAndExpression) {
+ final CustomAndExpression that = (CustomAndExpression) object;
+ return equals(this.fExpressions, that.fExpressions);
+ }
+
+ return false;
+ }
+
public EvaluationResult evaluate(IEvaluationContext scope)
throws CoreException {
if (fExpressions == null)
@@ -64,4 +79,13 @@
return result;
}
+ public int hashCode() {
+ if (hashCode == HASH_CODE_NOT_COMPUTED) {
+ hashCode = HASH_INITIAL * HASH_FACTOR + hashCode(fExpressions);
+ if (hashCode == HASH_CODE_NOT_COMPUTED) {
+ hashCode++;
+ }
+ }
+ return hashCode;
+ }
}