[jbosstools-commits] JBoss Tools SVN: r35328 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Tue Oct 4 11:36:05 EDT 2011


Author: dmaliarevich
Date: 2011-10-04 11:36:05 -0400 (Tue, 04 Oct 2011)
New Revision: 35328

Modified:
   trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
https://issues.jboss.org/browse/JBIDE-9827 Check for null has been added.

Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java	2011-10-04 15:10:52 UTC (rev 35327)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java	2011-10-04 15:36:05 UTC (rev 35328)
@@ -338,16 +338,24 @@
 				|| includeDocuments == null) {
 			throw new VpeDisposeException();
 		}
-		// check source node can be changed and link can be a null in this case
-		// we shouldn't process this node
-		if (sourceNode.getNodeType() != Node.TEXT_NODE
-			&& sourceNode.getNodeType() != Node.ELEMENT_NODE
-			&& sourceNode.getNodeType() != Node.COMMENT_NODE 
-			&& sourceNode.getNodeType() != Node.CDATA_SECTION_NODE
-			&& sourceNode.getNodeType() != Node.DOCUMENT_NODE) {
+		/*
+		 * 1) source node can be changed and link can be a null in this case --
+		 * we shouldn't process this node
+		 * 2) https://issues.jboss.org/browse/JBIDE-9827
+		 * Every source node's change/update causes a new update job, 
+		 * every update job is put to the queue.
+		 * When there is the update job for the same node in the queue -- 
+		 * the oldest one is removed from the queue, and then sourceNode could be null. 
+		 */
+		if ((sourceNode==null)
+				||(sourceNode.getNodeType() != Node.TEXT_NODE
+	 			&& sourceNode.getNodeType() != Node.ELEMENT_NODE
+	 			&& sourceNode.getNodeType() != Node.COMMENT_NODE 
+	 			&& sourceNode.getNodeType() != Node.CDATA_SECTION_NODE
+				&& sourceNode.getNodeType() != Node.DOCUMENT_NODE)) {
 			return null;
 		}
-
+		
 		Set<Node> ifDependencySet = new HashSet<Node>();
 		pageContext.setCurrentVisualNode(visualOldContainer);
 		VpeTemplate template = getTemplateManager().getTemplate(pageContext,



More information about the jbosstools-commits mailing list