Projects >> AirCastingAndroidClient >>fef218f5bc97835abacc2ab61b158b39a2d7f11e

Chunk
Conflicting content
{
  @Expose private UUID uuid = UUID.randomUUID();

<<<<<<< HEAD
  /** @deprecated will be removed */
  transient List measurements = newArrayList();

=======
>>>>>>> aa0bd5293d6260b0e806163791de4a3e67c747fd
  @Expose @SerializedName("streams") Map streams = newHashMap();

  @Expose private List notes = newArrayList();
Solution content
{
  @Expose private UUID uuid = UUID.randomUUID();

  @Expose @SerializedName("streams") Map streams = newHashMap();

  @Expose private List notes = newArrayList();
File
Session.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Method invocation
Chunk
Conflicting content
public class SessionRepository
{
<<<<<<< HEAD
=======
  public static final String TAG = SessionRepository.class.getSimpleName();

  @Language("SQL")
>>>>>>> aa0bd5293d6260b0e806163791de4a3e67c747fd
  private static final String SESSIONS_BY_SENSOR_QUERY =
      "SELECT " + SESSION_TABLE_NAME + ".*" +
          " FROM " + SESSION_TABLE_NAME +
Solution content
public class SessionRepository
{
  public static final String TAG = SessionRepository.class.getSimpleName();

  @Language("SQL")
  private static final String SESSIONS_BY_SENSOR_QUERY =
      "SELECT " + SESSION_TABLE_NAME + ".*" +
          " FROM " + SESSION_TABLE_NAME +
File
SessionRepository.java
Developer's decision
Version 2
Kind of conflict
Annotation
Attribute
Method invocation
Chunk
Conflicting content
  public void save(Session session, ProgressListener progressListener) {
    setupProgressListener(session, progressListener);

<<<<<<< HEAD
    db.beginTransaction();
    try
    {
      ContentValues values = new ContentValues();
=======

    ContentValues values = new ContentValues();
>>>>>>> aa0bd5293d6260b0e806163791de4a3e67c747fd

      prepareHeader(session, values);
Solution content
  public void save(Session session, ProgressListener progressListener) {
    setupProgressListener(session, progressListener);


      ContentValues values = new ContentValues();

      prepareHeader(session, values);
File
SessionRepository.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Try statement
Variable
Chunk
Conflicting content
      Collection streamsToSave = session.getMeasurementStreams();

<<<<<<< HEAD
      streams.saveAll(streamsToSave, sessionKey);

      notes.save(session.getNotes(), sessionKey);

      db.setTransactionSuccessful();
    }
    catch (Exception e)
    {
      Log.e(TAG, "Error saving session", e);
    }
    finally
    {
      db.endTransaction();
    }
=======
    notes.save(session.getNotes(), sessionKey);
>>>>>>> aa0bd5293d6260b0e806163791de4a3e67c747fd
  }

  private void setupProgressListener(Session session, ProgressListener progressListener) {
Solution content
      Collection streamsToSave = session.getMeasurementStreams();

      streams.saveAll(streamsToSave, sessionKey);

      notes.save(session.getNotes(), sessionKey);
  }

  private void setupProgressListener(Session session, ProgressListener progressListener) {
File
SessionRepository.java
Developer's decision
Combination
Kind of conflict
Catch clause
Method invocation
Chunk
Conflicting content
    }
    catch (SQLException e)
    {
    delete(condition);
  }

<<<<<<< HEAD
  private void delete(Long id)
  {
    db.beginTransaction();
    try
    {
      db.delete(SESSION_TABLE_NAME, SESSION_ID + " = " + id, null);
      db.delete(MEASUREMENT_TABLE_NAME, MEASUREMENT_SESSION_ID + " = " + id, null);
      db.delete(NOTE_TABLE_NAME, NOTE_SESSION_ID + " = " + id, null);

      db.setTransactionSuccessful();
    }
    catch(Exception e)
    {
      Log.e(TAG, "Error deleting session", e);
    }
    finally
    {
      db.endTransaction();
=======
  private void delete(Long sessionId)
  {
    try
    {
      db.delete(SESSION_TABLE_NAME, SESSION_ID + " = " + sessionId, null);
      db.delete(MEASUREMENT_TABLE_NAME, MEASUREMENT_SESSION_ID + " = " + sessionId, null);
      db.delete(STREAM_TABLE_NAME, STREAM_SESSION_ID + " = " + sessionId, null);
      db.delete(NOTE_TABLE_NAME, NOTE_SESSION_ID + " = " + sessionId, null);
      Log.e(TAG, "Error deleting session [ " + sessionId + " ]", e);
>>>>>>> aa0bd5293d6260b0e806163791de4a3e67c747fd
    }
  }
Solution content
    delete(condition);
  }

  private void delete(Long sessionId)
  {
    try
    {
      db.delete(SESSION_TABLE_NAME, SESSION_ID + " = " + sessionId, null);
      db.delete(MEASUREMENT_TABLE_NAME, MEASUREMENT_SESSION_ID + " = " + sessionId, null);
      db.delete(STREAM_TABLE_NAME, STREAM_SESSION_ID + " = " + sessionId, null);
      db.delete(NOTE_TABLE_NAME, NOTE_SESSION_ID + " = " + sessionId, null);
    }
    catch (SQLException e)
    {
      Log.e(TAG, "Error deleting session [ " + sessionId + " ]", e);
    }
  }
File
SessionRepository.java
Developer's decision
Version 2
Kind of conflict
Catch clause
Method invocation
Method signature
Try statement
Chunk
Conflicting content
    ContentValues values = new ContentValues();
    prepareHeader(session, values);

<<<<<<< HEAD
    db.beginTransaction();
    try
    {
      notes.save(session.getNotes(), session.getId());
      db.update(SESSION_TABLE_NAME, values, SESSION_ID + " = " + session.getId(), null);

      db.setTransactionSuccessful();
    }
    catch (Exception e)
    {
      Log.e(TAG, "Error updating session", e);
    }
    finally
    {
      db.endTransaction();
    }
=======
    try
    {
      notes.save(session.getNotes(), session.getId());

      db.update(SESSION_TABLE_NAME, values, SESSION_ID + " = " + session.getId(), null);
    }
    catch (SQLException e)
    {
      Log.e(TAG, "Error updating session [ " + session.getId() + " ]", e);
    }
  }

  public void deleteStream(Long sessionId, MeasurementStream stream)
  {
    streams.markForRemoval(stream, sessionId);
  }

  public StreamRepository streams()
  {
    return streams;
>>>>>>> aa0bd5293d6260b0e806163791de4a3e67c747fd
  }
}
Solution content
    ContentValues values = new ContentValues();
    prepareHeader(session, values);

    try
    {
      notes.save(session.getNotes(), session.getId());

      db.update(SESSION_TABLE_NAME, values, SESSION_ID + " = " + session.getId(), null);
    }
    catch (SQLException e)
    {
      Log.e(TAG, "Error updating session [ " + session.getId() + " ]", e);
    }
  }

  public void deleteStream(Long sessionId, MeasurementStream stream)
  {
    streams.markForRemoval(stream, sessionId);
  }

  public StreamRepository streams()
  {
    return streams;
  }
}
File
SessionRepository.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method declaration
Method invocation
Method signature
Return statement
Try statement
Chunk
Conflicting content
            result.setContent(output);
        return result;
    }

<<<<<<< HEAD
  private  HttpResult doRequest(HttpUriRequest request, Type target)
  {
    DefaultHttpClient client = new DefaultHttpClient();
    HttpResult result = new HttpResult();
    Reader reader = null;
    InputStream content = null;

    try
    {
      client.addRequestInterceptor(preemptiveAuth(), 0);

      HttpResponse response = client.execute(request);
      content = response.getEntity().getContent();
      reader = new InputStreamReader(content);

      List strings = CharStreams.readLines(reader);
      StringBuffer b = new StringBuffer();
      for (String string : strings)
      {
        b.append(string).append("\n");
      }

      String fullJson = b.toString();
      T output = gson.fromJson(new StringReader(fullJson), target);
      result.setContent(output);
      result.setStatus(response.getStatusLine().getStatusCode() < 300 ? Status.SUCCESS : Status.FAILURE);
    }
    catch (Exception e)
    {
      Log.e(TAG, "Http request failed", e);
      result.setStatus(Status.ERROR);
=======
    private  HttpResult doRequest(HttpUriRequest request, Type target) {
        DefaultHttpClient client = new DefaultHttpClient();
        HttpResult result = new HttpResult();
        Reader reader = null;
        InputStream content = null;

        try {
            client.addRequestInterceptor(preemptiveAuth(), 0);

            HttpResponse response = client.execute(request);
            content = response.getEntity().getContent();
            reader = new InputStreamReader(content);

      List strings = CharStreams.readLines(reader);
      StringBuffer buffer = new StringBuffer();
      for (String string : strings)
      {
        buffer.append(string).append("\n");
      }

      String fullJson = buffer.toString();
      T output = gson.fromJson(new StringReader(fullJson), target);
            result.setStatus(response.getStatusLine().getStatusCode() < 300 ? Status.SUCCESS : Status.FAILURE);
        } catch (Exception e) {
            Log.e(TAG, "Http request failed", e);
            result.setStatus(Status.ERROR);

            return result;
        } finally {
            closeQuietly(content);
            closeQuietly(reader);
            client.getConnectionManager().shutdown();
        }
>>>>>>> aa0bd5293d6260b0e806163791de4a3e67c747fd

      return result;
    }
Solution content
        return result;
    }

    private  HttpResult doRequest(HttpUriRequest request, Type target) {
        DefaultHttpClient client = new DefaultHttpClient();
        HttpResult result = new HttpResult();
        Reader reader = null;
        InputStream content = null;

        try {
            client.addRequestInterceptor(preemptiveAuth(), 0);

            HttpResponse response = client.execute(request);
            content = response.getEntity().getContent();
            reader = new InputStreamReader(content);

      List strings = CharStreams.readLines(reader);
      StringBuffer buffer = new StringBuffer();
      for (String string : strings)
      {
        buffer.append(string).append("\n");
      }

      String fullJson = buffer.toString();
      T output = gson.fromJson(new StringReader(fullJson), target);
            result.setContent(output);
            result.setStatus(response.getStatusLine().getStatusCode() < 300 ? Status.SUCCESS : Status.FAILURE);
        } catch (Exception e) {
            Log.e(TAG, "Http request failed", e);
            result.setStatus(Status.ERROR);

            return result;
        } finally {
            closeQuietly(content);
            closeQuietly(reader);
            client.getConnectionManager().shutdown();
        }

      return result;
    }
File
HttpBuilder.java
Developer's decision
Version 2
Kind of conflict
Catch clause
For statement
Method invocation
Method signature
Try statement
Variable