Author: dgeraskov
Date: 2012-03-14 10:34:20 -0400 (Wed, 14 Mar 2012)
New Revision: 39502
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java
Log:
https://issues.jboss.org/browse/JBIDE-11103
Filter out non java projects
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java 2012-03-14
13:58:50 UTC (rev 39501)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java 2012-03-14
14:34:20 UTC (rev 39502)
@@ -312,9 +312,15 @@
}
// insert this in last place
updateCollection(projects, findProject(consoleConfiguration));
- ArrayList<IJavaProject> res = new ArrayList<IJavaProject>();
- for (Iterator<IProject> it = projects.iterator(); it.hasNext();) {
- res.add(JavaCore.create(it.next()));
+ List<IJavaProject> res = new ArrayList<IJavaProject>();
+ for (int i = 0; i < projects.size(); i++) {
+ try {
+ if (projects.get(i).hasNature(JavaCore.NATURE_ID)){
+ res.add(JavaCore.create(projects.get(i)));
+ }
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().log(e);
+ }
}
return res.toArray(new IJavaProject[0]);
}