File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
src/main/kotlin/spp/protocol Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ interface LiveLocation {
2626 val service: Service ?
2727 val probeId: String?
2828
29- fun isSameLocation (other : LiveLocation ): Boolean
29+ fun isSameLocation (location : LiveLocation ): Boolean
3030 fun toJson (): JsonObject
3131
3232 companion object {
Original file line number Diff line number Diff line change @@ -55,12 +55,12 @@ data class LiveSourceLocation @JvmOverloads constructor(
5555 scope = json.getString(" scope" )?.let { LocationScope .valueOf(it) } ? : LocationScope .LINE
5656 )
5757
58- override fun isSameLocation (other : LiveLocation ): Boolean {
59- if (other !is LiveSourceLocation ) return false
60- if (source != other .source) return false
61- if (line != other .line && line != - 1 && other .line != - 1 ) return false // -1 is wildcard
62- if (service != null && (other .service == null || ! service.isSameLocation(other .service!! ))) return false
63- if (probeId != null && probeId != other .probeId) return false
58+ override fun isSameLocation (location : LiveLocation ): Boolean {
59+ if (location !is LiveSourceLocation ) return false
60+ if (source != location .source) return false
61+ if (line != location .line && line != - 1 && location .line != - 1 ) return false // -1 is wildcard
62+ if (service != null && (location .service == null || ! service.isSameLocation(location .service!! ))) return false
63+ if (probeId != null && probeId != location .probeId) return false
6464 return true
6565 }
6666
Original file line number Diff line number Diff line change @@ -89,8 +89,8 @@ data class Service(
8989 /* *
9090 * Ensures all non-null fields are equal.
9191 */
92- override fun isSameLocation (other : LiveLocation ): Boolean {
93- if ( other !is Service ) return false // todo: support other types
92+ override fun isSameLocation (location : LiveLocation ): Boolean {
93+ val other = location.service ? : return false
9494 if (name != other.name) return false
9595 if (group != null && group != other.group) return false
9696 if (shortName != null && shortName != other.shortName) return false
You can’t perform that action at this time.
0 commit comments