[
https://issues.apache.org/jira/browse/KNOX-3162?focusedWorklogId=976967&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-976967
]
ASF GitHub Bot logged work on KNOX-3162:
----------------------------------------
Author: ASF GitHub Bot
Created on: 30/Jul/25 14:25
Start Date: 30/Jul/25 14:25
Worklog Time Spent: 10m
Work Description: hanicz commented on code in PR #1069:
URL: https://github.com/apache/knox/pull/1069#discussion_r2242888393
##########
gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/ZookeeperTokenStateService.java:
##########
@@ -58,14 +62,46 @@ public ZookeeperTokenStateService(GatewayServices
gatewayServices, AliasServiceF
@Override
public void init(GatewayConfig config, Map<String, String> options) throws
ServiceLifecycleException {
log.deprecatedServiceUsage(this.getClass().getCanonicalName());
- final ZookeeperRemoteAliasService zookeeperAliasService =
(ZookeeperRemoteAliasService) aliasServiceFactory.create(gatewayServices,
ALIAS_SERVICE, config, options,
+
+ final Object createdService = aliasServiceFactory.create(gatewayServices,
ALIAS_SERVICE, config, options,
ZookeeperRemoteAliasService.class.getName());
+
+ if (createdService == null) {
+ throw new ServiceLifecycleException("aliasServiceFactory.create()
returned null - cannot create ZookeeperRemoteAliasService");
+ }
+
+ if (!(createdService instanceof ZookeeperRemoteAliasService)) {
+ throw new ServiceLifecycleException("aliasServiceFactory.create()
returned unexpected type: " + createdService.getClass().getName() +
+ ", expected: ZookeeperRemoteAliasService");
+ }
+
+ final ZookeeperRemoteAliasService zookeeperAliasService =
(ZookeeperRemoteAliasService) createdService;
+
+
options.put(ZookeeperRemoteAliasService.OPTION_NAME_SHOULD_CREATE_TOKENS_SUB_NODE,
"true");
options.put(ZookeeperRemoteAliasService.OPTION_NAME_SHOULD_USE_LOCAL_ALIAS,
"false");
- zookeeperAliasService.registerRemoteTokenStateChangeListener(this);
- zookeeperAliasService.init(config, options);
- super.setAliasService(zookeeperAliasService);
- super.init(config, options);
+
+ try {
Review Comment:
These try-catches don't seem to address anything.
Issue Time Tracking
-------------------
Worklog Id: (was: 976967)
Time Spent: 40m (was: 0.5h)
> Build support for JDK 17
> ------------------------
>
> Key: KNOX-3162
> URL: https://issues.apache.org/jira/browse/KNOX-3162
> Project: Apache Knox
> Issue Type: Bug
> Reporter: Sandeep More
> Assignee: Sandeep More
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> KNOX-2923 added support for Knox to run on JDK 17 but Knox currently does not
> compile on JDK 17. This JIRA is to add build support for JDK 17.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)