src/share/classes/com/sun/tools/javac/file/RegularFileObject.java

changeset 400
35e29f51a7c3
parent 333
7c2d6da61646
child 404
14735c7932d7
child 415
49359d0e6a9c
     1.1 --- a/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java	Thu Sep 03 18:34:17 2009 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java	Tue Sep 08 11:12:13 2009 -0700
     1.3 @@ -34,7 +34,6 @@
     1.4  import java.io.OutputStreamWriter;
     1.5  import java.io.Writer;
     1.6  import java.net.URI;
     1.7 -import java.net.URISyntaxException;
     1.8  import java.nio.ByteBuffer;
     1.9  import java.nio.CharBuffer;
    1.10  import java.nio.charset.CharsetDecoder;
    1.11 @@ -73,6 +72,7 @@
    1.12          return new FileInputStream(f);
    1.13      }
    1.14  
    1.15 +    @Override
    1.16      protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) {
    1.17          return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors);
    1.18      }
    1.19 @@ -147,6 +147,7 @@
    1.20      }
    1.21  
    1.22      @Deprecated
    1.23 +    @Override
    1.24      public String getPath() {
    1.25          return f.getPath();
    1.26      }
    1.27 @@ -201,11 +202,6 @@
    1.28      }
    1.29  
    1.30      public URI toUri() {
    1.31 -        try {
    1.32 -            String path = f.getAbsolutePath().replace(File.separatorChar, '/');
    1.33 -            return new URI("file://" + path).normalize();
    1.34 -        } catch (URISyntaxException ex) {
    1.35 -            return f.toURI();
    1.36 -        }
    1.37 +        return f.toURI().normalize();
    1.38      }
    1.39  }

mercurial