Skip to content

Commit d6f2a10

Browse files
committed
GH-474 reuse localized strings
1 parent 8d01dd1 commit d6f2a10

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

visualvm/heapviewer/src/org/graalvm/visualvm/heapviewer/java/impl/JavaThreadsProvider.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@
6666
class JavaThreadsProvider {
6767

6868
private static final String OPEN_THREADS_URL = "file:/stackframe/"; // NOI18N
69-
69+
private static final String LOCAL_VARIABLE = Bundle.JavaThreadsProvider_LocalVariable();
70+
private static final String JNI_LOCAL = Bundle.JavaThreadsProvider_JniLocal();
71+
7072

7173
static String getThreadName(Instance instance) {
7274
String threadName = getThreadInstanceName(instance);
@@ -166,9 +168,9 @@ protected HeapViewerNode[] computeChildren(RootNode root) {
166168
if (localInstance != null) {
167169
String text = "";
168170
if (GCRoot.JAVA_FRAME.equals(local.getKind())) {
169-
text = Bundle.JavaThreadsProvider_LocalVariable();
171+
text = LOCAL_VARIABLE;
170172
} else if (GCRoot.JNI_LOCAL.equals(local.getKind())) {
171-
text = Bundle.JavaThreadsProvider_JniLocal();
173+
text = JNI_LOCAL;
172174
}
173175
localVariableNodes.add(new LocalObjectNode(localInstance, text));
174176
} else {
@@ -261,9 +263,9 @@ static String getThreadsHTML(HeapContext context) {
261263
if (localInstance != null) {
262264
String text = "";
263265
if (GCRoot.JAVA_FRAME.equals(local.getKind())) {
264-
text = Bundle.JavaThreadsProvider_LocalVariable();
266+
text = LOCAL_VARIABLE;
265267
} else if (GCRoot.JNI_LOCAL.equals(local.getKind())) {
266-
text = Bundle.JavaThreadsProvider_JniLocal();
268+
text = JNI_LOCAL;
267269
}
268270
sb.append(" <span class=\"g\">" + text + ":</span> ").append(HeapUtils.instanceToHtml(localInstance, false, javaClassClass)).append("<br>"); // NOI18N
269271
} else {

0 commit comments

Comments
 (0)