-
Notifications
You must be signed in to change notification settings - Fork 828
Conversation
Hi @sriramr98! It looks like one or more of your builds have failed.
|
@iamareebjamal is JCenter down again? |
@@ -85,15 +85,15 @@ object Utils { | |||
if (isBaseUrlEmpty) { | |||
swipeRefreshLayout.isEnabled = false | |||
} else { | |||
StrategyRegistry.instance.eventBusStrategy!!.eventBus.register(`object`) | |||
StrategyRegistry.instance.eventBusStrategy?.getEventBus()?.register(`object`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not ?.eventBus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I could not set a default getter implementation because the getter referenced the eventBus and that turned into infinite recursion. So I had to create an explicit getEventBus method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would it recur? That doesn't make sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, accessing the property from inside the getter calls the getter again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you accessing it inside getter, of course it will recur that way
It's like saying
int getAge() {
return getAge();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, android studio showed the error. But I found a solution using the 'field' naming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Becuase we need to do this
if (field == null) {
field = Bus()
}
return field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use lazy delegator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need the lazy approach here. We can just use the field attribute.
|
||
StrategyRegistry.instance | ||
.eventBusStrategy!! | ||
.postEventOnUIThread(BookmarkChangedEvent()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SYIF
First steps for issues #2357
Changes: Converted classes to Kotlin.