Fix array cast (#1783)
This commit is contained in:
parent
9344cf6c54
commit
73f994ad2a
|
|
@ -372,6 +372,11 @@ public final class XposedBridge {
|
|||
return elements;
|
||||
}
|
||||
|
||||
public <T> T[] getSnapshot(T[] a) {
|
||||
var snapshot = getSnapshot();
|
||||
return (T[]) Arrays.copyOf(snapshot, snapshot.length, a.getClass());
|
||||
}
|
||||
|
||||
public synchronized void clear() {
|
||||
elements = EMPTY_ARRAY;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public abstract class XC_LayoutInflated extends XCallback {
|
|||
* @hide
|
||||
*/
|
||||
public LayoutInflatedParam(CopyOnWriteSortedSet<XC_LayoutInflated> callbacks) {
|
||||
super((XCallback[]) callbacks.getSnapshot());
|
||||
super(callbacks.getSnapshot(new XCallback[0]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue