From 915cd71b4a6aceb8003077e0e360ea7accbde38c Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 17 Dec 2018 17:36:28 -0800 Subject: nullability revert --- src/objective-c/GRPCClient/GRPCCall.h | 32 +++++++++++++++++--------------- src/objective-c/ProtoRPC/ProtoRPC.h | 9 ++++----- src/objective-c/ProtoRPC/ProtoService.h | 33 +++++++++++++++++---------------- 3 files changed, 38 insertions(+), 36 deletions(-) (limited to 'src/objective-c') diff --git a/src/objective-c/GRPCClient/GRPCCall.h b/src/objective-c/GRPCClient/GRPCCall.h index 15b1c90449..6669067fbf 100644 --- a/src/objective-c/GRPCClient/GRPCCall.h +++ b/src/objective-c/GRPCClient/GRPCCall.h @@ -275,6 +275,9 @@ extern NSString *const kGRPCTrailersKey; NS_ASSUME_NONNULL_END +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnullability-completeness" + /** * This interface is deprecated. Please use \a GRPCcall2. * @@ -282,7 +285,7 @@ NS_ASSUME_NONNULL_END */ @interface GRPCCall : GRXWriter -- (nonnull instancetype)init NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; /** * The container of the request headers of an RPC conforms to this protocol, which is a subset of @@ -308,7 +311,7 @@ NS_ASSUME_NONNULL_END * * The property is initialized to an empty NSMutableDictionary. */ -@property(nonnull, atomic, readonly) NSMutableDictionary *requestHeaders; +@property(atomic, readonly) NSMutableDictionary *requestHeaders; /** * This dictionary is populated with the HTTP headers received from the server. This happens before @@ -319,7 +322,7 @@ NS_ASSUME_NONNULL_END * The value of this property is nil until all response headers are received, and will change before * any of -writeValue: or -writesFinishedWithError: are sent to the writeable. */ -@property(nullable, atomic, readonly) NSDictionary *responseHeaders; +@property(atomic, readonly) NSDictionary *responseHeaders; /** * Same as responseHeaders, but populated with the HTTP trailers received from the server before the @@ -328,7 +331,7 @@ NS_ASSUME_NONNULL_END * The value of this property is nil until all response trailers are received, and will change * before -writesFinishedWithError: is sent to the writeable. */ -@property(nullable, atomic, readonly) NSDictionary *responseTrailers; +@property(atomic, readonly) NSDictionary *responseTrailers; /** * The request writer has to write NSData objects into the provided Writeable. The server will @@ -341,9 +344,9 @@ NS_ASSUME_NONNULL_END * host parameter should not contain the scheme (http:// or https://), only the name or IP addr * and the port number, for example @"localhost:5050". */ -- (nullable instancetype)initWithHost:(nonnull NSString *)host - path:(nonnull NSString *)path - requestsWriter:(nonnull GRXWriter *)requestWriter; +- (instancetype)initWithHost:(NSString *)host + path:(NSString *)path + requestsWriter:(GRXWriter *)requestWriter; /** * Finishes the request side of this call, notifies the server that the RPC should be cancelled, and @@ -354,12 +357,10 @@ NS_ASSUME_NONNULL_END /** * The following methods are deprecated. */ -+ (void)setCallSafety:(GRPCCallSafety)callSafety - host:(nonnull NSString *)host - path:(nonnull NSString *)path; -@property(nullable, atomic, copy, readwrite) NSString *serverName; ++ (void)setCallSafety:(GRPCCallSafety)callSafety host:(NSString *)host path:(NSString *)path; +@property(atomic, copy, readwrite) NSString *serverName; @property NSTimeInterval timeout; -- (void)setResponseDispatchQueue:(nonnull dispatch_queue_t)queue; +- (void)setResponseDispatchQueue:(dispatch_queue_t)queue; @end @@ -370,11 +371,11 @@ DEPRECATED_MSG_ATTRIBUTE("Use NSDictionary or NSMutableDictionary instead.") @protocol GRPCRequestHeaders @property(nonatomic, readonly) NSUInteger count; -- (nullable id)objectForKeyedSubscript:(nonnull id)key; -- (void)setObject:(nonnull id)obj forKeyedSubscript:(nonnull id)key; +- (id)objectForKeyedSubscript:(id)key; +- (void)setObject:(id)obj forKeyedSubscript:(id)key; - (void)removeAllObjects; -- (void)removeObjectForKey:(nonnull id)key; +- (void)removeObjectForKey:(id)key; @end #pragma clang diagnostic push @@ -383,3 +384,4 @@ DEPRECATED_MSG_ATTRIBUTE("Use NSDictionary or NSMutableDictionary instead.") @interface NSMutableDictionary (GRPCRequestHeaders) @end #pragma clang diagnostic pop +#pragma clang diagnostic pop diff --git a/src/objective-c/ProtoRPC/ProtoRPC.h b/src/objective-c/ProtoRPC/ProtoRPC.h index e6ba1f66ca..91a50d395a 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.h +++ b/src/objective-c/ProtoRPC/ProtoRPC.h @@ -142,11 +142,10 @@ __attribute__((deprecated("Please use GRPCProtoCall."))) @interface ProtoRPC * addr and the port number, for example @"localhost:5050". */ - - (nullable instancetype)initWithHost : (nonnull NSString *)host method - : (nonnull GRPCProtoMethod *)method requestsWriter - : (nonnull GRXWriter *)requestsWriter responseClass - : (nonnull Class)responseClass responsesWriteable - : (nonnull id)responsesWriteable NS_DESIGNATED_INITIALIZER; + (instancetype)initWithHost : (NSString *)host method + : (GRPCProtoMethod *)method requestsWriter : (GRXWriter *)requestsWriter responseClass + : (Class)responseClass responsesWriteable + : (id)responsesWriteable NS_DESIGNATED_INITIALIZER; - (void)start; @end diff --git a/src/objective-c/ProtoRPC/ProtoService.h b/src/objective-c/ProtoRPC/ProtoService.h index 70423ee9de..d76e96ce2a 100644 --- a/src/objective-c/ProtoRPC/ProtoService.h +++ b/src/objective-c/ProtoRPC/ProtoService.h @@ -27,38 +27,41 @@ @class GRPCStreamingProtoCall; @protocol GRPCProtoResponseCallbacks; -NS_ASSUME_NONNULL_BEGIN +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnullability-completeness" __attribute__((deprecated("Please use GRPCProtoService."))) @interface ProtoService : NSObject - - (nullable instancetype)initWithHost : (NSString *)host packageName - : (NSString *)packageName serviceName : (NSString *)serviceName callOptions + (nullable instancetype)initWithHost : (nonnull NSString *)host packageName + : (nonnull NSString *)packageName serviceName : (nonnull NSString *)serviceName callOptions : (nullable GRPCCallOptions *)callOptions NS_DESIGNATED_INITIALIZER; - (instancetype)initWithHost:(NSString *)host packageName:(NSString *)packageName serviceName:(NSString *)serviceName; -- (nullable GRPCProtoCall *)RPCToMethod:(NSString *)method - requestsWriter:(GRXWriter *)requestsWriter - responseClass:(Class)responseClass - responsesWriteable:(id)responsesWriteable; +- (GRPCProtoCall *)RPCToMethod:(NSString *)method + requestsWriter:(GRXWriter *)requestsWriter + responseClass:(Class)responseClass + responsesWriteable:(id)responsesWriteable; -- (nullable GRPCUnaryProtoCall *)RPCToMethod:(NSString *)method - message:(id)message - responseHandler:(id)handler +- (nullable GRPCUnaryProtoCall *)RPCToMethod:(nonnull NSString *)method + message:(nonnull id)message + responseHandler:(nonnull id)handler callOptions:(nullable GRPCCallOptions *)callOptions - responseClass:(Class)responseClass; + responseClass:(nonnull Class)responseClass; -- (nullable GRPCStreamingProtoCall *)RPCToMethod:(NSString *)method - responseHandler:(id)handler +- (nullable GRPCStreamingProtoCall *)RPCToMethod:(nonnull NSString *)method + responseHandler:(nonnull id)handler callOptions:(nullable GRPCCallOptions *)callOptions - responseClass:(Class)responseClass; + responseClass:(nonnull Class)responseClass; @end +#pragma clang diagnostic pop + /** * This subclass is empty now. Eventually we'll remove ProtoService class * to avoid potential naming conflict @@ -69,5 +72,3 @@ __attribute__((deprecated("Please use GRPCProtoService."))) @interface ProtoServ #pragma clang diagnostic pop @end - - NS_ASSUME_NONNULL_END -- cgit v1.2.3