Skip to content

Commit 6106c1a

Browse files
Copilotadriantuk
andauthored
Fix getApproovInterceptorExtensions to restore backward-compatible return type and null semantics
Agent-Logs-Url: https://github.com/approov/approov-service-retrofit/sessions/b69837c3-e914-4c6a-aa54-baf796cf8043 Co-authored-by: adriantuk <231012838+adriantuk@users.noreply.github.com>
1 parent fe961a4 commit 6106c1a

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

approov-service/src/main/java/io/approov/service/retrofit/ApproovService.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,14 +378,20 @@ public static synchronized ApproovServiceMutator getServiceMutator() {
378378
}
379379

380380
/**
381-
* Gets the interceptor extensions callback handlers.
381+
* Gets the interceptor extensions callback handlers if the active mutator is an
382+
* ApproovInterceptorExtensions instance, or null otherwise.
382383
*
383-
* @return the interceptor extensions callback handlers or null if none set
384+
* @return the interceptor extensions callback handlers, or null if none set or the active
385+
* mutator is not an ApproovInterceptorExtensions
384386
* @deprecated Use getServiceMutator instead
385387
*/
386388
@Deprecated
387-
public static ApproovServiceMutator getApproovInterceptorExtensions() {
388-
return getServiceMutator();
389+
public static ApproovInterceptorExtensions getApproovInterceptorExtensions() {
390+
ApproovServiceMutator mutator = getServiceMutator();
391+
if (mutator instanceof ApproovInterceptorExtensions) {
392+
return (ApproovInterceptorExtensions) mutator;
393+
}
394+
return null;
389395
}
390396

391397
/**

0 commit comments

Comments
 (0)