[384154] Web overlay not detected during JSP validation
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java
index 1339508..02ec475 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse License v1.0
* which accompanies this distribution, and is available at
@@ -26,6 +26,7 @@
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
/**
@@ -149,6 +150,10 @@
}
}
}
+ else {
+ // check assembled projects
+ return resolveInReferenced(project, referenceRuntimePath);
+ }
}
}
}
@@ -162,4 +167,26 @@
}
return null;
}
+ private static IPath resolveInReferenced(IProject project, IPath runtimeReference) {
+ IVirtualReference[] references = ComponentCore.createComponent(project).getReferences();
+ if (references != null) {
+ for (int i = 0; i < references.length; i++) {
+ IVirtualComponent referencedComponent = references[i].getReferencedComponent();
+ if (referencedComponent == null)
+ continue;
+ IVirtualComponent component = referencedComponent.getComponent();
+ if (component == null)
+ continue;
+ IVirtualFolder rootFolder = component.getRootFolder();
+ if (rootFolder == null)
+ continue;
+ // overlay?
+ IVirtualResource member = rootFolder.findMember(runtimeReference);
+ if (member != null) {
+ return member.getWorkspaceRelativePath();
+ }
+ }
+ }
+ return null;
+ }
}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java
index a11f012..e96469a 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse License v1.0
* which accompanies this distribution, and is available at
@@ -26,6 +26,7 @@
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
/**
@@ -149,6 +150,10 @@
}
}
}
+ else {
+ // check assembled projects
+ return resolveInReferenced(project, referenceRuntimePath);
+ }
}
}
}
@@ -162,4 +167,27 @@
}
return null;
}
+
+ private static IPath resolveInReferenced(IProject project, IPath runtimeReference) {
+ IVirtualReference[] references = ComponentCore.createComponent(project).getReferences();
+ if (references != null) {
+ for (int i = 0; i < references.length; i++) {
+ IVirtualComponent referencedComponent = references[i].getReferencedComponent();
+ if (referencedComponent == null)
+ continue;
+ IVirtualComponent component = referencedComponent.getComponent();
+ if (component == null)
+ continue;
+ IVirtualFolder rootFolder = component.getRootFolder();
+ if (rootFolder == null)
+ continue;
+ // overlay?
+ IVirtualResource member = rootFolder.findMember(runtimeReference);
+ if (member != null) {
+ return member.getWorkspaceRelativePath();
+ }
+ }
+ }
+ return null;
+ }
}