You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "reschke (via GitHub)" <gi...@apache.org> on 2025/04/14 13:27:19 UTC
[PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
reschke opened a new pull request, #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229
@kwin - this is a minimal patch which seems to do the right thing.
Could you please review?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke merged PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#issuecomment-2856041227
FWIW, I do not see test failures locally (both Win and WSL).
@mbaedke @kwin - any ideas what could be going on here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#issuecomment-2809311251
please re-check
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#issuecomment-2808730968
On hold; test failures...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#discussion_r2062641247
##########
oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/session/JackrabbitSessionTest.java:
##########
@@ -86,20 +88,39 @@ public void testGetExpandedName() throws RepositoryException {
assertEquals("{}testroot", s.getExpandedName(testRootNode));
Node n = testRootNode.addNode("test:bar");
assertEquals("{http://www.apache.org/jackrabbit/test}bar", s.getExpandedName(n));
- // now remap namespace uri
+ // now remap namespace uri - should not affect expanded name
+ assertEquals("prefix 'test' has unexpected mapping",
+ "http://www.apache.org/jackrabbit/test", s.getNamespaceURI("test"));
s.setNamespacePrefix("test", "urn:foo");
- assertEquals("{urn:foo}bar", s.getExpandedName(n));
+ assertEquals("{http://www.apache.org/jackrabbit/test}bar", s.getExpandedName(n));
// use special namespace uri
n = testRootNode.addNode("rep:bar");
assertEquals("{internal}bar", s.getExpandedName(n));
}
+ public void testGetExpandedNameBrokenNamespace() throws RepositoryException {
+ // empty namespace uri
+ assertEquals("{}testroot", s.getExpandedName(testRootNode));
+
+ // register broken namespace name
+ s.getWorkspace().getNamespaceRegistry().registerNamespace("foo", "bar");
Review Comment:
shouldn't this fail (https://github.com/apache/jackrabbit-oak/blob/4b7c14a6dd4d36d546306503c397d0a1ee627f9e/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistry.java#L74-L75)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#discussion_r2062642735
##########
oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/session/JackrabbitSessionTest.java:
##########
@@ -86,20 +88,39 @@ public void testGetExpandedName() throws RepositoryException {
assertEquals("{}testroot", s.getExpandedName(testRootNode));
Node n = testRootNode.addNode("test:bar");
assertEquals("{http://www.apache.org/jackrabbit/test}bar", s.getExpandedName(n));
- // now remap namespace uri
+ // now remap namespace uri - should not affect expanded name
+ assertEquals("prefix 'test' has unexpected mapping",
+ "http://www.apache.org/jackrabbit/test", s.getNamespaceURI("test"));
s.setNamespacePrefix("test", "urn:foo");
- assertEquals("{urn:foo}bar", s.getExpandedName(n));
+ assertEquals("{http://www.apache.org/jackrabbit/test}bar", s.getExpandedName(n));
// use special namespace uri
n = testRootNode.addNode("rep:bar");
assertEquals("{internal}bar", s.getExpandedName(n));
}
+ public void testGetExpandedNameBrokenNamespace() throws RepositoryException {
+ // empty namespace uri
+ assertEquals("{}testroot", s.getExpandedName(testRootNode));
+
+ // register broken namespace name
+ s.getWorkspace().getNamespaceRegistry().registerNamespace("foo", "bar");
Review Comment:
it actually does fail! Compare with https://github.com/apache/jackrabbit-oak/pull/2229#pullrequestreview-2797655309
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#issuecomment-2858612597
@kwin - I do not see any failures. Please retest.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "mbaedke (via GitHub)" <gi...@apache.org>.
mbaedke commented on PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#issuecomment-2808961936
I'm confused: are the IteratorUtils changes really supposed to be here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#issuecomment-2801715214
# Commit-Check ✔️
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "mbaedke (via GitHub)" <gi...@apache.org>.
mbaedke commented on code in PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#discussion_r2044174658
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/impl/GlobalNameMapper.java:
##########
@@ -143,11 +143,11 @@ public String getExpandedJcrName(@NotNull String oakName) {
int colon = oakName.indexOf(':');
if (colon > 0) {
String oakPrefix = oakName.substring(0, colon);
+ uri = getNamespacesProperty(oakPrefix);
// local mapping must take precedence...
- uri = getSessionLocalMappings().get(oakPrefix);
if (uri == null) {
- // ...over global mappings
- uri = getNamespacesProperty(oakPrefix);
+ // ...over local mappings
+ uri = getSessionLocalMappings().get(oakPrefix);
}
Review Comment:
"local mapping must take precedence over local mapping"?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#discussion_r2062641247
##########
oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/session/JackrabbitSessionTest.java:
##########
@@ -86,20 +88,39 @@ public void testGetExpandedName() throws RepositoryException {
assertEquals("{}testroot", s.getExpandedName(testRootNode));
Node n = testRootNode.addNode("test:bar");
assertEquals("{http://www.apache.org/jackrabbit/test}bar", s.getExpandedName(n));
- // now remap namespace uri
+ // now remap namespace uri - should not affect expanded name
+ assertEquals("prefix 'test' has unexpected mapping",
+ "http://www.apache.org/jackrabbit/test", s.getNamespaceURI("test"));
s.setNamespacePrefix("test", "urn:foo");
- assertEquals("{urn:foo}bar", s.getExpandedName(n));
+ assertEquals("{http://www.apache.org/jackrabbit/test}bar", s.getExpandedName(n));
// use special namespace uri
n = testRootNode.addNode("rep:bar");
assertEquals("{internal}bar", s.getExpandedName(n));
}
+ public void testGetExpandedNameBrokenNamespace() throws RepositoryException {
+ // empty namespace uri
+ assertEquals("{}testroot", s.getExpandedName(testRootNode));
+
+ // register broken namespace name
+ s.getWorkspace().getNamespaceRegistry().registerNamespace("foo", "bar");
Review Comment:
shouldn't this fail?
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/impl/GlobalNameMapper.java:
##########
@@ -143,17 +146,23 @@ public String getExpandedJcrName(@NotNull String oakName) {
int colon = oakName.indexOf(':');
if (colon > 0) {
String oakPrefix = oakName.substring(0, colon);
- // local mapping must take precedence...
- uri = getSessionLocalMappings().get(oakPrefix);
+ uri = getNamespacesProperty(oakPrefix);
+ // global mapping must take precedence...
if (uri == null) {
- // ...over global mappings
- uri = getNamespacesProperty(oakPrefix);
+ // ...over local mappings
+ uri = getSessionLocalMappings().get(oakPrefix);
}
if (uri == null) {
throw new IllegalStateException(
"No namespace mapping found for " + oakName);
}
localName = oakName.substring(colon + 1);
+ // check namespace name for validity in Oak
+ if (!isValidNamespaceName(uri)) {
+ throw new IllegalStateException(
+ new NamespaceException("Cannot determine expanded name for '" + oakName +
Review Comment:
how can one register an invalid namespace in oak in the first place?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#issuecomment-2833514550
I'll have to check. Give me a few days.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#issuecomment-2802067410
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#issuecomment-2804963867
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#discussion_r2062642735
##########
oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/session/JackrabbitSessionTest.java:
##########
@@ -86,20 +88,39 @@ public void testGetExpandedName() throws RepositoryException {
assertEquals("{}testroot", s.getExpandedName(testRootNode));
Node n = testRootNode.addNode("test:bar");
assertEquals("{http://www.apache.org/jackrabbit/test}bar", s.getExpandedName(n));
- // now remap namespace uri
+ // now remap namespace uri - should not affect expanded name
+ assertEquals("prefix 'test' has unexpected mapping",
+ "http://www.apache.org/jackrabbit/test", s.getNamespaceURI("test"));
s.setNamespacePrefix("test", "urn:foo");
- assertEquals("{urn:foo}bar", s.getExpandedName(n));
+ assertEquals("{http://www.apache.org/jackrabbit/test}bar", s.getExpandedName(n));
// use special namespace uri
n = testRootNode.addNode("rep:bar");
assertEquals("{internal}bar", s.getExpandedName(n));
}
+ public void testGetExpandedNameBrokenNamespace() throws RepositoryException {
+ // empty namespace uri
+ assertEquals("{}testroot", s.getExpandedName(testRootNode));
+
+ // register broken namespace name
+ s.getWorkspace().getNamespaceRegistry().registerNamespace("foo", "bar");
Review Comment:
it actually does fail! Compare with https://github.com/apache/jackrabbit-oak/pull/2229#pullrequestreview-2797655309. I am not sure though if it fails because of the invalid URI or because `foo` is already registered as prefix (exception message is a bit poor).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#discussion_r2062642735
##########
oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/session/JackrabbitSessionTest.java:
##########
@@ -86,20 +88,39 @@ public void testGetExpandedName() throws RepositoryException {
assertEquals("{}testroot", s.getExpandedName(testRootNode));
Node n = testRootNode.addNode("test:bar");
assertEquals("{http://www.apache.org/jackrabbit/test}bar", s.getExpandedName(n));
- // now remap namespace uri
+ // now remap namespace uri - should not affect expanded name
+ assertEquals("prefix 'test' has unexpected mapping",
+ "http://www.apache.org/jackrabbit/test", s.getNamespaceURI("test"));
s.setNamespacePrefix("test", "urn:foo");
- assertEquals("{urn:foo}bar", s.getExpandedName(n));
+ assertEquals("{http://www.apache.org/jackrabbit/test}bar", s.getExpandedName(n));
// use special namespace uri
n = testRootNode.addNode("rep:bar");
assertEquals("{internal}bar", s.getExpandedName(n));
}
+ public void testGetExpandedNameBrokenNamespace() throws RepositoryException {
+ // empty namespace uri
+ assertEquals("{}testroot", s.getExpandedName(testRootNode));
+
+ // register broken namespace name
+ s.getWorkspace().getNamespaceRegistry().registerNamespace("foo", "bar");
Review Comment:
it actually does fail! Compare with https://github.com/apache/jackrabbit-oak/pull/2229#pullrequestreview-2797655309.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#issuecomment-2856043164
Nor failed the Sonar build.
Maybe this just needed re-basing?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on code in PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#discussion_r2062660229
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/impl/GlobalNameMapper.java:
##########
@@ -143,17 +146,23 @@ public String getExpandedJcrName(@NotNull String oakName) {
int colon = oakName.indexOf(':');
if (colon > 0) {
String oakPrefix = oakName.substring(0, colon);
- // local mapping must take precedence...
- uri = getSessionLocalMappings().get(oakPrefix);
+ uri = getNamespacesProperty(oakPrefix);
+ // global mapping must take precedence...
if (uri == null) {
- // ...over global mappings
- uri = getNamespacesProperty(oakPrefix);
+ // ...over local mappings
+ uri = getSessionLocalMappings().get(oakPrefix);
}
if (uri == null) {
throw new IllegalStateException(
"No namespace mapping found for " + oakName);
}
localName = oakName.substring(colon + 1);
+ // check namespace name for validity in Oak
+ if (!isValidNamespaceName(uri)) {
+ throw new IllegalStateException(
+ new NamespaceException("Cannot determine expanded name for '" + oakName +
Review Comment:
Well, it is possible. That's bad, but changing that could be a breaking change. Note that this case already is error-logged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#discussion_r2062661672
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/impl/GlobalNameMapper.java:
##########
@@ -143,17 +146,23 @@ public String getExpandedJcrName(@NotNull String oakName) {
int colon = oakName.indexOf(':');
if (colon > 0) {
String oakPrefix = oakName.substring(0, colon);
- // local mapping must take precedence...
- uri = getSessionLocalMappings().get(oakPrefix);
+ uri = getNamespacesProperty(oakPrefix);
+ // global mapping must take precedence...
if (uri == null) {
- // ...over global mappings
- uri = getNamespacesProperty(oakPrefix);
+ // ...over local mappings
+ uri = getSessionLocalMappings().get(oakPrefix);
}
if (uri == null) {
throw new IllegalStateException(
"No namespace mapping found for " + oakName);
}
localName = oakName.substring(colon + 1);
+ // check namespace name for validity in Oak
+ if (!isValidNamespaceName(uri)) {
+ throw new IllegalStateException(
+ new NamespaceException("Cannot determine expanded name for '" + oakName +
Review Comment:
> Note that this case already is error-logged.
Have you found real use cases of that in life code? Otherwise I would tend to at least optionally toggle the behaviour to throw in case of invalid URI during namespace registration.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#issuecomment-2855560468
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [85.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11657: JackrabbitSession.getExpandedName/Path need to return stable expanded names [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #2229:
URL: https://github.com/apache/jackrabbit-oak/pull/2229#issuecomment-2856469602
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [85.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2229)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org