Minor. Renamed property for disambiguation.
This commit is contained in:
@@ -167,20 +167,20 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
}
|
}
|
||||||
|
|
||||||
private abstract class BasicMap<V> {
|
private abstract class BasicMap<V> {
|
||||||
protected var map: PersistentHashMap<String, V> = createMap()
|
protected var storage: PersistentHashMap<String, V> = createMap()
|
||||||
|
|
||||||
protected abstract fun createMap(): PersistentHashMap<String, V>
|
protected abstract fun createMap(): PersistentHashMap<String, V>
|
||||||
|
|
||||||
public fun clean() {
|
public fun clean() {
|
||||||
try {
|
try {
|
||||||
map.close()
|
storage.close()
|
||||||
}
|
}
|
||||||
catch (ignored: IOException) {
|
catch (ignored: IOException) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PersistentHashMap.deleteFilesStartingWith(map.getBaseFile()!!)
|
PersistentHashMap.deleteFilesStartingWith(storage.getBaseFile()!!)
|
||||||
try {
|
try {
|
||||||
map = createMap()
|
storage = createMap()
|
||||||
}
|
}
|
||||||
catch (ignored: IOException) {
|
catch (ignored: IOException) {
|
||||||
}
|
}
|
||||||
@@ -188,17 +188,17 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
|
|
||||||
public fun flush(memoryCachesOnly: Boolean) {
|
public fun flush(memoryCachesOnly: Boolean) {
|
||||||
if (memoryCachesOnly) {
|
if (memoryCachesOnly) {
|
||||||
if (map.isDirty()) {
|
if (storage.isDirty()) {
|
||||||
map.dropMemoryCaches()
|
storage.dropMemoryCaches()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
map.force()
|
storage.force()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun close() {
|
public fun close() {
|
||||||
map.close()
|
storage.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
public fun clearOutdated(outDirectory: File) {
|
public fun clearOutdated(outDirectory: File) {
|
||||||
val keysToRemove = HashSet<String>()
|
val keysToRemove = HashSet<String>()
|
||||||
|
|
||||||
map.processKeysWithExistingMapping { key ->
|
storage.processKeysWithExistingMapping { key ->
|
||||||
val className = JvmClassName.byInternalName(key!!)
|
val className = JvmClassName.byInternalName(key!!)
|
||||||
val classFile = File(outDirectory, FileUtil.toSystemDependentName(className.getInternalName()) + ".class")
|
val classFile = File(outDirectory, FileUtil.toSystemDependentName(className.getInternalName()) + ".class")
|
||||||
if (!classFile.exists()) {
|
if (!classFile.exists()) {
|
||||||
@@ -219,7 +219,7 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (key in keysToRemove) {
|
for (key in keysToRemove) {
|
||||||
map.remove(key)
|
storage.remove(key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -233,16 +233,16 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
|
|
||||||
public fun put(className: JvmClassName, data: ByteArray): Boolean {
|
public fun put(className: JvmClassName, data: ByteArray): Boolean {
|
||||||
val key = className.getInternalName()
|
val key = className.getInternalName()
|
||||||
val oldData = map[key]
|
val oldData = storage[key]
|
||||||
if (Arrays.equals(data, oldData)) {
|
if (Arrays.equals(data, oldData)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
map.put(key, data)
|
storage.put(key, data)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun get(className: JvmClassName): ByteArray? {
|
public fun get(className: JvmClassName): ByteArray? {
|
||||||
return map[className.getInternalName()]
|
return storage[className.getInternalName()]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,15 +276,15 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
private fun put(className: JvmClassName, constantsMap: Map<String, Any>?): Boolean {
|
private fun put(className: JvmClassName, constantsMap: Map<String, Any>?): Boolean {
|
||||||
val key = className.getInternalName()
|
val key = className.getInternalName()
|
||||||
|
|
||||||
val oldMap = map[key]
|
val oldMap = storage[key]
|
||||||
if (oldMap == constantsMap) {
|
if (oldMap == constantsMap) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (constantsMap != null) {
|
if (constantsMap != null) {
|
||||||
map.put(key, constantsMap)
|
storage.put(key, constantsMap)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
map.remove(key)
|
storage.remove(key)
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -394,15 +394,15 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
private fun put(className: JvmClassName, inlineFunctionsMap: Map<String, Long>?): Boolean {
|
private fun put(className: JvmClassName, inlineFunctionsMap: Map<String, Long>?): Boolean {
|
||||||
val key = className.getInternalName()
|
val key = className.getInternalName()
|
||||||
|
|
||||||
val oldMap = map[key]
|
val oldMap = storage[key]
|
||||||
if (oldMap == inlineFunctionsMap) {
|
if (oldMap == inlineFunctionsMap) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (inlineFunctionsMap != null) {
|
if (inlineFunctionsMap != null) {
|
||||||
map.put(key, inlineFunctionsMap)
|
storage.put(key, inlineFunctionsMap)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
map.remove(key)
|
storage.remove(key)
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -443,20 +443,20 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
)
|
)
|
||||||
|
|
||||||
public fun putPackagePartSourceData(sourceFile: File, className: JvmClassName) {
|
public fun putPackagePartSourceData(sourceFile: File, className: JvmClassName) {
|
||||||
map.put(sourceFile.getAbsolutePath(), className.getInternalName())
|
storage.put(sourceFile.getAbsolutePath(), className.getInternalName())
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun remove(sourceFile: File) {
|
public fun remove(sourceFile: File) {
|
||||||
map.remove(sourceFile.getAbsolutePath())
|
storage.remove(sourceFile.getAbsolutePath())
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun getRemovedPackageParts(compiledSourceFilesToFqName: Map<File, String>): Collection<String> {
|
public fun getRemovedPackageParts(compiledSourceFilesToFqName: Map<File, String>): Collection<String> {
|
||||||
val result = HashSet<String>()
|
val result = HashSet<String>()
|
||||||
|
|
||||||
map.processKeysWithExistingMapping { key ->
|
storage.processKeysWithExistingMapping { key ->
|
||||||
val sourceFile = File(key!!)
|
val sourceFile = File(key!!)
|
||||||
|
|
||||||
val packagePartClassName = map[key]!!
|
val packagePartClassName = storage[key]!!
|
||||||
if (!sourceFile.exists()) {
|
if (!sourceFile.exists()) {
|
||||||
result.add(packagePartClassName)
|
result.add(packagePartClassName)
|
||||||
}
|
}
|
||||||
@@ -477,8 +477,8 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
public fun getPackages(): Set<FqName> {
|
public fun getPackages(): Set<FqName> {
|
||||||
val result = HashSet<FqName>()
|
val result = HashSet<FqName>()
|
||||||
|
|
||||||
map.processKeysWithExistingMapping { key ->
|
storage.processKeysWithExistingMapping { key ->
|
||||||
val packagePartClassName = map[key!!]!!
|
val packagePartClassName = storage[key!!]!!
|
||||||
|
|
||||||
val packageFqName = JvmClassName.byInternalName(packagePartClassName).getPackageFqName()
|
val packageFqName = JvmClassName.byInternalName(packagePartClassName).getPackageFqName()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user