Skip to content
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

OAK-11486: Add failing test case for session-mapped non-registered #2081

Draft
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

kwin
Copy link
Member

@kwin kwin commented Feb 14, 2025

namespace URIs

@kwin kwin requested a review from reschke February 14, 2025 18:38
Copy link

Commit-Check ✔️

…e URIs lead to unexpected ISE for Node.getName() or Node.getPath()

LocalNameMapper now checks if only a local namespace mapping exists.
…e URIs lead to unexpected ISE for Node.getName() or Node.getPath()

Corrected faulty fix attempt.
@@ -91,9 +91,10 @@ public synchronized String getJcrName(@NotNull String oakName) {
}
}
}
} else {
throw new IllegalStateException("No namespace mapping found for " + oakName);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With that we are back at the same exception as before :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually we are now throwing an exception even earlier (i.e. for the first getName() without any mapping)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was an intermediate version. This current one should hopefully do, except for the problem I mentioned on Jira, which probably is something completely different.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't understand why Session.addNode("foo:bar").getName() wouldn't end up here, because

a) uri is null (there is no namespace URI registered for "foo" neither globally nor locally
b) there is no local namespace mapping for "foo"

This previously didn't lead to an exception. Now it does.

…e URIs lead to unexpected ISE for Node.getName() or Node.getPath()

Fixed handling of local namespace mappings with globally unknown URIs; code cleanup.
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