-
Notifications
You must be signed in to change notification settings - Fork 19
AP-25387: Replaces all usages of deprecated HubItemVersion with ItemVersion #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…ersion AP-25387 (Remove deprecated `HubItemVersion` and its `LinkType`)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR replaces the deprecated HubItemVersion class with the new ItemVersion API throughout the codebase. The change updates version handling for linked components by:
- Migrating from
HubItemVersionandLinkTypeenum to newItemVersionsubclasses (CurrentState,MostRecent,SpecificVersion) - Replacing direct URI manipulation with
URLResolverUtilfor parsing and applying version information - Adding proper URI construction using
URIBuilderwith exception handling
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ChangeComponentHubVersionCommand.java | Updates version change command to use ItemVersion and URLResolverUtil for URI manipulation with error handling |
| ChangeComponentHubVersionDialog.java | Refactors dialog to use ItemVersion subclasses instead of LinkType enum and updates version parsing logic |
| ChangeComponentHubVersionAction.java | Simplifies version retrieval using URLResolverUtil.parseVersion() instead of deprecated HubItemVersion.of() |
| BulkChangeMetaNodeLinksDialog.java | Updates bulk operations to use URLResolverUtil with URIBuilder for version changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| m_commandRegistry.add(changeCommand); | ||
| } | ||
| } catch (URISyntaxException e) { | ||
| LOGGER.error("Unable to construct new URI for component", e); |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message should be more specific about what failed and potentially include context about which component or URI caused the failure. Consider including the component ID or attempted URI in the error message to aid debugging.
| LOGGER.error("Unable to construct new URI for component", e); | |
| LOGGER.error("Unable to construct new URI for component " + m_component.getID() | |
| + " from source URI " + oldUri, e); |
| m_uriTextField.setText(m_selectedLinkURI.toString()); | ||
| m_uriInputViaText = false; | ||
| } catch (URISyntaxException e) { | ||
| LOGGER.error("Unable to construct new URI for component", e); |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message should be more specific about what failed and potentially include context about which URI or version caused the failure. Consider including the attempted URI or version information in the error message to aid debugging.
| LOGGER.error("Unable to construct new URI for component", e); | |
| LOGGER.error( | |
| "Unable to construct new URI for component using base URI \"" + m_selectedLinkURI | |
| + "\" and target version \"" + targetVersion + "\"", | |
| e); |
AP-25387 (Remove deprecated
HubItemVersionand itsLinkType)