Closed GoogleCodeExporter closed 8 years ago
The capacity argument you see there corresponds to the Vector's initial
capacity (see java.util.Vector's javadoc). It is not related to the
maxRetained feature.
Original comment by sype...@gmail.com
on 19 Jan 2012 at 2:57
Ok, but my concern is in the following code:
@Override
public PushedNotifications getPushedNotifications() {
int capacity = 0;
for (NotificationThread thread : threads)
capacity += thread.getPushedNotifications().size();
PushedNotifications all = new PushedNotifications(capacity);
for (NotificationThread thread : threads)
all.addAll(thread.getPushedNotifications());
return all;
}
you compute the capacity of the array but you don't call the setMaxRetained
capacity. When you call addAll(), it will retain only the last 1000 entries
(see prepareAdd()).
To fix the pb I put the call to setMaxRetained() in the PushedNotifications
constructor, but you can either put it just after the PushedNotifications
object is created.
PushedNotifications all = new PushedNotifications(capacity);
all.setMaxRetained(capacity);
Original comment by ericpr...@gmail.com
on 19 Jan 2012 at 3:31
Fixed in r351 (in source code only, will be part of the next build).
Original comment by sype...@gmail.com
on 19 Jan 2012 at 3:42
Original issue reported on code.google.com by
ericpr...@gmail.com
on 19 Jan 2012 at 8:28