[
https://issues.apache.org/jira/browse/CXF-6370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Colm O hEigeartaigh closed CXF-6370.
------------------------------------
> wrong usages for System.arraycopy in
> org.apache.cxf.jaxrs.impl.AsyncResponseImpl
> --------------------------------------------------------------------------------
>
> Key: CXF-6370
> URL: https://issues.apache.org/jira/browse/CXF-6370
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 3.0.2, 3.0.3, 2.7.15
> Reporter: iris ding
> Assignee: Sergey Beryozkin
> Fix For: 3.1.0, 3.0.5
>
>
> In org.apache.cxf.jaxrs.impl.AsyncResponseImpl, below method used
> System.arraycopy(). However, it mismatch the arrary to copy out of and array
> to copy into:
> "void java.lang.System.arraycopy(Object array1, int start1, Object array2,
> int start2, int length)
> Copies the contents of array1 starting at offset start1 into array2 starting
> at offset start2 for length elements."
> After below modification, my CTS test passed!
> @Override
> public Map<Class<?>, Collection<Class<?>>> register(Object callback,
> Object... callbacks)
> throws NullPointerException {
> Map<Class<?>, Collection<Class<?>>> map =
> new HashMap<Class<?>, Collection<Class<?>>>();
> Object[] allCallbacks = new Object[1 + callbacks.length];
> allCallbacks[0] = callback;
> // wrong usage for System.arraycopy
> // System.arraycopy(allCallbacks, 1, callbacks, 0, callbacks.length);
> System.arraycopy(callbacks, 0, allCallbacks, 1, callbacks.length);
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)