Skip to content

Duplicated code in generated sources. Client generator plugin probably don't pair well with IntelliJ based build, or there is a general bug in generator plugin. #560

@soberich

Description

@soberich

Hi, @rbygrave

A hard to reproduce effect here.

This is what I see regularly in generated client code.

I wish I could give more to reproduce but it was hard to catch, so I'd suggest to maybe double and triple check that generator annotation processor defensively deduplicates everything what it tries to output to generated source.

import com.example.MyApiAnnotatedInterface;
import com.example.MyApiHttpClient;
import io.avaje.http.api.Generated;
import io.avaje.http.api.spi.MetaData;
import io.avaje.http.client.HttpApiProvider;
import io.avaje.http.client.HttpClient;
import java.util.Map;

@Generated("avaje-client-generator")
@MetaData({MyApiHttpClient.class, MyApiHttpClient.class, MyApiHttpClient.class, MyApiHttpClient.class, MyApiHttpClient.class, MyApiHttpClient.class, MyApiHttpClient.class, MyApiHttpClient.class})
public final class GeneratedHttpComponent implements HttpClient.GeneratedComponent {

  @Override
  public void register(Map<Class<?>, HttpApiProvider<?>> providerMap) {
    providerMap.put(MyApiAnnotatedInterface.class, MyApiHttpClient::new);
    providerMap.put(MyApiAnnotatedInterface.class, MyApiHttpClient::new);
    providerMap.put(MyApiAnnotatedInterface.class, MyApiHttpClient::new);
    providerMap.put(MyApiAnnotatedInterface.class, MyApiHttpClient::new);
    providerMap.put(MyApiAnnotatedInterface.class, MyApiHttpClient::new);
    providerMap.put(MyApiAnnotatedInterface.class, MyApiHttpClient::new);
    providerMap.put(MyApiAnnotatedInterface.class, MyApiHttpClient::new);
    providerMap.put(MyApiAnnotatedInterface.class, MyApiHttpClient::new);
  }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions