Author: scabanovich
Date: 2007-09-20 11:59:50 -0400 (Thu, 20 Sep 2007)
New Revision: 3735
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
Log:
JBIDE-922
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-09-20
13:28:01 UTC (rev 3734)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-09-20
15:59:50 UTC (rev 3735)
@@ -758,10 +758,23 @@
factories.remove();
allVariables.remove(f);
fireChanges(changes);
+// System.out.println("Factory removed 1 " + f.getName());
}
}
+
+ firePathRemovedToDependentProjects(source);
}
-
+
+ public void firePathRemovedToDependentProjects(IPath source) {
+ if(usedBy.size() == 0) return;
+ if(source.toString().endsWith(".jar")) return;
+
+ for (SeamProject p : usedBy) {
+ p.resolve();
+ p.pathRemoved(source);
+ }
+ }
+
/**
*
* @param source
@@ -866,6 +879,7 @@
if(removed.containsKey(c.getId())) {
iterator.remove();
allVariables.remove(c);
+// System.out.println("Factory removed 2 " + c.getName());
changes = Change.addChange(changes, new Change(this, null, c, null));
}
}
@@ -1051,6 +1065,7 @@
*/
public void removeFactory(ISeamFactory factory) {
allFactories.remove(factory);
+// System.out.println("Factory removed 3 " + factory.getName());
allVariables.remove(factory);
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2007-09-20
13:28:01 UTC (rev 3734)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2007-09-20
15:59:50 UTC (rev 3735)
@@ -206,6 +206,21 @@
}
private void validateFactory(ISeamFactory factory, Set<String>
markedDuplicateFactoryNames) {
+
+ if(factory.getResource() == null) {
+ IPath source = factory.getSourcePath();
+ String name = factory.getName();
+ String message = null;
+ if(factory.getSeamProject() != null) {
+ factory.getSeamProject().removeFactory(factory);
+ message = "Seam core validator detected factory with null resource " +
"(name=" + name + " source=" + source + ").";
+ } else {
+ message = "Seam core validator detected factory with null resource " +
"(name=" + name + " source=" + source + ")" + " and
null parent in seam model.";
+ }
+ SeamCorePlugin.getPluginLog().logInfo(message);
+ return;
+ }
+
if(coreHelper.isJar(factory.getResource())) {
return;
}