Minor. Rename properties in FastJarVirtualFile
This commit is contained in:
committed by
teamcityserver
parent
6cd3d84e74
commit
4e66fd29e0
@@ -30,7 +30,7 @@ class FastJarHandler(val fileSystem: FastJarFileSystem, path: String) {
|
||||
}
|
||||
}
|
||||
|
||||
myRoot = FastJarVirtualFile(this, "", -1, myParent = null, entryDescription = null)
|
||||
myRoot = FastJarVirtualFile(this, "", -1, parent = null, entryDescription = null)
|
||||
|
||||
// ByteArrayCharSequence should not be used instead of String
|
||||
// because the former class does not support equals/hashCode properly
|
||||
|
||||
+17
-17
@@ -13,10 +13,10 @@ import java.io.InputStream
|
||||
import java.io.OutputStream
|
||||
|
||||
internal class FastJarVirtualFile(
|
||||
private val myHandler: FastJarHandler,
|
||||
private val myName: CharSequence,
|
||||
private val myLength: Int,
|
||||
private val myParent: FastJarVirtualFile?,
|
||||
private val handler: FastJarHandler,
|
||||
private val name: CharSequence,
|
||||
private val length: Int,
|
||||
private val parent: FastJarVirtualFile?,
|
||||
private val entryDescription: ZipEntryDescription?,
|
||||
) : VirtualFile() {
|
||||
|
||||
@@ -24,7 +24,7 @@ internal class FastJarVirtualFile(
|
||||
private val myChildrenList: MutableList<VirtualFile> = mutableListOf()
|
||||
|
||||
init {
|
||||
myParent?.myChildrenList?.add(this)
|
||||
parent?.myChildrenList?.add(this)
|
||||
}
|
||||
|
||||
fun initChildrenArrayFromList() {
|
||||
@@ -33,28 +33,28 @@ internal class FastJarVirtualFile(
|
||||
}
|
||||
|
||||
override fun getName(): String {
|
||||
return myName.toString()
|
||||
return name.toString()
|
||||
}
|
||||
|
||||
override fun getNameSequence(): CharSequence {
|
||||
return myName
|
||||
return name
|
||||
}
|
||||
|
||||
override fun getFileSystem(): VirtualFileSystem {
|
||||
return myHandler.fileSystem
|
||||
return handler.fileSystem
|
||||
}
|
||||
|
||||
override fun getPath(): String {
|
||||
if (myParent == null) {
|
||||
return FileUtil.toSystemIndependentName(myHandler.file.path) + "!/"
|
||||
if (parent == null) {
|
||||
return FileUtil.toSystemIndependentName(handler.file.path) + "!/"
|
||||
}
|
||||
val parentPath = myParent.path
|
||||
val answer = StringBuilder(parentPath.length + 1 + myName.length)
|
||||
val parentPath = parent.path
|
||||
val answer = StringBuilder(parentPath.length + 1 + name.length)
|
||||
answer.append(parentPath)
|
||||
if (answer[answer.length - 1] != '/') {
|
||||
answer.append('/')
|
||||
}
|
||||
answer.append(myName)
|
||||
answer.append(name)
|
||||
return answer.toString()
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ internal class FastJarVirtualFile(
|
||||
}
|
||||
|
||||
override fun isDirectory(): Boolean {
|
||||
return myLength < 0
|
||||
return length < 0
|
||||
}
|
||||
|
||||
override fun isValid(): Boolean {
|
||||
@@ -71,7 +71,7 @@ internal class FastJarVirtualFile(
|
||||
}
|
||||
|
||||
override fun getParent(): VirtualFile? {
|
||||
return myParent
|
||||
return parent
|
||||
}
|
||||
|
||||
override fun getChildren(): Array<VirtualFile> {
|
||||
@@ -86,12 +86,12 @@ internal class FastJarVirtualFile(
|
||||
@Throws(IOException::class)
|
||||
override fun contentsToByteArray(): ByteArray {
|
||||
if (entryDescription == null) return EMPTY_BYTE_ARRAY
|
||||
return myHandler.contentsToByteArray(entryDescription)
|
||||
return handler.contentsToByteArray(entryDescription)
|
||||
}
|
||||
|
||||
override fun getTimeStamp(): Long = 0
|
||||
|
||||
override fun getLength(): Long = myLength.toLong()
|
||||
override fun getLength(): Long = length.toLong()
|
||||
|
||||
override fun refresh(asynchronous: Boolean, recursive: Boolean, postRunnable: Runnable?) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user