Skip to content

Commit

Permalink
Use javax.lang.model APIs instead of javac implementation classes (#577)
Browse files Browse the repository at this point in the history
Summary:
`com.sun.tools.javac.code.Type.ClassType` is an internal javac API that should not be used in annotation processors, `javax.lang.model.type.DeclaredType` is the corresponding public interface.
Pull Request resolved: #577

Test Plan: Existing tests.

Reviewed By: colriot

Differential Revision: D16666070

Pulled By: muraziz

fbshipit-source-id: a38b80d5b7a9b380d8100cb9ca4655ddebd61234
  • Loading branch information
cushon authored and facebook-github-bot committed Aug 14, 2019
1 parent fb0d287 commit 6a58557
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
package com.facebook.litho.specmodels.processor;

import com.facebook.litho.annotations.TestSpec;
import com.sun.tools.javac.code.Type;
import javax.annotation.Nullable;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.DeclaredType;
import javax.lang.model.type.MirroredTypeException;
import javax.lang.model.type.TypeMirror;

Expand All @@ -31,7 +31,7 @@ public static TypeElement getTestSpecValue(TypeElement element) {
element.getAnnotation(TestSpec.class).value();
} catch (MirroredTypeException e) {
final TypeMirror typeMirror = e.getTypeMirror();
return (TypeElement) ((Type.ClassType) typeMirror).asElement();
return (TypeElement) ((DeclaredType) typeMirror).asElement();
}

return null;
Expand Down

0 comments on commit 6a58557

Please sign in to comment.