Skip to content

Refactor SBG to support generics and proper handling of overridable methods #1322

@vmutafov

Description

@vmutafov

Currently, the static binding generator has issues when extending Java classes which have generics or extend some class/interface which is generic. In order to fix that, there should be changes made in the logic for finding which methods could be overridden and to handle their argument and return types. Although this seems easy at first look, the fact that the Java generics are erased by the Java compiler is a big problem. This could be fixed reading the generics metadata in the Java class files produced by the compiler and manually creating a generics hierarchy view of the class/interface being extended. In that way there would be build time information about what concrete type would come in the place of the generic at runtime. After this is done, the search for overridable methods must be done according to the Java Language Specification.

Metadata

Metadata

Labels

needs docsDocumentation is needed before closing

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions