A status update: I'm probably about
95% done with porting the Leptonica routines -- I'm only porting those routines that my software uses. That's about 8,000 lines of code. I'm also about
90% complete with regression tests, to make sure my Java version does exactly the same thing as Leptonica.
While I was regression testing, I found a
bug in Leptonica! So I fixed that bug in the Java version, and logged a bug report against Leptonica.
The author of Leptonica claims that Leptonica is "regression tested" (see
ref, section "Implementation Characteristics"). When I first started the porting effort, I figured that I would use those regression tests against my code. Well, I couldn't find even a hint of any test cases in the source distribution for Leptonica. So I think maybe the author's idea and my idea of regression testing is different. (Hint: my idea is the right one

)
By the way, in the same section, the author claims Leptonica is thread-safe. BZZZT! I found him using a non-const global variable, so strike two.