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

tests make "equals" comparison of Path and String

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.20.0
    • Component/s: documentmk
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: