Details
Description
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);