[hg] main-silver: Clean up.

  • From: Tomas Zezula < >
  • To:
  • Subject: [hg] main-silver: Clean up.
  • Date: Mon, 01 Jul 2013 17:51:30 -0700

changeset d58e94e5344d in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/d58e94e5344d
description:
        Clean up.

diffstat:

 
parsing.api/src/org/netbeans/modules/parsing/impl/indexing/FileObjectIndexable.java
 |  17 +--------
 1 files changed, 3 insertions(+), 14 deletions(-)

diffs (54 lines):

diff --git 
a/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/FileObjectIndexable.java
 
b/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/FileObjectIndexable.java
--- 
a/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/FileObjectIndexable.java
+++ 
b/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/FileObjectIndexable.java
@@ -47,7 +47,6 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import org.openide.filesystems.FileObject;
-import org.openide.filesystems.FileStateInvalidException;
 import org.openide.filesystems.FileUtil;
 import org.openide.util.Parameters;
 
@@ -96,7 +95,7 @@
             try {
                 FileObject f = getFileObject();
                 if (f != null) {
-                    url = f.getURL();
+                    url = f.toURL();
                     if (LOG.isLoggable(Level.FINEST)) {
                         LOG.log(
                             Level.FINEST,
@@ -120,8 +119,6 @@
                             });
                     }
                 }
-            } catch (FileStateInvalidException ex) {
-                url = ex;
             } catch (MalformedURLException ex) {
                 url = ex;
             }
@@ -175,7 +172,7 @@
 
     @Override
     public String toString() {
-        return "FileObjectIndexable@" + 
Integer.toHexString(System.identityHashCode(this)) + " [" + toURL(root) + "/" 
+ getRelativePath() + "]"; //NOI18N
+        return "FileObjectIndexable@" + 
Integer.toHexString(System.identityHashCode(this)) + " [" + root.toURL() + 
"/" + getRelativePath() + "]"; //NOI18N
     }
 
     @Override
@@ -192,14 +189,6 @@
                     });
             }
         }
-        return file == null ? null : file.isValid() ? file : null;
+        return file != null && file.isValid() ? file : null;
     }
-
-    private static String toURL(FileObject f) {
-        try {
-            return f.getURL().toString();
-        } catch (FileStateInvalidException ex) {
-            return f.getPath();
         }
-    }
-}

[hg] main-silver: Clean up.

Tomas Zezula 07/02/2013

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 348 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close