Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1937

Java sequencers do not properly handle methods with same name and parameter names

    XMLWordPrintable

Details

    Description

      Hi,

      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
      

      The 'sns' attribute needs to be added to the definition to allow for same name sibling:

      [class:methods]
      + * (class:method) = class:method sns
      

      Thanks,
      Tamer

      Attachments

        Activity

          People

            rhauch Randall Hauch (Inactive)
            tamer_sk_jira Tamer Elgamal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: