Monday, March 8, 2010

Glasses

Coworkers and friends pointed out to me a few times in the last couple of months that I couldn't see things that I ought to have been able to. Text on a television screen, the menu items written up on a wall, etc. So I went and got an eye exam this morning.

The last time I had an eye exam I think I was 14 or 15 years old. I went because my eyes were *constantly* dry, so much so that I carried around a bottle of eyedrops with me for months on end. I guess Mom or Dad thought it might've been some sort of eye problem so I got an eye exam. I distinctly remember during the exam that I was only asked to read the top few lines of the eye chart, even though I could clearly read every line on the thing. Sure enough, it turned out my vision was fine, I just had dry eyes.

Fast forward 15 years, and I'm sitting in an exam room with the eye chart on the opposite wall and I realize that even the top most line is a bit blurry. And there's no way I'm reading anything below the second line. Funny how it took looking at an eye chart (even before the doctor came in) to make that painfully obvious.

So in comes the doctor and repeats the same procedure as my last eye exam. "Which is better? One? Or Two? One? .... or Two?" Only this time my vision actually gets better. Having never worn glasses, it's really odd to just put something in front of your eyes and suddenly see detail that wasn't there a second ago. It's like life is suddenly in HD. (again)

After the exam I was walked next door to peruse frames. They sat me down at a desk and brought me different frames to try on, which seemed rather inefficient -- I could've walked around the place and tried on the frames that they had on display myself, but instead the sales guy kept popping back into the back to get some more. I asked if he had any frameless glasses to try on. I can't remember his exact reply, but it was something along the lines of "You don't want those, you're not old. We can do better." Ok, whatever. I ended up with some rectangular jobbers trimmed in a thin charcoal-colored metallic frame. Still not sure whether I actually like them, but they don't have to be stylin' if I'm mostly going to wear them for driving.

Thursday, March 4, 2010

Weird Java SAX XML Parsing Error

One of our customers reported some erroneous data output by our command-line client. After about a day's worth of tracing code, I traced the bad data to the default implementation of SAXParser in Sun's Java 6 JRE.

We use Apache XML-RPC as an XMLRPC client, and it just calls out to SAXParserFactory.newInstance() to grab a SAX implementation. Java 5 and 6 both offer default implementations, but the error only appears in Java 6 JREs. In my debugging, I can see the JRE6 implementation passing in obviously bad data to the ContentHandler.characters() method in the Apache XMLRPC implementation.

Thankfully, if you drop in a replacement SAX parser, Sun's implementation will call out to it, so fixing the error was as easy as dropping in Apache Xerces.

The thing is, I'd like to track down the issue so I can make a proper bug report. I haven't been able to find any similar bug reports via googling or directly searching Sun's bug database.

The bad data is coming from "com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser", so it looks like it's a(n older) version of Xerces, but after about 15 minutes of searching I still hadn't found the correct version of source code to attach to my debugger. If anyone has suggestions let me know, but otherwise I think I'm going to give up searching for the root cause of the issue.