Author: j16sdiz
Date: 2008-04-09 16:01:05 +0000 (Wed, 09 Apr 2008)
New Revision: 19113
Modified:
trunk/freenet/src/freenet/support/math/BootstrappingDecayingRunningAverage.java
Log:
Fix missing fields and synchronization in copy constructor
Modified:
trunk/freenet/src/freenet/support/math/BootstrappingDecayingRunningAverage.java
===================================================================
---
trunk/freenet/src/freenet/support/math/BootstrappingDecayingRunningAverage.java
2008-04-09 16:00:47 UTC (rev 19112)
+++
trunk/freenet/src/freenet/support/math/BootstrappingDecayingRunningAverage.java
2008-04-09 16:01:05 UTC (rev 19113)
@@ -151,13 +151,17 @@
/**
* Copy constructor.
*/
- private
BootstrappingDecayingRunningAverage(BootstrappingDecayingRunningAverage a) {
- this.currentValue = a.currentValue;
- this.max = a.max;
- this.maxReports = a.maxReports;
- this.min = a.min;
- this.reports = a.reports;
- }
+ private
BootstrappingDecayingRunningAverage(BootstrappingDecayingRunningAverage a) {
+ synchronized (a) {
+ this.currentValue = a.currentValue;
+ this.max = a.max;
+ this.maxReports = a.maxReports;
+ this.min = a.min;
+ this.reports = a.reports;
+ this.zeros = a.zeros;
+ this.ones = a.ones;
+ }
+ }
/**
* {@inheritDoc}