Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-1880

Same name sibling: Jackrabbit behaves differently when calling Node.getPath()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.4, 1.5, 2.6
    • 2.6.5, 2.7.2
    • jackrabbit-core
    • None

    Description

      The following test case behaves differently when calling Node.getPath() versus not calling it:

      void test(boolean index) throws Exception {
      FileUtils.deleteDirectory(new File("repository"));
      Repository rep = new TransientRepository();
      Session session = rep.login(new SimpleCredentials("", new char[0]));
      Node test = session.getRootNode().addNode("test");
      Node a = test.addNode("a");
      Node b = a.addNode("b");
      session.save();
      session.move("/test/a/b", "/test/a");
      if (index)

      { b.getPath(); }

      session.move("/test/a", "/test/a");
      System.out.println("a: " + a.getPath());
      System.out.println("b: " + b.getPath());
      session.logout();
      }

      test(true) prints:
      a: /test/a[2]
      b: /test/a

      test(false) prints:
      a: /test/a
      b: /test/a

      Attachments

        1. JCR-1880-test.patch
          2 kB
          Frank van Lankvelt
        2. JCR-1880.patch
          1 kB
          Frank van Lankvelt

        Activity

          People

            unico@apache.org Unico Hommes
            thomasm Thomas Mueller
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: