chore: Remove SecurityManager usage. (#2106)
This commit is contained in:
parent
2a04e9649e
commit
273dc116d4
4 changed files with 44 additions and 51 deletions
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* license agreements; and to You under the Apache License, version 2.0:
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* This file is part of the Apache Pekko project, which was derived from Akka.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com>
|
||||
*/
|
||||
|
||||
package org.apache.pekko.util
|
||||
|
||||
import java.util.concurrent.TimeUnit
|
||||
import scala.annotation.nowarn
|
||||
|
||||
import org.openjdk.jmh.annotations.{ Benchmark, Measurement, Scope, State }
|
||||
|
||||
@State(Scope.Benchmark)
|
||||
@Measurement(timeUnit = TimeUnit.MICROSECONDS)
|
||||
class StackBench {
|
||||
|
||||
@nowarn("msg=deprecated")
|
||||
class CustomSecurtyManager extends SecurityManager {
|
||||
def getTrace: Array[Class[_]] =
|
||||
getClassContext
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
def currentThread(): Array[StackTraceElement] = {
|
||||
Thread.currentThread().getStackTrace
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
def securityManager(): Array[Class[_]] = {
|
||||
(new CustomSecurtyManager).getTrace
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue