diff options
author | pfullbright | 2010-04-16 19:29:16 +0000 |
---|---|---|
committer | pfullbright | 2010-04-16 19:29:16 +0000 |
commit | fe0ed73fdcaa67126f81f4852b22638830e1b349 (patch) | |
tree | 33c049921dc2f71560556a288870dcc955c52de6 | |
parent | 1ceef4cccb2695179eba7d7ee70c9c51befafaf2 (diff) | |
download | webtools.dali-fe0ed73fdcaa67126f81f4852b22638830e1b349.tar.gz webtools.dali-fe0ed73fdcaa67126f81f4852b22638830e1b349.tar.xz webtools.dali-fe0ed73fdcaa67126f81f4852b22638830e1b349.zip |
bug 307990 - fixed a few NPE's with xml maps id
2 files changed, 4 insertions, 2 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedIdMapping.java index fecf5dabd7..7884d524d9 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedIdMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedIdMapping.java @@ -27,6 +27,7 @@ import org.eclipse.jpt.core.jpa2.context.SingleRelationshipMapping2_0; import org.eclipse.jpt.core.resource.orm.Attributes; import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId; import org.eclipse.jpt.utility.internal.CollectionTools; +import org.eclipse.jpt.utility.internal.Tools; import org.eclipse.jpt.utility.internal.iterables.CompositeIterable; import org.eclipse.jpt.utility.internal.iterables.FilteringIterable; import org.eclipse.jpt.utility.internal.iterables.SubIterableWrapper; @@ -89,7 +90,7 @@ public class GenericOrmEmbeddedIdMapping protected boolean calculateMappedByRelationship() { for (SingleRelationshipMapping2_0 each : getMapsIdRelationships()) { - if (getName().equals(each.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getValue())) { + if (Tools.valuesAreEqual(getName(), each.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getValue())) { return true; } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java index bda245bef1..a21ef92b1c 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java @@ -26,6 +26,7 @@ import org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0; import org.eclipse.jpt.core.utility.TextRange; import org.eclipse.jpt.utility.internal.CollectionTools; import org.eclipse.jpt.utility.internal.StringTools; +import org.eclipse.jpt.utility.internal.Tools; import org.eclipse.jpt.utility.internal.iterables.CompositeIterable; import org.eclipse.jpt.utility.internal.iterables.FilteringIterable; import org.eclipse.jpt.utility.internal.iterables.SingleElementIterable; @@ -134,7 +135,7 @@ public class GenericOrmMapsIdDerivedIdentityStrategy2_0 public AttributeMapping getResolvedAttributeMappingValue() { if (getValue() != null) { for (AttributeMapping each : getAllAttributeMappingChoices()) { - if (each.getName().equals(getValue())) { + if (Tools.valuesAreEqual(each.getName(), getValue())) { return each; } } |