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

VersionHistory.addVersionLabel(...) should throw LabelExistsVersionException

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 4.1.0.Final
    • 4.0.0.Final
    • JCR
    • None

    Description

      According to the JCR spec:
      http://www.day.com/maven/jcr/2.0/15_Versioning.html#15.4.1.2 Adding a Version Label

      and the associated javadocs:
      http://www.day.com/specs/jsr170/javadocs/jcr-2.0/javax/jcr/version/VersionHistory.html#addVersionLabel(java.lang.String, java.lang.String, boolean)

      VersionHistory.addVersionLabel(...) should throw a LabelExistsVersionException under the following conditions:
      "moveLabel - if false, then attempting to assign an already used label will throw a LabelExistsVersionException."

      The ModeShape logic performs the right checks, but throws the wrong exception type:
      https://github.com/ModeShape/modeshape/blob/master/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrVersionHistoryNode.java#L320

      Attachments

        Activity

          People

            Unassigned Unassigned
            awoods_jira Andrew Woods (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: