From 379b60d5e8a2418f438e4291bf5ba140778db5bc Mon Sep 17 00:00:00 2001 From: Jonathan Lawlor Date: Wed, 22 Mar 2017 11:10:45 -0700 Subject: [PATCH] Fix ClassCastException in ReactModuleSpecProcessor Reviewed By: AaaChiuuu Differential Revision: D4752195 fbshipit-source-id: 7c01f9be4d82dbc605f1e6d3b217f0c83f177165 --- .../react/module/processing/ReactModuleSpecProcessor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java b/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java index d7c419cda..fe2c9ff6c 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java +++ b/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java @@ -79,6 +79,10 @@ public class ReactModuleSpecProcessor extends AbstractProcessor { Set reactModuleListElements = roundEnv.getElementsAnnotatedWith( ReactModuleList.class); for (Element reactModuleListElement : reactModuleListElements) { + if (!(reactModuleListElement instanceof TypeElement)) { + continue; + } + TypeElement typeElement = (TypeElement) reactModuleListElement; ReactModuleList reactModuleList = typeElement.getAnnotation(ReactModuleList.class); if (reactModuleList == null) {