Is this the right place to fix the problem? Why not teach DRLVM to send
the timezone ID without the trailing newline?
Regards,
Tim
[EMAIL PROTECTED] wrote:
Author: ayza
Date: Mon Feb 11 04:52:38 2008
New Revision: 620477
URL: http://svn.apache.org/viewvc?rev=620477&view=rev
Log:
Fixing the issue with extra \n at the end of timezone ID returned by DRLVM. See
HARMONY-5476.
Modified:
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java
Modified:
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java
URL:
http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java?rev=620477&r1=620476&r2=620477&view=diff
==============================================================================
---
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java
(original)
+++
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java
Mon Feb 11 04:52:38 2008
@@ -302,6 +302,7 @@
if (AvailableZones == null) {
initializeAvailable();
}
+
TimeZone zone = AvailableZones.get(name);
if (zone == null) {
if (name.startsWith("GMT") && name.length() > 3) {
@@ -420,6 +421,11 @@
String zone = AccessController.doPrivileged(new PriviAction<String>(
"user.timezone"));
+
+ // sometimes DRLVM incorrectly adds "\n" to the end of timezone ID
+ if (zone.contains("\n")) {
+ zone = zone.substring(0, zone.indexOf("\n"));
+ }
// if property user.timezone is not set, we call the native method
// getCustomTimeZone