Skip to content

Commit

Permalink
Fix an invalid cast
Browse files Browse the repository at this point in the history
bazelbuild/bazel#12605

PiperOrigin-RevId: 345742937
  • Loading branch information
cushon authored and Javac Team committed Dec 4, 2020
1 parent f311ffe commit b2a0c70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion java/com/google/turbine/processing/TurbineElements.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public boolean isDeprecated(Element element) {
if (!(element instanceof TurbineElement)) {
throw new IllegalArgumentException(element.toString());
}
for (AnnoInfo a : ((TurbineTypeElement) element).annos()) {
for (AnnoInfo a : ((TurbineElement) element).annos()) {
if (a.sym().equals(ClassSymbol.DEPRECATED)) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ public void isDeprecated() {
.isFalse();
assertThat(turbineElements.isDeprecated(turbineElements.getTypeElement("One"))).isFalse();
assertThat(turbineElements.isDeprecated(turbineElements.getTypeElement("Test"))).isTrue();
for (Element e : turbineElements.getTypeElement("java.lang.Object").getEnclosedElements()) {
assertThat(turbineElements.isDeprecated(e)).isFalse();
}
}

@Test
Expand Down

0 comments on commit b2a0c70

Please sign in to comment.