Skip to content

Commit

Permalink
ignore synthetic objects in Object2DescriptorConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdullinAM committed Feb 8, 2024
1 parent 83b655f commit d028f0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ private val maxGenerationDepth by lazy {
private val maxArrayLength by lazy {
kexConfig.getIntValue("reanimator", "maxArrayLength", 10_000)
}

private val ignoreSyntheticObjects by lazy {
kexConfig.getBooleanValue("reanimator", "ignoreSyntheticObjects", false)
}

class Object2DescriptorConverter : DescriptorBuilder() {
private val objectToDescriptor = IdentityHashMap<Any, Descriptor>()
Expand Down Expand Up @@ -184,6 +186,8 @@ class Object2DescriptorConverter : DescriptorBuilder() {
if (depth > maxGenerationDepth) return `null`

val klass = any.javaClass
if (klass.isSynthetic) return `null`

val kexClass = klass.kex as KexClass
val result = `object`(kexClass)
objectToDescriptor[any] = result
Expand Down
1 change: 1 addition & 0 deletions kex.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ maxSearchDepth = 1000
maxGenerationDepth = 100
maxConversionDepth = 10
useRecursiveConstructors = false
ignoreSyntheticObjects = true

[easy-random]
seed = 3735928559
Expand Down

0 comments on commit d028f0e

Please sign in to comment.