JBIDE-12308/JBIDE-12847 : VPE throws StackOverflowError and visual part is blank

JBIDE-12847: Cherry-picking changes from JBIDE-12308 (master) to 3.3.x
JBIDE-12308/JBIDE-12847 : VPE throws StackOverflowError and visual part is blank

JBIDE-12847: Cherry-picking changes from JBIDE-12308 (master) to 3.3.x