Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-8758

tests make "equals" comparison of Path and String

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.20.0
    • documentmk
    • None

    Description

      Spotbug complains about Path.equals being called with String arguments. I think we need to fix two line in the tests:

      Index: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java
      ===================================================================
      --- oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java      (revision 1869653)
      +++ oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java      (working copy)
      @@ -952,7 +952,7 @@
               for (String id : Sets.newHashSet(readSet)) {
                   doc = store.find(NODES, id);
                   assertNotNull(doc);
      -            if (doc.isSplitDocument() && !doc.getMainPath().equals("/")) {
      +            if (doc.isSplitDocument() && !doc.getMainPath().equals(Path.ROOT)) {
                       fail("must not access previous document: " + id);
                   }
               }
      Index: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentSplitTest.java
      ===================================================================
      --- oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentSplitTest.java  (revision 1869653)
      +++ oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentSplitTest.java  (working copy)
      @@ -725,7 +725,7 @@
               for (String id : Sets.newHashSet(readSet)) {
                   doc = store.find(NODES, id);
                   assertNotNull(doc);
      -            if (doc.isSplitDocument() && !doc.getMainPath().equals("/")) {
      +            if (doc.isSplitDocument() && !doc.getMainPath().equals(Path.ROOT)) {
                       fail("must not access previous document: " + id);
                   }
               }
      

      Attachments

        Issue Links

          Activity

            People

              reschke Julian Reschke
              reschke Julian Reschke
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: