This repository was archived by the owner on Oct 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +24
-14
lines changed
subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs Expand file tree Collapse file tree 1 file changed +24
-14
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package com.itsaky.androidide.javac.services.fs
1919
2020import com.itsaky.androidide.utils.VMUtils
2121import openjdk.tools.javac.file.CacheFSInfo
22+ import org.slf4j.LoggerFactory
2223import java.nio.file.Path
2324
2425/* *
@@ -27,26 +28,35 @@ import java.nio.file.Path
2728 * @author Akash Yadav
2829 */
2930object CacheFSInfoSingleton : CacheFSInfo() {
30-
31+
32+ const val TEST_PROP_ENABLED_ON_JVM = " ide.testing.javac.fsCache.isEnabledOnJVM"
33+ private val log = LoggerFactory .getLogger(CacheFSInfoSingleton ::class .java)
34+
3135 /* *
3236 * Caches information about the given [Path].
3337 */
3438 @JvmOverloads
3539 fun cache (file : Path , cacheJarClasspath : Boolean = true) {
36-
37- if (VMUtils .isJvm()) {
38- return
40+
41+ if (System .getProperty(TEST_PROP_ENABLED_ON_JVM , null ) != " true" ) {
42+ if (VMUtils .isJvm()) {
43+ return
44+ }
3945 }
40-
41- // Cache canonical path
42- getCanonicalFile(file)
43-
44- // Cache attributes
45- getAttributes(file)
46-
47- // Cache jar classpath if requested
48- if (cacheJarClasspath) {
49- getJarClassPath(file)
46+
47+ try {
48+ // Cache canonical path
49+ getCanonicalFile(file)
50+
51+ // Cache attributes
52+ getAttributes(file)
53+
54+ // Cache jar classpath if requested
55+ if (cacheJarClasspath) {
56+ getJarClassPath(file)
57+ }
58+ } catch (err: Throwable ) {
59+ log.warn(" Failed to cache jar file: {}" , file, err)
5060 }
5161 }
5262}
You can’t perform that action at this time.
0 commit comments