Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorisikm2008-06-14 17:53:32 -0400
committerisikm2008-06-14 17:53:32 -0400
commit1ad8f894a45921b3683728484268ba3df52cea18 (patch)
tree707491df9ad1aacc598cbf7c65064db78989160f
parent35623abea312cb2664cb46eb7f095960656655d1 (diff)
downloadorg.eclipse.ecf-1ad8f894a45921b3683728484268ba3df52cea18.tar.gz
org.eclipse.ecf-1ad8f894a45921b3683728484268ba3df52cea18.tar.xz
org.eclipse.ecf-1ad8f894a45921b3683728484268ba3df52cea18.zip
renamed method getLength() in UpdateMessage to be getLengthOfReplacedText() - getLength() is ambiguous and could be thought of as returning the length of insertion operations
-rw-r--r--framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/DocShare.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/cola/ColaUpdateMessage.java6
-rw-r--r--framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/messages/UpdateMessage.java2
3 files changed, 6 insertions, 6 deletions
diff --git a/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/DocShare.java b/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/DocShare.java
index b21f7e26d..089197309 100644
--- a/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/DocShare.java
+++ b/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/DocShare.java
@@ -322,7 +322,7 @@ public class DocShare extends AbstractShare {
// startContent
// directly
if (startContent != null) {
- modifyStartContent(remoteMsg.getOffset(), remoteMsg.getLength(), remoteMsg.getText());
+ modifyStartContent(remoteMsg.getOffset(), remoteMsg.getLengthOfReplacedText(), remoteMsg.getText());
// And we're done
return;
}
@@ -346,7 +346,7 @@ public class DocShare extends AbstractShare {
// changing document
setEditorToRefuseInput();
- document.replace(msgForLocalApplication.getOffset(), msgForLocalApplication.getLength(), msgForLocalApplication.getText());
+ document.replace(msgForLocalApplication.getOffset(), msgForLocalApplication.getLengthOfReplacedText(), msgForLocalApplication.getText());
}
} catch (final Exception e) {
logError(Messages.DocShare_EXCEPTION_RECEIVING_MESSAGE_TITLE, e);
diff --git a/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/cola/ColaUpdateMessage.java b/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/cola/ColaUpdateMessage.java
index 56ecf3fce..2f463c9d6 100644
--- a/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/cola/ColaUpdateMessage.java
+++ b/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/cola/ColaUpdateMessage.java
@@ -27,10 +27,10 @@ public class ColaUpdateMessage extends UpdateMessage {
final TransformationStrategy trafoStrat;
public ColaUpdateMessage(UpdateMessage msg, long localOperationsCount, long remoteOperationsCount) {
- super(msg.getOffset(), msg.getLength(), msg.getText());
+ super(msg.getOffset(), msg.getLengthOfReplacedText(), msg.getText());
this.localOperationsCount = localOperationsCount;
this.remoteOperationsCount = remoteOperationsCount;
- if (super.getLength() == 0) {
+ if (super.getLengthOfReplacedText() == 0) {
// this is neither a replacement, nor a deletion
trafoStrat = ColaInsertion.getInstance();
} else {
@@ -72,7 +72,7 @@ public class ColaUpdateMessage extends UpdateMessage {
public String toString() {
StringBuffer buf = new StringBuffer("ColaUpdateMessage["); //$NON-NLS-1$
buf.append("text=").append(getText()).append(";offset=").append(getOffset()); //$NON-NLS-1$ //$NON-NLS-2$
- buf.append(";length=").append(getLength()).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(";length=").append(getLengthOfReplacedText()).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
buf.append(";operationsCount[local=").append(getLocalOperationsCount()); //$NON-NLS-1$
buf.append(";remote=").append(getRemoteOperationsCount()).append("]]"); //$NON-NLS-1$//$NON-NLS-2$
return buf.toString();
diff --git a/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/messages/UpdateMessage.java b/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/messages/UpdateMessage.java
index 4fc1772c0..81c978417 100644
--- a/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/messages/UpdateMessage.java
+++ b/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/messages/UpdateMessage.java
@@ -48,7 +48,7 @@ public class UpdateMessage extends Message {
*
* @return length of replaced text
*/
- public int getLength() {
+ public int getLengthOfReplacedText() {
return length;
}

Back to the top