Author: scabanovich
Date: 2011-06-02 20:19:44 -0400 (Thu, 02 Jun 2011)
New Revision: 31792
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentRecognizer.java
Log:
JBIDE-9060
https://issues.jboss.org/browse/JBIDE-9060
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentRecognizer.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentRecognizer.java 2011-06-03
00:17:55 UTC (rev 31791)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentRecognizer.java 2011-06-03
00:19:44 UTC (rev 31792)
@@ -20,12 +20,22 @@
}
private boolean isComponents(String body) {
- int i = body.indexOf("<html"); //$NON-NLS-1$
- if(i < 0) return false;
- int j = body.indexOf(">", i); //$NON-NLS-1$
- if(j < 0) return false;
- String s = body.substring(i, j);
- return s.indexOf("\"" + COMPOSITE_XMLNS + "\"") >
0; //$NON-NLS-1$ //$NON-NLS-2$
+ String q = "\""; //$NON-NLS-1$
+ int i = body.indexOf(q + COMPOSITE_XMLNS + q);
+ while(i > 0) {
+ int j = body.lastIndexOf("xmlns", i); //$NON-NLS-1$
+ if(j > 0) {
+ int k = body.indexOf("=", j); //$NON-NLS-1$
+ if(k > j && k < i) {
+ int l = body.indexOf(q, k);
+ if(l == i) {
+ return true;
+ }
+ }
+ }
+ i = body.indexOf(q + COMPOSITE_XMLNS + q, i + 1);
+ }
+ return false;
}
-
+
}