Skip to content

Commit

Permalink
Remove some deprecated overloads, and broaden inputs from Set to Iter…
Browse files Browse the repository at this point in the history
…able.

PiperOrigin-RevId: 515136311
  • Loading branch information
graememorgan authored and Error Prone Team committed Mar 8, 2023
1 parent 1b80a5e commit 7a4507a
Showing 1 changed file with 7 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,9 @@ public Builder knownTypes(KnownTypes knownTypes) {
* example, when testing a class for immutability, this should be @Immutable.
*/
@CanIgnoreReturnValue
public Builder markerAnnotations(Set<String> markerAnnotations) {
return markerAnnotations(ImmutableSet.copyOf(markerAnnotations));
}

// TODO(ringwalt): Remove this constructor. We need it for binary compatibility.
@CanIgnoreReturnValue
public Builder markerAnnotations(ImmutableSet<String> markerAnnotations) {
public Builder markerAnnotations(Iterable<String> markerAnnotations) {
checkNotNull(markerAnnotations);
this.markerAnnotations = markerAnnotations;
this.markerAnnotations = ImmutableSet.copyOf(markerAnnotations);
return this;
}

Expand All @@ -184,15 +178,9 @@ public Builder markerAnnotations(ImmutableSet<String> markerAnnotations) {
* thread-safe.
*/
@CanIgnoreReturnValue
public Builder acceptedAnnotations(Set<String> acceptedAnnotations) {
return acceptedAnnotations(ImmutableSet.copyOf(acceptedAnnotations));
}

// TODO(ringwalt): Remove this constructor. We need it for binary compatibility.
@CanIgnoreReturnValue
public Builder acceptedAnnotations(ImmutableSet<String> acceptedAnnotations) {
public Builder acceptedAnnotations(Iterable<String> acceptedAnnotations) {
checkNotNull(acceptedAnnotations);
this.acceptedAnnotations = acceptedAnnotations;
this.acceptedAnnotations = ImmutableSet.copyOf(acceptedAnnotations);
return this;
}

Expand All @@ -206,7 +194,7 @@ public Builder containerOfAnnotation(Class<? extends Annotation> containerOfAnno

/** An annotation which marks a generic parameter as a container type. */
@CanIgnoreReturnValue
public Builder containerOfAnnotation(Set<String> containerOfAnnotation) {
public Builder containerOfAnnotation(Iterable<String> containerOfAnnotation) {
checkNotNull(containerOfAnnotation);
this.containerOfAnnotation = ImmutableSet.copyOf(containerOfAnnotation);
return this;
Expand All @@ -222,7 +210,7 @@ public Builder suppressAnnotation(Class<? extends Annotation> suppressAnnotation

/** An annotation which, when found on a class, should suppress the test */
@CanIgnoreReturnValue
public Builder suppressAnnotation(Set<String> suppressAnnotation) {
public Builder suppressAnnotation(Iterable<String> suppressAnnotation) {
checkNotNull(suppressAnnotation);
this.suppressAnnotation = ImmutableSet.copyOf(suppressAnnotation);
return this;
Expand All @@ -248,7 +236,7 @@ public Builder typeParameterAnnotation(Class<? extends Annotation> typeParameter
* only be instantiated with thread-safe types.
*/
@CanIgnoreReturnValue
public Builder typeParameterAnnotation(Set<String> typeParameterAnnotation) {
public Builder typeParameterAnnotation(Iterable<String> typeParameterAnnotation) {
checkNotNull(typeParameterAnnotation);
this.typeParameterAnnotation = ImmutableSet.copyOf(typeParameterAnnotation);
return this;
Expand Down

0 comments on commit 7a4507a

Please sign in to comment.