Skip to content

Commit

Permalink
Remove the isAnnotation check for Annotation.Builder.build. In ja…
Browse files Browse the repository at this point in the history
…vac, some annotations are not recognized as annotations.

PiperOrigin-RevId: 732261168
  • Loading branch information
Googler authored and copybara-github committed Feb 28, 2025
1 parent d144318 commit 7bde331
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package com.google.j2cl.transpiler.ast;

import static com.google.common.base.Preconditions.checkState;

import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableMap;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
Expand Down Expand Up @@ -56,7 +54,9 @@ public Builder addAllValues(Iterable<? extends Map.Entry<String, Literal>> value
abstract ImmutableMap.Builder<String, Literal> valuesBuilder();

public Annotation build() {
checkState(getTypeDescriptor().isAnnotation(), "Annotation must be an annotation type.");
// TODO(b/399477543): Some annotations are not recognized as annotations by javac. Fix this,
// then throw an exception here if the type is not an annotation.
// checkState(getTypeDescriptor().isAnnotation(), "Annotation must be an annotation type.");
return autoBuild();
}

Expand Down

0 comments on commit 7bde331

Please sign in to comment.