Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 0 additions & 16 deletions Sources/Sentry/Public/SentryThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,12 @@ NS_ASSUME_NONNULL_BEGIN

SENTRY_NO_INIT

#if SDK_V9
/**
* Number of the thread.
*
* Can be nil for threads in recrash reports where the thread index information is not available.
*/
@property (nullable, nonatomic, copy) NSNumber *threadId;
#else
/**
* Number of the thread
*/
@property (nonatomic, copy) NSNumber *threadId;
#endif // SDK_V9

/**
* Name (if available) of the thread
Expand All @@ -59,21 +52,12 @@ SENTRY_NO_INIT
*/
@property (nullable, nonatomic, copy) NSNumber *isMain;

#if SDK_V9
/**
* Initializes a SentryThread with its id
* @param threadId NSNumber or nil if thread index is not available (e.g., recrash reports)
* @return SentryThread
*/
- (instancetype)initWithThreadId:(nullable NSNumber *)threadId;
#else
/**
* Initializes a SentryThread with its id
* @param threadId NSNumber
* @return SentryThread
*/
- (instancetype)initWithThreadId:(NSNumber *)threadId;
#endif // SDK_V9

@end

Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/SentryBreadcrumb.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ - (BOOL)isEqual:(id _Nullable)other
{
if (other == self)
return YES;
if (!other || ![[other class] isEqual:[self class]])
if (!other || ![other isKindOfClass:[SentryBreadcrumb class]])
return NO;

return [self isEqualToBreadcrumb:SENTRY_UNWRAP_NULLABLE(SentryBreadcrumb, other)];
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/SentryGeo.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ - (BOOL)isEqual:(id _Nullable)other
if (other == self) {
return YES;
}
if (!other || ![[other class] isEqual:[self class]]) {
if (!other || ![other isKindOfClass:[SentryGeo class]]) {
return NO;
}

Expand Down
4 changes: 0 additions & 4 deletions Sources/Sentry/SentryThread.mm
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@

@implementation SentryThread

#if SDK_V9
- (instancetype)initWithThreadId:(nullable NSNumber *)threadId
#else
- (instancetype)initWithThreadId:(NSNumber *)threadId
#endif // SDK_V9
{
self = [super init];
if (self) {
Expand Down
11 changes: 1 addition & 10 deletions Sources/Swift/Protocol/Codable/SentryBreadcrumbCodable.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
@_implementationOnly import _SentryPrivate
import Foundation

#if SDK_V9
final class BreadcrumbDecodable: Breadcrumb {
convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
}
#else
typealias BreadcrumbDecodable = Breadcrumb
#endif

extension BreadcrumbDecodable: Decodable {

private enum CodingKeys: String, CodingKey {
Expand All @@ -21,12 +18,6 @@ extension BreadcrumbDecodable: Decodable {
case data
case origin
}

#if !SDK_V9
required convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
#endif

private convenience init(decodedFrom decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
Expand Down
11 changes: 0 additions & 11 deletions Sources/Swift/Protocol/Codable/SentryEventCodable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,13 @@ import Foundation
* overridden. Therefore, we add the Decodable implementation not on the Event, but to a subclass of
* the event.
*/
#if !SDK_V9
@objc(SentryEventDecodable)
open class SentryEventDecodable: Event, Decodable {
required convenience public init(from decoder: any Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.init()
try writePropertiesFrom(container: container)
}
}
#else
final class SentryEventDecodable: Event, Decodable {
required convenience public init(from decoder: any Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.init()
try writePropertiesFrom(container: container)
}
}
#endif

extension SentryEventDecodable {
private enum CodingKeys: String, CodingKey {
Expand Down
11 changes: 1 addition & 10 deletions Sources/Swift/Protocol/Codable/SentryExceptionCodable.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
@_implementationOnly import _SentryPrivate
import Foundation

#if SDK_V9
final class ExceptionDecodable: Exception {
convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
}
#else
typealias ExceptionDecodable = Exception
#endif

extension ExceptionDecodable: Decodable {

private enum CodingKeys: String, CodingKey {
Expand All @@ -21,12 +18,6 @@ extension ExceptionDecodable: Decodable {
case stacktrace
}

#if !SDK_V9
required convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
#endif

private convenience init(decodedFrom decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)

Expand Down
11 changes: 1 addition & 10 deletions Sources/Swift/Protocol/Codable/SentryFrameCodable.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
@_implementationOnly import _SentryPrivate
import Foundation

#if SDK_V9
final class FrameDecodable: Frame {
convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
}
#else
typealias FrameDecodable = Frame
#endif

extension FrameDecodable: Decodable {

enum CodingKeys: String, CodingKey {
Expand All @@ -35,12 +32,6 @@ extension FrameDecodable: Decodable {
case stackStart = "stack_start"
}

#if !SDK_V9
required convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
#endif

private convenience init(decodedFrom decoder: Decoder) throws {
self.init()

Expand Down
11 changes: 1 addition & 10 deletions Sources/Swift/Protocol/Codable/SentryGeoCodable.swift
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
@_implementationOnly import _SentryPrivate
import Foundation

#if SDK_V9
final class GeoDecodable: Geo {
convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
}
#else
typealias GeoDecodable = Geo
#endif

extension GeoDecodable: Decodable {

private enum CodingKeys: String, CodingKey {
case city
case countryCode = "country_code"
case region
}

#if !SDK_V9
required convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
#endif

private convenience init(decodedFrom decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
Expand Down
11 changes: 1 addition & 10 deletions Sources/Swift/Protocol/Codable/SentryMechanismCodable.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
@_implementationOnly import _SentryPrivate
import Foundation

#if SDK_V9
final class MechanismDecodable: Mechanism {
convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
}
#else
typealias MechanismDecodable = Mechanism
#endif

extension MechanismDecodable: Decodable {

enum CodingKeys: String, CodingKey {
Expand All @@ -21,12 +18,6 @@ extension MechanismDecodable: Decodable {
case helpLink = "help_link"
case meta
}

#if !SDK_V9
required convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
#endif

private convenience init(decodedFrom decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
@_implementationOnly import _SentryPrivate
import Foundation

#if SDK_V9
final class MechanismMetaDecodable: MechanismMeta {
convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
}
#else
typealias MechanismMetaDecodable = MechanismMeta
#endif

extension MechanismMetaDecodable: Decodable {

enum CodingKeys: String, CodingKey {
case signal
case machException = "mach_exception"
case error = "ns_error"
}

#if !SDK_V9
required convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
#endif

private convenience init(decodedFrom decoder: Decoder) throws {
self.init()
Expand Down
11 changes: 1 addition & 10 deletions Sources/Swift/Protocol/Codable/SentryMessage.swift
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
@_implementationOnly import _SentryPrivate
import Foundation

#if SDK_V9
final class SentryMessageDecodable: SentryMessage {
convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
}
#else
typealias SentryMessageDecodable = SentryMessage
#endif

extension SentryMessageDecodable: Decodable {

private enum CodingKeys: String, CodingKey {
case formatted
case message
case params
}

#if !SDK_V9
required convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
#endif

private convenience init(decodedFrom decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
Expand Down
11 changes: 1 addition & 10 deletions Sources/Swift/Protocol/Codable/SentryNSErrorCodable.swift
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
@_implementationOnly import _SentryPrivate
import Foundation

#if SDK_V9
final class SentryNSErrorDecodable: SentryNSError {
convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
}
#else
typealias SentryNSErrorDecodable = SentryNSError
#endif

extension SentryNSErrorDecodable: Decodable {

enum CodingKeys: String, CodingKey {
case domain
case code
}

#if !SDK_V9
required convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
#endif

private convenience init(decodedFrom decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
Expand Down
11 changes: 1 addition & 10 deletions Sources/Swift/Protocol/Codable/SentryRequestCodable.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
@_implementationOnly import _SentryPrivate
import Foundation

#if SDK_V9
final class SentryRequestDecodable: SentryRequest {
convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
}
#else
typealias SentryRequestDecodable = SentryRequest
#endif

extension SentryRequestDecodable: Decodable {

private enum CodingKeys: String, CodingKey {
Expand All @@ -21,12 +18,6 @@ extension SentryRequestDecodable: Decodable {
case queryString = "query_string"
case url
}

#if !SDK_V9
required convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
#endif

private convenience init(decodedFrom decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
Expand Down
11 changes: 1 addition & 10 deletions Sources/Swift/Protocol/Codable/SentryStacktraceCodable.swift
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
@_implementationOnly import _SentryPrivate
import Foundation

#if SDK_V9
final class SentryStacktraceDecodable: SentryStacktrace {
convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
}
#else
typealias SentryStacktraceDecodable = SentryStacktrace
#endif

extension SentryStacktraceDecodable: Decodable {

enum CodingKeys: String, CodingKey {
case frames
case registers
case snapshot
}

#if !SDK_V9
required convenience public init(from decoder: any Decoder) throws {
try self.init(decodedFrom: decoder)
}
#endif

private convenience init(decodedFrom decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
Expand Down
Loading
Loading