corrected 4 gnarly bugs: 1. no "static" local variables in java, UART decoder is re-entrant. 2. no unsigned types in java, need to mask out signed bit, 3. an OR instead of a "+", porting error, 4. a wrong state change, porting error.