Typo in native-glass/win/OleUtils.h checkJavaException

Scott Palmer swpalmer at gmail.com
Wed Nov 20 15:07:13 UTC 2019

I discovered this by accident while trying to figure out where a certain
console message was coming from while debugging.

I saw this printed to the console when testing my (broken) code:

    Java Messsge:com/openalpr/jni/AlprException

Note the typo in "Messsge" (the class name that follows is specific to what
I was testing).

I couldn't find the string "Java Messsge" in any of my code or the library
I was trying out (OpenALPR).  Eventually I found it was in glass.dll and
traced it to the checkJavaException function in OleUtils.h, line 230.

On another note, I see that function is declared as "inline", though I
suspect the body of the "else" really doesn't need to be inlined and the
extra size it adds to the method could make it less likely to actually get
inlined. It seems the part that you want inlined is the if
(!env-ExceptionCheck()) { return S_OK; }. Wouldn't the rest run very rarely
and not benefit from being inlined?  If that code does get inlined it would
bloat the code unnecessarily.  The premature optimizer in me (it's an evil
I have trouble controlling) thinks this just makes stuff less
cache-friendly.  I would put it in another not-inlined method.  Also note
that using "else" is redundant.


More information about the openjfx-dev mailing list