Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,10 @@ final String getString(byte[] name) {

@SuppressWarnings("deprecation")
protected void finalize() throws IOException {
close();
try {
close();
} catch (IOException ignored) {
}
}

// Reads len bytes of data from the specified offset into buf.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.itsaky.androidide.zipfs2.ZipFileSystem
import com.itsaky.androidide.zipfs2.ZipFileSystemProvider
import jdkx.lang.model.SourceVersion
import openjdk.tools.javac.file.RelativePath.RelativeDirectory
import org.slf4j.LoggerFactory
import java.io.IOException
import java.nio.file.Path

Expand All @@ -34,17 +35,24 @@ class CachedJarFileSystem(
zfpath: Path?,
env: MutableMap<String, *>?
) : ZipFileSystem(provider, zfpath, env) {


companion object {
private val log = LoggerFactory.getLogger(CachedJarFileSystem::class.java)
}

internal val packages = mutableMapOf<RelativeDirectory, Path>()

override fun close() {
// Do nothing
// This is called manually by the Java LSP
}

@Throws(IOException::class)
fun doClose() {
super.close()
try {
super.close()
} catch (e: IOException) {
log.warn("IOException during CachedJarFileSystem close", e)
}
}

fun storeJARPackageDir(dir: Path?): Boolean {
Expand Down