Skip to content

Commit cdf1e2a

Browse files
committed
doc(JavaDoc): fixed the code snippets and formatting of the JavaDoc for Configuration & Bugsnag
1 parent 79e9bd6 commit cdf1e2a

2 files changed

Lines changed: 65 additions & 62 deletions

File tree

bugsnag-android-core/src/main/java/com/bugsnag/android/Bugsnag.java

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
* Static access to a Bugsnag Client, the easiest way to use Bugsnag in your Android app.
1515
* For example:
1616
* <p>
17+
* <pre>{@code
1718
* Bugsnag.start(this, "your-api-key");
1819
* Bugsnag.notify(new RuntimeException("something broke!"));
20+
* }</pre>
1921
*
2022
* @see Client
2123
*/
@@ -72,7 +74,7 @@ public static Client start(@NonNull Context androidContext, @NonNull Configurati
7274
/**
7375
* Returns true if one of the <code>start</code> methods have been has been called and
7476
* so Bugsnag is initialized; false if <code>start</code> has not been called and the
75-
* other methods will throw IllegalStateException.
77+
* other methods will throw {@code IllegalStateException}.
7678
*/
7779
public static boolean isStarted() {
7880
return client != null;
@@ -149,12 +151,12 @@ public static User getUser() {
149151
* <p>
150152
* For example:
151153
* <p>
152-
* Bugsnag.addOnError(new OnErrorCallback() {
153-
* public boolean run(Event event) {
154-
* event.setSeverity(Severity.INFO);
155-
* return true;
156-
* }
157-
* })
154+
* <pre>{@code
155+
* Bugsnag.addOnError((Event event) -> {
156+
* event.setSeverity(Severity.INFO);
157+
* return true;
158+
* });
159+
* }</pre>
158160
*
159161
* @param onError a callback to run before sending errors to Bugsnag
160162
* @see OnErrorCallback
@@ -181,11 +183,11 @@ public static void removeOnError(@NonNull OnErrorCallback onError) {
181183
* <p>
182184
* For example:
183185
* <p>
184-
* Bugsnag.onBreadcrumb(new OnBreadcrumbCallback() {
185-
* public boolean run(Breadcrumb breadcrumb) {
186-
* return false; // ignore the breadcrumb
187-
* }
188-
* })
186+
* <pre>{@code
187+
* Bugsnag.onBreadcrumb((Breadcrumb breadcrumb) -> {
188+
* return false; // ignore the breadcrumb
189+
* });
190+
* }</pre>
189191
*
190192
* @param onBreadcrumb a callback to run before a breadcrumb is captured
191193
* @see OnBreadcrumbCallback
@@ -212,11 +214,11 @@ public static void removeOnBreadcrumb(@NonNull OnBreadcrumbCallback onBreadcrumb
212214
* <p>
213215
* For example:
214216
* <p>
215-
* Bugsnag.onSession(new OnSessionCallback() {
216-
* public boolean run(Session session) {
217-
* return false; // ignore the session
218-
* }
219-
* })
217+
* <pre>{@code
218+
* Bugsnag.onSession((Session session) -> {
219+
* return false; // ignore the session
220+
* });
221+
* }</pre>
220222
*
221223
* @param onSession a callback to run before a session is captured
222224
* @see OnSessionCallback

bugsnag-android-core/src/main/java/com/bugsnag/android/Configuration.java

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void setVersionCode(@Nullable Integer versionCode) {
102102

103103
/**
104104
* If you would like to distinguish between errors that happen in different stages of the
105-
* application release process (development, production, etc) you can set the releaseStage
105+
* application release process (development, production, etc.) you can set the releaseStage
106106
* that is reported to Bugsnag.
107107
* <p>
108108
* If you are running a debug build, we'll automatically set this to "development",
@@ -116,7 +116,7 @@ public String getReleaseStage() {
116116

117117
/**
118118
* If you would like to distinguish between errors that happen in different stages of the
119-
* application release process (development, production, etc) you can set the releaseStage
119+
* application release process (development, production, etc.) you can set the releaseStage
120120
* that is reported to Bugsnag.
121121
* <p>
122122
* If you are running a debug build, we'll automatically set this to "development",
@@ -168,7 +168,7 @@ public boolean getPersistUser() {
168168
}
169169

170170
/**
171-
* Set whether or not Bugsnag should persist user information between application sessions.
171+
* Set whether Bugsnag should persist user information between application sessions.
172172
* <p>
173173
* If enabled then any user information set will be re-used until the user information is
174174
* removed manually by calling {@link Bugsnag#setUser(String, String, String)}
@@ -179,7 +179,7 @@ public void setPersistUser(boolean persistUser) {
179179
}
180180

181181
/**
182-
* Set whether or not Bugsnag should generate an anonymous ID and persist it in local storage
182+
* Set whether Bugsnag should generate an anonymous ID and persist it in local storage
183183
* <p>
184184
* If disabled, any device ID that has been persisted will not be retrieved, and no new
185185
* device ID will be generated or stored
@@ -189,7 +189,7 @@ public boolean getGenerateAnonymousId() {
189189
}
190190

191191
/**
192-
* Set whether or not Bugsnag should generate an anonymous ID and persist it in local storage
192+
* Set whether Bugsnag should generate an anonymous ID and persist it in local storage
193193
* <p>
194194
* If disabled, any device ID that has been persisted will not be retrieved, and no new
195195
* device ID will be generated or stored
@@ -226,7 +226,7 @@ public File getPersistenceDirectory() {
226226
* The persistenceDirectory also stores user information if {@link #getPersistUser()} has been
227227
* set to true.
228228
* <p/>
229-
* By default, bugsnag sets the persistenceDirectory to {@link Context#getCacheDir()}.
229+
* By default, Bugsnag sets the persistenceDirectory to {@link Context#getCacheDir()}.
230230
* <p/>
231231
* If the persistenceDirectory is changed between application launches, no attempt will be made
232232
* to deliver events or sessions cached in the previous location.
@@ -236,7 +236,7 @@ public void setPersistenceDirectory(@Nullable File directory) {
236236
}
237237

238238
/**
239-
* Sets whether or not Bugsnag should send crashes synchronously that occurred during
239+
* Sets whether Bugsnag should send crashes synchronously that occurred during
240240
* the application's launch period. By default this behavior is enabled.
241241
* <p>
242242
* See {@link #setLaunchDurationMillis(long)}
@@ -246,10 +246,10 @@ public boolean getSendLaunchCrashesSynchronously() {
246246
}
247247

248248
/**
249-
* Sets whether or not Bugsnag should send crashes synchronously that occurred during
249+
* Sets whether Bugsnag should send crashes synchronously that occurred during
250250
* the application's launch period. By default this behavior is enabled.
251251
* <p>
252-
* See {@link #setLaunchDurationMillis(long)}
252+
* @see #setLaunchDurationMillis(long)
253253
*/
254254
public void setSendLaunchCrashesSynchronously(boolean sendLaunchCrashesSynchronously) {
255255
impl.setSendLaunchCrashesSynchronously(sendLaunchCrashesSynchronously);
@@ -261,7 +261,7 @@ public void setSendLaunchCrashesSynchronously(boolean sendLaunchCrashesSynchrono
261261
* event synchronously.
262262
* <p>
263263
* By default, this value is set at 5,000ms. Setting the value to 0 will count all crashes
264-
* as launch crashes until markLaunchCompleted() is called.
264+
* as launch crashes until {@link Bugsnag#markLaunchCompleted()} is called.
265265
*/
266266
public long getLaunchDurationMillis() {
267267
return impl.getLaunchDurationMillis();
@@ -286,7 +286,7 @@ public void setLaunchDurationMillis(@IntRange(from = 0) long launchDurationMilli
286286
}
287287

288288
/**
289-
* Sets whether or not Bugsnag should automatically capture and report User sessions whenever
289+
* Sets whether Bugsnag should automatically capture and report User sessions whenever
290290
* the app enters the foreground.
291291
* <p>
292292
* By default this behavior is enabled.
@@ -296,7 +296,7 @@ public boolean getAutoTrackSessions() {
296296
}
297297

298298
/**
299-
* Sets whether or not Bugsnag should automatically capture and report User sessions whenever
299+
* Sets whether Bugsnag should automatically capture and report User sessions whenever
300300
* the app enters the foreground.
301301
* <p>
302302
* By default this behavior is enabled.
@@ -416,10 +416,10 @@ public void setLogger(@Nullable Logger logger) {
416416
* You can use the return type from the deliver functions to control the strategy for
417417
* retrying the transmission at a later date.
418418
* <p>
419-
* If DeliveryStatus.UNDELIVERED is returned, the notifier will automatically cache
420-
* the payload and trigger delivery later on. Otherwise, if either DeliveryStatus.DELIVERED
421-
* or DeliveryStatus.FAILURE is returned the notifier will removed any cached payload
422-
* and no further delivery will be attempted.
419+
* If {@link DeliveryStatus#UNDELIVERED} is returned, the notifier will automatically cache
420+
* the payload and trigger delivery later on. Otherwise, if either
421+
* {@link DeliveryStatus#DELIVERED} or {@link DeliveryStatus#FAILURE} is returned the notifier
422+
* will remove any cached payload and no further delivery will be attempted.
423423
*/
424424
@NonNull
425425
public Delivery getDelivery() {
@@ -734,14 +734,15 @@ public void setEnabledReleaseStages(@Nullable Set<String> enabledReleaseStages)
734734
* empty set.
735735
* <p>
736736
* The following breadcrumb types can be enabled:
737-
* <p>
738-
* - Captured errors: left when an error event is sent to the Bugsnag API.
739-
* - Manual breadcrumbs: left via the Bugsnag.leaveBreadcrumb function.
740-
* - Navigation changes: left for Activity Lifecycle events to track the user's journey in
741-
* the app.
742-
* - State changes: state breadcrumbs are left for system broadcast events. For example:
743-
* battery warnings, airplane mode, etc.
744-
* - User interaction: left when the user performs certain system operations.
737+
* <ul>
738+
* <li>Captured errors: left when an error event is sent to the Bugsnag API.</li>
739+
* <li>Manual breadcrumbs: left via the Bugsnag.leaveBreadcrumb function.</li>
740+
* <li>Navigation changes: left for Activity Lifecycle events to track the user's journey in
741+
* the app.</li>
742+
* <li>State changes: state breadcrumbs are left for system broadcast events. For example:
743+
* battery warnings, airplane mode, etc.</li>
744+
* <li>User interaction: left when the user performs certain system operations.</li>
745+
* </ul>
745746
*/
746747
@Nullable
747748
public Set<BreadcrumbType> getEnabledBreadcrumbTypes() {
@@ -755,14 +756,15 @@ public Set<BreadcrumbType> getEnabledBreadcrumbTypes() {
755756
* empty set.
756757
* <p>
757758
* The following breadcrumb types can be enabled:
758-
* <p>
759-
* - Captured errors: left when an error event is sent to the Bugsnag API.
760-
* - Manual breadcrumbs: left via the Bugsnag.leaveBreadcrumb function.
761-
* - Navigation changes: left for Activity Lifecycle events to track the user's journey in
762-
* the app.
763-
* - State changes: state breadcrumbs are left for system broadcast events. For example:
764-
* battery warnings, airplane mode, etc.
765-
* - User interaction: left when the user performs certain system operations.
759+
* <ul>
760+
* <li>Captured errors: left when an error event is sent to the Bugsnag API.</li>
761+
* <li>Manual breadcrumbs: left via the Bugsnag.leaveBreadcrumb function.</li>
762+
* <li>Navigation changes: left for Activity Lifecycle events to track the user's journey in
763+
* the app.</li>
764+
* <li>State changes: state breadcrumbs are left for system broadcast events. For example:
765+
* battery warnings, airplane mode, etc.</li>
766+
* <li>User interaction: left when the user performs certain system operations.</li>
767+
* </ul>
766768
*/
767769
public void setEnabledBreadcrumbTypes(@Nullable Set<BreadcrumbType> enabledBreadcrumbTypes) {
768770
impl.setEnabledBreadcrumbTypes(enabledBreadcrumbTypes);
@@ -778,7 +780,10 @@ public Set<Telemetry> getTelemetry() {
778780
* <p>
779781
* The following telemetry can be enabled:
780782
* <p>
781-
* - internal errors: Errors in the Bugsnag SDK itself.
783+
* <ul>
784+
* <li>internal errors: Errors in the Bugsnag SDK itself</li>
785+
* <li>usage: Differences from the default configuration</li>
786+
* </ul>
782787
*/
783788
public void setTelemetry(@NonNull Set<Telemetry> telemetry) {
784789
if (telemetry != null) {
@@ -794,7 +799,7 @@ public void setTelemetry(@NonNull Set<Telemetry> telemetry) {
794799
* originate from any of these packages and this allows us to improve
795800
* the visual display of the stacktrace on the dashboard.
796801
* <p>
797-
* By default, projectPackages is set to be the package you called Bugsnag.start from.
802+
* By default, projectPackages is set to be the package you called {@link Bugsnag#start} from.
798803
*/
799804
@NonNull
800805
public Set<String> getProjectPackages() {
@@ -807,7 +812,7 @@ public Set<String> getProjectPackages() {
807812
* originate from any of these packages and this allows us to improve
808813
* the visual display of the stacktrace on the dashboard.
809814
* <p>
810-
* By default, projectPackages is set to be the package you called Bugsnag.start from.
815+
* By default, projectPackages is set to be the package you called {@link Bugsnag#start} from.
811816
*/
812817
public void setProjectPackages(@NonNull Set<String> projectPackages) {
813818
if (CollectionUtils.containsNullElements(projectPackages)) {
@@ -818,7 +823,7 @@ public void setProjectPackages(@NonNull Set<String> projectPackages) {
818823
}
819824

820825
/**
821-
* Add a "on error" callback, to execute code at the point where an error report is
826+
* Add an "on error" callback, to execute code at the point where an error report is
822827
* captured in Bugsnag.
823828
* <p>
824829
* You can use this to add or modify information attached to an Event
@@ -829,11 +834,9 @@ public void setProjectPackages(@NonNull Set<String> projectPackages) {
829834
* <p>
830835
* For example:
831836
* <pre>{@code
832-
* Bugsnag.addOnError(new OnErrorCallback() {
833-
* public boolean onError(Event event) {
834-
* event.setSeverity(Severity.INFO);
835-
* return true;
836-
* }
837+
* Bugsnag.addOnError((event) -> {
838+
* event.setSeverity(Severity.INFO);
839+
* return true;
837840
* });
838841
* }</pre>
839842
*
@@ -872,10 +875,8 @@ public void removeOnError(@NonNull OnErrorCallback onError) {
872875
* <p>
873876
* For example:
874877
* <pre>{@code
875-
* Bugsnag.onBreadcrumb(new OnBreadcrumbCallback() {
876-
* public boolean run(Breadcrumb breadcrumb) {
877-
* return false; // ignore the breadcrumb
878-
* }
878+
* Bugsnag.addOnBreadcrumb((breadcrumb) -> {
879+
* return false; // ignore the breadcrumb
879880
* });
880881
* }</pre>
881882
*

0 commit comments

Comments
 (0)