提交 d51d9719 编写于 作者: Y yhuang

6959252: convert the anonymous arrays to named arrays in Java List Resource files

Reviewed-by: katakai, psun
上级 04582969
...@@ -45,7 +45,7 @@ public class TTYResources extends java.util.ListResourceBundle { ...@@ -45,7 +45,7 @@ public class TTYResources extends java.util.ListResourceBundle {
* @return the contents of this <code>ResourceBundle</code>. * @return the contents of this <code>ResourceBundle</code>.
*/ */
public Object[][] getContents() { public Object[][] getContents() {
return new Object[][] { Object[][] temp = new Object[][] {
// NOTE: The value strings in this file containing "{0}" are // NOTE: The value strings in this file containing "{0}" are
// processed by the java.text.MessageFormat class. Any // processed by the java.text.MessageFormat class. Any
// single quotes appearing in these strings need to be // single quotes appearing in these strings need to be
...@@ -449,5 +449,7 @@ public class TTYResources extends java.util.ListResourceBundle { ...@@ -449,5 +449,7 @@ public class TTYResources extends java.util.ListResourceBundle {
"For command help type ''help'' at {0} prompt"}, "For command help type ''help'' at {0} prompt"},
// END OF MATERIAL TO LOCALIZE // END OF MATERIAL TO LOCALIZE
}; };
return temp;
} }
} }
...@@ -29,7 +29,7 @@ import java.util.ListResourceBundle; ...@@ -29,7 +29,7 @@ import java.util.ListResourceBundle;
public class MsgAppletViewer extends ListResourceBundle { public class MsgAppletViewer extends ListResourceBundle {
public Object[][] getContents() { public Object[][] getContents() {
return new Object[][] { Object[][] temp = new Object[][] {
{"textframe.button.dismiss", "Dismiss"}, {"textframe.button.dismiss", "Dismiss"},
{"appletviewer.tool.title", "Applet Viewer: {0}"}, {"appletviewer.tool.title", "Applet Viewer: {0}"},
{"appletviewer.menu.applet", "Applet"}, {"appletviewer.menu.applet", "Applet"},
...@@ -197,5 +197,7 @@ public class MsgAppletViewer extends ListResourceBundle { ...@@ -197,5 +197,7 @@ public class MsgAppletViewer extends ListResourceBundle {
{"appletsecurityexception.checkread.unknown", "unknown class loader type. unable to check for checking read {0}"}, {"appletsecurityexception.checkread.unknown", "unknown class loader type. unable to check for checking read {0}"},
{"appletsecurityexception.checkconnect.unknown", "unknown class loader type. unable to check for checking connect"}, {"appletsecurityexception.checkconnect.unknown", "unknown class loader type. unable to check for checking connect"},
}; };
return temp;
} }
} }
...@@ -46,8 +46,6 @@ import static java.awt.event.KeyEvent.*; ...@@ -46,8 +46,6 @@ import static java.awt.event.KeyEvent.*;
*/ */
public class JConsoleResources extends ListResourceBundle { public class JConsoleResources extends ListResourceBundle {
private static final String cr = System.getProperty("line.separator");
/** /**
* Returns the contents of this <code>ResourceBundle</code>. * Returns the contents of this <code>ResourceBundle</code>.
* *
...@@ -56,8 +54,8 @@ public class JConsoleResources extends ListResourceBundle { ...@@ -56,8 +54,8 @@ public class JConsoleResources extends ListResourceBundle {
* @return the contents of this <code>ResourceBundle</code>. * @return the contents of this <code>ResourceBundle</code>.
*/ */
protected Object[][] getContents0() { protected Object[][] getContents0() {
return new Object[][] { Object[][] temp = new Object[][] {
// NOTE 1: The value strings in this file containing "{0}" are // NOTE 1: The value strings in this file containing "{0}" are
// processed by the java.text.MessageFormat class. Any // processed by the java.text.MessageFormat class. Any
// single quotes appearing in these strings need to be // single quotes appearing in these strings need to be
// doubled up. // doubled up.
...@@ -98,7 +96,7 @@ public class JConsoleResources extends ListResourceBundle { ...@@ -98,7 +96,7 @@ public class JConsoleResources extends ListResourceBundle {
{"Attributes","Attributes"}, {"Attributes","Attributes"},
{"Blank", "Blank"}, {"Blank", "Blank"},
{"BlockedCount WaitedCount", {"BlockedCount WaitedCount",
"Total blocked: {0} Total waited: {1}" + cr}, "Total blocked: {0} Total waited: {1}\n"},
{"Boot class path","Boot class path"}, {"Boot class path","Boot class path"},
{"BorderedComponent.moreOrLessButton.toolTip", "Toggle to show more or less information"}, {"BorderedComponent.moreOrLessButton.toolTip", "Toggle to show more or less information"},
{"CPU Usage","CPU Usage"}, {"CPU Usage","CPU Usage"},
...@@ -271,21 +269,21 @@ public class JConsoleResources extends ListResourceBundle { ...@@ -271,21 +269,21 @@ public class JConsoleResources extends ListResourceBundle {
{"Minimize All.mnemonic", 'M'}, {"Minimize All.mnemonic", 'M'},
{"Minus Version", "This is {0} version {1}"}, {"Minus Version", "This is {0} version {1}"},
{"Monitor locked", {"Monitor locked",
" - locked {0}" + cr}, " - locked {0}\n"},
{"Motif","Motif"}, {"Motif","Motif"},
{"Name Build and Mode","{0} (build {1}, {2})"}, {"Name Build and Mode","{0} (build {1}, {2})"},
{"Name and Build","{0} (build {1})"}, {"Name and Build","{0} (build {1})"},
{"Name","Name"}, {"Name","Name"},
{"Name: ","Name: "}, {"Name: ","Name: "},
{"Name State", {"Name State",
"Name: {0}" + cr + "Name: {0}\n" +
"State: {1}" + cr}, "State: {1}\n"},
{"Name State LockName", {"Name State LockName",
"Name: {0}" + cr + "Name: {0}\n" +
"State: {1} on {2}" + cr}, "State: {1} on {2}\n"},
{"Name State LockName LockOwner", {"Name State LockName LockOwner",
"Name: {0}" + cr + "Name: {0}\n" +
"State: {1} on {2} owned by: {3}" + cr}, "State: {1} on {2} owned by: {3}\n"},
{"New Connection...", "New Connection..."}, {"New Connection...", "New Connection..."},
{"New Connection....mnemonic", 'N'}, {"New Connection....mnemonic", 'N'},
{"New value applied","New value applied"}, {"New value applied","New value applied"},
...@@ -351,7 +349,7 @@ public class JConsoleResources extends ListResourceBundle { ...@@ -351,7 +349,7 @@ public class JConsoleResources extends ListResourceBundle {
{"Size Mb","{0} Mb"}, {"Size Mb","{0} Mb"},
{"Source","Source"}, {"Source","Source"},
{"Stack trace", {"Stack trace",
cr + "Stack trace: " + cr}, "\nStack trace: \n"},
{"Success:","Success:"}, {"Success:","Success:"},
// Note: SummaryTab.headerDateTimeFormat can be one the following: // Note: SummaryTab.headerDateTimeFormat can be one the following:
// 1. A combination of two styles for date and time, using the // 1. A combination of two styles for date and time, using the
...@@ -433,22 +431,27 @@ public class JConsoleResources extends ListResourceBundle { ...@@ -433,22 +431,27 @@ public class JConsoleResources extends ListResourceBundle {
{"plot", "plot"}, {"plot", "plot"},
{"visualize","visualize"}, {"visualize","visualize"},
{"zz usage text", {"zz usage text",
"Usage: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]" + cr + "Usage: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n" +
cr + " -interval Set the update interval to n seconds (default is 4 seconds)\n" +
" -interval Set the update interval to n seconds (default is 4 seconds)" + cr + " -notile Do not tile windows initially (for two or more connections)\n" +
" -notile Do not tile windows initially (for two or more connections)" + cr + " -pluginpath Specify the path that jconsole uses to look up the plugins\n\n" +
" -pluginpath Specify the path that jconsole uses to look up the plugins" + cr + " -version Print program version\n" +
" -version Print program version" + cr + " connection = pid || host:port || JMX URL (service:jmx:<protocol>://...)\n" +
cr + " pid The process id of a target process\n" +
" connection = pid || host:port || JMX URL (service:jmx:<protocol>://...)" + cr + " host A remote host name or IP address\n" +
" pid The process id of a target process" + cr + " port The port number for the remote connection\n\n" +
" host A remote host name or IP address" + cr + " -J Specify the input arguments to the Java virtual machine\n" +
" port The port number for the remote connection" + cr +
cr +
" -J Specify the input arguments to the Java virtual machine" + cr +
" on which jconsole is running"}, " on which jconsole is running"},
// END OF MATERIAL TO LOCALIZE // END OF MATERIAL TO LOCALIZE
}; };
String ls = System.getProperty("line.separator");
for(int i=0;i<temp.length;i++) {
temp[i][1] = temp[i][1].toString().replaceAll("\n",ls);
}
return temp;
} }
public synchronized Object[][] getContents() { public synchronized Object[][] getContents() {
......
...@@ -30,12 +30,14 @@ import java.util.ListResourceBundle; ...@@ -30,12 +30,14 @@ import java.util.ListResourceBundle;
public class MsgNative2ascii extends ListResourceBundle { public class MsgNative2ascii extends ListResourceBundle {
public Object[][] getContents() { public Object[][] getContents() {
return new Object[][] { Object[][] temp = new Object[][] {
{"err.bad.arg", "-encoding requires argument"}, {"err.bad.arg", "-encoding requires argument"},
{"err.cannot.read", "{0} could not be read."}, {"err.cannot.read", "{0} could not be read."},
{"err.cannot.write", "{0} could not be written."}, {"err.cannot.write", "{0} could not be written."},
{"usage", "Usage: native2ascii" + {"usage", "Usage: native2ascii" +
" [-reverse] [-encoding encoding] [inputfile [outputfile]]"}, " [-reverse] [-encoding encoding] [inputfile [outputfile]]"},
}; };
return temp;
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册