Same name sibling for sequencers
tamer_sk May 13, 2013 4:49 PMHi,
I am currently making use of the java sequencer. I noticed if I have overloaded methodes that have the same parameter names but different types will cause an error when trying to sequence. Here is the error I get when trying to sequence (org/modeshape/common/text/TokenStream.java)
10:28:58,221 ERROR [org.modeshape.sequencer.javafile.JavaFileSequencer] (modeshape-sequencer-8-thread-2) Error sequencing file: javax.jcr.ItemExistsException: A node definition that allows same name siblings could not be found for the node "/TokenStream.java/TokenStream.java/org/modeshape/common/text/TokenStream/class:methods/consume(expected)[2]" in workspace "default"
at org.modeshape.jcr.AbstractJcrNode.validateChildNodeDefinition(AbstractJcrNode.java:1207) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]
at org.modeshape.jcr.AbstractJcrNode.addChildNode(AbstractJcrNode.java:1045) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]
at org.modeshape.jcr.AbstractJcrNode.addNode(AbstractJcrNode.java:1001) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]
at org.modeshape.jcr.AbstractJcrNode.addNode(AbstractJcrNode.java:931) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]
at org.modeshape.jcr.AbstractJcrNode.addNode(AbstractJcrNode.java:107) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]
at org.modeshape.sequencer.javafile.ClassSourceFileRecorder.writeMethods(ClassSourceFileRecorder.java:221)
at org.modeshape.sequencer.javafile.ClassSourceFileRecorder.writeClassMetadata(ClassSourceFileRecorder.java:80)
at org.modeshape.sequencer.javafile.ClassSourceFileRecorder.record(ClassSourceFileRecorder.java:48)
at org.modeshape.sequencer.javafile.JavaFileSequencer.execute(JavaFileSequencer.java:67)
at org.modeshape.jcr.SequencingRunner.run(SequencingRunner.java:224) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]
I checked the defenition for node type [class:methods] and it is
[class:methods]
+ * (class:method) = class:method
I am guessing this is not allowing same name sibling nodes. I ended up overriding it as in the following:
[class:methods]
+ * (class:method) = class:method sns
With the modification, I get the expected results. My questions
1- Is [class:methods] meant to not allow sns or is it a bug?
2- If it is not meant to allow sns, would overriding be the proper solution or is there a better solution?
Thanks,
Tamer