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

"Sandwich" style immutables in combination with Jackson and Set-type properties leads to compile time warnings in generated code #1512

Open
gerjon-eatch opened this issue Apr 9, 2024 · 1 comment
Labels

Comments

@gerjon-eatch
Copy link

E.g. the following definition of an Immutable type:

package com.example;

import java.util.Set;

import org.immutables.value.Value.Immutable;
import org.immutables.value.Value.Style;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@Immutable
@Style(jdkOnly = true)
@JsonDeserialize(as = ImmutableIssue.class)
@JsonSerialize(as = ImmutableIssue.class)
public interface Issue extends WithIssue {
  Set<String> getSet();
}

Generates ImmutableIssue.java code with the following compiler warning:

Varargs methods should only override or be overridden by other varargs methods unlike ImmutableIssue.Json.withSet(String[]) and WithIssue.withSet(String...)
@elucash
Copy link
Member

elucash commented May 21, 2024

This is definitely a bug as described, will be looking into it.

@elucash elucash added the bug label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants