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

Conditions that are always true.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Invalid
    • None
    • None
    • core
    • None

    Description

      Hi

      In a recent Github mirror, I found conditions that are always true.
      Path: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java

        92     /** storage model modifier: binary keys */
        93     public static final int SM_BINARY_KEYS = 1;
        94 
      ...
       666     public int getStorageModel() {
       667         return SM_BINARY_KEYS;
       668     }
      ...
       732     protected Object[] getKey(NodeId id) {
       733         if (getStorageModel() == SM_BINARY_KEYS) {
       734             return new Object[] { id.getRawBytes() };
       735         } else {
       736             return new Object[] {
       737                     id.getMostSignificantBits(), id.getLeastSignificantBits     () };
       738         }
      ...
      
      

      The condition in Line 733 seems always return true. I've found similar lines in Line 754, 800, 852 and 1111. These are just trivial things but there are else blocks. As I thought the conditions should do something more rather than being always true, I'm reporting them just in case.

      Thanks!

      Attachments

        Activity

          People

            Unassigned Unassigned
            lifove JC
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: