You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicCiphertextFilePathgetCiphertextFilePath(CryptoPathcleartextPath) throwsIOException {
CryptoPathparentPath = cleartextPath.getParent();
if (parentPath == null) {
thrownewIllegalArgumentException("Invalid file path (must have a parent): " + cleartextPath);
}
//---------HERE: we call getCiphertextDir(...)CiphertextDirectoryparent = getCiphertextDir(parentPath);
StringcleartextName = cleartextPath.getFileName().toString();
returngetCiphertextFilePath(parent.path, parent.dirId, cleartextName);
}
publicCiphertextDirectorygetCiphertextDir(CryptoPathcleartextPath) throwsIOException {
assertcleartextPath.isAbsolute();
CryptoPathparentPath = cleartextPath.getParent();
if (parentPath == null) {
returnrootDirectory;
} else {
try {
//--------------------cache.get() is an if-cached-return-else-create-and-return operationreturnciphertextDirectories.get(cleartextPath, p -> {
try {
//-------------------------------HERE: we call getCiphertextFilepath(...)PathdirFile = getCiphertextFilePath(p).getDirFilePath();
returnresolveDirectory(dirFile);
} catch (IOExceptione) {
thrownewUncheckedIOException(e);
}
});
} catch (UncheckedIOExceptione) {
thrownewIOException(e);
}
}
}
This leads to the following stacktrace when accessing deeper folderstructures:
java.lang.IllegalStateException: Recursive update
at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1991)
at com.github.benmanes.caffeine/com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2666)
at com.github.benmanes.caffeine/com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2649)
at com.github.benmanes.caffeine/com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:112)
at com.github.benmanes.caffeine/com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62)
at org.cryptomator.cryptofs/org.cryptomator.cryptofs.CryptoPathMapper.getCiphertextDir(CryptoPathMapper.java:161)
at org.cryptomator.cryptofs/org.cryptomator.cryptofs.CryptoPathMapper.getCiphertextFilePath(CryptoPathMapper.java:122)
....//more repetetions of the above stacktrace
at org.cryptomator.cryptofs/org.cryptomator.cryptofs.CryptoPathMapper.lambda$getCiphertextDir$0(CryptoPathMapper.java:163)
at com.github.benmanes.caffeine/com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2668)
at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916)
at com.github.benmanes.caffeine/com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2666)
at com.github.benmanes.caffeine/com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2649)
at com.github.benmanes.caffeine/com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:112)
at com.github.benmanes.caffeine/com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62)
at org.cryptomator.cryptofs/org.cryptomator.cryptofs.CryptoPathMapper.getCiphertextDir(CryptoPathMapper.java:161)
at org.cryptomator.cryptofs/org.cryptomator.cryptofs.CryptoPathMapper.getCiphertextFilePath(CryptoPathMapper.java:122)
at org.cryptomator.cryptofs/org.cryptomator.cryptofs.CryptoPathMapperTest.testPathEncryptionDEEP(CryptoPathMapperTest.java:173)
The text was updated successfully, but these errors were encountered:
With PR #164 we switched our caching library from Google's Guave implementation to Caffeine.
Unfortunately, caffeine does not allow recursive updates of the cache (see https://github.com/ben-manes/caffeine/wiki/Faq#recursive-computations), but we are doing it anyway in the
CryptoPathMapper
class:This leads to the following stacktrace when accessing deeper folderstructures:
The text was updated successfully, but these errors were encountered: