Skip to content

Commit

Permalink
Change ImmutablesStyle's retention policy (#369)
Browse files Browse the repository at this point in the history
Change immutablesStyle's retention policy to be SOURCE instead of CLASS, and make SerializableError use it. This avoids compilation warnings for consumers that don't depend on immutables.
  • Loading branch information
JiahuiJiang authored and dansanduleac committed Oct 24, 2019
1 parent 1c9d854 commit d77cfee
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.immutables.value.Value;

@Target({ElementType.PACKAGE, ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.SOURCE)
@Value.Style(
visibility = Value.Style.ImplementationVisibility.PACKAGE,
overshadowImplementation = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
@JsonDeserialize(builder = SerializableError.Builder.class)
@JsonSerialize(as = ImmutableSerializableError.class)
@Value.Immutable
@Value.Style(visibility = Value.Style.ImplementationVisibility.PACKAGE, jdkOnly = true)
@ImmutablesStyle
@Value.Style(overshadowImplementation = false)
@JsonIgnoreProperties(ignoreUnknown = true)
public abstract class SerializableError implements Serializable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.immutables.value.Value;

@Target({ElementType.PACKAGE, ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.SOURCE)
@Value.Style(
visibility = Value.Style.ImplementationVisibility.PACKAGE,
overshadowImplementation = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.immutables.value.Value;

@Target({ElementType.PACKAGE, ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.SOURCE)
@Value.Style(
visibility = Value.Style.ImplementationVisibility.PACKAGE,
overshadowImplementation = true,
Expand Down

0 comments on commit d77cfee

Please sign in to comment.