diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml new file mode 100644 index 00000000000..4c6c25387b2 --- /dev/null +++ b/.github/workflows/swift.yml @@ -0,0 +1,42 @@ +name: Swift lint and format + +on: + workflow_dispatch: + push: + branches: ["main"] + paths: + - "swift/**" + pull_request: + # The branches below must be a subset of the branches above + branches: ["main"] + paths: + - "swift/**" + +jobs: + swift-lint: + name: Swift Lint + runs-on: macos-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install SwiftLints + run: brew install swiftformat + + - name: SwiftLint + working-directory: swift + run: swiftlint --config .swiftlint.yml --strict + + swift-format: + name: Swift Format + runs-on: macos-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install SwiftFormat + run: brew install swiftformat + + - name: SwiftFormat + working-directory: swift + run: swiftformat --lint --verbose **/*.swift diff --git a/swift/src/Ice/AdminFacetFactory.swift b/swift/src/Ice/AdminFacetFactory.swift index 982f88b15c4..9788da0a05c 100644 --- a/swift/src/Ice/AdminFacetFactory.swift +++ b/swift/src/Ice/AdminFacetFactory.swift @@ -107,7 +107,7 @@ class AdminFacetFactory: ICEAdminFacetFactory { return AdminFacetFacade(communicator: c, disp: ProcessDisp(handle.getSwiftObject(ProcessI.self) { ProcessI(handle: handle) - })) + })) } static func createProperties(_ communicator: ICECommunicator, handle: ICEPropertiesAdmin) -> ICEBlobjectFacade { @@ -116,7 +116,7 @@ class AdminFacetFactory: ICEAdminFacetFactory { return AdminFacetFacade(communicator: c, disp: PropertiesAdminDisp(handle.getSwiftObject(PropertiesAdminI.self) { PropertiesAdminI(communicator: c, handle: handle) - })) + })) } static func createUnsupported(_ communicator: ICECommunicator, @@ -125,6 +125,6 @@ class AdminFacetFactory: ICEAdminFacetFactory { return AdminFacetFacade(communicator: c, disp: ObjectDisp(handle.getSwiftObject(UnsupportedAdminFacet.self) { UnsupportedAdminFacet(handle: handle) - })) + })) } } diff --git a/swift/src/Ice/BlobjectAsync.swift b/swift/src/Ice/BlobjectAsync.swift index dea2a6bdeab..5153930f2d1 100644 --- a/swift/src/Ice/BlobjectAsync.swift +++ b/swift/src/Ice/BlobjectAsync.swift @@ -32,6 +32,7 @@ public struct BlobjectAsyncDisp: Disp { public init(_ servant: BlobjectAsync) { self.servant = servant } + public func dispatch(request: Request, current: Current) throws -> Promise? { let inEncaps = try request.readParamEncaps() return servant.ice_invokeAsync(inEncaps: inEncaps, current: current).map(on: nil) { invokeResult in diff --git a/swift/src/Ice/Communicator.swift b/swift/src/Ice/Communicator.swift index f1df58e9263..83e954c8271 100644 --- a/swift/src/Ice/Communicator.swift +++ b/swift/src/Ice/Communicator.swift @@ -20,14 +20,15 @@ import PromiseKit /// the string is the same for all modes: you don't need to specify an encoding format or mode when reading such a /// string. public enum ToStringMode: Swift.UInt8 { - /// Unicode Characters with ordinal values greater than 127 are kept as-is in the resulting string. Non-printable ASCII - /// characters with ordinal values 127 and below are encoded as \\t, \\n (etc.) or \\unnnn. + /// Unicode Characters with ordinal values greater than 127 are kept as-is in the resulting string. Non-printable + /// ASCII characters with ordinal values 127 and below are encoded as \\t, \\n (etc.) or \\unnnn. case Unicode = 0 /// ASCII Characters with ordinal values greater than 127 are encoded as universal character names in the resulting /// string: \\unnnn for BMP characters and \\Unnnnnnnn for non-BMP characters. Non-printable ASCII characters /// with ordinal values 127 and below are encoded as \\t, \\n (etc.) or \\unnnn. case ASCII = 1 - /// Compat Characters with ordinal values greater than 127 are encoded as a sequence of UTF-8 bytes using octal escapes. + /// Compat Characters with ordinal values greater than 127 are encoded as a sequence of UTF-8 bytes using octal + /// escapes. /// Characters with ordinal values 127 and below are encoded as \\t, \\n (etc.) or an octal escape. Use this mode /// to generate strings compatible with Ice 3.6 and earlier. case Compat = 2 @@ -86,7 +87,7 @@ public extension OutputStream { /// The central object in Ice. One or more communicators can be instantiated for an Ice application. Communicator /// instantiation is language-specific, and not specified in Slice code. -public protocol Communicator: Swift.AnyObject { +public protocol Communicator: Swift.AnyObject { /// Destroy the communicator. This operation calls shutdown implicitly. Calling destroy cleans up /// memory, and shuts down this communicator's client functionality and destroys all object adapters. Subsequent /// calls to destroy are ignored. @@ -195,7 +196,8 @@ public protocol Communicator: Swift.AnyObject { /// Get the implicit context associated with this communicator. /// - /// - returns: `ImplicitContext` - The implicit context associated with this communicator; returns null when the property Ice.ImplicitContext + /// - returns: `ImplicitContext` - The implicit context associated with this communicator; returns null when the + /// property Ice.ImplicitContext /// is not set or is set to None. func getImplicitContext() -> ImplicitContext @@ -245,16 +247,16 @@ public protocol Communicator: Swift.AnyObject { /// for all connections associated with the communicator. Any errors that occur while flushing a connection are /// ignored. /// - /// - parameter _: `CompressBatch` Specifies whether or not the queued batch requests should be compressed before being sent over - /// the wire. + /// - parameter _: `CompressBatch` Specifies whether or not the queued batch requests should be compressed before + /// being sent over the wire. func flushBatchRequests(_ compress: CompressBatch) throws /// Flush any pending batch requests for this communicator. This means all batch requests invoked on fixed proxies /// for all connections associated with the communicator. Any errors that occur while flushing a connection are /// ignored. /// - /// - parameter _: `CompressBatch` Specifies whether or not the queued batch requests should be compressed before being sent over - /// the wire. + /// - parameter _: `CompressBatch` Specifies whether or not the queued batch requests should be compressed before + /// being sent over the wire. /// /// - parameter sentOn: `Dispatch.DispatchQueue?` - Optional dispatch queue used to /// dispatch the sent callback. @@ -265,15 +267,18 @@ public protocol Communicator: Swift.AnyObject { /// - parameter sent: `((Swift.Bool) -> Swift.Void)` - Optional sent callback. /// /// - returns: `PromiseKit.Promise<>` - The result of the operation - func flushBatchRequestsAsync(_ compress: CompressBatch, sentOn: Dispatch.DispatchQueue?, sentFlags: Dispatch.DispatchWorkItemFlags?, sent: ((Swift.Bool) -> Swift.Void)?) -> PromiseKit.Promise + func flushBatchRequestsAsync(_ compress: CompressBatch, + sentOn: Dispatch.DispatchQueue?, + sentFlags: Dispatch.DispatchWorkItemFlags?, + sent: ((Swift.Bool) -> Swift.Void)?) -> PromiseKit.Promise /// Add the Admin object with all its facets to the provided object adapter. If Ice.Admin.ServerId is /// set and the provided object adapter has a Locator, createAdmin registers the Admin's Process facet with /// the Locator's LocatorRegistry. createAdmin must only be called once; subsequent calls raise /// InitializationException. /// - /// - parameter adminAdapter: `ObjectAdapter?` The object adapter used to host the Admin object; if null and Ice.Admin.Endpoints is set, - /// create, activate and use the Ice.Admin object adapter. + /// - parameter adminAdapter: `ObjectAdapter?` The object adapter used to host the Admin object; if null and + /// Ice.Admin.Endpoints is set, create, activate and use the Ice.Admin object adapter. /// /// - parameter adminId: `Identity` The identity of the Admin object. /// @@ -286,7 +291,8 @@ public protocol Communicator: Swift.AnyObject { /// Ice.Admin.InstanceName is not set. If Ice.Admin.DelayCreation is 0 or not set, getAdmin is called /// by the communicator initialization, after initialization of all plugins. /// - /// - returns: `ObjectPrx?` - A proxy to the main ("") facet of the Admin object, or a null proxy if no Admin object is configured. + /// - returns: `ObjectPrx?` - A proxy to the main ("") facet of the Admin object, or a null proxy if no Admin + /// object is configured. func getAdmin() throws -> ObjectPrx? /// Add a new facet to the Admin object. Adding a servant with a facet that is already registered throws @@ -310,7 +316,8 @@ public protocol Communicator: Swift.AnyObject { /// /// - parameter _: `Swift.String` The name of the Admin facet. /// - /// - returns: `Disp?` - The servant associated with this Admin facet, or null if no facet is registered with the given name. + /// - returns: `Disp?` - The servant associated with this Admin facet, or null if no facet is registered with the + /// given name. func findAdminFacet(_ facet: Swift.String) -> Disp? /// Returns a map of all facets of the Admin object. diff --git a/swift/src/Ice/CommunicatorI.swift b/swift/src/Ice/CommunicatorI.swift index 0f930e325e3..318314481ae 100644 --- a/swift/src/Ice/CommunicatorI.swift +++ b/swift/src/Ice/CommunicatorI.swift @@ -269,7 +269,7 @@ public extension Communicator { if let sentCB = sentCB { sentCB($0) } - }) + }) } } diff --git a/swift/src/Ice/Connection.swift b/swift/src/Ice/Connection.swift index 2a53b4926d2..b7f23f1f4c3 100644 --- a/swift/src/Ice/Connection.swift +++ b/swift/src/Ice/Connection.swift @@ -83,13 +83,13 @@ public enum ACMClose: Swift.UInt8 { case CloseOff = 0 /// CloseOnIdle Gracefully closes a connection that has been idle for the configured timeout period. case CloseOnIdle = 1 - /// CloseOnInvocation Forcefully closes a connection that has been idle for the configured timeout period, but only if the connection - /// has pending invocations. + /// CloseOnInvocation Forcefully closes a connection that has been idle for the configured timeout period, but + /// only if the connection has pending invocations. case CloseOnInvocation = 2 /// CloseOnInvocationAndIdle Combines the behaviors of CloseOnIdle and CloseOnInvocation. case CloseOnInvocationAndIdle = 3 - /// CloseOnIdleForceful Forcefully closes a connection that has been idle for the configured timeout period, regardless of whether the - /// connection has pending invocations or dispatch. + /// CloseOnIdleForceful Forcefully closes a connection that has been idle for the configured timeout period, + /// regardless of whether the connection has pending invocations or dispatch. case CloseOnIdleForceful = 4 public init() { self = .CloseOff @@ -148,7 +148,8 @@ public extension OutputStream { public enum ACMHeartbeat: Swift.UInt8 { /// HeartbeatOff Disables heartbeats. case HeartbeatOff = 0 - /// HeartbeatOnDispatch Send a heartbeat at regular intervals if the connection is idle and only if there are pending dispatch. + /// HeartbeatOnDispatch Send a heartbeat at regular intervals if the connection is idle and only if there are + /// pending dispatch. case HeartbeatOnDispatch = 1 /// HeartbeatOnIdle Send a heartbeat at regular intervals when the connection is idle. case HeartbeatOnIdle = 2 @@ -227,11 +228,11 @@ public struct ACM: Swift.Hashable { /// Determines the behavior when manually closing a connection. public enum ConnectionClose: Swift.UInt8 { - /// Forcefully Close the connection immediately without sending a close connection protocol message to the peer and waiting - /// for the peer to acknowledge it. + /// Forcefully Close the connection immediately without sending a close connection protocol message to the peer + /// and waiting for the peer to acknowledge it. case Forcefully = 0 - /// Gracefully Close the connection by notifying the peer but do not wait for pending outgoing invocations to complete. On the - /// server side, the connection will not be closed until all incoming invocations have completed. + /// Gracefully Close the connection by notifying the peer but do not wait for pending outgoing invocations to + /// complete. On the server side, the connection will not be closed until all incoming invocations have completed. case Gracefully = 1 /// GracefullyWithWait Wait for all pending invocations to complete before closing the connection. case GracefullyWithWait = 2 @@ -292,7 +293,7 @@ public extension OutputStream { public typealias HeaderDict = [Swift.String: Swift.String] /// Base class providing access to the connection details. -public protocol ConnectionInfo: Swift.AnyObject { +public protocol ConnectionInfo: Swift.AnyObject { /// The information of the underyling transport or null if there's no underlying transport. var underlying: ConnectionInfo? { get set } /// Whether or not the connection is an incoming or outgoing connection. @@ -320,7 +321,7 @@ public typealias CloseCallback = (Connection?) -> Swift.Void public typealias HeartbeatCallback = (Connection?) -> Swift.Void /// The user-level interface to a connection. -public protocol Connection: Swift.AnyObject, Swift.CustomStringConvertible { +public protocol Connection: Swift.AnyObject, Swift.CustomStringConvertible { /// Manually close the connection using the specified closure mode. /// /// - parameter _: `ConnectionClose` Determines how the connection will be closed. @@ -340,14 +341,15 @@ public protocol Connection: Swift.AnyObject, Swift.CustomStringConvertible { /// is used by the proxy in order to receive callbacks. This is useful if the server cannot establish a connection /// back to the client, for example because of firewalls. /// - /// - parameter _: `ObjectAdapter?` The object adapter that should be used by this connection to dispatch requests. The object - /// adapter must be activated. When the object adapter is deactivated, it is automatically removed from the - /// connection. Attempts to use a deactivated object adapter raise ObjectAdapterDeactivatedException + /// - parameter _: `ObjectAdapter?` The object adapter that should be used by this connection to dispatch requests. + /// The object adapter must be activated. When the object adapter is deactivated, it is automatically removed from + /// the connection. Attempts to use a deactivated object adapter raise ObjectAdapterDeactivatedException func setAdapter(_ adapter: ObjectAdapter?) throws /// Get the object adapter that dispatches requests for this connection. /// - /// - returns: `ObjectAdapter?` - The object adapter that dispatches requests for the connection, or null if no adapter is set. + /// - returns: `ObjectAdapter?` - The object adapter that dispatches requests for the connection, or null if no + /// adapter is set. func getAdapter() -> ObjectAdapter? /// Get the endpoint from which the connection was created. @@ -358,15 +360,15 @@ public protocol Connection: Swift.AnyObject, Swift.CustomStringConvertible { /// Flush any pending batch requests for this connection. This means all batch requests invoked on fixed proxies /// associated with the connection. /// - /// - parameter _: `CompressBatch` Specifies whether or not the queued batch requests should be compressed before being sent over - /// the wire. + /// - parameter _: `CompressBatch` Specifies whether or not the queued batch requests should be compressed before + /// being sent over the wire. func flushBatchRequests(_ compress: CompressBatch) throws /// Flush any pending batch requests for this connection. This means all batch requests invoked on fixed proxies /// associated with the connection. /// - /// - parameter _: `CompressBatch` Specifies whether or not the queued batch requests should be compressed before being sent over - /// the wire. + /// - parameter _: `CompressBatch` Specifies whether or not the queued batch requests should be compressed before + /// being sent over the wire. /// /// - parameter sentOn: `Dispatch.DispatchQueue?` - Optional dispatch queue used to /// dispatch the sent callback. @@ -377,7 +379,10 @@ public protocol Connection: Swift.AnyObject, Swift.CustomStringConvertible { /// - parameter sent: `((Swift.Bool) -> Swift.Void)` - Optional sent callback. /// /// - returns: `PromiseKit.Promise<>` - The result of the operation - func flushBatchRequestsAsync(_ compress: CompressBatch, sentOn: Dispatch.DispatchQueue?, sentFlags: Dispatch.DispatchWorkItemFlags?, sent: ((Swift.Bool) -> Swift.Void)?) -> PromiseKit.Promise + func flushBatchRequestsAsync(_ compress: CompressBatch, + sentOn: Dispatch.DispatchQueue?, + sentFlags: Dispatch.DispatchWorkItemFlags?, + sent: ((Swift.Bool) -> Swift.Void)?) -> PromiseKit.Promise /// Set a close callback on the connection. The callback is called by the connection when it's closed. The callback /// is called from the Ice thread pool associated with the connection. If the callback needs more information about @@ -406,7 +411,9 @@ public protocol Connection: Swift.AnyObject, Swift.CustomStringConvertible { /// - parameter sent: `((Swift.Bool) -> Swift.Void)` - Optional sent callback. /// /// - returns: `PromiseKit.Promise<>` - The result of the operation - func heartbeatAsync(sentOn: Dispatch.DispatchQueue?, sentFlags: Dispatch.DispatchWorkItemFlags?, sent: ((Swift.Bool) -> Swift.Void)?) -> PromiseKit.Promise + func heartbeatAsync(sentOn: Dispatch.DispatchQueue?, + sentFlags: Dispatch.DispatchWorkItemFlags?, + sent: ((Swift.Bool) -> Swift.Void)?) -> PromiseKit.Promise /// Set the active connection management parameters. /// @@ -425,7 +432,7 @@ public protocol Connection: Swift.AnyObject, Swift.CustomStringConvertible { /// Return the connection type. This corresponds to the endpoint type, i.e., "tcp", "udp", etc. /// /// - returns: `Swift.String` - The type of the connection. - func `type`() -> Swift.String + func type() -> Swift.String /// Get the timeout for the connection. /// diff --git a/swift/src/Ice/Current.swift b/swift/src/Ice/Current.swift index d7568b94cf6..3579ea94ef4 100644 --- a/swift/src/Ice/Current.swift +++ b/swift/src/Ice/Current.swift @@ -20,12 +20,12 @@ import Foundation /// applications ignore this parameter. public class Current { /// The object adapter. - public var adapter: ObjectAdapter? = nil + public var adapter: ObjectAdapter? /// Information about the connection over which the current method invocation was received. If the invocation is /// direct due to collocation optimization, this value is set to null. - public var con: Connection? = nil + public var con: Connection? /// The Ice object identity. - public var id: Identity = Identity() + public var id: Identity = .init() /// The facet. public var facet: Swift.String = "" /// The operation name. @@ -33,15 +33,16 @@ public class Current { /// The mode of the operation. public var mode: OperationMode = .Normal /// The request context, as received from the client. - public var ctx: Context = Context() + public var ctx: Context = .init() /// The request id unless oneway (0). public var requestId: Swift.Int32 = 0 /// The encoding version used to encode the input and output parameters. - public var encoding: EncodingVersion = EncodingVersion() + public var encoding: EncodingVersion = .init() public init() {} - public init(adapter: ObjectAdapter?, con: Connection?, id: Identity, facet: Swift.String, operation: Swift.String, mode: OperationMode, ctx: Context, requestId: Swift.Int32, encoding: EncodingVersion) { + public init(adapter: ObjectAdapter?, con: Connection?, id: Identity, facet: Swift.String, operation: Swift.String, + mode: OperationMode, ctx: Context, requestId: Swift.Int32, encoding: EncodingVersion) { self.adapter = adapter self.con = con self.id = id diff --git a/swift/src/Ice/Endpoint.swift b/swift/src/Ice/Endpoint.swift index 595e1692570..8a0b29a25df 100644 --- a/swift/src/Ice/Endpoint.swift +++ b/swift/src/Ice/Endpoint.swift @@ -16,7 +16,7 @@ import Foundation /// Base class providing access to the endpoint details. -public protocol EndpointInfo: Swift.AnyObject { +public protocol EndpointInfo: Swift.AnyObject { /// The information of the underyling endpoint or null if there's no underlying endpoint. var underlying: EndpointInfo? { get set } /// The timeout for the endpoint in milliseconds. 0 means non-blocking, -1 means no timeout. @@ -27,7 +27,7 @@ public protocol EndpointInfo: Swift.AnyObject { /// Returns the type of the endpoint. /// /// - returns: `Swift.Int16` - The endpoint type. - func `type`() -> Swift.Int16 + func type() -> Swift.Int16 /// Returns true if this endpoint is a datagram endpoint. /// @@ -40,7 +40,7 @@ public protocol EndpointInfo: Swift.AnyObject { } /// The user-level interface to an endpoint. -public protocol Endpoint: Swift.AnyObject, Swift.CustomStringConvertible { +public protocol Endpoint: Swift.AnyObject, Swift.CustomStringConvertible { /// Return a string representation of the endpoint. /// /// - returns: `Swift.String` - The string representation of the endpoint. @@ -88,4 +88,3 @@ public protocol OpaqueEndpointInfo: EndpointInfo { } public typealias EndpointSeq = [Endpoint] - diff --git a/swift/src/Ice/Exception.swift b/swift/src/Ice/Exception.swift index 474c9fa7e34..688feb000ac 100644 --- a/swift/src/Ice/Exception.swift +++ b/swift/src/Ice/Exception.swift @@ -86,11 +86,11 @@ open class UserException: Exception { public class RuntimeError: LocalException { private let message: String - public override var description: String { + override public var description: String { return message } - open override class func ice_staticId() -> String { + override open class func ice_staticId() -> String { return "::Ice::RuntimeError" } diff --git a/swift/src/Ice/ImplicitContext.swift b/swift/src/Ice/ImplicitContext.swift index 2e909c59140..de317130d7d 100644 --- a/swift/src/Ice/ImplicitContext.swift +++ b/swift/src/Ice/ImplicitContext.swift @@ -32,7 +32,7 @@ import Foundation /// underlying context without first retrieving a copy of the entire context. These operations correspond to a subset /// of the java.util.Map methods, with java.lang.Object replaced by string and /// null replaced by the empty-string. -public protocol ImplicitContext: Swift.AnyObject { +public protocol ImplicitContext: Swift.AnyObject { /// Get a copy of the underlying context. /// /// - returns: `Context` - A copy of the underlying context. @@ -57,7 +57,7 @@ public protocol ImplicitContext: Swift.AnyObject { /// - parameter _: `Swift.String` The key. /// /// - returns: `Swift.String` - The value associated with the key. - func `get`(_ key: Swift.String) -> Swift.String + func get(_ key: Swift.String) -> Swift.String /// Create or update a key/value entry in the underlying context. /// diff --git a/swift/src/Ice/InputStream.swift b/swift/src/Ice/InputStream.swift index 1f27e1a3dab..36dcf53966a 100644 --- a/swift/src/Ice/InputStream.swift +++ b/swift/src/Ice/InputStream.swift @@ -267,7 +267,7 @@ public class InputStream { } // Reset the InputStream to prepare for retry - internal func startOver() { + func startOver() { pos = 0 encaps = nil } @@ -708,9 +708,9 @@ public extension InputStream { func read(enumMaxValue: Int32) throws -> Int32 { if currentEncoding == Encoding_1_0 { if enumMaxValue < 127 { - return Int32(try read() as UInt8) + return try Int32(read() as UInt8) } else if enumMaxValue < 32767 { - return Int32(try read() as Int16) + return try Int32(read() as Int16) } else { return try read() } @@ -754,10 +754,10 @@ public extension InputStream { /// - returns: `[String]` - The sequence of strings read from the stream. func read() throws -> [String] { let sz = try readAndCheckSeqSize(minSize: 1) - var r: [String] = [String]() + var r = [String]() r.reserveCapacity(sz) for _ in 0 ..< sz { - r.append(try read()) + try r.append(read()) } return r } @@ -1555,7 +1555,7 @@ private class EncapsDecoder11: EncapsDecoder { // indirect patch list into patch entries with direct references. // if current.sliceFlags.contains(.FLAG_HAS_INDIRECTION_TABLE) { - var indirectionTable = [Int32](repeating: 0, count: Int(try stream.readAndCheckSeqSize(minSize: 1))) + var indirectionTable = try [Int32](repeating: 0, count: Int(stream.readAndCheckSeqSize(minSize: 1))) for i in 0 ..< indirectionTable.count { indirectionTable[i] = try readInstance(index: stream.readSize(), cb: nil) @@ -1570,7 +1570,7 @@ private class EncapsDecoder11: EncapsDecoder { throw MarshalException(reason: "empty indirection table") } if current.indirectPatchList.isEmpty, - !current.sliceFlags.contains(.FLAG_HAS_OPTIONAL_MEMBERS) { + !current.sliceFlags.contains(.FLAG_HAS_OPTIONAL_MEMBERS) { throw MarshalException(reason: "no references to indirection table") } @@ -1600,7 +1600,7 @@ private class EncapsDecoder11: EncapsDecoder { if current.sliceType == .ValueSlice { throw NoValueFactoryException(reason: "no value factory found and compact format prevents " + "slicing (the sender should use the sliced format instead)", - type: current.typeId) + type: current.typeId) } else { if let r = current.typeId.range(of: "::") { throw UnknownUserException(unknown: String(current.typeId[r.upperBound...])) @@ -1643,7 +1643,7 @@ private class EncapsDecoder11: EncapsDecoder { // readSlicedData is called. // if current.sliceFlags.contains(.FLAG_HAS_INDIRECTION_TABLE) { - var indirectionTable = [Int32](repeating: 0, count: Int(try stream.readAndCheckSeqSize(minSize: 1))) + var indirectionTable = try [Int32](repeating: 0, count: Int(stream.readAndCheckSeqSize(minSize: 1))) for i in 0 ..< indirectionTable.count { indirectionTable[i] = try readInstance(index: stream.readSize(), cb: nil) diff --git a/swift/src/Ice/Instrumentation.swift b/swift/src/Ice/Instrumentation.swift index 8e16068fe8e..385cf68b7ee 100644 --- a/swift/src/Ice/Instrumentation.swift +++ b/swift/src/Ice/Instrumentation.swift @@ -19,11 +19,11 @@ import Foundation public enum InstrumentationThreadState: Swift.UInt8 { /// ThreadStateIdle The thread is idle. case ThreadStateIdle = 0 - /// ThreadStateInUseForIO The thread is in use performing reads or writes for Ice connections. This state is only for threads from an Ice - /// thread pool. + /// ThreadStateInUseForIO The thread is in use performing reads or writes for Ice connections. This state is only + /// for threads from an Ice thread pool. case ThreadStateInUseForIO = 1 - /// ThreadStateInUseForUser The thread is calling user code (servant implementation, AMI callbacks). This state is only for threads from an - /// Ice thread pool. + /// ThreadStateInUseForUser The thread is calling user code (servant implementation, AMI callbacks). This state is + /// only for threads from an Ice thread pool. case ThreadStateInUseForUser = 2 /// ThreadStateInUseForOther The thread is performing other internal activities (DNS lookups, timer callbacks, etc). case ThreadStateInUseForOther = 3 @@ -88,10 +88,11 @@ public enum InstrumentationConnectionState: Swift.UInt8 { case ConnectionStateHolding = 1 /// ConnectionStateActive The connection is active and can send and receive messages. case ConnectionStateActive = 2 - /// ConnectionStateClosing The connection is being gracefully shutdown and waits for the peer to close its end of the connection. + /// ConnectionStateClosing The connection is being gracefully shutdown and waits for the peer to close its end + /// of the connection. case ConnectionStateClosing = 3 - /// ConnectionStateClosed The connection is closed and waits for potential dispatch to be finished before being destroyed and detached - /// from the observer. + /// ConnectionStateClosed The connection is closed and waits for potential dispatch to be finished before being + /// destroyed and detached from the observer. case ConnectionStateClosed = 4 public init() { self = .ConnectionStateValidating @@ -147,7 +148,7 @@ public extension OutputStream { } /// The object observer interface used by instrumented objects to notify the observer of their existence. -public protocol InstrumentationObserver: Swift.AnyObject { +public protocol InstrumentationObserver: Swift.AnyObject { /// This method is called when the instrumented object is created or when the observer is attached to an existing /// object. func attach() throws @@ -231,7 +232,8 @@ public protocol InstrumentationInvocationObserver: InstrumentationObserver { /// - parameter size: `Swift.Int32` The size of the invocation. /// /// - returns: `InstrumentationRemoteObserver?` - The observer to instrument the remote invocation. - func getRemoteObserver(con: ConnectionInfo?, endpt: Endpoint?, requestId: Swift.Int32, size: Swift.Int32) throws -> InstrumentationRemoteObserver? + func getRemoteObserver(con: ConnectionInfo?, endpt: Endpoint?, requestId: Swift.Int32, size: Swift.Int32) + throws -> InstrumentationRemoteObserver? /// Get a collocated observer for this invocation. /// @@ -242,7 +244,8 @@ public protocol InstrumentationInvocationObserver: InstrumentationObserver { /// - parameter size: `Swift.Int32` The size of the invocation. /// /// - returns: `InstrumentationCollocatedObserver?` - The observer to instrument the collocated invocation. - func getCollocatedObserver(adapter: ObjectAdapter?, requestId: Swift.Int32, size: Swift.Int32) throws -> InstrumentationCollocatedObserver? + func getCollocatedObserver(adapter: ObjectAdapter?, requestId: Swift.Int32, size: Swift.Int32) + throws -> InstrumentationCollocatedObserver? } /// The observer updater interface. This interface is implemented by the Ice run-time and an instance of this interface @@ -251,7 +254,7 @@ public protocol InstrumentationInvocationObserver: InstrumentationObserver { /// provide the observer updater. /// This interface can be used by add-ins implementing the CommunicatorObserver interface to update the /// observers of connections and threads. -public protocol InstrumentationObserverUpdater: Swift.AnyObject { +public protocol InstrumentationObserverUpdater: Swift.AnyObject { /// Update connection observers associated with each of the Ice connection from the communicator and its object /// adapters. /// When called, this method goes through all the connections and for each connection @@ -270,17 +273,18 @@ public protocol InstrumentationObserverUpdater: Swift.AnyObject { /// objects. This interface should be implemented by add-ins that wish to observe Ice objects in order to collect /// statistics. An instance of this interface can be provided to the Ice run-time through the Ice communicator /// initialization data. -public protocol InstrumentationCommunicatorObserver: Swift.AnyObject { +public protocol InstrumentationCommunicatorObserver: Swift.AnyObject { /// This method should return an observer for the given endpoint information and connector. The Ice run-time calls /// this method for each connection establishment attempt. /// /// - parameter endpt: `Endpoint?` The endpoint. /// - /// - parameter connector: `Swift.String` The description of the connector. For IP transports, this is typically the IP address to - /// connect to. + /// - parameter connector: `Swift.String` The description of the connector. For IP transports, this is typically + /// the IP address to connect to. /// /// - returns: `InstrumentationObserver?` - The observer to instrument the connection establishment. - func getConnectionEstablishmentObserver(endpt: Endpoint?, connector: Swift.String) throws -> InstrumentationObserver? + func getConnectionEstablishmentObserver(endpt: Endpoint?, connector: Swift.String) + throws -> InstrumentationObserver? /// This method should return an observer for the given endpoint information. The Ice run-time calls this method to /// resolve an endpoint and obtain the list of connectors. For IP endpoints, this typically involves doing a DNS @@ -301,10 +305,14 @@ public protocol InstrumentationCommunicatorObserver: Swift.AnyObject { /// /// - parameter s: `InstrumentationConnectionState` The state of the connection. /// - /// - parameter o: `InstrumentationConnectionObserver?` The old connection observer if one is already set or a null reference otherwise. + /// - parameter o: `InstrumentationConnectionObserver?` The old connection observer if one is already set + /// or a null reference otherwise. /// /// - returns: `InstrumentationConnectionObserver?` - The connection observer to instrument the connection. - func getConnectionObserver(c: ConnectionInfo?, e: Endpoint?, s: InstrumentationConnectionState, o: InstrumentationConnectionObserver?) throws -> InstrumentationConnectionObserver? + func getConnectionObserver(c: ConnectionInfo?, + e: Endpoint?, + s: InstrumentationConnectionState, + o: InstrumentationConnectionObserver?) throws -> InstrumentationConnectionObserver? /// This method should return a thread observer for the given thread. The Ice run-time calls this method for each /// new thread and for all the Ice communicator threads when ObserverUpdater.updateThreadObservers is @@ -316,10 +324,14 @@ public protocol InstrumentationCommunicatorObserver: Swift.AnyObject { /// /// - parameter s: `InstrumentationThreadState` The state of the thread. /// - /// - parameter o: `InstrumentationThreadObserver?` The old thread observer if one is already set or a null reference otherwise. + /// - parameter o: `InstrumentationThreadObserver?` The old thread observer if one is already set or a null + /// reference otherwise. /// /// - returns: `InstrumentationThreadObserver?` - The thread observer to instrument the thread. - func getThreadObserver(parent: Swift.String, id: Swift.String, s: InstrumentationThreadState, o: InstrumentationThreadObserver?) throws -> InstrumentationThreadObserver? + func getThreadObserver(parent: Swift.String, + id: Swift.String, + s: InstrumentationThreadState, + o: InstrumentationThreadObserver?) throws -> InstrumentationThreadObserver? /// This method should return an invocation observer for the given invocation. The Ice run-time calls this method /// for each new invocation on a proxy. @@ -331,7 +343,9 @@ public protocol InstrumentationCommunicatorObserver: Swift.AnyObject { /// - parameter ctx: `Context` The context specified by the user. /// /// - returns: `InstrumentationInvocationObserver?` - The invocation observer to instrument the invocation. - func getInvocationObserver(prx: ObjectPrx?, operation: Swift.String, ctx: Context) throws -> InstrumentationInvocationObserver? + func getInvocationObserver(prx: ObjectPrx?, + operation: Swift.String, + ctx: Context) throws -> InstrumentationInvocationObserver? /// This method should return a dispatch observer for the given dispatch. The Ice run-time calls this method each /// time it receives an incoming invocation to be dispatched for an Ice object. diff --git a/swift/src/Ice/LocalException.swift b/swift/src/Ice/LocalException.swift index 1bfcafb2c29..0fbb19bee6d 100644 --- a/swift/src/Ice/LocalException.swift +++ b/swift/src/Ice/LocalException.swift @@ -32,14 +32,14 @@ open class InitializationException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::InitializationException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _InitializationExceptionDescription } } @@ -61,14 +61,14 @@ open class PluginInitializationException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::PluginInitializationException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _PluginInitializationExceptionDescription } } @@ -81,14 +81,14 @@ open class CollocationOptimizationException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::CollocationOptimizationException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _CollocationOptimizationExceptionDescription } } @@ -116,14 +116,14 @@ open class AlreadyRegisteredException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::AlreadyRegisteredException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _AlreadyRegisteredExceptionDescription } } @@ -153,14 +153,14 @@ open class NotRegisteredException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::NotRegisteredException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _NotRegisteredExceptionDescription } } @@ -184,14 +184,14 @@ open class TwowayOnlyException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::TwowayOnlyException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _TwowayOnlyExceptionDescription } } @@ -204,14 +204,14 @@ open class CloneNotImplementedException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::CloneNotImplementedException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _CloneNotImplementedExceptionDescription } } @@ -235,14 +235,14 @@ open class UnknownException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::UnknownException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _UnknownExceptionDescription } } @@ -256,14 +256,14 @@ open class UnknownLocalException: UnknownException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::UnknownLocalException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _UnknownLocalExceptionDescription } } @@ -277,14 +277,14 @@ open class UnknownUserException: UnknownException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::UnknownUserException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _UnknownUserExceptionDescription } } @@ -294,14 +294,14 @@ open class VersionMismatchException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::VersionMismatchException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _VersionMismatchExceptionDescription } } @@ -311,14 +311,14 @@ open class CommunicatorDestroyedException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::CommunicatorDestroyedException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _CommunicatorDestroyedExceptionDescription } } @@ -340,14 +340,14 @@ open class ObjectAdapterDeactivatedException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ObjectAdapterDeactivatedException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ObjectAdapterDeactivatedExceptionDescription } } @@ -370,14 +370,14 @@ open class ObjectAdapterIdInUseException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ObjectAdapterIdInUseException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ObjectAdapterIdInUseExceptionDescription } } @@ -399,14 +399,14 @@ open class NoEndpointException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::NoEndpointException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _NoEndpointExceptionDescription } } @@ -428,14 +428,14 @@ open class EndpointParseException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::EndpointParseException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _EndpointParseExceptionDescription } } @@ -457,14 +457,14 @@ open class EndpointSelectionTypeParseException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::EndpointSelectionTypeParseException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _EndpointSelectionTypeParseExceptionDescription } } @@ -486,14 +486,14 @@ open class VersionParseException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::VersionParseException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _VersionParseExceptionDescription } } @@ -515,14 +515,14 @@ open class IdentityParseException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::IdentityParseException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _IdentityParseExceptionDescription } } @@ -544,14 +544,14 @@ open class ProxyParseException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ProxyParseException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ProxyParseExceptionDescription } } @@ -559,7 +559,7 @@ open class ProxyParseException: LocalException { /// This exception is raised if an illegal identity is encountered. open class IllegalIdentityException: LocalException { /// The illegal identity. - public var id: Identity = Identity() + public var id: Identity = .init() public required init() { super.init() @@ -573,14 +573,14 @@ open class IllegalIdentityException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::IllegalIdentityException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _IllegalIdentityExceptionDescription } } @@ -602,14 +602,14 @@ open class IllegalServantException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::IllegalServantException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _IllegalServantExceptionDescription } } @@ -619,7 +619,7 @@ open class IllegalServantException: LocalException { /// local. open class RequestFailedException: LocalException { /// The identity of the Ice Object to which the request was sent. - public var id: Identity = Identity() + public var id: Identity = .init() /// The facet to which the request was sent. public var facet: Swift.String = "" /// The operation name of the request. @@ -629,7 +629,11 @@ open class RequestFailedException: LocalException { super.init() } - public init(id: Identity, facet: Swift.String, operation: Swift.String, file: Swift.String = #file, line: Swift.Int = #line) { + public init(id: Identity, + facet: Swift.String, + operation: Swift.String, + file: Swift.String = #file, + line: Swift.Int = #line) { self.id = id self.facet = facet self.operation = operation @@ -639,14 +643,14 @@ open class RequestFailedException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::RequestFailedException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _RequestFailedExceptionDescription } } @@ -657,14 +661,14 @@ open class ObjectNotExistException: RequestFailedException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ObjectNotExistException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ObjectNotExistExceptionDescription } } @@ -675,14 +679,14 @@ open class FacetNotExistException: RequestFailedException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::FacetNotExistException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _FacetNotExistExceptionDescription } } @@ -693,14 +697,14 @@ open class OperationNotExistException: RequestFailedException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::OperationNotExistException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _OperationNotExistExceptionDescription } } @@ -725,14 +729,14 @@ open class SyscallException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::SyscallException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _SyscallExceptionDescription } } @@ -742,14 +746,14 @@ open class SocketException: SyscallException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::SocketException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _SocketExceptionDescription } } @@ -771,14 +775,14 @@ open class CFNetworkException: SocketException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::CFNetworkException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _CFNetworkExceptionDescription } } @@ -800,14 +804,14 @@ open class FileException: SyscallException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::FileException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _FileExceptionDescription } } @@ -817,14 +821,14 @@ open class ConnectFailedException: SocketException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ConnectFailedException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ConnectFailedExceptionDescription } } @@ -834,14 +838,14 @@ open class ConnectionRefusedException: ConnectFailedException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ConnectionRefusedException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ConnectionRefusedExceptionDescription } } @@ -851,14 +855,14 @@ open class ConnectionLostException: SocketException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ConnectionLostException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ConnectionLostExceptionDescription } } @@ -884,14 +888,14 @@ open class DNSException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::DNSException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _DNSExceptionDescription } } @@ -901,14 +905,14 @@ open class OperationInterruptedException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::OperationInterruptedException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _OperationInterruptedExceptionDescription } } @@ -918,14 +922,14 @@ open class TimeoutException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::TimeoutException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _TimeoutExceptionDescription } } @@ -935,14 +939,14 @@ open class ConnectTimeoutException: TimeoutException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ConnectTimeoutException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ConnectTimeoutExceptionDescription } } @@ -952,14 +956,14 @@ open class CloseTimeoutException: TimeoutException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::CloseTimeoutException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _CloseTimeoutExceptionDescription } } @@ -969,14 +973,14 @@ open class ConnectionTimeoutException: TimeoutException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ConnectionTimeoutException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ConnectionTimeoutExceptionDescription } } @@ -986,14 +990,14 @@ open class InvocationTimeoutException: TimeoutException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::InvocationTimeoutException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _InvocationTimeoutExceptionDescription } } @@ -1003,14 +1007,14 @@ open class InvocationCanceledException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::InvocationCanceledException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _InvocationCanceledExceptionDescription } } @@ -1032,14 +1036,14 @@ open class ProtocolException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ProtocolException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ProtocolExceptionDescription } } @@ -1047,7 +1051,7 @@ open class ProtocolException: LocalException { /// This exception indicates that a message did not start with the expected magic number ('I', 'c', 'e', 'P'). open class BadMagicException: ProtocolException { /// A sequence containing the first four bytes of the incorrect message. - public var badMagic: ByteSeq = ByteSeq() + public var badMagic: ByteSeq = .init() public required init() { super.init() @@ -1061,14 +1065,14 @@ open class BadMagicException: ProtocolException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::BadMagicException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _BadMagicExceptionDescription } } @@ -1076,15 +1080,19 @@ open class BadMagicException: ProtocolException { /// This exception indicates an unsupported protocol version. open class UnsupportedProtocolException: ProtocolException { /// The version of the unsupported protocol. - public var bad: ProtocolVersion = ProtocolVersion() + public var bad: ProtocolVersion = .init() /// The version of the protocol that is supported. - public var supported: ProtocolVersion = ProtocolVersion() + public var supported: ProtocolVersion = .init() public required init() { super.init() } - public init(reason: Swift.String, bad: ProtocolVersion, supported: ProtocolVersion, file: Swift.String = #file, line: Swift.Int = #line) { + public init(reason: Swift.String, + bad: ProtocolVersion, + supported: ProtocolVersion, + file: Swift.String = #file, + line: Swift.Int = #line) { self.bad = bad self.supported = supported super.init(reason: reason, file: file, line: line) @@ -1093,14 +1101,14 @@ open class UnsupportedProtocolException: ProtocolException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::UnsupportedProtocolException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _UnsupportedProtocolExceptionDescription } } @@ -1108,15 +1116,19 @@ open class UnsupportedProtocolException: ProtocolException { /// This exception indicates an unsupported data encoding version. open class UnsupportedEncodingException: ProtocolException { /// The version of the unsupported encoding. - public var bad: EncodingVersion = EncodingVersion() + public var bad: EncodingVersion = .init() /// The version of the encoding that is supported. - public var supported: EncodingVersion = EncodingVersion() + public var supported: EncodingVersion = .init() public required init() { super.init() } - public init(reason: Swift.String, bad: EncodingVersion, supported: EncodingVersion, file: Swift.String = #file, line: Swift.Int = #line) { + public init(reason: Swift.String, + bad: EncodingVersion, + supported: EncodingVersion, + file: Swift.String = #file, + line: Swift.Int = #line) { self.bad = bad self.supported = supported super.init(reason: reason, file: file, line: line) @@ -1125,14 +1137,14 @@ open class UnsupportedEncodingException: ProtocolException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::UnsupportedEncodingException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _UnsupportedEncodingExceptionDescription } } @@ -1142,14 +1154,14 @@ open class UnknownMessageException: ProtocolException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::UnknownMessageException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _UnknownMessageExceptionDescription } } @@ -1159,14 +1171,14 @@ open class ConnectionNotValidatedException: ProtocolException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ConnectionNotValidatedException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ConnectionNotValidatedExceptionDescription } } @@ -1176,14 +1188,14 @@ open class UnknownRequestIdException: ProtocolException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::UnknownRequestIdException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _UnknownRequestIdExceptionDescription } } @@ -1193,14 +1205,14 @@ open class UnknownReplyStatusException: ProtocolException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::UnknownReplyStatusException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _UnknownReplyStatusExceptionDescription } } @@ -1214,14 +1226,14 @@ open class CloseConnectionException: ProtocolException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::CloseConnectionException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _CloseConnectionExceptionDescription } } @@ -1244,14 +1256,14 @@ open class ConnectionManuallyClosedException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ConnectionManuallyClosedException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ConnectionManuallyClosedExceptionDescription } } @@ -1261,14 +1273,14 @@ open class IllegalMessageSizeException: ProtocolException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::IllegalMessageSizeException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _IllegalMessageSizeExceptionDescription } } @@ -1278,14 +1290,14 @@ open class CompressionException: ProtocolException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::CompressionException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _CompressionExceptionDescription } } @@ -1296,14 +1308,14 @@ open class DatagramLimitException: ProtocolException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::DatagramLimitException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _DatagramLimitExceptionDescription } } @@ -1313,14 +1325,14 @@ open class MarshalException: ProtocolException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::MarshalException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _MarshalExceptionDescription } } @@ -1330,14 +1342,14 @@ open class ProxyUnmarshalException: MarshalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ProxyUnmarshalException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ProxyUnmarshalExceptionDescription } } @@ -1347,14 +1359,14 @@ open class UnmarshalOutOfBoundsException: MarshalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::UnmarshalOutOfBoundsException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _UnmarshalOutOfBoundsExceptionDescription } } @@ -1362,28 +1374,28 @@ open class UnmarshalOutOfBoundsException: MarshalException { /// This exception is raised if no suitable value factory was found during unmarshaling of a Slice class instance. open class NoValueFactoryException: MarshalException { /// The Slice type ID of the class instance for which no factory could be found. - public var `type`: Swift.String = "" + public var type: Swift.String = "" public required init() { super.init() } - public init(reason: Swift.String, `type`: Swift.String, file: Swift.String = #file, line: Swift.Int = #line) { - self.`type` = `type` + public init(reason: Swift.String, type: Swift.String, file: Swift.String = #file, line: Swift.Int = #line) { + self.type = type super.init(reason: reason, file: file, line: line) } /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::NoValueFactoryException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _NoValueFactoryExceptionDescription } } @@ -1394,7 +1406,7 @@ open class NoValueFactoryException: MarshalException { /// used to send Slice class instances and an operation is subscribed to the wrong topic. open class UnexpectedObjectException: MarshalException { /// The Slice type ID of the class instance that was unmarshaled. - public var `type`: Swift.String = "" + public var type: Swift.String = "" /// The Slice type ID that was expected by the receiving operation. public var expectedType: Swift.String = "" @@ -1402,8 +1414,12 @@ open class UnexpectedObjectException: MarshalException { super.init() } - public init(reason: Swift.String, `type`: Swift.String, expectedType: Swift.String, file: Swift.String = #file, line: Swift.Int = #line) { - self.`type` = `type` + public init(reason: Swift.String, + type: Swift.String, + expectedType: Swift.String, + file: Swift.String = #file, + line: Swift.Int = #line) { + self.type = type self.expectedType = expectedType super.init(reason: reason, file: file, line: line) } @@ -1411,14 +1427,14 @@ open class UnexpectedObjectException: MarshalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::UnexpectedObjectException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _UnexpectedObjectExceptionDescription } } @@ -1429,14 +1445,14 @@ open class MemoryLimitException: MarshalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::MemoryLimitException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _MemoryLimitExceptionDescription } } @@ -1446,14 +1462,14 @@ open class StringConversionException: MarshalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::StringConversionException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _StringConversionExceptionDescription } } @@ -1463,14 +1479,14 @@ open class EncapsulationException: MarshalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::EncapsulationException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _EncapsulationExceptionDescription } } @@ -1493,14 +1509,14 @@ open class FeatureNotSupportedException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::FeatureNotSupportedException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _FeatureNotSupportedExceptionDescription } } @@ -1522,14 +1538,14 @@ open class SecurityException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::SecurityException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _SecurityExceptionDescription } } @@ -1539,14 +1555,14 @@ open class FixedProxyException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::FixedProxyException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _FixedProxyExceptionDescription } } @@ -1556,14 +1572,14 @@ open class ResponseSentException: LocalException { /// Returns the Slice type ID of this exception. /// /// - returns: `Swift.String` - the Slice type ID of this exception. - open override class func ice_staticId() -> Swift.String { + override open class func ice_staticId() -> Swift.String { return "::Ice::ResponseSentException" } /// Returns a string representation of this exception /// /// - returns: `Swift.String` - The string representaton of this exception. - open override func ice_print() -> Swift.String { + override open func ice_print() -> Swift.String { return _ResponseSentExceptionDescription } } diff --git a/swift/src/Ice/Logger.swift b/swift/src/Ice/Logger.swift index c8093d3cc96..75a1c70db82 100644 --- a/swift/src/Ice/Logger.swift +++ b/swift/src/Ice/Logger.swift @@ -17,7 +17,7 @@ import Foundation /// The Ice message logger. Applications can provide their own logger by implementing this interface and installing it /// in a communicator. -public protocol Logger: Swift.AnyObject { +public protocol Logger: Swift.AnyObject { /// Print a message. The message is printed literally, without any decorations such as executable name or time /// stamp. /// diff --git a/swift/src/Ice/ObjectAdapter.swift b/swift/src/Ice/ObjectAdapter.swift index d900a5e3ee6..6f59dc0647e 100644 --- a/swift/src/Ice/ObjectAdapter.swift +++ b/swift/src/Ice/ObjectAdapter.swift @@ -18,7 +18,7 @@ import Foundation /// The object adapter provides an up-call interface from the Ice run time to the implementation of Ice objects. The /// object adapter is responsible for receiving requests from endpoints, and for mapping between servants, identities, /// and proxies. -public protocol ObjectAdapter: Swift.AnyObject { +public protocol ObjectAdapter: Swift.AnyObject { /// Get the name of this object adapter. /// /// - returns: `Swift.String` - This object adapter's name. @@ -130,15 +130,15 @@ public protocol ObjectAdapter: Swift.AnyObject { /// /// - parameter servant: `Disp` The default servant. /// - /// - parameter category: `Swift.String` The category for which the default servant is registered. An empty category means it will - /// handle all categories. + /// - parameter category: `Swift.String` The category for which the default servant is registered. An empty + /// category means it will handle all categories. func addDefaultServant(servant: Disp, category: Swift.String) throws /// Remove a servant (that is, the default facet) from the object adapter's Active Servant Map. /// - /// - parameter _: `Identity` The identity of the Ice object that is implemented by the servant. If the servant implements multiple - /// Ice objects, remove has to be called for all those Ice objects. Removing an identity that is not in - /// the map throws NotRegisteredException. + /// - parameter _: `Identity` The identity of the Ice object that is implemented by the servant. If the servant + /// implements multiple Ice objects, remove has to be called for all those Ice objects. Removing an identity + /// that is not in the map throws NotRegisteredException. /// /// - returns: `Disp` - The removed servant. @discardableResult @@ -180,8 +180,8 @@ public protocol ObjectAdapter: Swift.AnyObject { /// /// - parameter _: `Identity` The identity of the Ice object for which the servant should be returned. /// - /// - returns: `Disp?` - The servant that implements the Ice object with the given identity, or null if no such servant has been - /// found. + /// - returns: `Disp?` - The servant that implements the Ice object with the given identity, or null if no such + /// servant has been found. func find(_ id: Identity) -> Disp? /// Like find, but with a facet. Calling find(id) is equivalent to calling findFacet @@ -191,16 +191,16 @@ public protocol ObjectAdapter: Swift.AnyObject { /// /// - parameter facet: `Swift.String` The facet. An empty facet means the default facet. /// - /// - returns: `Disp?` - The servant that implements the Ice object with the given identity and facet, or null if no such - /// servant has been found. + /// - returns: `Disp?` - The servant that implements the Ice object with the given identity and facet, or null if + /// no such servant has been found. func findFacet(id: Identity, facet: Swift.String) -> Disp? /// Find all facets with the given identity in the Active Servant Map. /// /// - parameter _: `Identity` The identity of the Ice object for which the facets should be returned. /// - /// - returns: `FacetMap` - A collection containing all the facet names and servants that have been found, or an empty map if there - /// is no facet for the given identity. + /// - returns: `FacetMap` - A collection containing all the facet names and servants that have been found, or an + /// empty map if there is no facet for the given identity. func findAllFacets(_ id: Identity) -> FacetMap /// Look up a servant in this object adapter's Active Servant Map, given a proxy. @@ -231,26 +231,27 @@ public protocol ObjectAdapter: Swift.AnyObject { /// /// - parameter locator: `ServantLocator` The locator to add. /// - /// - parameter category: `Swift.String` The category for which the Servant Locator can locate servants, or an empty string if the - /// Servant Locator does not belong to any specific category. + /// - parameter category: `Swift.String` The category for which the Servant Locator can locate servants, or an + /// empty string if the Servant Locator does not belong to any specific category. func addServantLocator(locator: ServantLocator, category: Swift.String) throws /// Remove a Servant Locator from this object adapter. /// - /// - parameter _: `Swift.String` The category for which the Servant Locator can locate servants, or an empty string if the - /// Servant Locator does not belong to any specific category. + /// - parameter _: `Swift.String` The category for which the Servant Locator can locate servants, or an empty + /// string if the Servant Locator does not belong to any specific category. /// - /// - returns: `ServantLocator` - The Servant Locator, or throws NotRegisteredException if no Servant Locator was found for the - /// given category. + /// - returns: `ServantLocator` - The Servant Locator, or throws NotRegisteredException if no Servant Locator was + /// found for the given category. @discardableResult func removeServantLocator(_ category: Swift.String) throws -> ServantLocator /// Find a Servant Locator installed with this object adapter. /// - /// - parameter _: `Swift.String` The category for which the Servant Locator can locate servants, or an empty string if the - /// Servant Locator does not belong to any specific category. + /// - parameter _: `Swift.String` The category for which the Servant Locator can locate servants, or an empty + /// string if the Servant Locator does not belong to any specific category. /// - /// - returns: `ServantLocator?` - The Servant Locator, or null if no Servant Locator was found for the given category. + /// - returns: `ServantLocator?` - The Servant Locator, or null if no Servant Locator was found for the given + /// category. func findServantLocator(_ category: Swift.String) -> ServantLocator? /// Find the default servant for a specific category. @@ -297,7 +298,8 @@ public protocol ObjectAdapter: Swift.AnyObject { /// Get the Ice locator used by this object adapter. /// - /// - returns: `LocatorPrx?` - The locator used by this object adapter, or null if no locator is used by this object adapter. + /// - returns: `LocatorPrx?` - The locator used by this object adapter, or null if no locator is used by this + /// object adapter. func getLocator() -> LocatorPrx? /// Get the set of endpoints configured with this object adapter. diff --git a/swift/src/Ice/OutputStream.swift b/swift/src/Ice/OutputStream.swift index 45e3d253191..cee117c6465 100644 --- a/swift/src/Ice/OutputStream.swift +++ b/swift/src/Ice/OutputStream.swift @@ -7,7 +7,7 @@ import IceImpl /// Stream class to write (marshal) Slice types into a sequence of bytes. public class OutputStream { - private var data: Data = Data(capacity: 240) + private var data: Data = .init(capacity: 240) private let communicator: Communicator private let encoding: EncodingVersion private let encoding_1_0: Bool @@ -658,11 +658,11 @@ private final class EncapsEncoder10: EncapsEncoder { unowned let os: OutputStream unowned let encaps: Encaps var marshaledMap: [ValueHolder: Int32] - lazy var typeIdMap: [String: Int32] = [String: Int32]() + lazy var typeIdMap: [String: Int32] = .init() var typeIdIndex: Int32 // Instance attributes - private var sliceType: SliceType = SliceType.NoSlice + private var sliceType: SliceType = .NoSlice // Slice attributes private var writeSlice: Int32 = 0 // Position of the slice data members // Encapsulation attributes for instance marshaling. @@ -815,7 +815,7 @@ private final class EncapsEncoder11: EncapsEncoder { unowned let encaps: Encaps var marshaledMap: [ValueHolder: Int32] - lazy var typeIdMap: [String: Int32] = [String: Int32]() + lazy var typeIdMap: [String: Int32] = .init() var typeIdIndex: Int32 var current: InstanceData! @@ -953,7 +953,7 @@ private final class EncapsEncoder11: EncapsEncoder { // Write the slice length if necessary. // if current.sliceFlags.contains(.FLAG_HAS_SLICE_SIZE) { - let sz: Int32 = Int32(os.getCount()) - current.writeSlice + 4 + let sz = Int32(os.getCount()) - current.writeSlice + 4 os.write(bytesOf: sz, at: Int(current.writeSlice - 4)) } @@ -1053,7 +1053,7 @@ private final class EncapsEncoder11: EncapsEncoder { private class InstanceData { // Instance attributes - var sliceType: SliceType = SliceType.NoSlice + var sliceType: SliceType = .NoSlice var firstSlice: Bool = true // Slice attributes diff --git a/swift/src/Ice/Plugin.swift b/swift/src/Ice/Plugin.swift index e45dd3c57dd..fa0d88ec58c 100644 --- a/swift/src/Ice/Plugin.swift +++ b/swift/src/Ice/Plugin.swift @@ -18,7 +18,7 @@ import Foundation /// A communicator plug-in. A plug-in generally adds a feature to a communicator, such as support for a protocol. /// The communicator loads its plug-ins in two stages: the first stage creates the plug-ins, and the second stage /// invokes Plugin.initialize on each one. -public protocol Plugin: Swift.AnyObject { +public protocol Plugin: Swift.AnyObject { /// Perform any necessary initialization steps. func initialize() throws @@ -27,7 +27,7 @@ public protocol Plugin: Swift.AnyObject { } /// Each communicator has a plug-in manager to administer the set of plug-ins. -public protocol PluginManager: Swift.AnyObject { +public protocol PluginManager: Swift.AnyObject { /// Initialize the configured plug-ins. The communicator automatically initializes the plug-ins by default, but an /// application may need to interact directly with a plug-in prior to initialization. In this case, the application /// must set Ice.InitPlugins=0 and then invoke initializePlugins manually. The plug-ins are diff --git a/swift/src/Ice/Properties.swift b/swift/src/Ice/Properties.swift index d71fe2abeef..0b5b1e418b6 100644 --- a/swift/src/Ice/Properties.swift +++ b/swift/src/Ice/Properties.swift @@ -18,7 +18,7 @@ import Foundation /// A property set used to configure Ice and Ice applications. Properties are key/value pairs, with both keys and /// values being strings. By convention, property keys should have the form /// application-name[.category[.sub-category]].name. -public protocol Properties: Swift.AnyObject { +public protocol Properties: Swift.AnyObject { /// Get a property by key. If the property is not set, an empty string is returned. /// /// - parameter _: `Swift.String` The property key. @@ -100,11 +100,13 @@ public protocol Properties: Swift.AnyObject { /// --prefix. are converted into properties. If the prefix is empty, all options that begin with /// -- are converted to properties. /// - /// - parameter prefix: `Swift.String` The property prefix, or an empty string to convert all options starting with --. + /// - parameter prefix: `Swift.String` The property prefix, or an empty string to convert all options starting + /// with --. /// /// - parameter options: `StringSeq` The command-line options. /// - /// - returns: `StringSeq` - The command-line options that do not start with the specified prefix, in their original order. + /// - returns: `StringSeq` - The command-line options that do not start with the specified prefix, in their + /// original order. func parseCommandLineOptions(prefix: Swift.String, options: StringSeq) throws -> StringSeq /// Convert a sequence of command-line options into properties. All options that begin with one of the following @@ -113,7 +115,8 @@ public protocol Properties: Swift.AnyObject { /// /// - parameter _: `StringSeq` The command-line options. /// - /// - returns: `StringSeq` - The command-line options that do not start with one of the listed prefixes, in their original order. + /// - returns: `StringSeq` - The command-line options that do not start with one of the listed prefixes, + /// in their original order. func parseIceCommandLineOptions(_ options: StringSeq) throws -> StringSeq /// Load properties from a file. diff --git a/swift/src/Ice/Proxy.swift b/swift/src/Ice/Proxy.swift index ae64663158e..82c8e2566b2 100644 --- a/swift/src/Ice/Proxy.swift +++ b/swift/src/Ice/Proxy.swift @@ -633,7 +633,7 @@ public extension ObjectPrx { InputStream(communicator: self._impl.communicator, encoding: self._impl.encoding, bytes: Data(bytes: bytes, count: count)) // make a copy - seal.fulfill((ok, try istr.readEncapsulation().bytes)) + try seal.fulfill((ok, istr.readEncapsulation().bytes)) } catch { seal.reject(error) } @@ -663,7 +663,7 @@ public extension ObjectPrx { if let sentCB = sentCB { sentCB($0) } - }) + }) } } } @@ -749,9 +749,9 @@ public extension ObjectPrx { // generated code - this is why we give it the open access level. // open class ObjectPrxI: ObjectPrx { - internal let handle: ICEObjectPrx - internal let communicator: Communicator - internal let encoding: EncodingVersion + let handle: ICEObjectPrx + let communicator: Communicator + let encoding: EncodingVersion fileprivate let isTwoway: Bool public var description: String { @@ -775,12 +775,12 @@ open class ObjectPrxI: ObjectPrx { isTwoway = impl.isTwoway } - internal func fromICEObjectPrx(_ h: ICEObjectPrx) -> ObjectPrxType where ObjectPrxType: ObjectPrxI { + func fromICEObjectPrx(_ h: ICEObjectPrx) -> ObjectPrxType where ObjectPrxType: ObjectPrxI { return ObjectPrxType(handle: h, communicator: communicator) } - internal static func fromICEObjectPrx(handle: ICEObjectPrx, - communicator c: Communicator? = nil) -> Self { + static func fromICEObjectPrx(handle: ICEObjectPrx, + communicator c: Communicator? = nil) -> Self { let communicator = c ?? handle.ice_getCommunicator().getCachedSwiftObject(CommunicatorI.self) return self.init(handle: handle, communicator: communicator) } @@ -1123,7 +1123,7 @@ open class ObjectPrxI: ObjectPrx { // // The number of bytes consumed reading the proxy - var bytesRead: Int = 0 + var bytesRead = 0 let encoding = istr.currentEncoding let communicator = istr.communicator @@ -1183,7 +1183,7 @@ open class ObjectPrxI: ObjectPrx { } catch { uex = error } - }) + }) if let e = uex { throw e @@ -1238,7 +1238,7 @@ open class ObjectPrxI: ObjectPrx { } catch { uex = error } - }) + }) if let e = uex { throw e @@ -1324,7 +1324,7 @@ open class ObjectPrxI: ObjectPrx { if let sentCB = sentCB { sentCB($0) } - }) + }) } } } diff --git a/swift/src/Ice/ServantLocator.swift b/swift/src/Ice/ServantLocator.swift index d1b956f9aad..4137cc54357 100644 --- a/swift/src/Ice/ServantLocator.swift +++ b/swift/src/Ice/ServantLocator.swift @@ -16,7 +16,7 @@ import Foundation /// A servant locator is called by an object adapter to locate a servant that is not found in its active servant map. -public protocol ServantLocator: Swift.AnyObject { +public protocol ServantLocator: Swift.AnyObject { /// Called before a request is dispatched if a servant cannot be found in the object adapter's active servant map. /// Note that the object adapter does not automatically insert the returned servant into its active servant map. /// This must be done by the servant locator implementation, if this is desired. locate can throw any diff --git a/swift/src/Ice/ServantManager.swift b/swift/src/Ice/ServantManager.swift index 96c5327efc5..e37b102c68f 100644 --- a/swift/src/Ice/ServantManager.swift +++ b/swift/src/Ice/ServantManager.swift @@ -173,7 +173,7 @@ class ServantManager { locatorMap.removeAll() } - m.forEach { category, locator in + for (category, locator) in m { locator.deactivate(category) } } diff --git a/swift/src/Ice/UnknownSlicedValue.swift b/swift/src/Ice/UnknownSlicedValue.swift index 1cec3095fad..5126a3b441a 100644 --- a/swift/src/Ice/UnknownSlicedValue.swift +++ b/swift/src/Ice/UnknownSlicedValue.swift @@ -18,11 +18,11 @@ public final class UnknownSlicedValue: Value { /// Returns the Slice type ID associated with this object. /// /// - returns: `String` - The type ID. - public override func ice_id() -> String { + override public func ice_id() -> String { return unknownTypeId } - public override class func ice_staticId() -> String { + override public class func ice_staticId() -> String { return "::Ice::UnknownSlicedValue" } @@ -30,16 +30,16 @@ public final class UnknownSlicedValue: Value { /// un-marshaling of the value, nil is returned otherwise. /// /// - returns: `Ice.SlicedData?` - The sliced data or nil. - public override func ice_getSlicedData() -> SlicedData? { + override public func ice_getSlicedData() -> SlicedData? { return slicedData } - public override func _iceRead(from ins: InputStream) throws { + override public func _iceRead(from ins: InputStream) throws { ins.startValue() slicedData = try ins.endValue(preserve: true) } - public override func _iceWrite(to os: OutputStream) { + override public func _iceWrite(to os: OutputStream) { os.startValue(data: slicedData) os.endValue() } diff --git a/swift/src/Ice/Value.swift b/swift/src/Ice/Value.swift index c5b89064004..7c22a468c44 100644 --- a/swift/src/Ice/Value.swift +++ b/swift/src/Ice/Value.swift @@ -67,16 +67,16 @@ open class InterfaceByValue: Value { self.id = id } - open override func ice_id() -> String { + override open func ice_id() -> String { return id } - open override func _iceReadImpl(from ostr: InputStream) throws { + override open func _iceReadImpl(from ostr: InputStream) throws { _ = try ostr.startSlice() try ostr.endSlice() } - open override func _iceWriteImpl(to istr: OutputStream) { + override open func _iceWriteImpl(to istr: OutputStream) { istr.startSlice(typeId: ice_id(), compactId: -1, last: true) istr.endSlice() } diff --git a/swift/src/Ice/ValueFactory.swift b/swift/src/Ice/ValueFactory.swift index b07768d550d..192d56a9004 100644 --- a/swift/src/Ice/ValueFactory.swift +++ b/swift/src/Ice/ValueFactory.swift @@ -31,7 +31,7 @@ public typealias ValueFactory = (Swift.String) -> Value? /// A value factory manager maintains a collection of value factories. An application can supply a custom /// implementation during communicator initialization, otherwise Ice provides a default implementation. -public protocol ValueFactoryManager: Swift.AnyObject { +public protocol ValueFactoryManager: Swift.AnyObject { /// Add a value factory. Attempting to add a factory with an id for which a factory is already registered throws /// AlreadyRegisteredException. /// When unmarshaling an Ice value, the Ice run time reads the most-derived type id off the wire and attempts to @@ -52,12 +52,14 @@ public protocol ValueFactoryManager: Swift.AnyObject { /// /// - parameter factory: `@escaping ValueFactory` The factory to add. /// - /// - parameter id: `Swift.String` The type id for which the factory can create instances, or an empty string for the default factory. + /// - parameter id: `Swift.String` The type id for which the factory can create instances, or an empty string for + /// the default factory. func add(factory: @escaping ValueFactory, id: Swift.String) throws /// Find an value factory registered with this communicator. /// - /// - parameter _: `Swift.String` The type id for which the factory can create instances, or an empty string for the default factory. + /// - parameter _: `Swift.String` The type id for which the factory can create instances, or an empty string for + /// the default factory. /// /// - returns: `ValueFactory?` - The value factory, or null if no value factory was found for the given id. func find(_ id: Swift.String) -> ValueFactory? diff --git a/swift/test/Ice/acm/Server.swift b/swift/test/Ice/acm/Server.swift index 68a3da9974e..550a214eece 100644 --- a/swift/test/Ice/acm/Server.swift +++ b/swift/test/Ice/acm/Server.swift @@ -7,7 +7,7 @@ import PromiseKit import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.Warn.Connections", value: "0") properties.setProperty(key: "Ice.ACM.Timeout", value: "1") diff --git a/swift/test/Ice/acm/TestI.swift b/swift/test/Ice/acm/TestI.swift index e7ac4d30b0b..e0f9f08da6f 100644 --- a/swift/test/Ice/acm/TestI.swift +++ b/swift/test/Ice/acm/TestI.swift @@ -103,8 +103,8 @@ class TestI: TestIntf { } func waitForHeartbeatCount(count: Int32, current _: Current) { - for _ in 0.. Void in + _ = completed!.done { (v: Int32) throws in if v != expected { cond.set(value: false) } @@ -121,7 +121,7 @@ func allTests(_ helper: TestHelper) throws { } } - _ = completed!.done { (v: Int32) throws -> Void in + _ = completed!.done { (v: Int32) throws in if v != expected { cond.set(value: false) } diff --git a/swift/test/Ice/hold/Client.swift b/swift/test/Ice/hold/Client.swift index 6287acd71eb..8e6547f2d1b 100644 --- a/swift/test/Ice/hold/Client.swift +++ b/swift/test/Ice/hold/Client.swift @@ -7,7 +7,7 @@ import PromiseKit import TestCommon public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let communicator = try initialize(args) defer { communicator.destroy() diff --git a/swift/test/Ice/hold/Server.swift b/swift/test/Ice/hold/Server.swift index 0130718d499..cf194ca9584 100644 --- a/swift/test/Ice/hold/Server.swift +++ b/swift/test/Ice/hold/Server.swift @@ -7,7 +7,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let communicator = try initialize(args) defer { communicator.destroy() diff --git a/swift/test/Ice/info/AllTests.swift b/swift/test/Ice/info/AllTests.swift index 9f672d9dca3..5c11a786275 100644 --- a/swift/test/Ice/info/AllTests.swift +++ b/swift/test/Ice/info/AllTests.swift @@ -217,7 +217,7 @@ func allTests(_ helper: TestHelper) throws { connection = try base.ice_datagram().ice_getConnection()! try connection.setBufferSize(rcvSize: 2048, sndSize: 1024) - let udpInfo = (try connection.getInfo() as? Ice.UDPConnectionInfo)! + let udpInfo = try (connection.getInfo() as? Ice.UDPConnectionInfo)! try test(!udpInfo.incoming) try test(udpInfo.adapterName == "") try test(udpInfo.localPort > 0) diff --git a/swift/test/Ice/info/Client.swift b/swift/test/Ice/info/Client.swift index 6287acd71eb..8e6547f2d1b 100644 --- a/swift/test/Ice/info/Client.swift +++ b/swift/test/Ice/info/Client.swift @@ -7,7 +7,7 @@ import PromiseKit import TestCommon public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let communicator = try initialize(args) defer { communicator.destroy() diff --git a/swift/test/Ice/info/Server.swift b/swift/test/Ice/info/Server.swift index 3863ab33b1b..d138ea4e774 100644 --- a/swift/test/Ice/info/Server.swift +++ b/swift/test/Ice/info/Server.swift @@ -7,7 +7,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let communicator = try initialize(args) defer { communicator.destroy() diff --git a/swift/test/Ice/inheritance/Client.swift b/swift/test/Ice/inheritance/Client.swift index 48b4d34ba85..d02ff398b9a 100644 --- a/swift/test/Ice/inheritance/Client.swift +++ b/swift/test/Ice/inheritance/Client.swift @@ -7,7 +7,7 @@ import PromiseKit import TestCommon public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let communicator = try initialize(args) defer { communicator.destroy() diff --git a/swift/test/Ice/inheritance/Collocated.swift b/swift/test/Ice/inheritance/Collocated.swift index 4098d59c287..23d9a14340a 100644 --- a/swift/test/Ice/inheritance/Collocated.swift +++ b/swift/test/Ice/inheritance/Collocated.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Collocated: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let communicator = try initialize(args) defer { communicator.destroy() diff --git a/swift/test/Ice/inheritance/Server.swift b/swift/test/Ice/inheritance/Server.swift index dc471283182..a7fdf7e4e9f 100644 --- a/swift/test/Ice/inheritance/Server.swift +++ b/swift/test/Ice/inheritance/Server.swift @@ -7,7 +7,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let communicator = try initialize(args) defer { communicator.destroy() diff --git a/swift/test/Ice/interceptor/Client.swift b/swift/test/Ice/interceptor/Client.swift index cfc14d06400..95df46ebdb0 100644 --- a/swift/test/Ice/interceptor/Client.swift +++ b/swift/test/Ice/interceptor/Client.swift @@ -34,8 +34,8 @@ class InterceptorI: Disp { do { if let p = try servantDisp.dispatch(request: request, current: current) { guard let error = p.error, - let errorType = error as? InterceptorError, - errorType == .retry + let errorType = error as? InterceptorError, + errorType == .retry else { fatalError("Expected an error") } @@ -231,7 +231,7 @@ public class Client: TestHelperI { } } - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.Warn.Dispatch", value: "0") let communicator = try initialize(properties) @@ -241,7 +241,7 @@ public class Client: TestHelperI { communicator.getProperties().setProperty(key: "MyOA.AdapterId", value: "myOA") let oa = try communicator.createObjectAdapterWithEndpoints(name: "MyOA2", endpoints: "tcp -h localhost") let interceptor = InterceptorI(MyObjectDisp(MyObjectI())) - var prx = uncheckedCast(prx: try oa.addWithUUID(interceptor), type: MyObjectPrx.self) + var prx = try uncheckedCast(prx: oa.addWithUUID(interceptor), type: MyObjectPrx.self) let out = getWriter() out.writeLine("Collocation optimization on") diff --git a/swift/test/Ice/invoke/Client.swift b/swift/test/Ice/invoke/Client.swift index 3fa999ddd18..93f0ecbf0f8 100644 --- a/swift/test/Ice/invoke/Client.swift +++ b/swift/test/Ice/invoke/Client.swift @@ -7,7 +7,7 @@ import PromiseKit import TestCommon public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) var initData = Ice.InitializationData() initData.properties = properties diff --git a/swift/test/Ice/invoke/Server.swift b/swift/test/Ice/invoke/Server.swift index e2f93e303e1..798e25bbdeb 100644 --- a/swift/test/Ice/invoke/Server.swift +++ b/swift/test/Ice/invoke/Server.swift @@ -27,7 +27,7 @@ class ServantLocatorI: Ice.ServantLocator { } class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let async = args.contains("--async") let properties = try createTestProperties(args) diff --git a/swift/test/Ice/location/Client.swift b/swift/test/Ice/location/Client.swift index 01c6d81a178..38dc39fe481 100644 --- a/swift/test/Ice/location/Client.swift +++ b/swift/test/Ice/location/Client.swift @@ -7,7 +7,7 @@ import PromiseKit import TestCommon public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.Default.Locator", value: "locator:\(getTestEndpoint(properties: properties, num: 0))") diff --git a/swift/test/Ice/location/Server.swift b/swift/test/Ice/location/Server.swift index 4bb468638db..32d88240d97 100644 --- a/swift/test/Ice/location/Server.swift +++ b/swift/test/Ice/location/Server.swift @@ -7,7 +7,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { // // Register the server manager. The server manager creates a new // 'server'(a server isn't a different process, it's just a new diff --git a/swift/test/Ice/objects/Client.swift b/swift/test/Ice/objects/Client.swift index bb07508e60d..c724008cd88 100644 --- a/swift/test/Ice/objects/Client.swift +++ b/swift/test/Ice/objects/Client.swift @@ -7,7 +7,7 @@ import PromiseKit import TestCommon public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.AcceptClassCycles", value: "1") var initData = InitializationData() diff --git a/swift/test/Ice/objects/Collocated.swift b/swift/test/Ice/objects/Collocated.swift index f2791e7212a..c951d3301db 100644 --- a/swift/test/Ice/objects/Collocated.swift +++ b/swift/test/Ice/objects/Collocated.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Collocated: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.AcceptClassCycles", value: "1") properties.setProperty(key: "Ice.Warn.Dispatch", value: "0") diff --git a/swift/test/Ice/objects/Server.swift b/swift/test/Ice/objects/Server.swift index 3738e7f02aa..dd8342a5df6 100644 --- a/swift/test/Ice/objects/Server.swift +++ b/swift/test/Ice/objects/Server.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.Warn.Dispatch", value: "0") var initData = Ice.InitializationData() diff --git a/swift/test/Ice/objects/TestI.swift b/swift/test/Ice/objects/TestI.swift index 0e87ed1a38a..486a034e200 100644 --- a/swift/test/Ice/objects/TestI.swift +++ b/swift/test/Ice/objects/TestI.swift @@ -6,31 +6,31 @@ import Ice import PromiseKit public class BI: B { - public override func ice_preMarshal() { + override public func ice_preMarshal() { preMarshalInvoked = true } - public override func ice_postUnmarshal() { + override public func ice_postUnmarshal() { postUnmarshalInvoked = true } } public class CI: C { - public override func ice_preMarshal() { + override public func ice_preMarshal() { preMarshalInvoked = true } - public override func ice_postUnmarshal() { + override public func ice_postUnmarshal() { postUnmarshalInvoked = true } } public class DI: D { - public override func ice_preMarshal() { + override public func ice_preMarshal() { preMarshalInvoked = true } - public override func ice_postUnmarshal() { + override public func ice_postUnmarshal() { postUnmarshalInvoked = true } } diff --git a/swift/test/Ice/operations/BatchOneways.swift b/swift/test/Ice/operations/BatchOneways.swift index 699fe698775..5d08ccefa63 100644 --- a/swift/test/Ice/operations/BatchOneways.swift +++ b/swift/test/Ice/operations/BatchOneways.swift @@ -73,8 +73,8 @@ func batchOneways(_ helper: TestHelper, _ p: MyClassPrx) throws { conn = try p.ice_getConnection() if supportsCompress, - conn != nil, - p.ice_getCommunicator().getProperties().getProperty("Ice.Override.Compress") == "" { + conn != nil, + p.ice_getCommunicator().getProperties().getProperty("Ice.Override.Compress") == "" { let prx = try p.ice_getConnection()!.createProxy(p.ice_getIdentity()).ice_batchOneway() let batchC1 = uncheckedCast(prx: prx.ice_compress(false), type: MyClassPrx.self) diff --git a/swift/test/Ice/operations/Client.swift b/swift/test/Ice/operations/Client.swift index 9ffb1d4b40e..40acd4d752b 100644 --- a/swift/test/Ice/operations/Client.swift +++ b/swift/test/Ice/operations/Client.swift @@ -6,7 +6,7 @@ import Ice import TestCommon public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { var initData = Ice.InitializationData() let properties = try createTestProperties(args) properties.setProperty(key: "Ice.ThreadPool.Client.Size", value: "2") diff --git a/swift/test/Ice/operations/Collocated.swift b/swift/test/Ice/operations/Collocated.swift index 9d53105dd2b..6a69b468255 100644 --- a/swift/test/Ice/operations/Collocated.swift +++ b/swift/test/Ice/operations/Collocated.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Collocated: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.ThreadPool.Client.Size", value: "2") diff --git a/swift/test/Ice/operations/Server.swift b/swift/test/Ice/operations/Server.swift index 2e970c93cbd..cd317c95953 100644 --- a/swift/test/Ice/operations/Server.swift +++ b/swift/test/Ice/operations/Server.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) // // Its possible to have batch oneway requests dispatched diff --git a/swift/test/Ice/operations/ServerAMD.swift b/swift/test/Ice/operations/ServerAMD.swift index c7be8ec7893..b28b8d3e473 100644 --- a/swift/test/Ice/operations/ServerAMD.swift +++ b/swift/test/Ice/operations/ServerAMD.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class ServerAMD: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) // // Its possible to have batch oneway requests dispatched diff --git a/swift/test/Ice/operations/TestAMDI.swift b/swift/test/Ice/operations/TestAMDI.swift index 5db53bd0a4f..a92a95d346d 100644 --- a/swift/test/Ice/operations/TestAMDI.swift +++ b/swift/test/Ice/operations/TestAMDI.swift @@ -101,11 +101,11 @@ class MyDerivedClassI: ObjectI, MyDerivedClass { } return Promise { seal in do { - seal.fulfill( - (try uncheckedCast(prx: adapter.createProxy(current.id), type: MyClassPrx.self), + try seal.fulfill( + (uncheckedCast(prx: adapter.createProxy(current.id), type: MyClassPrx.self), p1, - try uncheckedCast(prx: adapter.createProxy(Ice.stringToIdentity("noSuchIdentity")), - type: MyClassPrx.self))) + uncheckedCast(prx: adapter.createProxy(Ice.stringToIdentity("noSuchIdentity")), + type: MyClassPrx.self))) } catch { seal.reject(error) } @@ -434,29 +434,29 @@ class MyDerivedClassI: ObjectI, MyDerivedClass { return opStringLiteralsAsync(current: current) } - func opMStruct1Async(current: Current) -> Promise { + func opMStruct1Async(current _: Current) -> Promise { var s = Structure() s.e = .enum1 return Promise.value(s) } - func opMStruct2Async(p1: Structure, current: Current) -> Promise<(returnValue: Structure, p2: Structure)> { + func opMStruct2Async(p1: Structure, current _: Current) -> Promise<(returnValue: Structure, p2: Structure)> { return Promise.value((p1, p1)) } - func opMSeq1Async(current: Current) -> Promise { + func opMSeq1Async(current _: Current) -> Promise { return Promise.value([]) } - func opMSeq2Async(p1: StringS, current: Current) -> Promise<(returnValue: StringS, p2: StringS)> { + func opMSeq2Async(p1: StringS, current _: Current) -> Promise<(returnValue: StringS, p2: StringS)> { return Promise.value((p1, p1)) } - func opMDict1Async(current: Current) -> Promise { + func opMDict1Async(current _: Current) -> Promise { return Promise.value([:]) } - func opMDict2Async(p1: StringStringD, current: Current) -> + func opMDict2Async(p1: StringStringD, current _: Current) -> Promise<(returnValue: StringStringD, p2: StringStringD)> { return Promise.value((p1, p1)) } diff --git a/swift/test/Ice/operations/TestI.swift b/swift/test/Ice/operations/TestI.swift index effd0ad8b2b..ea6665d975c 100644 --- a/swift/test/Ice/operations/TestI.swift +++ b/swift/test/Ice/operations/TestI.swift @@ -110,9 +110,9 @@ class MyDerivedClassI: ObjectI, MyDerivedClass { guard let adapter = current.adapter else { fatalError() } - return (try uncheckedCast(prx: adapter.createProxy(current.id), type: MyClassPrx.self), - p1, - try uncheckedCast(prx: adapter.createProxy(Ice.stringToIdentity("noSuchIdentity")), + return try (uncheckedCast(prx: adapter.createProxy(current.id), type: MyClassPrx.self), + p1, + uncheckedCast(prx: adapter.createProxy(Ice.stringToIdentity("noSuchIdentity")), type: MyClassPrx.self)) } @@ -405,29 +405,29 @@ class MyDerivedClassI: ObjectI, MyDerivedClass { return try opStringLiterals(current: current) } - func opMStruct1(current: Current) throws -> Structure { + func opMStruct1(current _: Current) throws -> Structure { var s = Structure() s.e = .enum1 return s } - func opMStruct2(p1: Structure, current: Current) throws -> (returnValue: Structure, p2: Structure) { + func opMStruct2(p1: Structure, current _: Current) throws -> (returnValue: Structure, p2: Structure) { return (p1, p1) } - func opMSeq1(current: Current) throws -> StringS { + func opMSeq1(current _: Current) throws -> StringS { return [] } - func opMSeq2(p1: StringS, current: Current) throws -> (returnValue: StringS, p2: StringS) { + func opMSeq2(p1: StringS, current _: Current) throws -> (returnValue: StringS, p2: StringS) { return (p1, p1) } - func opMDict1(current: Current) throws -> StringStringD { + func opMDict1(current _: Current) throws -> StringStringD { return [:] } - func opMDict2(p1: StringStringD, current: Current) throws -> (returnValue: StringStringD, p2: StringStringD) { + func opMDict2(p1: StringStringD, current _: Current) throws -> (returnValue: StringStringD, p2: StringStringD) { return (p1, p1) } } diff --git a/swift/test/Ice/operations/Twoways.swift b/swift/test/Ice/operations/Twoways.swift index 88efed4dfdf..4c31e7cefb5 100644 --- a/swift/test/Ice/operations/Twoways.swift +++ b/swift/test/Ice/operations/Twoways.swift @@ -238,7 +238,7 @@ func twoways(_ helper: TestHelper, _ p: MyClassPrx) throws { do { let bsi1: [Bool] = [true, true, false] - let bsi2: [Bool] = [false] + let bsi2 = [false] let (rso, bso) = try p.opBoolS(p1: bsi1, p2: bsi2) try test(bso.count == 4) @@ -454,13 +454,13 @@ func twoways(_ helper: TestHelper, _ p: MyClassPrx) throws { } do { - let s11: [String] = ["abc"] + let s11 = ["abc"] let s12: [String] = ["de", "fghi"] let ssi1 = [s11, s12] let s21: [String] = [] let s22: [String] = [] - let s23: [String] = ["xyz"] + let s23 = ["xyz"] let ssi2 = [s21, s22, s23] let (rso, sso) = try p.opStringSS(p1: ssi1, p2: ssi2) @@ -1094,7 +1094,7 @@ func twoways(_ helper: TestHelper, _ p: MyClassPrx) throws { let lengths: [Int32] = [0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000] for l in 0 ..< lengths.count { - var s: [Int32] = [Int32]() + var s = [Int32]() for i in 0 ..< lengths[l] { s.append(i) } diff --git a/swift/test/Ice/optional/Client.swift b/swift/test/Ice/optional/Client.swift index 0abdd0b94d3..a06adece62a 100644 --- a/swift/test/Ice/optional/Client.swift +++ b/swift/test/Ice/optional/Client.swift @@ -6,7 +6,7 @@ import Ice import TestCommon public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) var initData = Ice.InitializationData() initData.properties = properties diff --git a/swift/test/Ice/optional/Server.swift b/swift/test/Ice/optional/Server.swift index 259e6170c4f..7d6220eb6d7 100644 --- a/swift/test/Ice/optional/Server.swift +++ b/swift/test/Ice/optional/Server.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.AcceptClassCycles", value: "1") var initData = Ice.InitializationData() diff --git a/swift/test/Ice/optional/ServerAMD.swift b/swift/test/Ice/optional/ServerAMD.swift index ffe514119ef..02f574056f7 100644 --- a/swift/test/Ice/optional/ServerAMD.swift +++ b/swift/test/Ice/optional/ServerAMD.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class ServerAMD: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.AcceptClassCycles", value: "1") var initData = Ice.InitializationData() diff --git a/swift/test/Ice/properties/Client.swift b/swift/test/Ice/properties/Client.swift index 1d81b726ec3..54ac7acd24d 100644 --- a/swift/test/Ice/properties/Client.swift +++ b/swift/test/Ice/properties/Client.swift @@ -6,7 +6,7 @@ import Ice import TestCommon public class Client: TestHelperI { - public override func run(args _: [String]) throws { + override public func run(args _: [String]) throws { let output = getWriter() output.write("testing load properties exception... ") diff --git a/swift/test/Ice/proxy/AllTests.swift b/swift/test/Ice/proxy/AllTests.swift index ef8d731b31a..556c68a685e 100644 --- a/swift/test/Ice/proxy/AllTests.swift +++ b/swift/test/Ice/proxy/AllTests.swift @@ -610,10 +610,10 @@ public func allTests(_ helper: TestHelper) throws -> MyClassPrx { try test(compObj!.ice_timeout(10).ice_getTimeout() == 10) try test(compObj!.ice_timeout(20).ice_getTimeout() == 20) - let loc1 = uncheckedCast(prx: try communicator.stringToProxy("loc1:default -p 10000")!, - type: Ice.LocatorPrx.self) - let loc2 = uncheckedCast(prx: try communicator.stringToProxy("loc2:default -p 10000")!, - type: Ice.LocatorPrx.self) + let loc1 = try uncheckedCast(prx: communicator.stringToProxy("loc1:default -p 10000")!, + type: Ice.LocatorPrx.self) + let loc2 = try uncheckedCast(prx: communicator.stringToProxy("loc2:default -p 10000")!, + type: Ice.LocatorPrx.self) try test(compObj!.ice_locator(nil) == compObj!.ice_locator(nil)) try test(compObj!.ice_locator(loc1) == compObj!.ice_locator(loc1)) @@ -621,10 +621,10 @@ public func allTests(_ helper: TestHelper) throws -> MyClassPrx { try test(compObj!.ice_locator(nil) != compObj!.ice_locator(loc2)) try test(compObj!.ice_locator(loc1) != compObj!.ice_locator(loc2)) - let rtr1 = uncheckedCast(prx: try communicator.stringToProxy("rtr1:default -p 10000")!, - type: Ice.RouterPrx.self) - let rtr2 = uncheckedCast(prx: try communicator.stringToProxy("rtr2:default -p 10000")!, - type: Ice.RouterPrx.self) + let rtr1 = try uncheckedCast(prx: communicator.stringToProxy("rtr1:default -p 10000")!, + type: Ice.RouterPrx.self) + let rtr2 = try uncheckedCast(prx: communicator.stringToProxy("rtr2:default -p 10000")!, + type: Ice.RouterPrx.self) try test(compObj!.ice_router(nil) == compObj!.ice_router(nil)) try test(compObj!.ice_router(rtr1) == compObj!.ice_router(rtr1)) diff --git a/swift/test/Ice/proxy/Client.swift b/swift/test/Ice/proxy/Client.swift index c9c20481403..1a95808ab6e 100644 --- a/swift/test/Ice/proxy/Client.swift +++ b/swift/test/Ice/proxy/Client.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { do { let communicator = try initialize(args) defer { diff --git a/swift/test/Ice/proxy/Collocated.swift b/swift/test/Ice/proxy/Collocated.swift index f5c74c3d8ea..c88c330d16e 100644 --- a/swift/test/Ice/proxy/Collocated.swift +++ b/swift/test/Ice/proxy/Collocated.swift @@ -7,7 +7,7 @@ import PromiseKit import TestCommon class Collocated: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.ThreadPool.Client.Size", value: "2") properties.setProperty(key: "Ice.ThreadPool.Client.SizeWarn", value: "0") diff --git a/swift/test/Ice/proxy/Server.swift b/swift/test/Ice/proxy/Server.swift index f1da3ffef74..140d98d17cc 100644 --- a/swift/test/Ice/proxy/Server.swift +++ b/swift/test/Ice/proxy/Server.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) // // We don't want connection warnings because of the timeout test. diff --git a/swift/test/Ice/proxy/ServerAMD.swift b/swift/test/Ice/proxy/ServerAMD.swift index 33547e1bf21..16e8be152a2 100644 --- a/swift/test/Ice/proxy/ServerAMD.swift +++ b/swift/test/Ice/proxy/ServerAMD.swift @@ -7,7 +7,7 @@ import PromiseKit import TestCommon class ServerAMD: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) // // We don't want connection warnings because of the timeout test. diff --git a/swift/test/Ice/retry/Client.swift b/swift/test/Ice/retry/Client.swift index 8cad79667c7..2afba42f090 100644 --- a/swift/test/Ice/retry/Client.swift +++ b/swift/test/Ice/retry/Client.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { do { var properties = try createTestProperties(args) properties.setProperty(key: "Ice.RetryIntervals", value: "0 1 10 1") @@ -27,14 +27,14 @@ class Client: TestHelperI { // properties = communicator.getProperties().clone() properties.setProperty(key: "Ice.RetryIntervals", value: "0 1 10000") - let communicator2 = try self.initialize(properties) + let communicator2 = try initialize(properties) defer { communicator2.destroy() } let r = try allTests(helper: self, communicator2: communicator2, - ref: "retry:\(self.getTestEndpoint(num: 0))") + ref: "retry:\(getTestEndpoint(num: 0))") try r.shutdown() } } diff --git a/swift/test/Ice/retry/Collocated.swift b/swift/test/Ice/retry/Collocated.swift index ce1f6cca75d..3c819c622a8 100644 --- a/swift/test/Ice/retry/Collocated.swift +++ b/swift/test/Ice/retry/Collocated.swift @@ -7,7 +7,7 @@ import PromiseKit import TestCommon class Collocated: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { var properties = try createTestProperties(args) properties.setProperty(key: "Ice.RetryIntervals", value: "0 1 10 1") @@ -31,7 +31,7 @@ class Collocated: TestHelperI { // properties = communicator.getProperties().clone() properties.setProperty(key: "Ice.RetryIntervals", value: "0 1 10000") - let communicator2 = try self.initialize(properties) + let communicator2 = try initialize(properties) defer { communicator2.destroy() } diff --git a/swift/test/Ice/retry/Server.swift b/swift/test/Ice/retry/Server.swift index d9a3e45a12d..a1af9e8dcfa 100644 --- a/swift/test/Ice/retry/Server.swift +++ b/swift/test/Ice/retry/Server.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.Warn.Dispatch", value: "0") properties.setProperty(key: "Ice.Warn.Connections", value: "0") diff --git a/swift/test/Ice/scope/Client.swift b/swift/test/Ice/scope/Client.swift index 3e88b2c4cab..82601b8b0a2 100644 --- a/swift/test/Ice/scope/Client.swift +++ b/swift/test/Ice/scope/Client.swift @@ -6,7 +6,7 @@ import Ice import TestCommon public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { var initData = Ice.InitializationData() initData.properties = try createTestProperties(args) initData.classResolverPrefix = ["IceScope"] diff --git a/swift/test/Ice/scope/Server.swift b/swift/test/Ice/scope/Server.swift index 36f9b40eb04..588ef4c3031 100644 --- a/swift/test/Ice/scope/Server.swift +++ b/swift/test/Ice/scope/Server.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { var initData = Ice.InitializationData() initData.properties = try createTestProperties(args) initData.classResolverPrefix = ["IceScope"] diff --git a/swift/test/Ice/scope/TestI.swift b/swift/test/Ice/scope/TestI.swift index 57f61391a4e..7617f33afb0 100644 --- a/swift/test/Ice/scope/TestI.swift +++ b/swift/test/Ice/scope/TestI.swift @@ -31,23 +31,23 @@ class I1: I { return (c1, c1) } - func opE1(E1: E1, current: Current) throws -> E1 { + func opE1(E1: E1, current _: Current) throws -> E1 { return E1 } - func opS1(S1: S1, current: Current) throws -> S1 { + func opS1(S1: S1, current _: Current) throws -> S1 { return S1 } - func opC1(C1: C1?, current: Current) throws -> C1? { + func opC1(C1: C1?, current _: Current) throws -> C1? { return C1 } - func opS1Seq(S1Seq: S1Seq, current: Current) throws -> S1Seq { + func opS1Seq(S1Seq: S1Seq, current _: Current) throws -> S1Seq { return S1Seq } - func opS1Map(S1Map: S1Map, current: Current) throws -> S1Map { + func opS1Map(S1Map: S1Map, current _: Current) throws -> S1Map { return S1Map } diff --git a/swift/test/Ice/servantLocator/Client.swift b/swift/test/Ice/servantLocator/Client.swift index a982c357d82..f0c71b64844 100644 --- a/swift/test/Ice/servantLocator/Client.swift +++ b/swift/test/Ice/servantLocator/Client.swift @@ -6,7 +6,7 @@ import Ice import TestCommon public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { var initData = Ice.InitializationData() initData.properties = try createTestProperties(args) initData.classResolverPrefix = ["IceServantLocator"] diff --git a/swift/test/Ice/servantLocator/Collocated.swift b/swift/test/Ice/servantLocator/Collocated.swift index 39fb23a9417..2d51cd2765a 100644 --- a/swift/test/Ice/servantLocator/Collocated.swift +++ b/swift/test/Ice/servantLocator/Collocated.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Collocated: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { var initData = Ice.InitializationData() initData.properties = try createTestProperties(args) initData.classResolverPrefix = ["IceServantLocator"] diff --git a/swift/test/Ice/servantLocator/Server.swift b/swift/test/Ice/servantLocator/Server.swift index d1b4e9780d5..9239623c074 100644 --- a/swift/test/Ice/servantLocator/Server.swift +++ b/swift/test/Ice/servantLocator/Server.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { var initData = Ice.InitializationData() initData.properties = try createTestProperties(args) initData.classResolverPrefix = ["IceServantLocator"] diff --git a/swift/test/Ice/servantLocator/ServerAMD.swift b/swift/test/Ice/servantLocator/ServerAMD.swift index 67ac190048e..d533975de39 100644 --- a/swift/test/Ice/servantLocator/ServerAMD.swift +++ b/swift/test/Ice/servantLocator/ServerAMD.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class ServerAMD: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { var initData = Ice.InitializationData() initData.properties = try createTestProperties(args) initData.classResolverPrefix = ["IceServantLocator"] diff --git a/swift/test/Ice/services/Client.swift b/swift/test/Ice/services/Client.swift index c3efe618e53..261cd730fb4 100644 --- a/swift/test/Ice/services/Client.swift +++ b/swift/test/Ice/services/Client.swift @@ -9,7 +9,7 @@ import IceStorm import TestCommon public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { var initData = Ice.InitializationData() initData.properties = try createTestProperties(args) let communicator = try initialize(initData) @@ -20,8 +20,8 @@ public class Client: TestHelperI { do { out.write("Testing Glacier2 stub... ") - let router = uncheckedCast(prx: try communicator.stringToProxy("test:\(getTestEndpoint(num: 0))")!, - type: Glacier2.RouterPrx.self) + let router = try uncheckedCast(prx: communicator.stringToProxy("test:\(getTestEndpoint(num: 0))")!, + type: Glacier2.RouterPrx.self) do { _ = try router.createSession(userId: "foo", password: "bar") try test(false) @@ -33,8 +33,8 @@ public class Client: TestHelperI { do { out.write("Testing IceStorm stub... ") - let manager = uncheckedCast(prx: try communicator.stringToProxy("test:\(getTestEndpoint(num: 0))")!, - type: TopicManagerPrx.self) + let manager = try uncheckedCast(prx: communicator.stringToProxy("test:\(getTestEndpoint(num: 0))")!, + type: TopicManagerPrx.self) let topicName = "time" var topic: TopicPrx? @@ -55,8 +55,8 @@ public class Client: TestHelperI { do { out.write("Testing IceGrid stub... ") - let registry = uncheckedCast(prx: try communicator.stringToProxy("test:\(getTestEndpoint(num: 0))")!, - type: RegistryPrx.self) + let registry = try uncheckedCast(prx: communicator.stringToProxy("test:\(getTestEndpoint(num: 0))")!, + type: RegistryPrx.self) var session: AdminSessionPrx? do { diff --git a/swift/test/Ice/slicing/exceptions/Client.swift b/swift/test/Ice/slicing/exceptions/Client.swift index 2c371b8bc10..7ae8becaeeb 100644 --- a/swift/test/Ice/slicing/exceptions/Client.swift +++ b/swift/test/Ice/slicing/exceptions/Client.swift @@ -7,7 +7,7 @@ import PromiseKit import TestCommon public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { var initData = Ice.InitializationData() initData.properties = try createTestProperties(args) initData.classResolverPrefix = ["IceSlicingExceptions", "IceSlicingExceptionsClient"] diff --git a/swift/test/Ice/slicing/exceptions/Server.swift b/swift/test/Ice/slicing/exceptions/Server.swift index b66b44fca47..e6872e73300 100644 --- a/swift/test/Ice/slicing/exceptions/Server.swift +++ b/swift/test/Ice/slicing/exceptions/Server.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.Warn.Dispatch", value: "0") var initData = InitializationData() diff --git a/swift/test/Ice/slicing/exceptions/ServerAMD.swift b/swift/test/Ice/slicing/exceptions/ServerAMD.swift index 04991fe5177..ba92f2b4bdb 100644 --- a/swift/test/Ice/slicing/exceptions/ServerAMD.swift +++ b/swift/test/Ice/slicing/exceptions/ServerAMD.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class ServerAMD: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.Warn.Dispatch", value: "0") var initData = InitializationData() diff --git a/swift/test/Ice/slicing/objects/Client.swift b/swift/test/Ice/slicing/objects/Client.swift index 203d07afabb..32ab43b5414 100644 --- a/swift/test/Ice/slicing/objects/Client.swift +++ b/swift/test/Ice/slicing/objects/Client.swift @@ -33,7 +33,7 @@ class PNodeI: PNode { } public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.AcceptClassCycles", value: "1") var initData = InitializationData() diff --git a/swift/test/Ice/slicing/objects/Server.swift b/swift/test/Ice/slicing/objects/Server.swift index 8d89d0bc01f..4103737737b 100644 --- a/swift/test/Ice/slicing/objects/Server.swift +++ b/swift/test/Ice/slicing/objects/Server.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.AcceptClassCycles", value: "1") properties.setProperty(key: "Ice.Warn.Dispatch", value: "0") diff --git a/swift/test/Ice/slicing/objects/ServerAMD.swift b/swift/test/Ice/slicing/objects/ServerAMD.swift index d9d87fad95e..f7cbdae39c5 100644 --- a/swift/test/Ice/slicing/objects/ServerAMD.swift +++ b/swift/test/Ice/slicing/objects/ServerAMD.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class ServerAMD: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let properties = try createTestProperties(args) properties.setProperty(key: "Ice.AcceptClassCycles", value: "1") properties.setProperty(key: "Ice.Warn.Dispatch", value: "0") diff --git a/swift/test/Ice/stream/Client.swift b/swift/test/Ice/stream/Client.swift index 0c64ac89458..162c2935696 100644 --- a/swift/test/Ice/stream/Client.swift +++ b/swift/test/Ice/stream/Client.swift @@ -7,7 +7,7 @@ import Ice import TestCommon public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let writer = getWriter() writer.write("testing primitive types... ") @@ -154,8 +154,8 @@ public class Client: TestHelperI { s.d = 6.0 s.str = "7" s.e = MyEnum.enum2 - s.p = uncheckedCast(prx: try communicator.stringToProxy("test:default")!, - type: MyInterfacePrx.self) + s.p = try uncheckedCast(prx: communicator.stringToProxy("test:default")!, + type: MyInterfacePrx.self) outS.write(s) let data = outS.finished() inS = Ice.InputStream(communicator: communicator, bytes: data) @@ -393,8 +393,8 @@ public class Client: TestHelperI { smallStructArray[i].d = 6.0 smallStructArray[i].str = "7" smallStructArray[i].e = MyEnum.enum2 - smallStructArray[i].p = uncheckedCast(prx: try communicator.stringToProxy("test:default")!, - type: MyInterfacePrx.self) + smallStructArray[i].p = try uncheckedCast(prx: communicator.stringToProxy("test:default")!, + type: MyInterfacePrx.self) } var myClassArray = [MyClass]() diff --git a/swift/test/Ice/timeout/Client.swift b/swift/test/Ice/timeout/Client.swift index 94a5ffc4a64..a0d1506b752 100644 --- a/swift/test/Ice/timeout/Client.swift +++ b/swift/test/Ice/timeout/Client.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { do { let communicator = try initialize(args) defer { diff --git a/swift/test/Ice/timeout/Server.swift b/swift/test/Ice/timeout/Server.swift index d5ee3b48fca..4e7b99083f4 100644 --- a/swift/test/Ice/timeout/Server.swift +++ b/swift/test/Ice/timeout/Server.swift @@ -6,8 +6,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { - + override public func run(args: [String]) throws { let properties = try createTestProperties(args) // diff --git a/swift/test/Ice/timeout/TestI.swift b/swift/test/Ice/timeout/TestI.swift index d5732c8f9c5..5aca78f8ff0 100644 --- a/swift/test/Ice/timeout/TestI.swift +++ b/swift/test/Ice/timeout/TestI.swift @@ -1,5 +1,6 @@ // import Foundation + // Copyright (c) ZeroC, Inc. All rights reserved. // import Ice diff --git a/swift/test/Ice/udp/Client.swift b/swift/test/Ice/udp/Client.swift index 5e013b65422..242ab049904 100644 --- a/swift/test/Ice/udp/Client.swift +++ b/swift/test/Ice/udp/Client.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { do { var restArgs = args let properties = try createTestProperties(&restArgs) diff --git a/swift/test/Ice/udp/Server.swift b/swift/test/Ice/udp/Server.swift index e2f72e0e55e..1eb2d08a6e7 100644 --- a/swift/test/Ice/udp/Server.swift +++ b/swift/test/Ice/udp/Server.swift @@ -6,7 +6,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { var restArgs = args let properties = try createTestProperties(&restArgs) properties.setProperty(key: "Ice.Warn.Connections", value: "0") @@ -31,7 +31,7 @@ class Server: TestHelperI { try adapter2.activate() } - var endpoint: String = "" + var endpoint = "" // // Use loopback to prevent other machines to answer. // diff --git a/swift/test/IceSSL/configuration/Client.swift b/swift/test/IceSSL/configuration/Client.swift index 7616dd195bb..9fe3a37e8f8 100644 --- a/swift/test/IceSSL/configuration/Client.swift +++ b/swift/test/IceSSL/configuration/Client.swift @@ -7,7 +7,7 @@ import Ice import TestCommon class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { do { let communicator = try initialize(args) defer { diff --git a/swift/test/IceSSL/configuration/Server.swift b/swift/test/IceSSL/configuration/Server.swift index 9caddca705a..2078b8e4906 100644 --- a/swift/test/IceSSL/configuration/Server.swift +++ b/swift/test/IceSSL/configuration/Server.swift @@ -7,7 +7,7 @@ import Ice import TestCommon class Server: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let communicator = try initialize(args) defer { communicator.destroy() diff --git a/swift/test/Slice/escape/Client.swift b/swift/test/Slice/escape/Client.swift index c119d0fbfc5..18b9881ae0a 100644 --- a/swift/test/Slice/escape/Client.swift +++ b/swift/test/Slice/escape/Client.swift @@ -25,7 +25,7 @@ class doI: `do` { } public class Client: TestHelperI { - public override func run(args: [String]) throws { + override public func run(args: [String]) throws { let communicator = try initialize(args) defer { communicator.destroy() @@ -46,19 +46,19 @@ public class Client: TestHelperI { out.write("testing types... ") let e: `continue` = .let - var g: `guard` = `guard`() + var g = `guard`() g.default = 0 - var d: `defer` = `defer`() + var d = `defer`() d.else = "else" - let c: `switch` = `switch`() + let c = `switch`() c.if = 0 c.export = nil c.volatile = 0 try test(c.if == 0) - let ss: `fileprivate` = `fileprivate`(repeating: g, count: 1) + let ss = `fileprivate`(repeating: g, count: 1) let dd: `for` = ["g": g] try test(dd.count == ss.count) diff --git a/swift/test/TestDriver/iOS/ViewController.swift b/swift/test/TestDriver/iOS/ViewController.swift index 3493bb98beb..d23bbeaa998 100644 --- a/swift/test/TestDriver/iOS/ViewController.swift +++ b/swift/test/TestDriver/iOS/ViewController.swift @@ -27,7 +27,7 @@ class ViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDele if getifaddrs(&ifap) == 0 { for curr in sequence(first: ifap!, next: { $0.pointee.ifa_next }) { if (curr.pointee.ifa_flags & UInt32(IFF_UP)) != 0, - (curr.pointee.ifa_flags & UInt32(IFF_LOOPBACK)) == 0 { + (curr.pointee.ifa_flags & UInt32(IFF_LOOPBACK)) == 0 { if curr.pointee.ifa_addr!.pointee.sa_family == UInt32(AF_INET) { var buf = [Int8](repeating: 0, count: Int(INET_ADDRSTRLEN)) curr.pointee.ifa_addr!.withMemoryRebound(to: sockaddr_in.self, capacity: 1) { addr in