langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
changeset 3998 c66be272f350
parent 3890 b53fced26fa4
parent 3995 73af8b6fb8bc
child 4073 9788f4549740
equal deleted inserted replaced
3900:ce74bd35ce94 3998:c66be272f350
  2561             super(null); // no file manager; never referenced for this file object
  2561             super(null); // no file manager; never referenced for this file object
  2562             this.name = name;
  2562             this.name = name;
  2563             this.flatname = flatname;
  2563             this.flatname = flatname;
  2564         }
  2564         }
  2565 
  2565 
       
  2566         @Override
       
  2567         public URI toUri() {
       
  2568             try {
       
  2569                 return new URI(null, name.toString(), null);
       
  2570             } catch (URISyntaxException e) {
       
  2571                 throw new CannotCreateUriError(name.toString(), e);
       
  2572             }
       
  2573         }
       
  2574 
       
  2575         @Override
       
  2576         public String getName() {
       
  2577             return name.toString();
       
  2578         }
       
  2579 
       
  2580         @Override
       
  2581         public String getShortName() {
       
  2582             return getName();
       
  2583         }
       
  2584 
       
  2585         @Override
       
  2586         public JavaFileObject.Kind getKind() {
       
  2587             return getKind(getName());
       
  2588         }
       
  2589 
       
  2590         @Override
  2566         public InputStream openInputStream() {
  2591         public InputStream openInputStream() {
  2567             throw new UnsupportedOperationException();
  2592             throw new UnsupportedOperationException();
  2568         }
  2593         }
  2569 
  2594 
       
  2595         @Override
  2570         public OutputStream openOutputStream() {
  2596         public OutputStream openOutputStream() {
  2571             throw new UnsupportedOperationException();
  2597             throw new UnsupportedOperationException();
  2572         }
  2598         }
  2573 
  2599 
  2574         public Reader openReader() {
  2600         @Override
       
  2601         public CharBuffer getCharContent(boolean ignoreEncodingErrors) {
  2575             throw new UnsupportedOperationException();
  2602             throw new UnsupportedOperationException();
  2576         }
  2603         }
  2577 
  2604 
       
  2605         @Override
       
  2606         public Reader openReader(boolean ignoreEncodingErrors) {
       
  2607             throw new UnsupportedOperationException();
       
  2608         }
       
  2609 
       
  2610         @Override
  2578         public Writer openWriter() {
  2611         public Writer openWriter() {
  2579             throw new UnsupportedOperationException();
  2612             throw new UnsupportedOperationException();
  2580         }
  2613         }
  2581 
  2614 
  2582         /** @deprecated see bug 6410637 */
  2615         @Override
  2583         @Deprecated
       
  2584         public String getName() {
       
  2585             return name.toString();
       
  2586         }
       
  2587 
       
  2588         public long getLastModified() {
  2616         public long getLastModified() {
  2589             throw new UnsupportedOperationException();
  2617             throw new UnsupportedOperationException();
  2590         }
  2618         }
  2591 
  2619 
       
  2620         @Override
  2592         public boolean delete() {
  2621         public boolean delete() {
  2593             throw new UnsupportedOperationException();
  2622             throw new UnsupportedOperationException();
  2594         }
  2623         }
  2595 
  2624 
  2596         public CharBuffer getCharContent(boolean ignoreEncodingErrors) {
  2625         @Override
  2597             throw new UnsupportedOperationException();
  2626         protected String inferBinaryName(Iterable<? extends File> path) {
       
  2627             return flatname.toString();
       
  2628         }
       
  2629 
       
  2630         @Override
       
  2631         public boolean isNameCompatible(String simpleName, JavaFileObject.Kind kind) {
       
  2632             return true; // fail-safe mode
  2598         }
  2633         }
  2599 
  2634 
  2600         @Override
  2635         @Override
  2601         public boolean equals(Object other) {
  2636         public boolean equals(Object other) {
  2602             if (!(other instanceof SourceFileObject))
  2637             if (!(other instanceof SourceFileObject))
  2607 
  2642 
  2608         @Override
  2643         @Override
  2609         public int hashCode() {
  2644         public int hashCode() {
  2610             return name.hashCode();
  2645             return name.hashCode();
  2611         }
  2646         }
  2612 
       
  2613         public boolean isNameCompatible(String simpleName, JavaFileObject.Kind kind) {
       
  2614             return true; // fail-safe mode
       
  2615         }
       
  2616 
       
  2617         public URI toUri() {
       
  2618             try {
       
  2619                 return new URI(null, name.toString(), null);
       
  2620             } catch (URISyntaxException e) {
       
  2621                 throw new CannotCreateUriError(name.toString(), e);
       
  2622             }
       
  2623         }
       
  2624 
       
  2625         @Override
       
  2626         public Reader openReader(boolean ignoreEncodingErrors) throws IOException {
       
  2627             throw new UnsupportedOperationException();
       
  2628         }
       
  2629 
       
  2630         @Override
       
  2631         protected String inferBinaryName(Iterable<? extends File> path) {
       
  2632             return flatname.toString();
       
  2633         }
       
  2634     }
  2647     }
  2635 }
  2648 }