Skip to content

Commit e50d17b

Browse files
committed
Delay checking null values of language and endpoint attributes until building. This allows that if null values are set in the builder the default ones wil l be used
1 parent 3673d30 commit e50d17b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

rollbar-java/src/main/java/com/rollbar/notifier/config/ConfigBuilder.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,8 @@ public class ConfigBuilder {
7575
private ConfigBuilder(String accessToken) {
7676
// Defaults
7777
this.accessToken = accessToken;
78-
this.language = "java";
7978
this.handleUncaughtErrors = true;
8079
this.enabled = true;
81-
this.endpoint = "https://api.rollbar.com/api/1/item/";
82-
8380
}
8481

8582
/**
@@ -375,6 +372,12 @@ public ConfigBuilder enabled(boolean enabled) {
375372
* @return the config.
376373
*/
377374
public Config build() {
375+
if (this.language == null) {
376+
this.language = "java";
377+
}
378+
if (this.endpoint == null) {
379+
this.endpoint = SyncSender.DEFAULT_API_ENDPOINT;
380+
}
378381
if (this.notifier == null) {
379382
this.notifier = new NotifierProvider();
380383
}

0 commit comments

Comments
 (0)