ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r815769 - /ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResourceChangeListener.java
Date Wed, 16 Sep 2009 13:25:51 GMT
Author: hibou
Date: Wed Sep 16 13:25:50 2009
New Revision: 815769

URL: http://svn.apache.org/viewvc?rev=815769&view=rev
Log:
Try to avoid some useless error log when closing non java project

Modified:
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResourceChangeListener.java

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResourceChangeListener.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResourceChangeListener.java?rev=815769&r1=815768&r2=815769&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResourceChangeListener.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResourceChangeListener.java
Wed Sep 16 13:25:50 2009
@@ -65,30 +65,33 @@
                     return;
                 }
                 IResource res = event.getResource();
-                IJavaProject javaProject;
+                IProject project;
                 switch (res.getType()) {
                     case IResource.FOLDER:
-                        javaProject = JavaCore.create(((IFolder) res).getProject());
+                        project = ((IFolder) res).getProject();
                         break;
                     case IResource.FILE:
-                        javaProject = JavaCore.create(((IFile) res).getProject());
+                        project = ((IFile) res).getProject();
                         break;
                     case IResource.PROJECT:
-                        javaProject = JavaCore.create((IProject) res);
+                        project = (IProject) res;
                         break;
                     default:
                         return;
                 }
-                projectClosed(javaProject);
+                try {
+                    if (project.hasNature(JavaCore.NATURE_ID)) {
+                        projectClosed(JavaCore.create(project));
+                    }
+                } catch (CoreException e) {
+                    // project doesn't exist or is not open: ignore
+                }
             } else if (event.getType() == IResourceChangeEvent.POST_CHANGE) {
                 if (!IvyPlugin.getPreferenceStoreHelper().getAutoResolveOnOpen()) {
                     return;
                 }
                 projectOpened(event);
             }
-        } catch (JavaModelException jme) {
-            IvyPlugin.log(IStatus.ERROR,
-                "Errors occurred trying to find projects affected by closure", jme);
         } catch (OperationCanceledException oce) {
             IvyPlugin.log(IStatus.CANCEL,
                 "Ivy update of dependent proejects affected by project close operation canceled",



Mime
View raw message