Skip to content

Commit

Permalink
style: improve code style for delivery api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed May 4, 2018
1 parent b15a4f4 commit 72b744c
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,11 @@ public static Delivery generateDelivery() {
return new Delivery() {
@Override
public void deliver(SessionTrackingPayload payload,
Configuration config) throws DeliveryFailureException {

}
Configuration config) throws DeliveryFailureException {}

@Override
public void deliver(Report report,
Configuration config) throws DeliveryFailureException {

}
Configuration config) throws DeliveryFailureException {}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;


public class DeliveryCompatTest {

private final Configuration config = BugsnagTestUtils.generateConfiguration();
Expand Down Expand Up @@ -45,7 +44,6 @@ public void deliver(Report report,
}
};
deliveryCompat = new DeliveryCompat(baseDelivery);

}

@Test
Expand Down Expand Up @@ -125,5 +123,4 @@ public void testExceptionConversion() {

assertNull(deliveryCompat.convertException(new RuntimeException()));
}

}
3 changes: 0 additions & 3 deletions sdk/src/main/java/com/bugsnag/android/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,6 @@ void setErrorReportApiClient(@NonNull ErrorReportApiClient errorReportApiClient)
if (errorReportApiClient == null) {
throw new IllegalArgumentException("ErrorReportApiClient cannot be null.");
}

DeliveryCompat compat = (DeliveryCompat) config.getDelivery();
compat.errorReportApiClient = errorReportApiClient;
}
Expand Down Expand Up @@ -1239,9 +1238,7 @@ void deliver(@NonNull Report report, @NonNull Error error) {
config.getDelivery().deliver(report, config);
Logger.info("Sent 1 new error to Bugsnag");
} catch (DeliveryFailureException exception) {

switch (exception.reason) {

case CONNECTIVITY:
Logger.info("Could not send error(s) to Bugsnag, saving to disk to send later");
// Save error to disk for later sending
Expand Down
4 changes: 0 additions & 4 deletions sdk/src/main/java/com/bugsnag/android/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ public void setLaunchCrashThresholdMs(long launchCrashThresholdMs) {

/**
* Returns whether automatic breadcrumb capture or common application events is enabled.
*
* @return true if automatic capture is enabled, otherwise false.
*/
public boolean isAutomaticallyCollectingBreadcrumbs() {
Expand All @@ -474,7 +473,6 @@ public void setAutomaticallyCollectBreadcrumbs(boolean automaticallyCollectBread

/**
* Intended for internal use only - sets the type of the notifier (e.g. Android, React Native)
*
* @param notifierType the notifier type
*/
public void setNotifierType(String notifierType) {
Expand All @@ -483,7 +481,6 @@ public void setNotifierType(String notifierType) {

/**
* Intended for internal use only - sets the code bundle id for React Native
*
* @param codeBundleId the code bundle id
*/
public void setCodeBundleId(String codeBundleId) {
Expand Down Expand Up @@ -523,7 +520,6 @@ public void setDelivery(Delivery delivery) {
if (delivery == null) {
throw new IllegalArgumentException("Delivery cannot be null");
}

if (delivery instanceof DeliveryCompat) {
this.delivery = delivery;
} else {
Expand Down
2 changes: 0 additions & 2 deletions sdk/src/main/java/com/bugsnag/android/DefaultDelivery.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public void deliver(SessionTrackingPayload payload,
@Override
public void deliver(Report report,
Configuration config) throws DeliveryFailureException {

String endpoint = config.getEndpoint();
int status = deliver(endpoint, report, config.getErrorApiHeaders());

Expand Down Expand Up @@ -96,5 +95,4 @@ private void checkHasNetworkConnection() throws DeliveryFailureException {
throw new DeliveryFailureException(CONNECTIVITY, "No network connection available");
}
}

}
1 change: 0 additions & 1 deletion sdk/src/main/java/com/bugsnag/android/DeliveryCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@ DeliveryFailureException convertException(Exception exception) {
return null;
}
}

}

0 comments on commit 72b744c

Please sign in to comment.