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

Single-argument constructor overload #20

Open
bsideup opened this issue Jan 5, 2019 · 0 comments
Open

Single-argument constructor overload #20

bsideup opened this issue Jan 5, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@bsideup
Copy link
Member

bsideup commented Jan 5, 2019

Hi!

If I have a service named MyService , the current implementation generates a constructor (MyServiceServer) with 3 parameters:

  1. MyService
  2. Optional<MeterRegistry>
  3. Optional<Tracer>

The problem is that if you exclude opentracing & micrometer from the classpath, new MyServiceServer(myService, Optional.empty(), Optional.empty()) fails at runtime because it refers to the missing classes. There is a workaround for it:

new MyServiceServer(myService, (Optional) Optional.empty(), (Optional) Optional.empty());

But it would be nice if the generator will create an additional constructor, without optionals and @Inject at all:

new MyServiceServer(myService);

and delegate to this(service, Optional.empty(), Optional.empty());

Not everyone is using opentracing and/or micrometer and it will help to not have them on classpath

@OlegDokuka OlegDokuka added the enhancement New feature or request label Jan 5, 2019
@OlegDokuka OlegDokuka self-assigned this Jan 5, 2019
@OlegDokuka OlegDokuka pinned this issue Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants