I prefer the verbosity of the null impl to peppering a growing set of null
checks throughout the code that uses the calldata object.  If there is a
third way you'd prefer, let me know.
On Apr 5, 2013 11:40 AM, "Moxie Marlinspike" <notifications@github.com>
wrote:

> In src/org/thoughtcrime/redphone/monitor/CallMonitor.java:
>
> > +/**
> > + * CallMonitor manages accumulation data and upload of call quality data.
> > + */
> > +public class CallMonitor {
> > +  private final List<Pair<String, SampledMetrics>> metrics = new ArrayList<Pair<String, SampledMetrics>>();
> > +  private final CallData data;
> > +  private final ScheduledExecutorService sampler = Executors.newSingleThreadScheduledExecutor();
> > +  private final ScheduledFuture sampleFuture;
> > +
> > +  public CallMonitor(Context context) {
> > +    CallData data;
> > +    try {
> > +      data = new CallDataImpl(context);
> > +    } catch (IOException e) {
> > +      Log.e("CallMonitor", "Failed to create call data store", e);
> > +      data = new CallDataMock();
>
> Having an interface, implementation, and null implementation seems a
> little heavy handed all for this case?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/WhisperSystems/RedPhone/pull/109/files#r3678226>
> .
>