Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f9eff10 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Re-throw reflective exceptions"

parents b8d804f0 c74a113d
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -40,8 +40,15 @@ public class GeneratedInspectionCompanionProvider implements InspectionCompanion
            final Class<InspectionCompanion<T>> companionClass =
            final Class<InspectionCompanion<T>> companionClass =
                    (Class<InspectionCompanion<T>>) cls.getClassLoader().loadClass(companionName);
                    (Class<InspectionCompanion<T>>) cls.getClassLoader().loadClass(companionName);
            return companionClass.newInstance();
            return companionClass.newInstance();
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
        } catch (ClassNotFoundException e) {
            return null;
            return null;
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (InstantiationException e) {
            Throwable cause = e.getCause();
            if (cause instanceof RuntimeException) throw (RuntimeException) cause;
            if (cause instanceof Error) throw (Error) cause;
            throw new RuntimeException(cause);
        }
        }
    }
    }
}
}