Skip to content

Commit

Permalink
Remove usage of @OverridesAttribute.List
Browse files Browse the repository at this point in the history
Java 8 supports specifying repeated annotations, so there's no need to
use this any more.
  • Loading branch information
rhowe committed Feb 2, 2022
1 parent 775d096 commit 981bdec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@
@OverridesAttribute(constraint = MaxDataSize.class, name = "value")
long max() default Long.MAX_VALUE;

@OverridesAttribute.List({
@OverridesAttribute(constraint = MinDataSize.class, name = "unit"),
@OverridesAttribute(constraint = MaxDataSize.class, name = "unit")
})
@OverridesAttribute(constraint = MinDataSize.class, name = "unit")
@OverridesAttribute(constraint = MaxDataSize.class, name = "unit")
DataSizeUnit unit() default DataSizeUnit.BYTES;

String message() default "must be between {min} {unit} and {max} {unit}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@
@OverridesAttribute(constraint = MaxDuration.class, name = "value")
long max() default Long.MAX_VALUE;

@OverridesAttribute.List({
@OverridesAttribute(constraint = MinDuration.class, name = "unit"),
@OverridesAttribute(constraint = MaxDuration.class, name = "unit")
})
@OverridesAttribute(constraint = MinDuration.class, name = "unit")
@OverridesAttribute(constraint = MaxDuration.class, name = "unit")
TimeUnit unit() default TimeUnit.SECONDS;

String message() default "must be between {min} {unit} and {max} {unit}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@
@OverridesAttribute(constraint = MaxSize.class, name = "value")
long max() default Long.MAX_VALUE;

@OverridesAttribute.List({
@OverridesAttribute(constraint = MinSize.class, name = "unit"),
@OverridesAttribute(constraint = MaxSize.class, name = "unit")
})
@OverridesAttribute(constraint = MinSize.class, name = "unit")
@OverridesAttribute(constraint = MaxSize.class, name = "unit")
SizeUnit unit() default SizeUnit.BYTES;

String message() default "must be between {min} {unit} and {max} {unit}";
Expand Down

0 comments on commit 981bdec

Please sign in to comment.