Skip to content

Commit b359bb9

Browse files
committed
Merge pull request #2475 from akarnokd/SyncQueueCloneFix
SynchronousQueue.clone fix
2 parents 2af4f74 + 67e8cfe commit b359bb9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/rx/internal/util/SynchronizedQueue.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ public synchronized boolean offer(T e) {
138138

139139
@Override
140140
public synchronized Object clone() {
141-
return list.clone();
141+
SynchronizedQueue<T> q = new SynchronizedQueue<T>(size);
142+
q.addAll(list);
143+
return q;
142144
}
143145

144146
@Override

0 commit comments

Comments
 (0)