fixing code after java driver upgrade