Restructured shim's patch method if/else logic and added comments

The shim code is now a closer match to the style of the original OpenJDK code.
The code is a little more complex with added if/else nesting, but allows for better explanatory comments.