Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToManyAnnotation.java')
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToManyAnnotation.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToManyAnnotation.java
index 73d8ef8db2..fd81b634d7 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToManyAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToManyAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2010 Oracle. 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.
@@ -57,9 +57,9 @@ public final class SourceManyToManyAnnotation
}
@Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setMappedBy(this.buildMappedBy(astRoot));
+ public void synchronizeWith(CompilationUnit astRoot) {
+ super.synchronizeWith(astRoot);
+ this.syncMappedBy(this.buildMappedBy(astRoot));
}
@@ -89,13 +89,16 @@ public final class SourceManyToManyAnnotation
}
public void setMappedBy(String mappedBy) {
- if (this.attributeValueHasNotChanged(this.mappedBy, mappedBy)) {
- return;
+ if (this.attributeValueHasChanged(this.mappedBy, mappedBy)) {
+ this.mappedBy = mappedBy;
+ this.mappedByAdapter.setValue(mappedBy);
}
+ }
+
+ private void syncMappedBy(String astMappedBy) {
String old = this.mappedBy;
- this.mappedBy = mappedBy;
- this.mappedByAdapter.setValue(mappedBy);
- this.firePropertyChanged(MAPPED_BY_PROPERTY, old, mappedBy);
+ this.mappedBy = astMappedBy;
+ this.firePropertyChanged(MAPPED_BY_PROPERTY, old, astMappedBy);
}
private String buildMappedBy(CompilationUnit astRoot) {

Back to the top