Fix Spring PRD and Java code generation failing due to null target states.