Skip to content

Retain injection annotations in generated code #19

@raner

Description

@raner

Consider the following interface:

interface Booleans
{
  @Inject True getTrue();
  @Inject False getFalse();
}

The generated implementation class will contain synthetic fields for true and false, however, if the class is instantiated via a dependency injection system like Guice no values for True and False will be injected because the generated (synthetic) field lacks an @Inject annotation.

Therefore the generated bytecode of the implementation class should be equivalent to:

class Booleans$Projo implements Booleans
{
  @Inject private True getTrue;
  @Inject private False getFalse;

  //...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions