spring-boot-migrator icon indicating copy to clipboard operation
spring-boot-migrator copied to clipboard

Provide type representation for compiled types

Open fabapp2 opened this issue 2 years ago • 0 comments

What needs to be done

A representation for compiled types should be provided.

Why it needs to be done

Given this code

class MyClass implements MyInterface, Serializable {}

it implements java.io.Serializable which is not part of the AST as it does not exist as source code.

Type myClass = ...
List<? extends Type> implementedTypes = myClass.getImplements();

The Type API for Serialializable must be a subset (read-only, reflection API) of the Type API for MyInterface (which exists as source code, is part of the AST and can be modified).

Additional Information

  • How is OpenRewrite's JavaType implementing this?
  • How is GitHub JavaParser implementing this?

fabapp2 avatar May 10 '23 11:05 fabapp2