@Test public void testRefer() { OperationProgress progress1 = new OperationProgress(); progress1.addStep(new Pending()); OperationProgress progress2 = new OperationProgress(); progress2.addStep(new WaitingForClusterModel()); assertTrue(progress1.progress().get(0) instanceof Pending); progress1.refer(progress2); assertTrue(progress1.progress().get(0) instanceof WaitingForClusterModel); assertEquals(progress1.progress(), progress2.progress()); }
public void refer(OperationProgress other) { List<OperationStep> steps; List<Long> startTimes; synchronized (other) { steps = other._steps; startTimes = other._startTimes; } synchronized (this) { ensureMutable(); this._steps = steps; this._startTimes = startTimes; this._mutable = false; } }
OperationProgress { public void refer(OperationProgress other) { List<OperationStep> steps; List<Long> startTimes; synchronized (other) { steps = other._steps; startTimes = other._startTimes; } synchronized (this) { ensureMutable(); this._steps = steps; this._startTimes = startTimes; this._mutable = false; } } }
OperationProgress { public void refer(OperationProgress other) { List<OperationStep> steps; List<Long> startTimes; synchronized (other) { steps = other._steps; startTimes = other._startTimes; } synchronized (this) { ensureMutable(); this._steps = steps; this._startTimes = startTimes; this._mutable = false; } } OperationProgress();  OperationProgress(String operation); }
OperationProgress { public void refer(OperationProgress other) { List<OperationStep> steps; List<Long> startTimes; synchronized (other) { steps = other._steps; startTimes = other._startTimes; } synchronized (this) { ensureMutable(); this._steps = steps; this._startTimes = startTimes; this._mutable = false; } } OperationProgress();  OperationProgress(String operation); synchronized void addStep(OperationStep step); void refer(OperationProgress other); synchronized List<OperationStep> progress(); synchronized void clear(); @Override synchronized String toString(); Map<String, Object> getJsonStructure(); }
OperationProgress { public void refer(OperationProgress other) { List<OperationStep> steps; List<Long> startTimes; synchronized (other) { steps = other._steps; startTimes = other._startTimes; } synchronized (this) { ensureMutable(); this._steps = steps; this._startTimes = startTimes; this._mutable = false; } } OperationProgress();  OperationProgress(String operation); synchronized void addStep(OperationStep step); void refer(OperationProgress other); synchronized List<OperationStep> progress(); synchronized void clear(); @Override synchronized String toString(); Map<String, Object> getJsonStructure();  }