diff options
| author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-22 16:04:55 +0000 |
|---|---|---|
| committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-22 16:04:55 +0000 |
| commit | 94d43e7046ee9257b0e6684f41783b9f947c59d9 (patch) | |
| tree | b6cca022867a508330c4917198eb1491fc030faa /libjava/classpath/java/util/Date.java | |
| parent | 3ab1d71055c182b3bd71a63ee47905eb700f1745 (diff) | |
| download | ppe42-gcc-94d43e7046ee9257b0e6684f41783b9f947c59d9.tar.gz ppe42-gcc-94d43e7046ee9257b0e6684f41783b9f947c59d9.zip | |
libjava/
PR libgcj/17002
PR classpath/28550
* java/util/VMTimeZone.java (getDefaultTimeZoneId): To read
/etc/localtime, use ZoneInfo.readTZFile instead of
VMTimeZone.readtzFile. Get better timezone name for /etc/localtime,
either if it is a symlink or through /etc/sysconfig/clock.
(readSysconfigClockFile): New static method.
(readtzFile): Removed.
* java/lang/System.java: Add gnu.java.util.zoneinfo.dir to comments.
* posix.cc (_Jv_platform_initProperties): Set
gnu.java.util.zoneinfo.dir.
* sources.am (gnu_java_util_source_files): Add
classpath/gnu/java/util/ZoneInfo.java.
* Makefile.in: Regenerated.
* java/util/VMTimeZone.h: Regenerated.
* java/util/TimeZone.h: Regenerated.
* gnu/java/util/ZoneInfo.h: Generated.
libjava/classpath/
* java/util/Date.java (parse): Properly parse 09:01:02 as
hours/minutes/seconds, not as hours/minutes/year.
* java/util/SimpleTimeZone.java (SimpleTimeZone): Simplify
{start,end}TimeMode constructor by calling shorter constructor,
set {start,end}TimeMode fields after it returns.
(setStartRule): Don't adjust startTime into WALL_TIME. Set
startTimeMode to WALL_TIME.
(endStartRule): Similarly.
(getOffset): Handle properly millis + dstOffset overflowing into the
next day. Adjust startTime resp. endTime based on startTimeMode
resp. endTimeMode.
* java/util/TimeZone.java (zoneinfo_dir, availableIDs, aliases0): New
static fields.
(timezones): Remove synchronized keyword. Set zoneinfo_dir.
If non-null, set up aliases0 and don't put anything into
timezones0.
(defaultZone): Call getTimeZone instead of timezones().get.
(getDefaultTimeZone): Fix parsing of EST5 or EST5EDT6. Use
getTimeZoneInternal instead of timezones().get.
(parseTime): Parse correctly hour:minute.
(getTimeZoneInternal): New private method.
(getTimeZone): Do the custom ID checking first, canonicalize
ID for custom IDs as required by documentation. Call
getTimeZoneInternal to handle the rest.
(getAvailableIDs(int)): Add locking. Handle zoneinfo_dir != null.
(getAvailableIDs(File,String,ArrayList)): New private method.
(getAvailableIDs()): Add locking. Handle zoneinfo_dir != null.
* gnu/java/util/ZoneInfo.java: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122229 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/java/util/Date.java')
| -rw-r--r-- | libjava/classpath/java/util/Date.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libjava/classpath/java/util/Date.java b/libjava/classpath/java/util/Date.java index 5c43bf3c154..f481753db8d 100644 --- a/libjava/classpath/java/util/Date.java +++ b/libjava/classpath/java/util/Date.java @@ -754,6 +754,7 @@ public class Date } else if (firstch >= '0' && firstch <= '9') { + int lastPunct = -1; while (tok != null && tok.length() > 0) { int punctOffset = tok.length(); @@ -791,6 +792,13 @@ public class Date else minute = num; } + else if (lastPunct == ':' && hour >= 0 && (minute < 0 || second < 0)) + { + if (minute < 0) + minute = num; + else + second = num; + } else if ((num >= 70 && (punct == ' ' || punct == ',' || punct == '/' || punct < 0)) @@ -828,6 +836,7 @@ public class Date tok = null; else tok = tok.substring(punctOffset + 1); + lastPunct = punct; } } else if (firstch >= 'A' && firstch <= 'Z') |

