Check for non-existing resource, log it into IDE log file. BLD200502211900
authormentlicher@netbeans.org
Mon, 21 Feb 2005 18:03:15 +0000
changeset 5850e45a1520202a
parent 5849 6789175df561
child 5851 b872f7de7717
Check for non-existing resource, log it into IDE log file.
Fix of issue #55091.
vcs.advanced/src/org/netbeans/modules/vcs/profiles/commands/AddLocalParents.java
     1.1 --- a/vcs.advanced/src/org/netbeans/modules/vcs/profiles/commands/AddLocalParents.java	Mon Feb 21 15:44:53 2005 +0000
     1.2 +++ b/vcs.advanced/src/org/netbeans/modules/vcs/profiles/commands/AddLocalParents.java	Mon Feb 21 18:03:15 2005 +0000
     1.3 @@ -18,6 +18,7 @@
     1.4  import java.util.Collection;
     1.5  import java.util.Hashtable;
     1.6  import java.util.Iterator;
     1.7 +import org.openide.ErrorManager;
     1.8  
     1.9  import org.openide.filesystems.FileObject;
    1.10  import org.openide.filesystems.FileSystem;
    1.11 @@ -108,7 +109,11 @@
    1.12              for (Iterator it = processingFiles.iterator(); it.hasNext(); ) {
    1.13                  String name = (String) it.next();
    1.14                  FileObject fo = fs.findResource(name);
    1.15 -                addLocalParents(fo, localParents);
    1.16 +                if (fo != null) {
    1.17 +                    addLocalParents(fo, localParents);
    1.18 +                } else {
    1.19 +                    ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, new IllegalStateException("No resource found for '"+name+"'"));
    1.20 +                }
    1.21              }
    1.22          } else {
    1.23              for (Iterator it = processingFiles.iterator(); it.hasNext(); ) {
    1.24 @@ -116,6 +121,8 @@
    1.25                  FileObject fo = FileUtil.toFileObject(new File(fullPath));
    1.26                  if (fo != null) {
    1.27                      addLocalParents(fo, localParents);
    1.28 +                } else {
    1.29 +                    ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, new IllegalStateException("No resource found for '"+fullPath+"'"));
    1.30                  }
    1.31              }
    1.32          }