Skip to content

Commit f106b20

Browse files
committed
WW-5352 Map-like type support
1 parent 6df8004 commit f106b20

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core/src/main/java/org/apache/struts2/interceptor/parameter/ParametersInterceptor.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,15 @@ protected void allowlistParameterizedTypeArg(Type genericType) {
400400
if (!(genericType instanceof ParameterizedType)) {
401401
return;
402402
}
403-
Type paramType = ((ParameterizedType) genericType).getActualTypeArguments()[0];
403+
Type[] paramTypes = ((ParameterizedType) genericType).getActualTypeArguments();
404+
allowlistParamType(paramTypes[0]);
405+
if (paramTypes.length > 1) {
406+
// Probably useful for Map or Map-like classes
407+
allowlistParamType(paramTypes[1]);
408+
}
409+
}
410+
411+
protected void allowlistParamType(Type paramType) {
404412
if (paramType instanceof Class) {
405413
threadAllowlist.allowClass((Class<?>) paramType);
406414
}

0 commit comments

Comments
 (0)