Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address existing UnknownNullness lint violations #395

Merged
merged 17 commits into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
053ca17
build: regenerate lint baseline file to account for changed lines + b…
fractalwrench Dec 11, 2018
2ff6ca5
feat: add nullability annotations to public Client methods
fractalwrench Dec 11, 2018
8f22662
feat: add nullability annotations to public Bugsnag.java methods
fractalwrench Dec 11, 2018
8472047
feat: add nullability annotations for Client
fractalwrench Dec 11, 2018
d1fefcd
feat: add nullability annotations to NativeInterface class
fractalwrench Dec 12, 2018
181e809
feat: add nullability annotations to remaining public sites
fractalwrench Dec 12, 2018
ebab41a
feat: update mazerunner delivery signatures to use non-null parameters
fractalwrench Dec 13, 2018
a633394
Merge pull request #396 from bugsnag/null-annotations-client
fractalwrench Dec 13, 2018
cfa6c7a
Merge pull request #397 from bugsnag/null-annotations-bugsnag
fractalwrench Dec 13, 2018
221b04e
Merge pull request #399 from bugsnag/null-annotations-native-interface
fractalwrench Dec 13, 2018
78e3df2
Merge pull request #398 from bugsnag/null-annotations-config
fractalwrench Dec 13, 2018
24e414e
Merge branch 'resolve-unknown-nullness-issues' into null-annotations-…
fractalwrench Dec 13, 2018
4e272eb
Merge pull request #400 from bugsnag/null-annotations-remaining
fractalwrench Dec 13, 2018
99fd5ca
Merge branch 'next' into resolve-unknown-nullness-issues
fractalwrench Dec 13, 2018
18c5b5a
feat: add nullability annotations to missed getters
fractalwrench Dec 13, 2018
55f1577
feat: final adjustments of nullability annotations on second sweep
fractalwrench Dec 14, 2018
194f576
docs: add changelog entry
fractalwrench Dec 17, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## 4.X.X (TBD)

* Added additional nullability annotations to public API
[#395](https://github.com/bugsnag/bugsnag-android/pull/395)

### Bug fixes

* Add binary architecture of application to payload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ internal fun createSlowDelivery(context: Context): Delivery {
val delivery = DefaultDelivery(cm)

return object : Delivery {
override fun deliver(payload: SessionTrackingPayload?, config: Configuration?) {
override fun deliver(payload: SessionTrackingPayload, config: Configuration) {
Thread.sleep(500)
delivery.deliver(payload, config)
}

override fun deliver(report: Report?, config: Configuration?) {
override fun deliver(report: Report, config: Configuration) {
Thread.sleep(500)
delivery.deliver(report, config)
}
Expand All @@ -47,18 +47,18 @@ internal fun createCustomHeaderDelivery(context: Context): Delivery {
return object : Delivery {
val delivery: DefaultDelivery = createDefaultDelivery(context)

override fun deliver(payload: SessionTrackingPayload?, config: Configuration?) {
deliver(config?.sessionEndpoint, payload, config?.sessionApiHeaders)
override fun deliver(payload: SessionTrackingPayload, config: Configuration) {
deliver(config.sessionEndpoint, payload, config.sessionApiHeaders)
}

override fun deliver(report: Report?, config: Configuration?) {
deliver(config?.endpoint, report, config?.errorApiHeaders)
override fun deliver(report: Report, config: Configuration) {
deliver(config.endpoint, report, config.errorApiHeaders)
}

fun deliver(endpoint: String?,
streamable: JsonStream.Streamable?,
headers: MutableMap<String, String>?) {
headers!!["Custom-Client"] = "Hello World"
fun deliver(endpoint: String,
streamable: JsonStream.Streamable,
headers: MutableMap<String, String>) {
headers["Custom-Client"] = "Hello World"
delivery.deliver(endpoint, streamable, headers)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ abstract internal class Scenario(protected val config: Configuration,
protected fun disableSessionDelivery() {
val baseDelivery = Bugsnag.getClient().config.delivery
Bugsnag.getClient().config.delivery = object: Delivery {
override fun deliver(payload: SessionTrackingPayload?, config: Configuration?) {
override fun deliver(payload: SessionTrackingPayload, config: Configuration) {
throw DeliveryFailureException("Session Delivery NOP", RuntimeException("NOP"))
}

override fun deliver(report: Report?, config: Configuration?) {
override fun deliver(report: Report, config: Configuration) {
baseDelivery.deliver(report, config)
}
}
Expand All @@ -34,11 +34,11 @@ abstract internal class Scenario(protected val config: Configuration,
protected fun disableReportDelivery() {
val baseDelivery = Bugsnag.getClient().config.delivery
Bugsnag.getClient().config.delivery = object: Delivery {
override fun deliver(payload: SessionTrackingPayload?, config: Configuration?) {
override fun deliver(payload: SessionTrackingPayload, config: Configuration) {
baseDelivery.deliver(payload, config)
}

override fun deliver(report: Report?, config: Configuration?) {
override fun deliver(report: Report, config: Configuration) {
throw DeliveryFailureException("Session Delivery NOP", RuntimeException("NOP"))
}
}
Expand All @@ -57,11 +57,11 @@ abstract internal class Scenario(protected val config: Configuration,

protected fun disableAllDelivery(config: Configuration) {
config.delivery = object: Delivery {
override fun deliver(payload: SessionTrackingPayload?, config: Configuration?) {
override fun deliver(payload: SessionTrackingPayload, config: Configuration) {
throw DeliveryFailureException("Error Delivery NOP", RuntimeException("NOP"))
}

override fun deliver(report: Report?, config: Configuration?) {
override fun deliver(report: Report, config: Configuration) {
throw DeliveryFailureException("Session Delivery NOP", RuntimeException("NOP"))
}
}
Expand Down
Loading