agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java
Print this page
@@ -217,11 +217,11 @@
private static void initThreadFields() {
if (threadNameField == null) {
SystemDictionary sysDict = VM.getVM().getSystemDictionary();
InstanceKlass k = sysDict.getThreadKlass();
- threadNameField = (OopField) k.findField("name", "[C");
+ threadNameField = (OopField) k.findField("name", "Ljava/lang/String;");
threadGroupField = (OopField) k.findField("group", "Ljava/lang/ThreadGroup;");
threadEETopField = (LongField) k.findField("eetop", "J");
threadTIDField = (LongField) k.findField("tid", "J");
threadStatusField = (IntField) k.findField("threadStatus", "I");
threadParkBlockerField = (OopField) k.findField("parkBlocker",
@@ -256,11 +256,11 @@
return threadGroupField.getValue(threadOop);
}
public static String threadOopGetName(Oop threadOop) {
initThreadFields();
- return charArrayToString((TypeArray) threadNameField.getValue(threadOop));
+ return stringOopToString(threadNameField.getValue(threadOop));
}
/** May return null if, e.g., thread was not started */
public static JavaThread threadOopGetJavaThread(Oop threadOop) {
initThreadFields();