Lines 57-62
Link Here
|
57 |
import org.netbeans.lib.profiler.heap.HeapProgress; |
57 |
import org.netbeans.lib.profiler.heap.HeapProgress; |
58 |
import org.netbeans.lib.profiler.heap.Instance; |
58 |
import org.netbeans.lib.profiler.heap.Instance; |
59 |
import org.netbeans.lib.profiler.heap.JavaClass; |
59 |
import org.netbeans.lib.profiler.heap.JavaClass; |
|
|
60 |
import org.netbeans.lib.profiler.heap.PrimitiveArrayInstance; |
60 |
|
61 |
|
61 |
|
62 |
|
62 |
/** |
63 |
/** |
Lines 196-201
Link Here
|
196 |
} |
197 |
} |
197 |
} |
198 |
} |
198 |
|
199 |
|
|
|
200 |
if ("java.lang.String".equals(instance.getJavaClass().getName())) { // NOI18N |
201 |
Object _value = instance.getValueOfField("value"); // NOI18N |
202 |
Object _offset = instance.getValueOfField("offset"); // NOI18N |
203 |
Object _count = instance.getValueOfField("count"); // NOI18N |
204 |
if (_value instanceof PrimitiveArrayInstance && ((Instance) _value).getJavaClass().getName().equals("char[]") && // NOI18N |
205 |
_offset instanceof Integer && _count instanceof Integer) { |
206 |
int offset = (Integer) _offset; |
207 |
int count = (Integer) _count; |
208 |
List fields = ((PrimitiveArrayInstance) _value).getValues(); |
209 |
StringBuilder logicalValue = new StringBuilder(); |
210 |
boolean truncated = false; |
211 |
if (count > PrimitiveArrayNode.MAX_CHAR_ARRAY_STRING_SIZE) { |
212 |
truncated = true; |
213 |
count = PrimitiveArrayNode.MAX_CHAR_ARRAY_STRING_SIZE; |
214 |
} |
215 |
for (int i = offset; i < offset + count; i++) { |
216 |
logicalValue.append((String) fields.get(i)); |
217 |
} |
218 |
if (truncated) { |
219 |
logicalValue.append(PrimitiveArrayNode.TRUNCATED_STRING); |
220 |
} |
221 |
return "#" + instance.getInstanceNumber() + " (\"" + logicalValue + "\")"; // NOI18N |
222 |
} |
223 |
} |
224 |
|
199 |
return "#" + instance.getInstanceNumber(); // NOI18N |
225 |
return "#" + instance.getInstanceNumber(); // NOI18N |
200 |
} |
226 |
} |
201 |
|
227 |
|