[threeten-dev] ZoneIdPrinterParser.parser and SubstringTree

Xueming Shen xueming.shen at oracle.com
Mon Dec 10 22:19:58 PST 2012


Stephen,

SubstringTree + zid parsing code currently only works with the case that 
the ZondID is
the last piece of the input text (I added back the TestZoneIdParser with 
a new startMatch).
It appears there are at least two issues here.

(1) L#2574, the last matched zoneid will get lost if there are more 
chars in the input, which
will fail the last try tree.get(...).

(2) There are two possible reasons tree.get(...) returns null. A 
mismatch OR the end of the branch
reached (longest zid found, no more try).

Here is the webrev to fix them. I also change the substringMap to only 
be initialized (create
the HashMap) if needed. My test suggests only less than 40 out of 500+ 
nodes (from current
zid list) are parent node that really needs a HashaMap. This might not 
be a big issue given the
the zid is mostly likely a one-time initialization. But we will probably 
use this for the ZoneText
parser as well, in which there will be one for each locale, each style...

http://cr.openjdk.java.net/~sherman/jdk8_threeten/zid_parser

-Sherman




More information about the threeten-dev mailing list