diff options
author | Brian Vosburgh | 2015-10-20 14:16:19 -0400 |
---|---|---|
committer | Brian Vosburgh | 2015-10-20 14:16:19 -0400 |
commit | db47352eb0be8cf74cf7d015b42e65d96e1f03fc (patch) | |
tree | bf5ba8c345129e615affb67c28507e981dc4b1fe | |
parent | c484b3b8ffe866f4b158ce7e9d5a565fae76fec3 (diff) | |
download | webtools.dali-db47352eb0be8cf74cf7d015b42e65d96e1f03fc.tar.gz webtools.dali-db47352eb0be8cf74cf7d015b42e65d96e1f03fc.tar.xz webtools.dali-db47352eb0be8cf74cf7d015b42e65d96e1f03fc.zip |
tweak IntReferences
3 files changed, 10 insertions, 4 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/AbstractIntReference.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/AbstractIntReference.java index 00f7789449..b0e3d5e2b3 100644 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/AbstractIntReference.java +++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/AbstractIntReference.java @@ -95,8 +95,8 @@ public abstract class AbstractIntReference // ********** standard methods ********** /** - * Object identity is critical to int references. - * There is no reason for two different int references to be + * Object identity is critical to <code>int</code> references. + * There is no reason for two different <code>int</code> references to be * <em>equal</em>. * * @see #equals(int) diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/AbstractModifiableIntReference.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/AbstractModifiableIntReference.java index 34593085eb..5fe37595d0 100644 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/AbstractModifiableIntReference.java +++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/AbstractModifiableIntReference.java @@ -195,7 +195,13 @@ public abstract class AbstractModifiableIntReference } public int swap(ModifiableIntReference other) { + if (other == this) { + return this.getValue(); + } int otherValue = other.getValue(); + if (otherValue == this.getValue()) { + return this.getValue(); + } other.setValue(this.getValue()); this.setValue(otherValue); return otherValue; diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/SimpleIntReference.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/SimpleIntReference.java index e1059caeed..bf17d4cbe4 100644 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/SimpleIntReference.java +++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/SimpleIntReference.java @@ -276,8 +276,8 @@ public final class SimpleIntReference } /** - * Object identity is critical to int references. - * There is no reason for two different int references to be + * Object identity is critical to <code>int</code> references. + * There is no reason for two different <code>int</code> references to be * <em>equal</em>. * * @see #equals(int) |