< prev index next >
test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java
Print this page
*** 44,56 ****
// build the set of all Charset subclasses in the
// two known charset implementation packages
FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/"));
Set<Class> charsets =
! Stream.concat(Files.walk(fs.getPath("/java.base/sun/nio/cs/")),
! Files.walk(fs.getPath("/jdk.charsets/sun/nio/cs/ext/")))
! .map( p -> p.subpath(1, p.getNameCount()).toString())
.filter( s -> s.indexOf("$") == -1 && s.endsWith(".class"))
.map( s -> {
try {
return Class.forName(s.substring(0, s.length() - 6)
.replace('/', '.'));
--- 44,56 ----
// build the set of all Charset subclasses in the
// two known charset implementation packages
FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/"));
Set<Class> charsets =
! Stream.concat(Files.walk(fs.getPath("/modules/java.base/sun/nio/cs/")),
! Files.walk(fs.getPath("/modules/jdk.charsets/sun/nio/cs/ext/")))
! .map( p -> p.subpath(2, p.getNameCount()).toString())
.filter( s -> s.indexOf("$") == -1 && s.endsWith(".class"))
.map( s -> {
try {
return Class.forName(s.substring(0, s.length() - 6)
.replace('/', '.'));
< prev index next >