|
29 | 29 | #import "java/lang/reflect/GenericDeclaration.h" |
30 | 30 | #import "java/lang/reflect/Type.h" |
31 | 31 |
|
| 32 | +#if __has_feature(nullability) |
| 33 | +#pragma clang diagnostic push |
| 34 | +#pragma GCC diagnostic ignored "-Wnullability-completeness" |
| 35 | +#endif |
| 36 | + |
32 | 37 | @class IOSObjectArray; |
33 | 38 | @class JavaLangClassLoader; |
34 | 39 | @class JavaLangReflectConstructor; |
|
45 | 50 | * instances: those representing real classes and interfaces, those |
46 | 51 | * representing primitive types, and those representing array classes. |
47 | 52 | */ |
| 53 | +NS_ASSUME_NONNULL_BEGIN |
48 | 54 | @interface IOSClass : NSObject <JavaLangReflectAnnotatedElement, |
49 | 55 | JavaLangReflectGenericDeclaration, JavaIoSerializable, |
50 | 56 | JavaLangReflectType, NSCopying> { |
|
99 | 105 |
|
100 | 106 | // Class.getMethod(String, Class...) |
101 | 107 | - (JavaLangReflectMethod *)getMethod:(NSString *)name |
102 | | - parameterTypes:(IOSObjectArray *)types; |
| 108 | + parameterTypes:(nullable IOSObjectArray *)types; |
103 | 109 |
|
104 | 110 | // Class.getDeclaredMethod(String, Class...) |
105 | 111 | - (JavaLangReflectMethod *)getDeclaredMethod:(NSString *)name |
106 | | - parameterTypes:(IOSObjectArray *)types; |
| 112 | + parameterTypes:(nullable IOSObjectArray *)types; |
107 | 113 |
|
108 | 114 | // Class.getDeclaredConstructor(Class...) |
109 | | -- (JavaLangReflectConstructor *)getDeclaredConstructor:(IOSObjectArray *)types; |
| 115 | +- (JavaLangReflectConstructor *)getDeclaredConstructor:(nullable IOSObjectArray *)types; |
110 | 116 |
|
111 | 117 | // Class.getConstructor(Class) |
112 | | -- (JavaLangReflectConstructor *)getConstructor:(IOSObjectArray *)types; |
| 118 | +- (JavaLangReflectConstructor *)getConstructor:(nullable IOSObjectArray *)types; |
113 | 119 |
|
114 | 120 | // Class.getConstructors() |
115 | 121 | - (IOSObjectArray *)getConstructors; |
|
130 | 136 | + (IOSClass *)forName:(NSString *)className; |
131 | 137 | + (IOSClass *)forName:(NSString *)className |
132 | 138 | initialize:(jboolean)load |
133 | | - classLoader:(JavaLangClassLoader *)loader; |
| 139 | + classLoader:(nullable JavaLangClassLoader *)loader; |
134 | 140 |
|
135 | 141 | // Class.cast(Object) |
136 | | -- (id)cast:(id)throwable; |
| 142 | +- (id)cast:(nullable id)throwable; |
137 | 143 |
|
138 | 144 | // Class.getEnclosingClass() |
139 | 145 | - (IOSClass *)getEnclosingClass; |
|
154 | 160 | - (IOSObjectArray *)getGenericInterfaces; |
155 | 161 | - (IOSObjectArray *)getTypeParameters; |
156 | 162 |
|
157 | | -- (id<JavaLangAnnotationAnnotation>) |
158 | | - getAnnotationWithIOSClass:(IOSClass *)annotationClass; |
159 | | -- (jboolean)isAnnotationPresentWithIOSClass:(IOSClass *)annotationType; |
| 163 | +- (id<JavaLangAnnotationAnnotation>)getAnnotationWithIOSClass:(nullable IOSClass *)annotationClass; |
| 164 | +- (jboolean)isAnnotationPresentWithIOSClass:(nullable IOSClass *)annotationType; |
160 | 165 | - (IOSObjectArray *)getAnnotations; |
161 | 166 | - (IOSObjectArray *)getDeclaredAnnotations; |
162 | 167 | - (id<JavaLangAnnotationAnnotation>) |
@@ -219,7 +224,7 @@ CF_EXTERN_C_BEGIN |
219 | 224 | IOSClass *IOSClass_forName_(NSString *className); |
220 | 225 | // Class.forName(String, boolean, ClassLoader) |
221 | 226 | IOSClass *IOSClass_forName_initialize_classLoader_( |
222 | | - NSString *className, jboolean load, JavaLangClassLoader *loader); |
| 227 | + NSString *className, jboolean load, JavaLangClassLoader * _Nullable loader); |
223 | 228 |
|
224 | 229 | // Lookup a IOSClass from its associated ObjC class, protocol or component type. |
225 | 230 | IOSClass *IOSClass_fromClass(Class cls); |
@@ -252,4 +257,10 @@ J2OBJC_STATIC_INIT(IOSClass) |
252 | 257 |
|
253 | 258 | J2OBJC_TYPE_LITERAL_HEADER(IOSClass) |
254 | 259 |
|
| 260 | +NS_ASSUME_NONNULL_END |
| 261 | + |
| 262 | +#if __has_feature(nullability) |
| 263 | +#pragma clang diagnostic pop |
| 264 | +#endif |
| 265 | + |
255 | 266 | #endif // _IOSClass_H_ |
0 commit comments