/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6410367 6411310
* @summary FileObject should support user-friendly names via getName()
*/
// Test FileObject.getName returned from JavacFileManager and its support classes.
public class Test {
}
// names for entries to be created in directories and jar files
// test various combinations of directories and jar files, intended to
// cover all sources of file objects within JavacFileManager's support classes
for (boolean useOptimizedZip: new boolean[] { false, true }) {
for (boolean useSymbolFile: new boolean[] { false, true }) {
}
}
if (errors > 0)
// Verify that we hit all the impl classes we intended
"RegularFileObject", "SymbolFileObject", "ZipFileIndexFileObject", "ZipFileObject");
// Verify that we hit the jar files we intended, specifically ct.sym as well as rt.jar
"ct.sym", "jar", "jar jar", "rt.jar");
}
// use a new file manager for each test
try {
if (f.isDirectory()) {
}
}
}
// we could use fm.getLocation but the following guarantees we preserve the original filename
}
}
} finally {
}
}
// if ct.sym is found, replace it with the equivalent rt.jar
}
// record the file object class name for coverage checks later
// record access to the jar file for coverage checks later
}
}
}
}
return createFileManager(false, false);
}
return createFileManager(useOptimizedZip, false);
}
if (!useSymbolFile) {
}
return new JavacFileManager(c, false, null);
}
}
return dir;
}
try {
}
} finally {
}
return jar;
}
throw new Exception("can't find rt.jar");
return rt_jar;
}
byte[] data = new byte[1024];
int offset = 0;
try {
int n;
offset += n;
}
} finally {
}
}
f.getParentFile().mkdirs();
try {
} finally {
}
}
errors++;
}
int errors;
}