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

Issue 213 #224

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
issue - 213 : quote replacement to fix issue 213
'Grabbit fails sync when node name contain'
  • Loading branch information
ElmiraZhernova committed Apr 1, 2019
commit 91d5eea673eb529b22d3f4b9cc6d06e1c343eb0d
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import com.twcable.grabbit.proto.NodeProtos.Node as ProtoNode
import com.twcable.grabbit.proto.NodeProtos.Value as ProtoValue
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j

import java.util.regex.Matcher
import java.util.regex.Pattern
import javax.annotation.Nonnull
import javax.jcr.Node as JCRNode
Expand Down Expand Up @@ -55,7 +57,7 @@ class DefaultProtoNodeDecorator extends ProtoNodeDecorator {
if(innerProtoNode.mandatoryChildNodeList && innerProtoNode.mandatoryChildNodeList.size() > 0) {
for(ProtoNode childNode: innerProtoNode.mandatoryChildNodeList) {
//Mandatory children must inherit any name overrides from their parent (if they exist)
createFrom(childNode, childNode.getName().replaceFirst(Pattern.quote(innerProtoNode.name), getName())).writeToJcr(session)
createFrom(childNode, childNode.getName().replaceFirst(Pattern.quote(innerProtoNode.name), Matcher.quoteReplacement(getName()))).writeToJcr(session)
}
}
return new JCRNodeDecorator(jcrNode)
Expand Down