[521999] Handle IBM java.lang.String implementation

Change-Id: If89e5e0bf48479ba32db8452fc812ef4e5b4b2fc
Signed-off-by: robbins <robbins@uk.ibm.com>
diff --git a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/snapshot/model/PrettyPrinter.java b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/snapshot/model/PrettyPrinter.java
index ca91efe..c3e7a0a 100644
--- a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/snapshot/model/PrettyPrinter.java
+++ b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/snapshot/model/PrettyPrinter.java
@@ -46,10 +46,12 @@
             if (count.intValue() == 0)

                 return ""; //$NON-NLS-1$

 

+            // IBM java.lang.String implementation may have count but not offset

+            Integer offset = 0;

             Object offsetObj = stringObject.resolveValue("offset"); //$NON-NLS-1$

-            if (!(offsetObj instanceof Integer))

-                return null;

-            Integer offset = (Integer) offsetObj;

+            if ((offsetObj instanceof Integer)) {

+                offset = (Integer) offsetObj;

+            }

 

             return arrayAsString(charArray, offset, count, limit);

         }