[jbosstools-commits] JBoss Tools SVN: r41799 - trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/helpers.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Jun 7 18:00:30 EDT 2012


Author: scabanovich
Date: 2012-06-07 18:00:30 -0400 (Thu, 07 Jun 2012)
New Revision: 41799

Modified:
   trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/helpers/OpenRuleHelper.java
Log:
JBIDE-12135
https://issues.jboss.org/browse/JBIDE-12135



Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/helpers/OpenRuleHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/helpers/OpenRuleHelper.java	2012-06-07 21:48:26 UTC (rev 41798)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/helpers/OpenRuleHelper.java	2012-06-07 22:00:30 UTC (rev 41799)
@@ -55,20 +55,21 @@
 		if(webinf == null) return null;
 		XModelObject pagesXML = webinf.getChildByPath("pages.xml"); //$NON-NLS-1$
 		if(pagesXML == null) return null;
-		XModelObject pagesFolder = pagesXML.getChildByPath("Pages");
+		XModelObject pagesFolder = pagesXML.getChildByPath("Pages"); //$NON-NLS-1$
+		if(pagesFolder == null) return null; //happens when pages.xml is broken
 		XModelObject[] ps = pagesFolder.getChildren();
 		
 		for (int i = 0; i < ps.length; i++) {
-			String viewId = ps[i].getAttributeValue("view id");
+			String viewId = ps[i].getAttributeValue("view id"); //$NON-NLS-1$
 			if(!isPatternMatches(viewId, viewPath)) continue;
 			XModelObject[] ns = ps[i].getChildren();
 			for (int j = 0; j < ns.length; j++) {
 				String entity = ns[j].getModelEntity().getName();
-				if(!entity.startsWith("SeamPageNavigation")) continue;
+				if(!entity.startsWith("SeamPageNavigation")) continue; //$NON-NLS-1$
 				if(entity.startsWith("SeamPageNavigationRule")) continue;
 				XModelObject[] rs = ns[j].getChildren();
 				for (int k = 0; k < rs.length; k++) {
-					String a = rs[k].getAttributeValue("if outcome");
+					String a = rs[k].getAttributeValue("if outcome"); //$NON-NLS-1$
 					if(a != null && a.equals(action)) {
 						//TODO compare match length
 						return rs[k];



More information about the jbosstools-commits mailing list