compiler: java: handle checked exceptions when reading sequences