Fixed class cast exception in new java pdp code