Cleanup RC deprecations in compiler and plugin.
This commit is contained in:
+2
-1
@@ -28,6 +28,7 @@ import java.io.PrintStream
|
||||
import java.rmi.server.UnicastRemoteObject
|
||||
import java.util.concurrent.Semaphore
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.comparisons.*
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
|
||||
@@ -216,7 +217,7 @@ object KotlinCompilerClient {
|
||||
val memBefore = daemon.getUsedMemory().get() / 1024
|
||||
val startTime = System.nanoTime()
|
||||
|
||||
val res = daemon.remoteCompile(CompileService.NO_SESSION, CompileService.TargetPlatform.JVM, filteredArgs.toArrayList().toTypedArray(), servicesFacade, outStrm, CompileService.OutputFormat.PLAIN, outStrm, null)
|
||||
val res = daemon.remoteCompile(CompileService.NO_SESSION, CompileService.TargetPlatform.JVM, filteredArgs.toList().toTypedArray(), servicesFacade, outStrm, CompileService.OutputFormat.PLAIN, outStrm, null)
|
||||
|
||||
val endTime = System.nanoTime()
|
||||
println("Compilation result code: $res")
|
||||
|
||||
@@ -39,6 +39,7 @@ import java.util.concurrent.atomic.AtomicInteger
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock
|
||||
import java.util.logging.Level
|
||||
import java.util.logging.Logger
|
||||
import kotlin.comparisons.*
|
||||
import kotlin.concurrent.read
|
||||
import kotlin.concurrent.schedule
|
||||
import kotlin.concurrent.write
|
||||
@@ -303,7 +304,7 @@ class CompileServiceImpl(
|
||||
synchronized(state.sessions) {
|
||||
// 2. check if any session hanged - clean
|
||||
// making copy of the list before calling release
|
||||
state.sessions.filterValues { !it.isAlive }.keys.toArrayList()
|
||||
state.sessions.filterValues { !it.isAlive }.keys.toList()
|
||||
}.forEach { releaseCompileSession(it) }
|
||||
|
||||
// 3. check if in graceful shutdown state and all sessions are closed
|
||||
|
||||
@@ -47,7 +47,7 @@ class LazyClasspathWatcher(classpath: Iterable<String>,
|
||||
private data class FileId(val file: File, val lastModified: Long, val digest: ByteArray)
|
||||
|
||||
private val fileIdsLock = Semaphore(1) // a barrier for ensuring ids are initialized, using semaphore to allow modifications from another thread
|
||||
private var fileIds: ArrayList<FileId>? = null
|
||||
private var fileIds: List<FileId>? = null
|
||||
private val lastChangedStatus = AtomicBoolean(false)
|
||||
private val lastUpdate = AtomicLong(0)
|
||||
private val lastDigestUpdate = AtomicLong(0)
|
||||
@@ -63,7 +63,7 @@ class LazyClasspathWatcher(classpath: Iterable<String>,
|
||||
.asSequence()
|
||||
.flatMap { it.walk().filter(::isClasspathFile) }
|
||||
.map { FileId(it, it.lastModified(), it.md5Digest()) }
|
||||
.toArrayList()
|
||||
.toList()
|
||||
val nowMs = TimeUnit.MILLISECONDS.toMillis(System.nanoTime())
|
||||
lastUpdate.set(nowMs)
|
||||
lastDigestUpdate.set(nowMs)
|
||||
|
||||
Reference in New Issue
Block a user