Skip to content

Commit

Permalink
I am stupid: Not all types are generic
Browse files Browse the repository at this point in the history
  • Loading branch information
SwanX1 committed Apr 4, 2024
1 parent 28faa1f commit e423378
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION=4.0.2-SNAPSHOT
VERSION=4.0.3-SNAPSHOT
GROUP=org.infernalstudios
ARTIFACT=config
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ public ListConfigElement(Field field, IConfigElementHandler<List, ?> handler) {
ParameterizedType parameterized = (ParameterizedType) field.getGenericType();
Type[] typeArgs = parameterized.getActualTypeArguments();
String genericTypeName = typeArgs[0].getTypeName();
Class<?> genericType = Class.forName(genericTypeName.substring(0, genericTypeName.indexOf("<")));
String typeName = genericTypeName.indexOf("<") != -1 ?
genericTypeName.substring(0, genericTypeName.indexOf("<")) :
genericTypeName;
Class<?> genericType = Class.forName(typeName);
this.serializeHandler = serializeClass.getDeclaredMethod(serializeMethod, genericType);
} catch (NoSuchMethodException e) {
throw new IllegalStateException("Could not find method for serialization handler", e);
Expand Down

0 comments on commit e423378

Please sign in to comment.