You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by kevinxu021 <gi...@git.apache.org> on 2015/10/14 08:39:56 UTC

[GitHub] incubator-trafodion pull request: [TRAFODION-1525]Locale for JDBCT...

GitHub user kevinxu021 opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/120

    [TRAFODION-1525]Locale for JDBCT4 doesn't work

    Change the base name of the bundler.
    Fixed an NullPointerException for messageArguments as well.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kevinxu021/incubator-trafodion t4err

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/120.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #120
    
----
commit 3af9220820110dd2253d0ff25759f01e2485c960
Author: kevinxu021 <ka...@esgyn.cn>
Date:   2015-10-14T04:03:13Z

    Merge pull request #1 from apache/master
    
    got latest changes

commit 9d50425d72f771cd5954cdccd033a7a70ff62dd6
Author: Kevin Xu <ka...@esgyn.cn>
Date:   2015-10-14T06:36:37Z

    For locale issues

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: [TRAFODION-1525]Locale for JDBCT...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-trafodion/pull/120


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: [TRAFODION-1525]Locale for JDBCT...

Posted by arvind-narain <gi...@git.apache.org>.
Github user arvind-narain commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/120#discussion_r42021824
  
    --- Diff: core/conn/jdbc_type4/src/org/trafodion/jdbc/t4/HPT4Messages.java ---
    @@ -251,18 +253,13 @@ static HPT4Exception createSQLException(T4Properties t4props, Locale msgLocale,
     			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;
    --- End diff --
    
    Do please check that ignoring msgLocale is ok for all callers.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: [TRAFODION-1525]Locale for JDBCT...

Posted by arvind-narain <gi...@git.apache.org>.
Github user arvind-narain commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/120#discussion_r42021375
  
    --- Diff: core/conn/jdbc_type4/src/org/trafodion/jdbc/t4/HPT4Messages.java ---
    @@ -295,7 +292,7 @@ static HPT4Exception createSQLException(T4Properties t4props, Locale msgLocale,
     			if (messageArguments != null) {
     				message = message.concat(" With parameters: ");
     				while (true) {
    -					message = message.concat(messageArguments[i++].toString());
    +					message = message.concat(messageArguments[i++] + "");
    --- End diff --
    
    This is minor - do we need to make the same change on line 83 also ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request: [TRAFODION-1525]Locale for JDBCT...

Posted by kevinxu021 <gi...@git.apache.org>.
Github user kevinxu021 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/120#discussion_r42072033
  
    --- Diff: core/conn/jdbc_type4/src/org/trafodion/jdbc/t4/HPT4Messages.java ---
    @@ -251,18 +253,13 @@ static HPT4Exception createSQLException(T4Properties t4props, Locale msgLocale,
     			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;
    --- End diff --
    
    Arvind, Dont worry about it. t4props is the only way to get locale and should be the only way. As i said, that is meaningless that some messages are Chinese but the others are English. If we do that, it will involve more misunderstandings.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---