Sometimes you need to be truly stuck in order to appreciate the capabilities of your vehicle. On a rough gravel bed, you will quickly find out how good the suspension and sturdy wheels of your bike really are. And likewise, when working on a urgent software development project, you will find out about the true power of open-source software when running into a library compatibility issue.
Let me explain, expand, expound and exposit:
Recently, I was working on adding SRX-based segmentation capabilities to an XLIFF converter. Rather than trying to reinvent the wheel, I decided to use the fantastic Okapi localization framework, which provides an SRX segmenter class (amongst many, many other useful things). It was easy enough to set up: Simply include the Okapi library jar in your Eclipse project, read through the excellent developer guide and off you go. Until that strange bug hits you, when trying to actually read in the first SRX file:
“ClassCastException: Cannot cast java.util.ArrayList (id=77) to org.w3c.dom.NodeList “.
“Very interesting”, you think to yourself, keeping the non-quotable exclamations well restrained inside your little developer brain. And then – the true power of open-source kicks in: Instead of trying to get hold of some tech support person and – if lucky – waiting for an updated release, I simply include the actual Okapi source code in my project. I can inspect the code, identify the problematic line, and modify it to make my own code work again.
In the end, it turned out that the XML parser library we were using was a bit out-of-date and that the return type of an XPath evaluation method was an ArrayList instead of the expected NodeList. Having written to the Okapi mailing list, I quickly got assistance from the ever so helpful Yves Savourel. However, in the meantime I was also able to continue on my project, after having modified the Okapi code, thanks to the open-ness of open-source software.
Sweet, isn’t it? Imagine what the situation might have been with a proprietary library…
Tags: okapi open-source