Cleanup in compiler modules
This commit is contained in:
@@ -29,7 +29,7 @@ import java.util.jar.Manifest
|
||||
import java.util.zip.ZipFile
|
||||
|
||||
public object LibraryUtils {
|
||||
private val LOG = Logger.getInstance(javaClass<LibraryUtils>())
|
||||
private val LOG = Logger.getInstance(LibraryUtils::class.java)
|
||||
|
||||
public val KOTLIN_JS_MODULE_NAME: String = "Kotlin-JS-Module-Name"
|
||||
private var TITLE_KOTLIN_JAVASCRIPT_STDLIB: String
|
||||
@@ -43,7 +43,7 @@ public object LibraryUtils {
|
||||
var jsStdLib = ""
|
||||
var jsLib = ""
|
||||
|
||||
val manifestProperties = javaClass<LibraryUtils>().getResourceAsStream("/kotlinManifest.properties")
|
||||
val manifestProperties = LibraryUtils::class.java.getResourceAsStream("/kotlinManifest.properties")
|
||||
if (manifestProperties != null) {
|
||||
try {
|
||||
val properties = Properties()
|
||||
@@ -157,7 +157,7 @@ public object LibraryUtils {
|
||||
processDirectory(dir, action)
|
||||
}
|
||||
catch (ex: IOException) {
|
||||
LOG.error("Could not read files from directory ${dir.getName()}: ${ex.getMessage()}")
|
||||
LOG.error("Could not read files from directory ${dir.getName()}: ${ex.message}")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ public object LibraryUtils {
|
||||
}
|
||||
}
|
||||
catch (ex: IOException) {
|
||||
LOG.error("Could not extract files from archive ${file.getName()}: ${ex.getMessage()}")
|
||||
LOG.error("Could not extract files from archive ${file.getName()}: ${ex.message}")
|
||||
}
|
||||
finally {
|
||||
zipFile.close()
|
||||
@@ -196,7 +196,7 @@ public object LibraryUtils {
|
||||
val systemIndependentPath = FileUtil.toSystemIndependentName(path)
|
||||
if (systemIndependentPath.startsWith(METAINF)) {
|
||||
if (systemIndependentPath.startsWith(METAINF_RESOURCES)) {
|
||||
return path.substring(METAINF_RESOURCES.length())
|
||||
return path.substring(METAINF_RESOURCES.length)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public fun File?.readTextOrEmpty(): String = this?.readText() ?: ""
|
||||
public fun File.withReplacedExtensionOrNull(oldExt: String, newExt: String): File? {
|
||||
if (getName().endsWith(oldExt)) {
|
||||
val path = getPath()
|
||||
val pathWithoutExt = path.substring(0, path.length() - oldExt.length())
|
||||
val pathWithoutExt = path.substring(0, path.length - oldExt.length)
|
||||
val pathWithNewExt = pathWithoutExt + newExt
|
||||
return File(pathWithNewExt)
|
||||
}
|
||||
|
||||
@@ -24,10 +24,10 @@ private val END_MARKER = "<~END~>"
|
||||
|
||||
public fun CharSequence.substringWithContext(beginIndex: Int, endIndex: Int, range: Int): String {
|
||||
val start = Math.max(0, beginIndex - range)
|
||||
val end = Math.min(this.length(), endIndex + range)
|
||||
val end = Math.min(this.length, endIndex + range)
|
||||
|
||||
val notFromBegin = start != 0
|
||||
val notToEnd = end != this.length()
|
||||
val notToEnd = end != this.length
|
||||
|
||||
val updatedStart = beginIndex - start
|
||||
val updatedEnd = endIndex - start
|
||||
|
||||
Reference in New Issue
Block a user