Skip to content

Commit 96a7b6a

Browse files
committed
Fix issue with JarInJar, probably.
Signed-off-by: cpw <cpw+github@weeksfamily.ca>
1 parent 4e05cab commit 96a7b6a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/cpw/mods/niofs/union/UnionFileSystem.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ public UnionFileSystem(final UnionFileSystemProvider provider, final BiPredicate
134134
private static Optional<EmbeddedFileSystemMetadata> openFileSystem(final Path path) {
135135
try {
136136
var zfs = FileSystems.newFileSystem(path);
137-
FileChannel fci = (FileChannel) ZIPFS_CH.invoke(zfs);
138-
FCI_UNINTERUPTIBLE.invoke(fci);
137+
SeekableByteChannel fci = (SeekableByteChannel) ZIPFS_CH.invoke(zfs);
138+
if (fci instanceof FileChannel) { // we only make file channels uninterruptible because byte channels (JIJ) already are
139+
FCI_UNINTERUPTIBLE.invoke(fci);
140+
}
139141
return Optional.of(new EmbeddedFileSystemMetadata(path, zfs, fci));
140142
} catch (IOException e) {
141143
throw new UncheckedIOException(e);

0 commit comments

Comments
 (0)