ACS-9981 removed invalid T function import in Parameters (#3499)

This commit is contained in:
jakubkochman
2025-08-07 11:33:23 +02:00
committed by GitHub
parent 61dc54bb33
commit 0e6b444a25
2 changed files with 3 additions and 5 deletions

View File

@@ -27,7 +27,6 @@ package org.alfresco.rest.framework.resource.parameters;
import java.util.List; import java.util.List;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.extensions.webscripts.WebScriptRequest; import org.springframework.extensions.webscripts.WebScriptRequest;
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException; import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
@@ -69,7 +68,7 @@ public interface Parameters
* @return The Parameter value * @return The Parameter value
* @throws InvalidArgumentException * @throws InvalidArgumentException
*/ */
T getParameter(String parameterName, Class<T> clazz) throws InvalidArgumentException; <T> T getParameter(String parameterName, Class<T> clazz) throws InvalidArgumentException;
/** /**
* Returns a representation of the Paging of collections of resources, with skip count and max items. See {@link Paging} Specified by the "skipCount" and "maxItems" request parameters. * Returns a representation of the Paging of collections of resources, with skip count and max items. See {@link Paging} Specified by the "skipCount" and "maxItems" request parameters.

View File

@@ -31,7 +31,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.commons.beanutils.ConvertUtils; import org.apache.commons.beanutils.ConvertUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.extensions.webscripts.WebScriptRequest; import org.springframework.extensions.webscripts.WebScriptRequest;
import org.alfresco.repo.content.MimetypeMap; import org.alfresco.repo.content.MimetypeMap;
@@ -231,7 +230,7 @@ public class Params implements Parameters
} }
@Override @Override
public T getParameter(String parameterName, Class<T> clazz) throws InvalidArgumentException public <T> T getParameter(String parameterName, Class<T> clazz) throws InvalidArgumentException
{ {
String param = getParameter(parameterName); String param = getParameter(parameterName);
if (param == null) if (param == null)
@@ -239,7 +238,7 @@ public class Params implements Parameters
Object obj = ConvertUtils.convert(param, clazz); Object obj = ConvertUtils.convert(param, clazz);
if (obj != null && obj.getClass().equals(clazz)) if (obj != null && obj.getClass().equals(clazz))
{ {
return (T) obj; return clazz.cast(obj);
} }
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID, new Object[]{parameterName}); throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID, new Object[]{parameterName});
} }