JBIDE-13897 via cherry-pick plus small merge issues