Skip to content

Conversation

@3nol
Copy link
Contributor

@3nol 3nol commented Dec 22, 2025

AP-25387 (Remove deprecated HubItemVersion and its LinkType)

…ersion

AP-25387 (Remove deprecated `HubItemVersion` and its `LinkType`)
@3nol 3nol requested a review from a team as a code owner December 22, 2025 10:00
Copilot AI review requested due to automatic review settings December 22, 2025 10:00
Copy link

Copilot AI left a 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 HubItemVersion and LinkType enum to new ItemVersion subclasses (CurrentState, MostRecent, SpecificVersion)
  • Replacing direct URI manipulation with URLResolverUtil for parsing and applying version information
  • Adding proper URI construction using URIBuilder with 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);
Copy link

Copilot AI Dec 22, 2025

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.

Suggested change
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);

Copilot uses AI. Check for mistakes.
m_uriTextField.setText(m_selectedLinkURI.toString());
m_uriInputViaText = false;
} catch (URISyntaxException e) {
LOGGER.error("Unable to construct new URI for component", e);
Copy link

Copilot AI Dec 22, 2025

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.

Suggested change
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);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants