Skip to content

Commit deae525

Browse files
committed
rename
1 parent 15cd5a5 commit deae525

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

control/src/main/kotlin/spp/probe/SourceProbe.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ object SourceProbe {
9696
"org.apache.skywalking.apm.agent.core.plugin.loader.AgentClassLoader"
9797
).getMethod("getDefault").invoke(null) as java.lang.ClassLoader
9898
val sizeCappedClass = Class.forName(
99-
"spp.probe.services.common.serialize.DepthSizeCappedTypeAdapterFactory", true, agentClassLoader
99+
"spp.probe.services.common.serialize.CappedTypeAdapterFactory", true, agentClassLoader
100100
)
101101
sizeCappedClass.getMethod("setInstrumentation", Instrumentation::class.java)
102102
.invoke(null, instrumentation)
@@ -138,7 +138,7 @@ object SourceProbe {
138138
"org.apache.skywalking.apm.agent.core.plugin.loader.AgentClassLoader"
139139
).getMethod("getDefault").invoke(null) as java.lang.ClassLoader
140140
val sizeCappedClass = Class.forName(
141-
"spp.probe.services.common.serialize.DepthSizeCappedTypeAdapterFactory", true, agentClassLoader
141+
"spp.probe.services.common.serialize.CappedTypeAdapterFactory", true, agentClassLoader
142142
)
143143
sizeCappedClass.getMethod("setInstrumentation", Instrumentation::class.java)
144144
.invoke(null, instrumentation)

services/src/main/kotlin/spp/probe/services/common/ModelSerializer.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import com.google.gson.reflect.TypeToken
2222
import com.google.gson.stream.JsonReader
2323
import com.google.gson.stream.JsonWriter
2424
import spp.probe.services.common.serialize.RuntimeClassNameTypeAdapterFactory
25-
import spp.probe.services.common.serialize.DepthSizeCappedTypeAdapterFactory
25+
import spp.probe.services.common.serialize.CappedTypeAdapterFactory
2626
import java.io.IOException
2727
import java.io.OutputStream
2828
import java.util.*
@@ -41,7 +41,7 @@ enum class ModelSerializer {
4141
private val gson: Gson = GsonBuilder().disableHtmlEscaping().create()
4242
val extendedGson: Gson = GsonBuilder()
4343
.setJsogPolicy(JsogPolicy.DEFAULT.withJsogAlwaysEnabled())
44-
.registerTypeAdapterFactory(DepthSizeCappedTypeAdapterFactory(2))
44+
.registerTypeAdapterFactory(CappedTypeAdapterFactory(2))
4545
.registerTypeAdapterFactory(object : TypeAdapterFactory {
4646
override fun <T> create(gson: Gson, typeToken: TypeToken<T>): TypeAdapter<T>? {
4747
return if (ignoredTypes.contains(typeToken.rawType.name)) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import spp.probe.services.common.ModelSerializer
2828
import java.io.IOException
2929
import java.lang.instrument.Instrumentation
3030

31-
class DepthSizeCappedTypeAdapterFactory(val maxDepth: Int) : TypeAdapterFactory {
31+
class CappedTypeAdapterFactory(val maxDepth: Int) : TypeAdapterFactory {
3232

3333
override fun <T> create(gson: Gson, type: TypeToken<T>): TypeAdapter<T>? {
3434
return if (instrumentation == null || maxMemorySize == -1L) null else object : TypeAdapter<T>() {
@@ -61,7 +61,7 @@ class DepthSizeCappedTypeAdapterFactory(val maxDepth: Int) : TypeAdapterFactory
6161
JsogRegistry.get().userData["depth"] = (JsogRegistry.get().userData["depth"] as Int) + 1
6262
try {
6363
ModelSerializer.INSTANCE.extendedGson.getDelegateAdapter(
64-
this@DepthSizeCappedTypeAdapterFactory, type
64+
this@CappedTypeAdapterFactory, type
6565
).write(jsonWriter, value)
6666
} catch (e: Exception) {
6767
jsonWriter.beginObject()

0 commit comments

Comments
 (0)