From 996eba6faa2ec928645098d3a8780772f3697ef8 Mon Sep 17 00:00:00 2001 From: MrNavaStar Date: Sat, 17 Aug 2024 17:37:28 -0600 Subject: [PATCH] oops this project is java 8 --- src/main/java/me/mrnavastar/r/R.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/mrnavastar/r/R.java b/src/main/java/me/mrnavastar/r/R.java index ecc5956..ae546a3 100644 --- a/src/main/java/me/mrnavastar/r/R.java +++ b/src/main/java/me/mrnavastar/r/R.java @@ -87,8 +87,9 @@ public R call(String name, Object... args) { } public Class[] generics() { - if (clazz.getGenericSuperclass() instanceof ParameterizedType type) { - return Arrays.stream(type.getActualTypeArguments()).map(t -> { + Type generic = clazz.getGenericSuperclass(); + if (generic instanceof ParameterizedType) { + return Arrays.stream(((ParameterizedType) generic).getActualTypeArguments()).map(t -> { try { return Class.forName(t.getTypeName()); } catch (ClassNotFoundException e) {