
Hi Gerd, I have been having difficulties with the mkgmap test code which uses the discontinued javax.xml.bind.DatatypeConverter for a single function printHexBinary. Despite downloading a copy of the library and telling Eclipse to use it, it doesn't seem to want to work. I found a replacement bit of code on the Internet, but as I can't compare the two outputs I can't confirm its output is identical. Can you take a look at the attached patch which does away with the dependency on javax and allows the tests to run under the latest version of Eclipse? Thanks, Mike

Hi Mike, I've not written that code and I don't know why DatatypeConverter.printHexBinary is used. @Steve: Please have a look. Reg. Eclipse: I use Eclipse "Version: 2020-12 (4.18.0) Build id: 20201210-1552" with the JRE that comes with AdoptOpenJDK\jdk-11.0.9.11-hotspot and the JDK AdoptOpenJDK\jdk-8.0.272.10-hotspot. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Mike Baggaley <mike@tvage.co.uk> Gesendet: Montag, 29. März 2021 23:47 An: 'Development list for mkgmap' Betreff: [mkgmap-dev] rules test Hi Gerd, I have been having difficulties with the mkgmap test code which uses the discontinued javax.xml.bind.DatatypeConverter for a single function printHexBinary. Despite downloading a copy of the library and telling Eclipse to use it, it doesn't seem to want to work. I found a replacement bit of code on the Internet, but as I can't compare the two outputs I can't confirm its output is identical. Can you take a look at the attached patch which does away with the dependency on javax and allows the tests to run under the latest version of Eclipse? Thanks, Mike

On 29/03/2021 22:47, Mike Baggaley wrote:
I have been having difficulties with the mkgmap test code which uses the discontinued javax.xml.bind.DatatypeConverter for a single function printHexBinary. Despite downloading a copy of the library and telling Eclipse to use it, it doesn't seem to want to work. I found a replacement bit of code on the Internet, but as I can't compare the two outputs I can't confirm its output is identical. Can you take a look at the attached patch which does away with the dependency on javax and allows the tests to run under the latest version of Eclipse?
So java 1.11 has removed all of the javax.* classes, so we need a replacement. The patch is fine and gives the same results, but since we are now using java 1.8 you can do this in one line like so: String s = String.format("%032x", new BigInteger(1, digest)).substring(0, 8); [You can add '.toUpperCase(Locale.ROOT)' if you want to preserve the uppercase names which I don't think is important.] Cheers, Steve
participants (3)
-
Gerd Petermann
-
Mike Baggaley
-
Steve Ratcliffe