Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Phillips2013-07-25 19:24:39 -0400
committerDavid Phillips2013-07-25 19:24:39 -0400
commiteae2bc6b2e67de04b49bd4a344c8efddeb838ed5 (patch)
tree5eab3be79d469f13cc23dc4cdf335379246968bc
parenta92204e2f1c2c79367f25f03c60bd9fadf53f299 (diff)
downloadorg.eclipse.osee-eae2bc6b2e67de04b49bd4a344c8efddeb838ed5.tar.gz
org.eclipse.osee-eae2bc6b2e67de04b49bd4a344c8efddeb838ed5.tar.xz
org.eclipse.osee-eae2bc6b2e67de04b49bd4a344c8efddeb838ed5.zip
bug[ats_3FPR8]: StringElement.getChars handles null char correctly
-rw-r--r--plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/data/MemoryResource.java7
-rw-r--r--plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/elements/StringElement.java3
2 files changed, 4 insertions, 6 deletions
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/data/MemoryResource.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/data/MemoryResource.java
index afe200e445..4e0cb99090 100644
--- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/data/MemoryResource.java
+++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/data/MemoryResource.java
@@ -214,11 +214,8 @@ public class MemoryResource {
break;
}
char ch = getASCIICharFromOffset(offset + i);
- if (ch != 0) {// NOTE this was done to be compatible with java
- // Strings that don't null char termination
- destination[destIndex] = ch;
- destIndex++;
- }
+ destination[destIndex] = ch;
+ destIndex++;
}
return destIndex;
}
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/elements/StringElement.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/elements/StringElement.java
index 3d45ac9b62..df88a362d1 100644
--- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/elements/StringElement.java
+++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/elements/StringElement.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.ote.message.elements;
import java.util.Collection;
+
import org.eclipse.osee.ote.core.MethodFormatter;
import org.eclipse.osee.ote.core.environment.interfaces.ITestEnvironmentAccessor;
import org.eclipse.osee.ote.core.testPoint.CheckPoint;
@@ -72,7 +73,7 @@ public class StringElement extends DiscreteElement<String> {
/**
* copies this elements chars into the given array. The array must be big enough to contain this elements data or an
- * ArrayIndexOutOfBoundsException will be thrown
+ * ArrayIndexOutOfBoundsException will be thrown. Does not exclude or stop on null (\0) characters in the element data.
*
* @param destination the destination array that will receive the char data
* @return the actual number of characters copied. The destination array will contain undefined data starting at this

Back to the top