| commit | fcbb581cac72dc84612d732614bde28d6b64ca3d | [log] [tgz] |
|---|---|---|
| author | Bertrand Delacretaz <bdelacretaz@apache.org> | Wed Jul 20 15:22:53 2016 +0000 |
| committer | Bertrand Delacretaz <bdelacretaz@apache.org> | Wed Jul 20 15:22:53 2016 +0000 |
| tree | fc168c9e1e1a8581b540767da526a9566821a605 | |
| parent | 337a21142bed241dd5cb6cf0a3641a9d4397e76a [diff] |
SLING-5843 - prefix is required when registering JCR namespaces git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/repoinit/parser@1753535 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/javacc/RepoInitGrammar.jjt b/src/main/javacc/RepoInitGrammar.jjt index 9939f81..288b6d5 100644 --- a/src/main/javacc/RepoInitGrammar.jjt +++ b/src/main/javacc/RepoInitGrammar.jjt
@@ -302,15 +302,11 @@ } { <REGISTER> <NAMESPACE> - ( <LPAREN> prefix = <STRING> <RPAREN> )? + <LPAREN> prefix = <STRING> <RPAREN> uri = <STRING> { - if(prefix == null) { - result.add(new RegisterNamespace(null, uri.image)); - } else { - result.add(new RegisterNamespace(prefix.image, uri.image)); - } + result.add(new RegisterNamespace(prefix.image, uri.image)); } (<EOL> | <EOF>)
diff --git a/src/test/resources/testcases/test-40-output.txt b/src/test/resources/testcases/test-40-output.txt index e80b5c8..097e4bf 100644 --- a/src/test/resources/testcases/test-40-output.txt +++ b/src/test/resources/testcases/test-40-output.txt
@@ -1,3 +1,2 @@ RegisterNamespace (foo) uri:some-uri/V/1.0 -RegisterNamespace () uri:without-prefix RegisterNamespace (prefix_with-other.things) andSimpleURI \ No newline at end of file
diff --git a/src/test/resources/testcases/test-40.txt b/src/test/resources/testcases/test-40.txt index aa77e26..f5be1b9 100644 --- a/src/test/resources/testcases/test-40.txt +++ b/src/test/resources/testcases/test-40.txt
@@ -1,4 +1,3 @@ # Test the register namespace statement register namespace (foo) uri:some-uri/V/1.0 -register namespace uri:without-prefix register namespace ( prefix_with-other.things ) andSimpleURI \ No newline at end of file