You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by ar...@apache.org on 2015/10/14 23:58:53 UTC
[1/2] incubator-trafodion git commit: For locale issues
Repository: incubator-trafodion
Updated Branches:
refs/heads/master e4b7b2b32 -> ab8f637ee
For locale issues
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/9d50425d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/9d50425d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/9d50425d
Branch: refs/heads/master
Commit: 9d50425d72f771cd5954cdccd033a7a70ff62dd6
Parents: 3af9220
Author: Kevin Xu <ka...@esgyn.cn>
Authored: Wed Oct 14 14:36:37 2015 +0800
Committer: Kevin Xu <ka...@esgyn.cn>
Committed: Wed Oct 14 14:36:37 2015 +0800
----------------------------------------------------------------------
.../src/org/trafodion/jdbc/t4/HPT4Messages.java | 23 +++++++++-----------
1 file changed, 10 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9d50425d/core/conn/jdbc_type4/src/org/trafodion/jdbc/t4/HPT4Messages.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbc_type4/src/org/trafodion/jdbc/t4/HPT4Messages.java b/core/conn/jdbc_type4/src/org/trafodion/jdbc/t4/HPT4Messages.java
index f72d867..cf58470 100644
--- a/core/conn/jdbc_type4/src/org/trafodion/jdbc/t4/HPT4Messages.java
+++ b/core/conn/jdbc_type4/src/org/trafodion/jdbc/t4/HPT4Messages.java
@@ -43,12 +43,14 @@ class HPT4Messages {
log.logp(Level.WARNING, "HPT4Messages", "createSQLWarning", "", p);
}
- Locale currentLocale = (t4props != null) ? t4props.getLocale() : Locale.getDefault();
+ Locale currentLocale = t4props == null ? null : t4props.getLocale();
+ currentLocale = currentLocale == null ? Locale.getDefault() : currentLocale;
+
int sqlcode = 1;
SQLWarning ret = null;
try {
- PropertyResourceBundle messageBundle = (PropertyResourceBundle) ResourceBundle.getBundle("HPT4Messages",
+ PropertyResourceBundle messageBundle = (PropertyResourceBundle) ResourceBundle.getBundle("T4Messages",
currentLocale);
MessageFormat formatter = new MessageFormat("");
@@ -251,18 +253,13 @@ class HPT4Messages {
Object p[] = T4LoggingUtilities.makeParams(t4props, messageId, messageArguments);
log.logp(Level.SEVERE, "HPT4Messages", "createSQLException", "", p);
}
-
- Locale currentLocale;
+
+ Locale currentLocale = t4props == null ? null : t4props.getLocale();
+ currentLocale = currentLocale == null ? Locale.getDefault(): currentLocale;
+
int sqlcode;
-
- if (msgLocale == null) {
- currentLocale = Locale.getDefault();
- } else {
- currentLocale = msgLocale;
-
- }
try {
- PropertyResourceBundle messageBundle = (PropertyResourceBundle) ResourceBundle.getBundle("HPT4Messages",
+ PropertyResourceBundle messageBundle = (PropertyResourceBundle) ResourceBundle.getBundle("T4Messages",
currentLocale);
MessageFormat formatter = new MessageFormat("");
@@ -295,7 +292,7 @@ class HPT4Messages {
if (messageArguments != null) {
message = message.concat(" With parameters: ");
while (true) {
- message = message.concat(messageArguments[i++].toString());
+ message = message.concat(messageArguments[i++] + "");
if (i >= messageArguments.length) {
break;
} else {
[2/2] incubator-trafodion git commit: Merge [TRAFODION-1525] PR-120
Locale for JDBCT4 doesn't work
Posted by ar...@apache.org.
Merge [TRAFODION-1525] PR-120 Locale for JDBCT4 doesn't work
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/ab8f637e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/ab8f637e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/ab8f637e
Branch: refs/heads/master
Commit: ab8f637ee6105f7480766f0a1c9c407158c7a6fe
Parents: e4b7b2b 9d50425
Author: Arvind Narain <ar...@apache.org>
Authored: Wed Oct 14 21:53:15 2015 +0000
Committer: Arvind Narain <ar...@apache.org>
Committed: Wed Oct 14 21:53:15 2015 +0000
----------------------------------------------------------------------
.../src/org/trafodion/jdbc/t4/HPT4Messages.java | 23 +++++++++-----------
1 file changed, 10 insertions(+), 13 deletions(-)
----------------------------------------------------------------------