Skip to content

Commit

Permalink
refactoring test
Browse files Browse the repository at this point in the history
  • Loading branch information
teletha committed Nov 17, 2024
1 parent 89db711 commit 068b4e5
Show file tree
Hide file tree
Showing 2 changed files with 402 additions and 253 deletions.
10 changes: 9 additions & 1 deletion src/main/java/kiss/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,14 @@ static synchronized Model of(Type type, Type base) {
if (base == variable.getGenericDeclaration()) {
return of(variable.getBounds()[0], base);
} else {
return of(collectParameters(base, variable.getGenericDeclaration())[i], base);
Type[] types = collectParameters(base, variable.getGenericDeclaration());

if (types.length == 0) {
System.out.println(base + " " + variable.getGenericDeclaration() + " " + variable + " " + Arrays
.toString(variables) + " " + Arrays.toString(variable.getBounds()));
}

return of(types.length < i ? variable.getBounds()[0] : types[i], base);
}
}

Expand Down Expand Up @@ -672,6 +679,7 @@ private static Type[] collectParameters(Type clazz, GenericDeclaration target, T
try {
args[i] = Model.of(args[i], base).type;
} catch (ArrayIndexOutOfBoundsException e) {
e.printStackTrace();
args[i] = clazz == base ? Object.class : collectParameters(clazz, target)[i];
}
}
Expand Down
Loading

0 comments on commit 068b4e5

Please sign in to comment.