Author: scabanovich
Date: 2011-11-15 19:49:18 -0500 (Tue, 15 Nov 2011)
New Revision: 36359
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.verification/src/org/jboss/tools/jst/web/verification/vrules/CheckResource.java
Log:
JBIDE-10177
https://issues.jboss.org/browse/JBIDE-10177
Fix for verification of error page with .xhtml extension, when default suffix is not
specified.
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.verification/src/org/jboss/tools/jst/web/verification/vrules/CheckResource.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.verification/src/org/jboss/tools/jst/web/verification/vrules/CheckResource.java 2011-11-16
00:20:01 UTC (rev 36358)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.verification/src/org/jboss/tools/jst/web/verification/vrules/CheckResource.java 2011-11-16
00:49:18 UTC (rev 36359)
@@ -53,14 +53,15 @@
if("true".equals(rule.getProperty("acceptEmpty"))) return null;
//$NON-NLS-1$ //$NON-NLS-2$
return fire(object, attribute + ".empty", attribute, null); //$NON-NLS-1$
}
- String value1 = !value.startsWith("/") ? "/" + value : value;
//$NON-NLS-1$ //$NON-NLS-2$
- XModelObject tld = XModelImpl.getByRelativePath(model, value1);
- if(tld == null) {
- return fire(object, attribute + ".exists", attribute, value); //$NON-NLS-1$
+
+ XModelObject o = null;
+ for (Object v: list) {
+ String valuei = v.toString();
+ String value2 = valuei.startsWith("/") ? valuei.substring(1) : valuei;
//$NON-NLS-1$
+ o = webRoot.getChildByPath(value2);
+ if(o != null) break;
}
- String value2 = value.startsWith("/") ? value.substring(1) : value;
//$NON-NLS-1$
- XModelObject tld2 = webRoot.getChildByPath(value2);
- if(tld2 == null) {
+ if(o == null) {
return fire(object, attribute + ".exists", attribute, value); //$NON-NLS-1$
}
if(!checkExtensions(value)) {