Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum values in Qualifiers not referenced correctly anymore #3619

Closed
bentatham opened this issue Oct 31, 2022 · 1 comment
Closed

Enum values in Qualifiers not referenced correctly anymore #3619

bentatham opened this issue Oct 31, 2022 · 1 comment

Comments

@bentatham
Copy link

bentatham commented Oct 31, 2022

Version: 2.44

When a Qualifier on an @Inject member field has an enum value, like this:

  @Inject
  @StartTime(StartTime.Units.MILLIS)
  long startTimeMillis;

the generated MembersInjector no longer references the enum value correctly (it drops the referencing classes and/or necessary imports):

  @InjectedFieldSignature("ca.nanometrics.apollo.core.MissionControlApollo.startTimeMillis")
  @ApolloCoreModule.StartTime(MILLIS)
  public static void injectStartTimeMillis(MissionControlApollo instance,
      long startTimeMillis) {
    instance.startTimeMillis = startTimeMillis;
  }

and therefore causes a compile failure:

diagnostic: /home/bentatham/git/products_apollo-server/apollo-core/target/generated-sources/annotations/ca/nanometrics/apollo/core/MissionControlApollo_MembersInjector.java:72: error: cannot find symbol
  @ApolloCoreModule.StartTime(MILLIS)
                              ^
  symbol:   variable MILLIS
  location: class ca.nanometrics.apollo.core.MissionControlApollo_MembersInjector

In previous versions, up to 2.43.2, it worked fine and generated this code:

  @InjectedFieldSignature("ca.nanometrics.apollo.core.MissionControlApollo.startTimeMillis")
  @ApolloCoreModule.StartTime(ApolloCoreModule.StartTime.Units.MILLIS)
  public static void injectStartTimeMillis(MissionControlApollo instance,
      long startTimeMillis) {
    instance.startTimeMillis = startTimeMillis;
  }
@bcorso
Copy link

bcorso commented Oct 31, 2022

Hi @bentatham, thanks for reporting this!

Looks like this was a bug in our XProcessing dependency that was fixed upstream in aosp/2170603 but unfortunately didn't make it into the 2.44 release in time. However, it should be fixed at HEAD, so I'm going to go ahead and close this.

I can look into doing another Dagger release this week that should include this fix.

@bcorso bcorso closed this as completed Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants