Skip to content

Subclasses for java.lang.Object are not resolved #94

@sergeypospelov

Description

@sergeypospelov

The result of hierarchy.findSubClasses(cp.findClass<Any>(), allHierarchy = false) returns an empty sequence. I expect those classes and interfaces from cp, which don't have an explicit supertype. See the example below:

import org.jacodb.api.ext.findClass
import org.jacodb.impl.features.InMemoryHierarchy
import org.jacodb.impl.features.hierarchyExt
import org.jacodb.impl.jacodb

suspend fun main() {
    val db = jacodb {
        useProcessJavaRuntime()
        installFeatures(InMemoryHierarchy)
    }
    val cp = db.classpath(emptyList())

    val hierarchy = cp.hierarchyExt()

    val subClassesComparable = hierarchy.findSubClasses(cp.findClass<Comparable<*>>(), allHierarchy = false).count()
    val subClassesAny = hierarchy.findSubClasses(cp.findClass<Any>(), allHierarchy = false).count()

    check(subClassesComparable > 0)
    check(subClassesAny > 0) // fails here
}

Details

  • The issue still exists, if we don't use InMemoryHierarchy feature
  • Using allHierarchy = true still returns an empty sequence

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions