All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.natpryce.snodge.reflect.TroublesomeClassesJvm.kt Maven / Gradle / Ivy

Go to download

A small, extensible Java library to randomly mutate JSON documents. Useful for fuzz testing.

There is a newer version: 3.7.0.0
Show newest version
package com.natpryce.snodge.reflect

import kotlin.reflect.jvm.jvmName

class CodeExecutionVulnerability(message: String) : Error(message)

class ClassCannotBeLoaded {
    companion object {
        init {
            throw CodeExecutionVulnerability("tried to load an arbitrary class")
        }
    }
}

class ClassCannotBeInstantiated {
    init {
        throw CodeExecutionVulnerability("tried to instantiate an arbitrary class")
    }
}

private class PrivateClass {
}

fun troublesomeClasses() =
    listOf(ClassCannotBeLoaded::class, ClassCannotBeInstantiated::class, PrivateClass::class)
        .map { it.jvmName }






© 2015 - 2024 Weber Informatics LLC | Privacy Policy