langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/PathFileObject.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
102 public static PathFileObject createJRTPathFileObject(BaseFileManager fileManager, |
102 public static PathFileObject createJRTPathFileObject(BaseFileManager fileManager, |
103 final Path path) { |
103 final Path path) { |
104 return new PathFileObject(fileManager, path) { |
104 return new PathFileObject(fileManager, path) { |
105 @Override |
105 @Override |
106 public String inferBinaryName(Iterable<? extends Path> paths) { |
106 public String inferBinaryName(Iterable<? extends Path> paths) { |
107 // use subpath to ignore the leading component containing the module name |
107 // use subpath to ignore the leading /modules/MODULE-NAME |
108 return toBinaryName(path.subpath(1, path.getNameCount())); |
108 return toBinaryName(path.subpath(2, path.getNameCount())); |
109 } |
109 } |
110 }; |
110 }; |
111 } |
111 } |
112 |
112 |
113 /** |
113 /** |