Index: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java	(revision 21518)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java	(working copy)
@@ -439,8 +439,15 @@
 				}
 			}
 			if(index < i.getEndPosition()) {
-				sb.append(name.substring(index, i.getEndPosition()));
-				index = i.getEndPosition();
+				//fix has been added by Maksim Areshkau
+				// https://jira.jboss.org/jira/browse/JBIDE-6064
+				if(name.length()>i.getEndPosition()) {
+					sb.append(name.substring(index, i.getEndPosition()));
+					index = i.getEndPosition();
+				}else {
+					sb.append(name.substring(index, name.length()));
+					index =name.length();
+				}
 			}
 		}
 		sb.append(name.substring(index));
Index: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java	(revision 21518)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java	(working copy)
@@ -549,8 +549,8 @@
 									// refresh job in time, so we just ignore
 									// this exception
 								}
-							} catch(ClassCastException ex) {
-								VpePlugin.getDefault().reportProblem(ex);
+							} catch(Exception ex) {
+								VpePlugin.getPluginLog().logError(ex);
 							}
 							getChangeEvents().remove(eventBean);
 						}
@@ -1527,7 +1527,9 @@
 							// refresh job in time, so we just ignore this
 							// exception
 						}
-					} finally {
+					}catch (Exception ex){
+						VpePlugin.getPluginLog().logError(ex);
+					}finally {
 						if (switcher != null) {
 							switcher.stopActiveEditor();
 						}
Index: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java	(revision 21518)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java	(working copy)
@@ -93,6 +93,7 @@
 import org.jboss.tools.jsf.vpe.jsf.test.jbide.TaglibXMLUnformatedDTD_JBIDE5642;
 import org.jboss.tools.jsf.vpe.jsf.test.jbide.TestContextPathResolution;
 import org.jboss.tools.jsf.vpe.jsf.test.jbide.TestFViewLocaleAttribute_JBIDE5218;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.UnclosedELExpressionTest;
 import org.jboss.tools.jsf.vpe.jsf.test.jbide.TestForUsingComponentsLibrariesWithDefaultNamespace;
 import org.jboss.tools.jsf.vpe.jsf.test.jbide.TestOpenOnForXhtmlFiles_JBIDE5577;
 import org.jboss.tools.jsf.vpe.jsf.test.jbide.VPERefreshTest;
@@ -123,6 +124,7 @@
 
 		TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); //$NON-NLS-1$
 		// $JUnit-BEGIN$
+		suite.addTestSuite(UnclosedELExpressionTest.class);
 		suite.addTestSuite(TestContextPathResolution.class);
 		suite.addTestSuite(JBIDE5920Test.class);
 		suite.addTestSuite(RenderFacetAndInsertChildrenTest.class);
Index: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/6064/jbide6064.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/6064/jbide6064.xhtml.xml	(revision 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/6064/jbide6064.xhtml.xml	(revision 0)
@@ -0,0 +1,17 @@
+<tests>
+<test id="jbide6064Test">
+<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="border: 1px dashed rgb(42, 127, 0);">
+<DIV>
+<SPAN CLASS="__any__tag__caption">
+ui:composition
+</SPAN>
+<SPAN CLASS="__any__tag__caption" STYLE="color: red; font-style: italic;">
+Template file is not found: ""
+</SPAN>
+</DIV>
+<SPAN CLASS="vpe-text">
+#{{
+</SPAN>
+</DIV>
+</test>
+</tests>
Index: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/6064/jbide6064.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/6064/jbide6064.xhtml	(revision 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/6064/jbide6064.xhtml	(revision 0)
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:ui="http://java.sun.com/jsf/facelets"
+      xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:h="http://java.sun.com/jsf/html">
+
+	<ui:composition template="" id="jbide6064Test">
+	#{{
+	</ui:composition>
+</html>
