Author: scabanovich
Date: 2011-08-09 16:44:15 -0400 (Tue, 09 Aug 2011)
New Revision: 33736
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
JBIDE-9484
https://issues.jboss.org/browse/JBIDE-9484
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2011-08-09
20:15:03 UTC (rev 33735)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2011-08-09
20:44:15 UTC (rev 33736)
@@ -482,6 +482,21 @@
public Dependencies getDependencies() {
return dependencies;
}
+
+ public Dependencies getAllDependencies() {
+ Set<CDICoreNature> ns = project.getCDIProjects(true);
+ if(!ns.isEmpty()) {
+ Dependencies d = new Dependencies();
+ d.direct.putAll(dependencies.direct);
+ d.reverse.putAll(dependencies.reverse);
+ for (CDICoreNature n: ns) {
+ d.direct.putAll(n.getDefinitions().getDependencies().direct);
+ d.reverse.putAll(n.getDefinitions().getDependencies().reverse);
+ }
+ return d;
+ }
+ return dependencies;
+ }
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-08-09
20:15:03 UTC (rev 33735)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-08-09
20:44:15 UTC (rev 33736)
@@ -113,6 +113,7 @@
IValidatingProjectTree projectTree;
IValidatingProjectSet projectSet;
Set<IFolder> sourceFolders;
+ Dependencies dependencies;
private Set<IInjectionPointValidatorFeature> injectionValidationFeatures;
@@ -209,6 +210,7 @@
if(cdiProject==null) {
CDICorePlugin.getDefault().logError("Trying to validate " + rootProject +
" but CDI Tools model for the project is not built.");
}
+ dependencies = nature.getDefinitions().getAllDependencies();
injectionValidationFeatures =
nature.getExtensionManager().getFeatures(IInjectionPointValidatorFeature.class);
}
projectName = projectSet.getRootProject().getName();
@@ -231,10 +233,9 @@
Set<IPath> resources = new HashSet<IPath>(); // Resources which we have
// to validate.
Set<IPath> resourcesToClean = new HashSet<IPath>(); // Resource which we
should remove from validation context
- Dependencies ds = cdiProject.getNature().getDefinitions().getDependencies();
for(IFile file: changedFiles) {
resourcesToClean.add(file.getFullPath());
- Set<IPath> dd = ds.getDirectDependencies(file.getFullPath());
+ Set<IPath> dd = dependencies.getDirectDependencies(file.getFullPath());
if(dd != null) {
for (IPath p: dd) {
IFile f = root.getFile(p);
@@ -414,8 +415,7 @@
displaySubtask(CDIValidationMessages.VALIDATING_RESOURCE, new String[]
{file.getProject().getName(), file.getName()});
coreHelper.getValidationContextManager().addValidatedProject(this, file.getProject());
- Dependencies ds = cdiProject.getNature().getDefinitions().getDependencies();
- Set<IPath> dd = ds.getDirectDependencies(file.getFullPath());
+ Set<IPath> dd = dependencies.getDirectDependencies(file.getFullPath());
if(dd != null && !dd.isEmpty()) {
Set<IPath> resources = new HashSet<IPath>();
for (IPath p: dd) {
@@ -451,6 +451,10 @@
validateInterceptorBinding(binding);
}
Set<IValidatorFeature> extensions =
cdiProject.getNature().getExtensionManager().getValidatorFeatures();
+ Set<CDICoreNature> ns = cdiProject.getNature().getCDIProjects();
+ for (CDICoreNature n: ns) {
+ extensions.addAll(n.getExtensionManager().getValidatorFeatures());
+ }
for (IValidatorFeature v: extensions) {
setSeverityPreferences(v.getSeverityPreferences());
v.validateResource(file, this);