JC created JCR-4171:
-----------------------

             Summary: Conditions that are always true.
                 Key: JCR-4171
                 URL: https://issues.apache.org/jira/browse/JCR-4171
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: core
            Reporter: JC
            Priority: Trivial


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

{code: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         }
...

{code}
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!




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to