Author: scabanovich
Date: 2010-12-30 08:04:10 -0500 (Thu, 30 Dec 2010)
New Revision: 27823
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/scanner/lib/ClassPath.java
Log:
JBIDE-8024
https://issues.jboss.org/browse/JBIDE-8024
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 2010-12-30
08:54:55 UTC (rev 27822)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2010-12-30
13:04:10 UTC (rev 27823)
@@ -735,6 +735,17 @@
//we need that, or registering will remove them
ds.getNamespaces().addAll(ns);
}
+
+ Iterator<ISeamComponentDeclaration> it = ds.getComponents().iterator();
+ while(it.hasNext()) {
+ ISeamComponentDeclaration d = it.next();
+ if(d instanceof ISeamJavaComponentDeclaration) {
+ ISeamJavaComponentDeclaration sd = (ISeamJavaComponentDeclaration)d;
+ if(sd.getClassName() == null) {
+ it.remove();
+ }
+ }
+ }
registerComponents(ds, path);
long t2 = System.currentTimeMillis();
@@ -1335,6 +1346,9 @@
*/
public Set<ISeamComponent> getComponentsByClass(String className) {
Set<ISeamComponent> result = new HashSet<ISeamComponent>();
+ if(className == null) {
+ return result;
+ }
Set<SeamComponentDeclaration> ds =
components.getDeclarationsByClasName(className);
if(ds == null) return result;
for (SeamComponentDeclaration d: ds) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2010-12-30
08:54:55 UTC (rev 27822)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2010-12-30
13:04:10 UTC (rev 27823)
@@ -13,7 +13,6 @@
import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -159,14 +158,16 @@
List<SeamProject> getSeamProjects(IProject project) throws CoreException {
List<SeamProject> list = new ArrayList<SeamProject>();
- IJavaProject javaProject = JavaCore.create(project);
- IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
- for (int i = 0; i < es.length; i++) {
- if(es[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) {
- IProject p =
ResourcesPlugin.getWorkspace().getRoot().getProject(es[i].getPath().lastSegment());
- if(p == null || !p.isAccessible()) continue;
- ISeamProject sp = SeamCorePlugin.getSeamProject(p, false);
- if(sp != null) list.add((SeamProject)sp);
+ if(project.isAccessible() && project.hasNature(JavaCore.NATURE_ID)) {
+ IJavaProject javaProject = JavaCore.create(project);
+ IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
+ for (int i = 0; i < es.length; i++) {
+ if(es[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) {
+ IProject p =
ResourcesPlugin.getWorkspace().getRoot().getProject(es[i].getPath().lastSegment());
+ if(p == null || !p.isAccessible()) continue;
+ ISeamProject sp = SeamCorePlugin.getSeamProject(p, false);
+ if(sp != null) list.add((SeamProject)sp);
+ }
}
}
return list;